Subversion Repositories Applications.referentiel

Compare Revisions

No changes between revisions

Ignore whitespace Rev 343 → Rev 344

/branches/v2.0-betulales/interfaces/composants/Composant.php
New file
0,0 → 1,13
<?php
 
class Composant {
 
public static function fabrique($classe, $options = array()) {
$classe_nom = implode('', array_map('ucfirst', explode('_', $classe)));
require_once dirname(__FILE__).DS.$classe.DS.$classe_nom.'.php';
$Composant = new $classe_nom($options);
return $Composant;
}
}
?>
/branches/v2.0-betulales/interfaces/composants/fragmenteur/squelettes/defaut.tpl.html
New file
0,0 → 1,56
<!-- FRAGMENTEUR : début -->
<div class="fragmenteur" style="clear:left;">
<h2>Navigation dans les résultats :</h2>
<?php if (isset($alphabet)) : ?>
<p style="margin:0;" class="aide">Cliquer sur une lettre pour faire apparaitre la liste des taxons correspondante :</p>
<p>
<strong>
<?php foreach ($alphabet as $lettre) : ?>
<?php if ($lettre['lettre'] == $lettre_selected) : ?>
<span class="frag_alpha_lien_selection"><?=$lettre['lettre'];?></span>&nbsp;
<?php else : ?>
<a class="frag_alpha_lien" href="<?=$lettre['url']?>"><?=$lettre['lettre'];?></a>&nbsp;
<?php endif; ?>
<?php endforeach; ?>
</strong>
</p>
<?php endif; ?>
<form id="fragmenteur_quantite" action="<?=$url;?>" method="get">
<p>
<?php if ($pager_links['pages']) : ?>
Pages&nbsp;:
<?php if (!empty($pager_links['first'])) : ?>
<span class="frag_premier frag_boite"><?=trim($pager_links['first']);?></span>
<?php endif; ?>
<?php if (!empty($pager_links['back'])) : ?>
<span class="frag_precedent frag_boite"><?=$pager_links['back'];?></span>
<?php endif; ?>
<?php if (!empty($pager_links['pages'])) : ?>
<span class="frag_pages"><?=$pager_links['pages'];?></span>
<?php endif; ?>
<?php if (!empty($pager_links['next'])) : ?>
<span class="frag_suivant frag_boite"><?=$pager_links['next'];?></span>
<?php endif; ?>
<?php if (!empty($pager_links['last'])) : ?>
<span class="frag_dernier frag_boite"><?=$pager_links['last'];?></span>
<?php endif; ?>
.
<?php endif; ?>
Résultats : <span class="frag_resultats"><?=$frag_donnee_debut;?> à <?=$frag_donnee_fin;?> sur <?=$frag_donnee_total;?></span> avec
<select id="frag_nbre" name="frag_nbre" onchange="javascript:this.form.submit();">
<option value="*" <?= ($par_page_selected == '*') ? 'selected="selected"': '';?>>tous</option>
<?php foreach ($par_page as $nbre) : ?>
<option value="<?=$nbre;?>" <?=$nbre == $par_page_selected? 'selected="selected"': '';?>><?=$nbre;?></option>
<?php endforeach; ?>
</select>
résultats par page.
<?php foreach ($form_get_url_chp_hidden as $cle => $val) : ?>
<input type="hidden" name="<?=$cle;?>" value="<?=$val;?>" />
<?php endforeach; ?>
</p>
</form>
</div>
<!-- FRAGMENTEUR : fin -->
/branches/v2.0-betulales/interfaces/composants/fragmenteur/squelettes/fragmenteur_defaut.css
New file
0,0 → 1,15
.fragmenteur select,.fragmenteur a,.fragmenteur .frag_page_courrante, .fragmenteur .frag_resultats{
color:white;
padding:5px;
margin:0 2px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;}
.fragmenteur select,.fragmenteur a{
background-color:#5D5C5C;
border:1px solid black;}
.fragmenteur a:hover,.fragmenteur .frag_page_courrante, .fragmenteur .frag_resultats{
font-weight:bold;
background-color:#AEDC43;
border:1px solid #86A736;}
.frag_separateur{display:none;}
/branches/v2.0-betulales/interfaces/composants/fragmenteur/Fragmenteur.php
New file
0,0 → 1,179
<?php
 
class Fragmenteur {
const PAGER_MODE = 'Sliding';
const PAGE_DELTA = 2;
const PAGE_SEPARATEUR = '-';
const URL_VAR = 'page';
const SQUELETTE = 'defaut';
const DONNEES_PAR_PAGE_CHOIX = '10,20,50,100';
const DONNEES_PAR_PAGE_DEFAUT = 10;
const ALPHABET_AFFICHAGE_DEFAUT = false;
const ALPHABET_LETTRE_DEFAUT = 'A';
private $pager_mode;
private $pager;
private $url;
private $lettre;
private $page_delta;
private $page_separateur;
private $donnees_total;
private $donnees_par_page;
private $donnees_par_page_choix;
private $url_var;
private $squelette;
private $chemin_squelette;
private $recherche_alphabetique;
private $squelette_donnees = array();
public function __construct($options) {
// Gestion de l'url
if (isset($options['url'])) {
if ($options['url'] instanceof Url) {
$this->url = $options['url'];
} else {
$msg = "Fragmenteur nécessite nécessite un objet Url du Framework de Tela Botanica pour fonctionner.";
trigger_error($msg, E_USER_ERROR);
}
} else {
$msg = "Fragmenteur nécessite de renseigner dans le tableau d'options l'url pour la clé 'url'".
trigger_error($msg, E_USER_ERROR);
}
// Gestion de la liste alphabétique
$this->alphabet_affichage = (isset($options['alphabet_affichage']) ? $options['alphabet_affichage'] : self::ALPHABET_AFFICHAGE_DEFAUT);
if ($this->alphabet_affichage == true) {
$lettre = (isset($options['lettre']) ? $options['lettre'] : self::ALPHABET_LETTRE_DEFAUT);
$this->setLettre($lettre);
if (isset($_GET['lettre'])) {
$this->setLettre(urldecode($_GET['lettre']));
}
}
// Gestion des infos pour le pager
$this->squelette = (isset($options['squelette']) ? $options['squelette'] : self::SQUELETTE).'.tpl.html';
$this->chemin_squelette = dirname(__FILE__).DS.'squelettes'.DS.$this->squelette;
$this->pager_mode = (isset($options['pager_mode']) ? $options['pager_mode'] : self::PAGER_MODE);
$this->page_delta = (isset($options['page_delta']) ? $options['page_delta'] : self::PAGE_DELTA);
$this->page_separateur = (isset($options['page_separateur']) ? $options['page_separateur'] : self::PAGE_SEPARATEUR);
$this->url_var = (isset($options['url_var']) ? $options['url_var'] : self::URL_VAR);
$this->donnees_par_page = (isset($options['donnees_par_page']) ? $options['donnees_par_page'] : self::DONNEES_PAR_PAGE_DEFAUT);
$this->donnees_par_page_choix = (isset($options['donnees_par_page_choix']) ? $options['donnees_par_page_choix'] : self::DONNEES_PAR_PAGE_CHOIX);
$this->donnees_total = (isset($options['donnees_total']) ? $options['donnees_total'] : 0);
// Gestion du nombre de données à afficher par page.
if (isset($_GET['frag_nbre'])) {
if ($_GET['frag_nbre'] == '*') {
$_GET['page'] = 1;
}
$_SESSION['fragmenteur']['donnees_par_page'] = $_GET['frag_nbre'];
} else {
$_SESSION['fragmenteur']['donnees_par_page'] = $this->donnees_par_page;
}
$this->donnees_par_page = $_SESSION['fragmenteur']['donnees_par_page'];
if ($this->donnees_par_page == '*') {
$this->donnees_par_page = $this->donnees_total;
}
// Découpage de l'url pour le pager
$url_morceaux = parse_url($this->url->getURL());
$pager_url_page = basename($url_morceaux['path']);
$pager_url_chemin = $url_morceaux['scheme'].'://'.$url_morceaux['host'].dirname($url_morceaux['path']).'/';
// Gestion du Fragmenteur (basé sur le Pager de Pear)
$pager_options = array( 'mode' => $this->pager_mode,
'perPage' => $this->donnees_par_page,
'delta' => $this->page_delta,
'totalItems' => $this->donnees_total,
'urlVar' => $this->url_var,
'separator' => $this->page_separateur,
'path' => $pager_url_chemin,
'fileName' => $pager_url_page);
$this->pager = Pager::factory($pager_options);
}
public function getDonneesParPage() {
return $this->donnees_par_page;
}
public function getDeplacementParPageId() {
return $this->pager->getOffsetByPageId();
}
public function getLettre() {
return $this->lettre;
}
public function setLettre($l) {
$this->lettre = $l;
}
public function getDonneesTotal() {
return $this->donnees_total;
}
public function setDonneesTotal($dt) {
$this->donnees_total = $dt;
}
 
private function getSqueletteDonnees() {
return $this->squelette_donnees;
}
private function setSqueletteDonnees($cle, $valeur) {
$this->squelette_donnees[$cle] = $valeur;
}
public function executer() {
// Gestion de la liste alphabétique
if ($this->alphabet_affichage == true) {
$alphabet = array();
$this->url->setVariableRequete('lettre', '*');
$alphabet['*'] = array( 'url' => $this->url->getURL(),
'lettre' => 'tous');
$this->url->unsetVariableRequete('lettre');
for ($i = 65; $i <= 90; $i++){
$this->url->setVariableRequete('lettre', chr($i));
$alphabet[chr($i)] = array('url' => $this->url->getURL(),
'lettre' => chr($i));
$this->url->unsetVariableRequete('lettre');
}
$this->setSqueletteDonnees('alphabet', $alphabet);
// Gestion de la lettre
$this->setSqueletteDonnees('lettre_selected', $this->getLettre());
// Gestion de l'url
$this->url->setVariableRequete('lettre', $this->getLettre());
}
// Gestion des urls
$this->url->setVariableRequete('page', $this->pager->getCurrentPageID());
$this->setSqueletteDonnees('url', $this->url->getURL());
// Gestion du fragmenteur
$this->setSqueletteDonnees('frag_donnee_total', $this->donnees_total);
$page_id_x_saut = ($this->pager->getCurrentPageID() * $this->donnees_par_page);
$this->setSqueletteDonnees('frag_donnee_debut', (($page_id_x_saut - $this->donnees_par_page) > 0 ? ($page_id_x_saut - $this->donnees_par_page) : 0));
$this->setSqueletteDonnees('frag_donnee_fin', ($page_id_x_saut >= $this->donnees_total ? $this->donnees_total : $page_id_x_saut));
$this->setSqueletteDonnees('par_page', explode(',', $this->donnees_par_page_choix));
$this->setSqueletteDonnees('par_page_selected', $_SESSION['fragmenteur']['donnees_par_page']);
$this->setSqueletteDonnees('pager_links', $this->pager->getLinks());
// Gestion des paramêtres pour le formulaire du Fragmenteur
$tab_parties = $this->url->getVariablesRequete();
$form_get_url_chp_hidden = array();
foreach ($tab_parties as $cle => $valeur) {
$form_get_url_chp_hidden[$cle] = $valeur;
}
$this->setSqueletteDonnees('form_get_url_chp_hidden', $form_get_url_chp_hidden);
// Création du rendu à partir du squelette et de ses données
$sortie = SquelettePhp::analyser($this->chemin_squelette, $this->getSqueletteDonnees());
return $sortie;
}
}
?>
/branches/v2.0-betulales/interfaces/configurations/config.default.ini
New file
0,0 → 1,82
; +------------------------------------------------------------------------------------------------------+
; Général
; Séparateur de dossier
ds = DIRECTORY_SEPARATOR
 
; +------------------------------------------------------------------------------------------------------+
; Info sur l'application
info.nom = Gestion des référentiels
; Abréviation de l'application
info.abr = REF
; Version du Framework nécessaire au fonctionnement de cette application
info.framework.version = 0.2
;Encodage de l'application
appli_encodage = "UTF-8"
; Paramêtres indiquant que l'on est en français pour permettre l'affichage des dates en français.
i18n_locale_systeme = "php:setlocale(LC_TIME, 'fr_FR.UTF-8')"
; Paramêtres indiquant la zone horaire locale
i18n_zone_horaire_systeme = "php:date_default_timezone_set('Europe/Paris')"
; Nom de domaine pour l'URL de base de l'application : 162.38.234.6
domaine = "localhost"
; URL de base de l'application, si elle est laissée vide, l'application fonctionnera en Stand-alone
url_base = "http://{ref:domaine}/referentiel/"
; URL de base de l'application avec l'indicaiton du fichier de départ
url_base_index = "{ref:url_base}index.php"
; Mettre à true si l'application nécessite de s'identifier.
identification = false
 
; +------------------------------------------------------------------------------------------------------+
; Paramètrage de la session
; Devons nous démarrer une session : oui (true) ou non (false)
session_demarrage = "php:true"
; Définition du nom de la session à utiliser
session_nom = "referentiel"
; Nombre de résultats à afficher par défaut
resultat_par_page_defaut=20
 
; +------------------------------------------------------------------------------------------------------+
; Débogage
; Indique si oui ou non on veut afficher le débogage.
fw_debogage = true
; Indique si oui ou non on veut lancer le chronométrage
chronometrage = true
 
; +------------------------------------------------------------------------------------------------------+
; Spécifique à l'application
 
; Scripts
; Chemin vers le binaire php
chemin_bin_php = "/opt/lampp/bin/php"
; Chemin vers le fichier principal de lancement des scripts
chemin_script = "{ref:chemin_appli}../scripts/script.php"
;Chemin vers le dossier temporaire
chemin_tmp = "/home/delphine/web/tmp/"
; Chemin du fichier où les log des scripts sont stockés
chemin_script_log = "{ref:chemin_appli}../log.txt"
; Doit on afficher les messages de paramêtrage du serveur pour les scripts
script_message = "php:true";
; Durée de vie en seconde d'un traitement en attente
ddv_traitement_attente = 300
; Durée de vie en seconde d'un traitement en cours
ddv_traitement_en_cours = 300
; Squelete de l'url de téléchargement des fichiers zip
url_zip_tpl = "http://{ref:domaine}/zip/%s"
; URL de base pour accéder au dossier où sont générés les téléchargements
base_url_telechargements = "http://{ref:domaine}/tmp/referentiels/"
 
; +------------------------------------------------------------------------------------------------------+
; Url du Jrest utilisé pour les services web fournissant les données à l'application
url_jrest = "{ref:url_base}services/"
; Nom du fichier contenant les infos sur la version courante du manuel technique
manuel = "referentiel_v4.4.ini"
; Liste des forums de discussion de chaque projet : forum.<code_du_projet>
forum.bdtfx = "isff@tela-botanica.org"
forum.bdbfx = "tb-bryophyta@tela-botanica.org"
forum.bdtre = "tb-flore-reunion@tela-botanica.org"
forum.bdtxa = "tb-flore-antilles@tela-botanica.org"
forum.bdtgf = "ref_guyane@tela-botanica.org"
site.bdlfx = "http://www.lichenologue.org"
; Squelette de l'url du service d'authentification
authentification.serviceUrlTpl = "http://www.tela-botanica.org/service:annuaire:TestLoginMdp/%s/%s"
; Liste des courriels des coordinateurs des référentiels séparés par des virgules
authentification.coordinateurs = "samuel.dufour@cirad.fr,jpm@tela-botanica.org,louise@tela-botanica.org,mareva@tela-botanica.org,b.bock@orange.fr,lemonnier.cecile@orange.fr,regis.courtecuisse@univ-lille2.fr,vincent.boullet@cbnmc.fr,claudie.pavis@antilles.inra.fr,sophie.gonzalez@ird.fr"
/branches/v2.0-betulales/interfaces/configurations/.htaccess
New file
0,0 → 1,2
# Ce fichier est là pour éviter l'accès au fichier .ini depuis un navigateur.
deny from all
/branches/v2.0-betulales/interfaces/configurations
New file
Property changes:
Added: svn:ignore
+config.ini
/branches/v2.0-betulales/interfaces/framework.defaut.php
New file
0,0 → 1,6
<?php
// Inclusion du Framework
// Renomer ce fichier en "framework.php"
// Indiquyer ci-dessous le chemin absolu vers le fichier autoload.inc.php de la bonne version du Framework
require_once '/home/referentiel/www/commun/tbframework/0.2/autoload.inc.php';
?>
/branches/v2.0-betulales/interfaces/referentiel.php
New file
0,0 → 1,49
<?php
// declare(encoding='UTF-8');
/**
* Application permettant de tester, versionner et consulter les référentiels de travail.
* Fichier principal d'initialisation.
*
* @category PHP5
* @package Referentiel
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license GPL-v3 et CECILL-v2
* @version SVN:$Id$
*/
// Autoload pour cette application
function __autoload($nom_classe) {
// Tableau des chemins à inclure pour trouver une classe relatif à ce fichier
$chemins = array(
'..'.DS.'bibliotheque'.DS.'dao',
'..'.DS.'bibliotheque'.DS.'utilitaires',
'bibliotheque'.DS.'pear',
'composants');
foreach ($chemins as $chemin) {
$fichier_a_inclure = dirname(__FILE__).DS.$chemin.DS.$nom_classe.'.php';
if (file_exists($fichier_a_inclure)) {
include_once $fichier_a_inclure;
return null;
}
}
}
 
// Le fichier autoload.inc.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.
// Sinon, rien ne sera chargé.
// Chemin du fichier chargeant le framework requis
$framework = dirname(__FILE__).'/framework.php';
if (!file_exists($framework)) {
$e = "Veuillez paramêtrer l'emplacement et la version du Framework dans le fichier $framework";
trigger_error($e, E_USER_ERROR);
} else {
// Inclusion du Framework
require_once $framework;
// Ajout d'information concernant cette application
Application::setChemin(__FILE__);// Obligatoire
Application::setInfo(Config::get('info'));
 
// Lancement de l'application
Referentiel::initialiser();
}
?>
/branches/v2.0-betulales/interfaces/.htaccess
New file
0,0 → 1,2
#AddHandler x-httpd-php5 .php
#AddDefaultCharset UTF-8
/branches/v2.0-betulales/interfaces/bibliotheque/RestClient.php
New file
0,0 → 1,213
<?php
// declare(encoding='UTF-8');
/**
* Classe modèle spécifique à l'application, donc d'accés au données, elle ne devrait pas être appelée de l'extérieur.
*
* @category php5
* @package Widget
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
class RestClient {
const ORDRE_ASCENDANT = 'ASC';
const ORDRE_DESCENDANT = 'DESC';
const HTTP_REQUETE_SEPARATEUR = '&';
protected $distinction = '0';
protected $limite_debut = null;
protected $limite_nbre = null;
protected $ordre = null;
//+----------------------------------------------------------------------------------------------------------------+
// ACCESSEURS
public function setDistinction($distinct) {
$this->distinction = $distinct;
}
public function getDistinction() {
return $this->distinction;
}
public function viderDistinction() {
$this->distinction = null;
}
public function avoirLimitation() {
$limitation = false;
if (!is_null($this->limite_debut) && !is_null($this->limite_nbre)) {
$limitation = true;
}
return $limitation;
}
public function setLimitation($limite_debut, $limite_nbre) {
$this->limite_debut = $limite_debut;
$this->limite_nbre = $limite_nbre;
}
public function getLimiteDebut() {
return $this->limite_debut;
}
public function getLimiteNbre() {
return $this->limite_nbre;
}
public function viderLimite() {
$this->limite_debut = null;
$this->limite_nbre = null;
}
public function addOrdre($champ, $trie = self::ORDRE_ASCENDANT) {
if (!isset($this->ordre[$champ])) {
if (self::ORDRE_ASCENDANT == $trie || self::ORDRE_DESCENDANT == $trie) {
$this->ordre[$champ] = $trie;
} else {
$e = "La valeur pour le trie doit être : {self::ORDRE_ASCENDANT} ou {self::ORDRE_DESCENDANT}.";
trigger_error($e, E_USER_WARNING);
}
} else {
$e = "Le champ $champ existe déjà dans le tableau des ordres.";
trigger_error($e, E_USER_WARNING);
}
}
public function getOrdre() {
$champs = array();
foreach ($this->ordre as $champ => $trie) {
$champs[] = "$champ $trie";
}
return implode(', ', $champs);
}
public function viderOrdre() {
$this->ordre = null;
}
//+----------------------------------------------------------------------------------------------------------------+
// MÉTHODES
public function envoyerRequeteConsultation($url) {
$url = $this->traiterUrlParametres($url);
$retour = $this->envoyerRequete($url, 'GET');
return $retour;
}
public function envoyerRequeteAjout($url, Array $donnees) {
$retour = $this->envoyerRequete($url, 'PUT', $donnees);
return $retour;
}
public function envoyerRequeteModif($url, Array $donnees) {
$retour = $this->envoyerRequete($url, 'POST', $donnees);
return $retour;
}
public function envoyerRequeteSuppression($url) {
$retour = $this->envoyerRequete($url, 'DELETE');
return $retour;
}
private function envoyerRequete($url, $mode, Array $donnees = array()) {
$contenu = false;
if ($mode != 'GET' && $mode != 'PUT' && $mode != 'POST' && $mode != 'DELETE') {
$e = "Le mode de requête '$mode' n'est pas accepté!";
trigger_error($e, E_USER_WARNING);
} else {
$contexte = stream_context_create(array(
'http' => array(
'method' => $mode,
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'content' => http_build_query($donnees, null, self::HTTP_REQUETE_SEPARATEUR))));
$flux = @fopen($url, 'r', false, $contexte);
if (!$flux) {
$this->traiterEntete($http_response_header, $url);
$e = "L'ouverture de l'url '$url' par la méthode HTTP '$mode' a échoué!";
trigger_error($e, E_USER_WARNING);
} else {
// Informations sur les en-têtes et métadonnées du flux
$entetes = stream_get_meta_data($flux);
$this->traiterEntete($entetes, $url);
// Contenu actuel de $url
$contenu = stream_get_contents($flux);
fclose($flux);
}
}
$this->reinitialiser();
return $contenu;
}
private function traiterUrlParametres($url) {
$parametres = array();
if (! is_null($this->getLimiteDebut())) {
$parametres[] = 'start='.$this->getLimiteDebut();
}
if (! is_null($this->getLimiteNbre())) {
$parametres[] = 'limit='.$this->getLimiteNbre();
}
if (! is_null($this->ordre)) {
$parametres[] = 'orderby='.urlencode($this->getOrdre());
}
if ($this->getDistinction() != 0) {
$parametres[] = 'distinct='.$this->getDistinction();
}
if (count($parametres) > 0) {
$url_parametres = implode('&', $parametres);
$url = $url.'?'.$url_parametres;
}
return $url;
}
private function traiterEntete($entetes, $uri) {
$infos = $this->analyserEntete($entetes, $uri);
$this->traiterEnteteDebug($infos);
$this->traiterEnteteMessage($infos);
}
private function analyserEntete($entetes, $uri) {
$infos = array('date' => null, 'uri' => $uri, 'debugs' => null, 'messages' => null);
if (isset($entetes['wrapper_data'])) {
$entetes = $entetes['wrapper_data'];
}
foreach ($entetes as $entete) {
if (preg_match('/^X-DebugJrest-Data: (.+)$/', $entete, $match)) {
$infos['debugs'] = json_decode($match[1]);
}
if (preg_match('/^X-MessageJrest-Data: (.+)$/', $entete, $match)) {
$infos['messages'] = json_decode($match[1]);
}
if (preg_match('/^Date: .+ ([012][0-9]:[012345][0-9]:[012345][0-9]) .*$/', $entete, $match)) {
$infos['date'] = $match[1];
}
}
return $infos;
}
private function traiterEnteteDebug($entetes) {
if (isset($entetes['debugs'])) {
$date = $entetes['date'];
$uri = $entetes['uri'];
$debugs = $entetes['debugs'];
foreach ($debugs as $debug) {
$e = "DEBUG : $date - $uri :\n$debug";
trigger_error($e, E_USER_NOTICE);
}
}
}
private function traiterEnteteMessage($entetes) {
if (isset($entetes['messages'])) {
$date = $entetes['date'];
$uri = $entetes['uri'];
$messages = $entetes['messages'];
foreach ($messages as $message) {
$e = "MESSAGE : $date - $uri :\n$message";
trigger_error($e, E_USER_NOTICE);
}
}
}
private function reinitialiser() {
$this->viderDistinction();
$this->viderLimite();
$this->viderOrdre();
}
}
/branches/v2.0-betulales/interfaces/bibliotheque/pear/A_LIRE.txt
New file
0,0 → 1,4
Paquetages PEAR :
PEAR -> 1.6.2
Pager -> 2.4.4
Auth -> 1.5.4
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/branches/v2.0-betulales/interfaces/bibliotheque/pear/PEAR.php
New file
0,0 → 1,1108
<?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 10 2010-03-05 14:15:42Z jpm $
* @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.6.1
* @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;
if (!isset($properties[$class])) {
$properties[$class] = array();
}
if (!array_key_exists($var, $properties[$class])) {
$properties[$class][$var] = null;
}
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.6.1
* @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 (!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) {
$this->backtrace = debug_backtrace();
if (isset($this->backtrace[0]) && isset($this->backtrace[0]['object'])) {
unset($this->backtrace[0]['object']);
}
}
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:
*/
?>
/branches/v2.0-betulales/interfaces/bibliotheque/pear/Pager/Pager_savebc.php
New file
0,0 → 1,3
<?php
require_once 'Pager.php';
?>
/branches/v2.0-betulales/interfaces/bibliotheque/pear/Pager/Common.php
New file
0,0 → 1,1539
<?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: Common.php 10 2010-03-05 14:15:42Z jpm $
* @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) == '/') {
$http = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://';
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 onclick
* @access private
*/
var $_onclick = '';
 
/**
* @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',
'onclick',
'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()
{
//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();
}
}
 
// }}}
// {{{ 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);
}
$onclick = '';
if (array_key_exists($this->_urlVar, $this->_linkData)) {
$onclick = str_replace('%d', $this->_linkData[$this->_urlVar], $this->_onclick);
}
return sprintf('<a href="%s"%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].'"',
empty($onclick) ? '' : ' onclick="'.$onclick.'"',
$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;
}
}
foreach ($this->_excludeVars as $exclude) {
if (array_key_exists($exclude, $qs)) {
unset($qs[$exclude]);
}
}
if (count($this->_extraVars)){
$this->_recursive_urldecode($this->_extraVars);
$qs = array_merge($qs, $this->_extraVars);
}
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 ();
$separator = ini_get('arg_separator.output');
if ($separator == '&amp;') {
$separator = '&'; //the string is escaped by htmlentities anyway...
}
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($separator, $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 (strpos($this->_fileName, '%d') === false) {
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]);
}
 
// }}}
}
?>
/branches/v2.0-betulales/interfaces/bibliotheque/pear/Pager/Jumping.php
New file
0,0 → 1,254
<?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: Jumping.php 10 2010-03-05 14:15:42Z jpm $
* @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();
}
 
// }}}
// {{{ 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)) {
$this->links = '';
if ($this->_totalPages > $this->_delta) {
$this->links .= $this->_printFirstPage();
}
 
$_sav = $this->_currentPage;
$this->_currentPage = $pageID;
 
$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;
}
 
// }}}
}
?>
/branches/v2.0-betulales/interfaces/bibliotheque/pear/Pager/Sliding.php
New file
0,0 → 1,289
<?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: Sliding.php 62 2010-05-06 13:21:56Z jpm $
* @link http://pear.php.net/package/Pager
*/
 
/**
* require PEAR::Pager_Common base class
*/
require_once dirname(__FILE__).'/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();
}
 
// }}}
// {{{ 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;
}
 
// }}}
}
?>
/branches/v2.0-betulales/interfaces/bibliotheque/pear/Pager/HtmlWidgets.php
New file
0,0 → 1,229
<?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: HtmlWidgets.php 10 2010-03-05 14:15:42Z jpm $
* @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
* - 'checkMaxLimit': if true, Pager checks if $end is bigger
* than $totalItems, and doesn't show the extra select options
* @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 = '';
$checkMaxLimit = false;
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 (array_key_exists('checkMaxLimit', $extraParams)) {
$checkMaxLimit = $extraParams['checkMaxLimit'];
}
}
 
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;
}
if ($checkMaxLimit && $this->pager->_totalItems > 0 && $this->pager->_totalItems < $end) {
$end = $this->pager->_totalItems;
}
 
$tmp = '<select name="'.$this->pager->_sessionVar.'"';
if (!empty($attributes)) {
$tmp .= ' '.$attributes;
}
$tmp .= '>';
$last = $start;
for ($i=$start; $i<=$end; $i+=$step) {
$last = $i;
$tmp .= '<option value="'.$i.'"';
if ($i == $selected) {
$tmp .= ' selected="selected"';
}
$tmp .= '>'.sprintf($optionText, $i).'</option>';
}
if ($showAllData && $last != $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;
}
// }}}
}
?>
/branches/v2.0-betulales/interfaces/bibliotheque/pear/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: Pager.php 19 2010-03-24 18:22:25Z jpm $
* @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
*/
static 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;
}
 
// }}}
}
?>
/branches/v2.0-betulales/interfaces/index.php
New file
0,0 → 1,90
<?php
// declare(encoding='UTF-8');
/** Inclusion du fichier principal de l'application*/
require_once 'referentiel.php';
?>
<!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" >
<head xml:lang="fr" lang="fr">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-style-type" content="text/css" />
<meta http-equiv="Content-script-type" content="text/javascript" />
<meta http-equiv="Content-language" content="fr" />
 
<title><?php echo Referentiel::getMetaTitre(); ?></title>
<meta name="description" content="<?php echo Referentiel::getMetaDescription();?>" />
<meta name="keywords" content="<?php echo Referentiel::getMetaTags();?>" />
<meta name="revisit-after" content="150 days" />
<meta name="robots" content="noindex,nofollow" />
<meta name="author" content="Tela Botanica" />
 
<link rel="shortcut icon" type="image/x-icon" href="http://www.tela-botanica.org/favicon.ico" />
<link rel="icon" type="image/png" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.png" />
 
<link rel="stylesheet" type="text/css" media="screen" href="interfaces/squelettes/css/humanity/jquery-ui-1.8.7.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="interfaces/squelettes/css/referentiel/referentiel.css" />
<link rel="stylesheet" type="text/css" media="screen" href="interfaces/squelettes/css/referentiel/debogage.css" />
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/1.4.4/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/cookie/1.0/jquery.cookie.min.js"></script>
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/chromatable/1.3.0/jquery.chromatable.js"></script>
<script type="text/javascript" src="interfaces/squelettes/js/jquery-ui-1.8.7.custom.min.js"></script>
<script type="text/javascript" src="interfaces/squelettes/js/referentiels.js"></script>
</head>
<body xml:lang="fr" lang="fr">
<div id="zone-centrale">
 
<div id="zone-logo">
<a href="<?php echo Config::get('url_base'); ?>" title="Retour à l'accueil du site">
<img src="interfaces/squelettes/css/referentiel/images/logo.png" alt="le logo de Tela Botanica"/>
</a>
</div>
<div id="zone-entete">
<div id="zone-entete-contenu">
<div id="zone-titre-site">
<h1>RTax-ß</h1>
</div>
</div>
</div>
<div id="zone-corps">
<div id="zone-navigation">
<?php echo Referentiel::getContenuMenu(); ?>
</div>
<div id="zone-corps-contenu">
<div id="zone-fil-ariane">
<p>Vous êtes ici&nbsp;:</p>
<?php echo Referentiel::getContenuNavigation(); ?>
</div>
<div id="entete">
<?php echo Referentiel::getContenuTete(); ?>
</div>
<div id="texte">
<?php echo Referentiel::getContenuCorps(); ?>
</div>
<div id="pied_texte">
<?php echo Referentiel::getContenuPied(); ?>
</div>
</div>
<div>
<?php echo Referentiel::getChrono(); ?>
<?php echo Referentiel::getExceptions(); ?>
</div>
<div id="zone-pied">
<p> &copy;<a href="http://www.tela-botanica.org/" accesskey="1">Tela Botanica</a> / 2000-<?=date('Y')?> - Le réseau des Botanistes Francophones</p>
<script type="text/javascript" src="http://www.google-analytics.com/ga.js">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-42874437-1', 'tela-botanica.org');
ga('send', 'pageview');
</script>
</div>
</div>
</div>
</body>
</html>
/branches/v2.0-betulales/interfaces/squelettes/resultat.tpl.html
New file
0,0 → 1,34
<!-- REF - DEBUT RESULTAT -->
<div id="ref-resultat">
<h1>
Test
<?php if (isset($resultat)) : ?>
«&nbsp;<?=$resultat['nom'];?> <span class="discretion">(id:<?=$resultat['id_resultat']?>)</span>&nbsp;»
<?php endif; ?>
</h1>
<?php if (isset($messages)) : ?>
<h2>Messages</h2>
<?php foreach ($messages as $message) : ?>
<p class="information"><?=$message;?></p>
<?php endforeach; ?>
<?php endif; ?>
<?php if (isset($resultat)) : ?>
<h2>Description</h2>
<p class="description"><?=$resultat['description']?></p>
 
<h2>Résultat</h2>
<p class="resultat <?=$resultat['resultat'] ? 'ok' : 'ko';?>"><?=$resultat['resultat'] ? 'ok' : 'ko';?></p>
<h2>Messages du test</h2>
<?php if (isset($resultat['message'])) : ?>
<div class="message"><?=$resultat['message']?></div>
<?php else : ?>
<p class="information">Aucun message pour ce résultat.</p>
<?php endif; ?>
<?php endif; ?>
</div>
<!-- REF - FIN RESULTAT -->
/branches/v2.0-betulales/interfaces/squelettes/arbre_taxon.tpl.html
New file
0,0 → 1,189
<!-- REF - DEBUT ARBRE RECHERCHE -->
<script type="text/javascript">
var urlFicheTaxonTpl = '<?= $url_fiche_taxon_tpl; ?>';
var urlServiceTpl = '<?= $url_service_tpl; ?>';
var referentiel = '<?= $referentiel; ?>';
function afficherChargement(element) {
var htmlChargement = '<div class="arbre-chargement"> chargement </div>';
element.after(htmlChargement);
}
function cacherChargement() {
$('.arbre-chargement').remove();
}
function chargerSousClassification(element) {
var lienTpl = '<?= html_entity_decode($url_sous_taxons_tpl); ?>';
var lien = lienTpl+element.attr('rel');
var parent = element.parent();
afficherChargement(parent);
$.get(lien, function(data) {
var html = "";
var infras = data['resultats_infra'];
var nb_syn = data['resultats_nb_syn'];
var nb_infras = data['resultats_nb_infra'];
if(infras.length > 0) {
$.each(infras, function() {
html += creerTemplateSousClassification(this, nb_infras, nb_syn);
});
} else {
html =
'<ul class="branche-arbre-taxo">'+
'<li class="feuille-arbre-taxo aucun-sous-taxon">'+
'Aucun sous-taxon'+
'</li>'+
'</ul>';
}
cacherChargement();
parent.append(html);
});
}
function creerTemplateSousClassification(infra, nb_infras, nb_syn) {
var blocDepliageSousClassificiation = '';
if(nb_infras[infra.num_nom] > 0) {
blocDepliageSousClassification = '<div rel="'+infra.num_nom+'" class="icone-deplier-arbre imagette-plus branche-arbre-fermee" title="Voir les sous taxons du rang inférieur ('+nb_infras[infra.num_nom]+')"></div>';
} else {
blocDepliageSousClassification = '<div class="imagette-moins" title="Aucun sous-taxon"></div>';
}
var blocDepliageSynonymes = '';
if(nb_syn[infra.num_nom] > 1) {
blocDepliageSynonymes = '&nbsp;<a rel="'+infra.num_nom+'" title="Afficher les synynomes de ce taxon ('+(nb_syn[infra.num_nom] - 1)+')" class="lien-voir-synonymes-taxo" href="#">(syn)</a>';
}
var urlFicheTaxon = urlFicheTaxonTpl.replace('%s', infra.num_nom);
htmlTpl =
'<ul class="branche-arbre-taxo">'+
'<li class="feuille-arbre-taxo">'+
blocDepliageSousClassification+
'<a title="Voir la fiche de ce taxon (s\'ouvre dans un nouvel onglet)" class="lien-ouvrir-fiche-taxo" href="'+urlFicheTaxon+'">'+
infra.nom_sci+
'</a>'+
blocDepliageSynonymes+
'</li>'+
'</ul>';
return htmlTpl;
}
function afficherSousClassification(element) {
element.removeClass('branche-arbre-fermee');
element.addClass('branche-arbre-ouverte');
element.removeClass('imagette-plus');
element.addClass('imagette-moins');
element.addClass('chargee');
element.siblings('.branche-arbre-taxo').show();
}
function cacherSousClassification(element) {
element.addClass('branche-arbre-fermee');
element.removeClass('branche-arbre-ouverte');
element.addClass('imagette-plus');
element.removeClass('imagette-moins');
element.siblings('.branche-arbre-taxo').hide();
}
function chargerSynonymes(element) {
var lienTpl = '<?= html_entity_decode($url_synonymes_tpl); ?>';
var lien = lienTpl+element.attr('rel');
var parent = element.parent(".feuille-arbre-taxo");
afficherChargement(parent);
$.get(lien, function(data) {
// Un seul élément reçu = pas de synonymes car on a reçu le nom retenu
var syn = data['resultats_syn'];
if(syn.length > 1) {
var html = "";
$.each(syn, function() {
html += creerTemplateSynonymes(this);
});
} else {
var html =
'<ul class="arbre-liste-synonymes">'+
'<li class="feuille-arbre-synonyme-taxo aucun-synonyme">'+
'Aucun synonyme'+
'</li>'+
'</ul>';
}
cacherChargement();
element.after(html);
});
}
function creerTemplateSynonymes(synonyme) {
htmlTpl = '';
if(synonyme.num_nom != synonyme.num_nom_retenu) {
var urlFicheTaxon = urlFicheTaxonTpl.replace('%s', synonyme.num_nom);
var htmlTpl =
'<ul class="arbre-liste-synonymes">'+
'<li class="feuille-arbre-synonyme-taxo">'+
'<a title="Voir la fiche de ce taxon (s\'ouvre dans un nouvel onglet)" class="lien-ouvrir-fiche-taxo" href="'+urlFicheTaxon+'">'+synonyme.nom_sci+'</a>'+
'</li>'+
'</ul>';
}
return htmlTpl;
}
// Function pour cacher / afficher les options de recherche
$(document).ready(function() {
$(".icone-deplier-arbre").live('click', function(event) {
event.preventDefault();
if($(this).hasClass('branche-arbre-fermee')) {
if(!$(this).hasClass('chargee')) {
chargerSousClassification($(this));
}
afficherSousClassification($(this));
} else {
cacherSousClassification($(this));
}
});
$(".lien-voir-synonymes-taxo").live('click', function(event) {
event.preventDefault();
if(!$(this).hasClass('chargee')) {
chargerSynonymes($(this));
$(this).addClass('chargee');
} else {
$(this).siblings('.arbre-liste-synonymes').toggle();
}
});
$(".lien-ouvrir-fiche-taxo").live('click', function(event) {
event.preventDefault();
window.open($(this).attr("href"),'_blank');
});
});
</script>
<noscript>
<hr class="nettoyage" />
<div class="attention">Attention, la consultation de l'arborescence du référentiel
nécessite l'activation de Javascript</div>
</noscript>
<hr class="nettoyage" />
<h2 class="arbre-nombre-familles"><?= count($resultats); ?> familles</h2>
<div id="ref-arbre-taxo">
<ul class="branche-arbre-taxo">
<? foreach ($resultats as $resultat) : ?>
<? if($resultat['num_nom'] == $resultat['num_nom_retenu']) : ?>
<li class="feuille-arbre-taxo">
<?php $url_fiche_taxon = str_replace('%s', $resultat['num_nom'], $url_fiche_taxon_tpl) ?>
<?php if(isset($resultats_nb_infra[$resultat['num_nom']]) && $resultats_nb_infra[$resultat['num_nom']] > 0) { ?>
<div rel="<?=$resultat['num_nom']?>" class="icone-deplier-arbre imagette-plus branche-arbre-fermee" title="Voir les sous taxons du rang inférieur (<?= $resultats_nb_infra[$resultat['num_nom']]; ?>)"></div>
<?php } else { ?>
<div class="imagette-moins" title="Aucun sous-taxon"></div>
<?php } ?>
<a title="Voir la fiche de ce taxon (s'ouvre dans un nouvel onglet)" class="lien-ouvrir-fiche-taxo" href="<?= $url_fiche_taxon; ?>">
<?= $resultat['nom_sci'] ?>
</a>
<?php if(isset($resultats_nb_syn[$resultat['num_nom']]) && $resultats_nb_syn[$resultat['num_nom']] > 1) : ?>
&nbsp;<a rel="<?=$resultat['num_nom']?>" title="Afficher les synynomes de ce taxon (<?= $resultats_nb_syn[$resultat['num_nom']] - 1; ?>)" class="lien-voir-synonymes-taxo" href="#">(syn)</a>
<?php endif; ?>
</li>
<? endif; ?>
<? endforeach; ?>
</ul>
</div>
/branches/v2.0-betulales/interfaces/squelettes/menu.tpl.html
New file
0,0 → 1,9
<!-- REF - DEBUT MENU -->
<?php if (isset($menus)) : ?>
<ul>
<?php foreach ($menus as $menu) : ?>
<li class="<?=$menu['activite'];?>"><a href="<?=$menu['url'];?>" title="<?=$menu['title'];?>"><?=$menu['nom'];?></a></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<!-- REF - FIN MENU -->
/branches/v2.0-betulales/interfaces/squelettes/resultat_recherche_taxon.tpl.html
New file
0,0 → 1,177
<!-- REF - DEBUT RESULTAT -->
<div id="ref-resultat-recherche">
<div>
<div style="float:left;"><?=$fragmenteur ?></div>
<div style="float:right; padding-right:20px;">
<h2>Légende :</h2>
<span class="transmis">à transmettre à taxref</span><br />
<span class="non_transmis">exclu de taxref</span><br />
<span class="nom_retenu">nom retenu</span>
</div>
</div>
<p><em>Le nombre de résultats correspond au nombre de nom retenu retourné.</em></p>
<? if (isset($resultats)) : ?>
<table>
<thead>
<tr>
<th title="Identifiant numérique du nom scientifique retenu">num_nom du nom retenu</th>
<th title="Identifiant numérique du nom scientifique">num_nom</th>
<th>Nom scientifique</th>
<th>Auteur</th>
<th>Année</th>
<th>Référence bibliographique</th>
<th>Présence</th>
<th>Nom addendum</th>
</tr>
</thead>
<tbody>
<?if (isset($resultats['nom_retenu'])) :
foreach ($resultats['nom_retenu'] as $id => $retenu) : ?>
<?= ($retenu['exclure_taxref'] == 0) ? '<tr class="nom_retenu transmis">' : '<tr class="nom_retenu non_transmis">' ?>
<td></td>
<td><a href="<?=Recherche::getUrlFicheTaxon($retenu)?>"><?=$retenu['num_nom']?></a></td>
<td><a href="<?=Recherche::getUrlFicheTaxon($retenu)?>"><?=$retenu['nom_sci'];?></a>
<? if ($retenu['nom_sci'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche($retenu['nom_sci'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$retenu['auteur'];?>
<? if ($retenu['auteur'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('au:'.$retenu['auteur'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$retenu['annee'];?>
<? if ($retenu['annee'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('an:'.$retenu['annee'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$retenu['biblio_origine'];?>
<? if ($retenu['biblio_origine'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('bib:'.$retenu['biblio_origine'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$retenu['presence'];?>
<? if ($retenu['presence'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('pre:1', $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$retenu['nom_addendum'];?>
<? if ($retenu['nom_addendum'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('mots:',$retenu['nom_addendum'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
</tr>
<?if (isset($resultats[$id])) :
foreach ($resultats[$id] as $synonyme) : ?>
<?=($synonyme['exclure_taxref'] == 0) ? '<tr class="transmis">' : '<tr class="non_transmis">' ?>
<td><?=$synonyme['num_nom_retenu'];?></td>
<td><a href="<?=Recherche::getUrlFicheTaxon($synonyme)?>"><?=$synonyme['num_nom']?></a></td>
<td><a href="<?=Recherche::getUrlFicheTaxon($synonyme)?>"><?=$synonyme['nom_sci'];?></a>
<? if ($synonyme['nom_sci'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche($synonyme['nom_sci'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$synonyme['auteur'];?>
<? if ($synonyme['auteur'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('au:'.$synonyme['auteur'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$synonyme['annee'];?>
<? if ($synonyme['annee'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('an:'.$synonyme['annee'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$synonyme['biblio_origine'];?>
<? if ($synonyme['biblio_origine'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('bib:'.$synonyme['biblio_origine'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$synonyme['presence'];?>
<? if ($synonyme['presence'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('pre:1', $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$synonyme['nom_addendum'];?>
<? if ($synonyme['nom_addendum'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('mots:'.$synonyme['nom_addendum'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
</tr>
<? endforeach;
endif;
endforeach;
else :
foreach ($resultats as $res) :
foreach ($res as $synonyme) : ?>
<?=($synonyme['exclure_taxref'] == 0) ? '<tr class="transmis">' : '<tr class="non_transmis">' ?>
<td><?=$synonyme['num_nom_retenu'];?></td>
<td><a href="<?=Recherche::getUrlFicheTaxon($synonyme)?>"><?=$synonyme['num_nom']?></a></td>
<td><a href="<?=Recherche::getUrlFicheTaxon($synonyme)?>"><?=$synonyme['nom_sci'];?></a>
<? if ($synonyme['nom_sci'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche($synonyme['nom_sci'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$synonyme['auteur'];?>
<? if ($synonyme['auteur'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('au:'.$synonyme['auteur'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$synonyme['annee'];?>
<? if ($synonyme['annee'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('an:'.$synonyme['annee'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$synonyme['biblio_origine'];?>
<? if ($synonyme['biblio_origine'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('bib:'.$synonyme['biblio_origine'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$synonyme['nom_addendum'];?>
<? if ($synonyme['nom_addendum'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('mots:',$synonyme['nom_addendum'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
</tr>
<? endforeach;
endforeach;
endif;?>
</tbody>
</table>
<? endif; ?>
</div>
<!-- REF - FIN RESULTAT -->
/branches/v2.0-betulales/interfaces/squelettes/accueil.tpl.html
New file
0,0 → 1,18
<!-- REF - DEBUT ACCUEIL -->
<h1>Liste des référentiels en cours de travail</h1>
<p>Veuillez sélectionner un référentiel ci-dessous pour accéder aux différentes applications disponibles.</p>
<?php if (isset($messages)) : ?>
<h2>Messages</h2>
<?php foreach ($messages as $message) : ?>
<p class="information"><?=$message;?></p>
<?php endforeach; ?>
<?php endif; ?>
 
<?php if (isset($referentiels)) : ?>
<ul>
<?php foreach ($referentiels as $referentiel) : ?>
<li><a href="<?=$referentiel['url'];?>"><?=$referentiel['titre']." (".$referentiel['nom'].")";?> (Mis à jour le <?=$referentiel['date']?>)</a></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<!-- REF - FIN ACCUEIL -->
/branches/v2.0-betulales/interfaces/squelettes/form_tests.tpl.html
New file
0,0 → 1,100
<!-- REF - DEBUT TEST -->
<script type="text/javascript">
$(document).ready(function() {
$('#ref-dem-ok').click(function(e) {
var ok = false;
if (confirm('Êtes vous sûr de vouloir lancer de nouveaux tests ?')) {
ok = true;
}
return ok;
});
// Rend les tables portant la classe "defilante" srollable
$('.defilante').chromatable();
});
</script>
<h1>Tests du référentiel «&nbsp;<?=$nom_referentiel;?>&nbsp;» (<?=$ref?>)</h1>
 
<?php if (isset($messages)) : ?>
<h2>Messages</h2>
<?php foreach ($messages as $message) : ?>
<p class="information"><?=$message;?></p>
<?php endforeach; ?>
<?php endif; ?>
 
<h2>Demande de tests</h2>
<?php if (isset($ref)) : ?>
<div id="zone-form">
<form id="ref-demande-traitement" name="ref-demande-traitement" action="<?=$url_form;?>" method="get">
<input name="module" type="hidden" value="<?=$url_module;?>" />
<input name="action" type="hidden" value="<?=$url_action_demande;?>" />
<input name="ref" type="hidden" value="<?=$ref;?>" />
<input id="ref-dem-ok" type="submit" value="1. Lancer les tests" />
</form>
<form id="ref-rafraichir" name="ref-rafraichir" action="<?=$url_form;?>" method="get">
<input name="module" type="hidden" value="<?=$url_module;?>" />
<input name="action" type="hidden" value="<?=$url_action_rafraichir;?>" />
<input name="ref" type="hidden" value="<?=$ref;?>" />
<input id="ref-raf-ok" type="submit" value="2. Rafraichir" />
</form>
</div>
<?php endif; ?>
 
<h2>Tests</h2>
<table class="defilante">
<caption>Traitements <?=strftime('à %H:%M:%S le %d %B %Y')?></caption>
<thead>
<tr>
<th>Nom (#)</th>
<th>État</th>
<th>Date début</th>
<th>Date fin</th>
<th>Durée</th>
</tr>
</thead>
<tbody>
<?php if (isset($traitements_en_attente)) : ?>
<?php foreach ($traitements_en_attente as $traitement) : ?>
<tr>
<td><?=$traitement['nom']?> <span class="discretion">(id:<?=$traitement['id_traitement']?>)</span></a></td>
<td class="traitement-attente">En attente de traitement...</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php if (isset($traitements_en_cours)) : ?>
<?php foreach ($traitements_en_cours as $traitement) : ?>
<tr>
<td><?=$traitement['nom']?> <span class="discretion">(id:<?=$traitement['id_traitement']?>)</span></a></td>
<td class="traitement-cours">En cours de traitement...</td>
<td><?=$traitement['date_debut']?></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php if (isset($traitements_termines)) : ?>
<?php foreach ($traitements_termines as $traitement) : ?>
<tr>
<td><a href="<?=$traitement['url']?>"><?=$traitement['nom']?> <span class="discretion">(id:<?=$traitement['id_traitement']?>)</span></a></td>
<td class="traitement-termine">Terminé</td>
<td><?=$traitement['date_debut']?></td>
<td><?=$traitement['date_fin']?></td>
<td><?=$traitement['duree']?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
 
<h2>Importation d'une version taxref</h2>
<?php if (isset($ref)) : ?>
<div id="zone-form">
<form id="ref-importation" name="ref-importation" action="<?=$url_importation;?>" method="post" enctype="multipart/form-data">
<input type="file" name="nom_fichier" />
<input id="ref-imp-ok" type="submit" value="Lancer l'importation" />
</form>
</div>
<?php endif; ?>
<!-- REF - FIN TEST -->
/branches/v2.0-betulales/interfaces/squelettes/detail_referentiel.tpl.html
New file
0,0 → 1,102
<!-- REF - DEBUT DETAIL -->
<h1><?=$nom_referentiel;?> (<?=$referentiel;?>)</h1>
 
<?php if (isset($messages)) : ?>
<h2>Messages</h2>
<?php foreach ($messages as $message) : ?>
<p class="information"><?=$message;?></p>
<?php endforeach; ?>
<?php endif; ?>
 
<p>
Vous pouvez <a href="<?=$url_menu_test;?>">tester</a> la <?=strtolower($referentiel);?>
afin de contrôler les données saisies dans la version de travail.<br />
Lorsqu'une version de travail est prête à être publiée, vous pouvez accéder à
<a href="<?=$url_menu_versionnage;?>">l'outil de versionnage</a> pour réaliser
cette manipulation. Cette interface permet aussi de télécharger les versions précédentes.<br />
Enfin, il est possible de <a href="<?=$url_menu_consultation;?>">consulter</a> en permanence les données saisies
dans la version de travail.
</p>
 
 
<h2>Téléchargement personnalisé</h2>
<?php if(isset($url_telechargement_zip)): ?>
<div class="telecharger-resultat">
<h2>Votre téléchargement est prêt</h2>
Si le téléchargement ne commence pas automatiquement, cliquez sur le lien ci-dessous
<br/>
<a id="telecharger_resultat" href="<?= $url_telechargement_zip ?>">Télécharger le référentiel</a><br />
Pour ouvrir les fichiers csv avec votre tableur, veuillez choisir l'encodage (jeu de caractères) UTF-8, le sépateur {tab} ou \t et aucune séparation de texte.
</div>
<script type="text/javascript">
$(document).ready(function() {
document.location = $('#telecharger_resultat').attr('href');
});
</script>
<?php endif ?>
 
<?php if (isset($versions) && !empty($versions)) { ?>
<form id="export" action="<?=$url_form_telech?>" method="post">
Pouvez-vous nous indiquer votre futur usage du référentiel ?<br />
<input type="radio" name="usage" id="usage" value="essai"/><label for="usage">essai</label>
<input type="radio" name="usage" id="usage" value="personnel"/><label for="usage">personnel</label>
<input type="radio" name="usage" id="usage" value="professionnel"/><label for="usage">professionnel</label><br /><br />
Choississez la version que vous souhaitez télécharger :<br />
<!-- chercher comment inclure meta donnees et manuel technique -->
<? foreach ($versions as $version) { ?>
<input type="radio" name="version" id="version" checked value="<?=$version['version']?>"/><label for="version">version <?=$version['version'].' du '.$version['date_prod']?></label><br />
<? } ?>
<br />
Sélectionnez les données :<br />
<input type="checkbox" name="filtres[]" id="nnr" value="nnr"/><label for="filtres">que les noms retenus</label><br />
<!-- à modifier pour tenir compte du référentiel -->
<input type="checkbox" name="filtres[]" id="pre" value="pre"/><label for="filtres">que les taxons présents en France</label><br />
<label for="filtres"><span title="Saisir un nom scientifique">de la famille</span></label><input type="text" name="filtres[]" id="famille"/><br />
<br />
 
Choississez les champs que vous souhaitez exporter
(cocher : <a class="curseur-pointeur" id="cocher-tous">tous</a> /
<a class="curseur-pointeur" id="cocher-base">champs de base</a> /
<a class="curseur-pointeur" id="decocher-tous">aucun</a>)
<br/>
<?php $i = 0; ?>
<div class="colonne-cases">
<?php foreach ($colonnesOrdonnees as $id => $description) { ?>
<input type="checkbox" <?=$description[1]?> name="champs[]" id="<?=$id?>" value="<?=$id?>" <?= ($description[1] == 'checked') ? 'class="base"' : '' ?>/>
<label for="$id"><span title=<?='"'.$description[2].'"'?>><?=$description[0]?></span></label><br />
<?php if($i == 22): ?>
</div>
<div class="colonne-cases">
<?php endif ?>
<?php $i++; ?>
<?php } ?>
</div>
<br/>
<br/>
<input type="submit" value="telecharger">
</form>
<?php } ?>
 
<h2>Versions</h2>
<?php if (isset($infos_telechargements) && !empty($infos_telechargements)) { ?>
<?php foreach ($infos_telechargements as $info) : ?>
<?php foreach ($info['urls_zip'] as $zip => $url) : ?>
<div class="lien_telechargement">
<a href="<?=$url?>">
Télécharger la version <?=$zip?>
</a>
<span class="description_telechargement"><?=$info['description']?></span></div>
<?php endforeach; ?>
<?php endforeach; ?>
<?php } else { ?>
<p> Aucun téléchargement n'est disponible pour ce référentiel </p>
<?php } ?>
 
 
 
 
 
 
<!-- REF - FIN DETAIL -->
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/debogage.css
New file
0,0 → 1,40
/*--------------------------------------------------------------------------------------------------------------*/
/* Débogage */
.debogage{
color:black;
border:3px solid #6495ed;}
.debogage_fichier, .debogage_ligne{
font-size:10px;
color:#A9A9A9;}
 
/*--------------------------------------------------------------------------------------------------------------*/
/* Tableau du chronométrage du programme */
table#chrono{
display:block;
border:3px solid #6495ed;
border-collapse:collapse;
text-align: center;
margin:0 auto;}
#chrono thead, tfoot{
background-color:#D0E3FA;
border:1px solid #6495ed;}
#chrono tbody{
background-color:#FFFFFF;
border:1px solid #6495ed;}
#chrono th{
font-family:monospace;
border:1px dotted #6495ed;
padding:5px;
background-color:#EFF6FF;
width:25%;}
#chrono td{
font-family:sans-serif;
font-size:80%;
border:1px solid #6495ed;
padding:5px;
text-align:center;}
#chrono caption{
font-family:sans-serif;
text-align: center;
width:90%;
margin:auto;}
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/aide.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/aide.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/infraplus.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/infraplus.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/norm_left_both_securise.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/norm_left_both_securise.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/seinet.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/seinet.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/sfo.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/sfo.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/cjb.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/cjb.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/ipni.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/ipni.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/nybg.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/nybg.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/tpl.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/tpl.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/mnhn.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/mnhn.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/jstor.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/jstor.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/lichen.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/lichen.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/tropicos.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/tropicos.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/inpn.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/inpn.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/anbg.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/anbg.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/antilles.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/antilles.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/si.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/si.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/vha.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/vha.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/cbnm.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/cbnm.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/smf.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/sites/smf.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/inframoins.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/inframoins.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/attention.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/attention.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/norm_right_both.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/norm_right_both.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/bandeau_atelier_fond.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/bandeau_atelier_fond.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/fermer.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/fermer.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/mail.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/mail.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/norm_left_both.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/norm_left_both.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/information.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/information.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/ouvrir.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/ouvrir.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/norm_right_both_securise.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/norm_right_both_securise.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/img_underline_atelier.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/img_underline_atelier.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/img_underline_hover_atelier.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/img_underline_hover_atelier.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/chargement.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/chargement.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/data_query.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/data_query.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/bandeau_atelier.jpg
Cannot display: file marked as a binary type.
svn:mime-type = image/jpeg
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/bandeau_atelier.jpg
New file
Property changes:
Added: svn:mime-type
+image/jpeg
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/logo.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/images/logo.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/initialisation.css
New file
0,0 → 1,224
/*
style.css contains a reset, font normalization and some base styles.
credit is left where credit is due.
additionally, much inspiration was taken from these projects:
yui.yahooapis.com/2.8.1/build/base/base.css
camendesign.com/design/
praegnanz.de/weblog/htmlcssjs-kickstart
*/
 
/*
html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
v1.4 2009-07-27 | Authors: Eric Meyer & Richard Clark
html5doctor.com/html-5-reset-stylesheet/
*/
 
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code,del, dfn, em, img,
ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption,
tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, hgroup, menu, nav, section, menu, time, mark, audio,
video {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;}
 
article, aside, figure, footer, header, hgroup, nav, section{
display:block;}
nav ul{
list-style:none;}
blockquote, q { quotes:none; }
 
blockquote:before, blockquote:after,
q:before, q:after { content:''; content:none; }
 
a { margin:0; padding:0; border:0; font-size:100%; vertical-align:baseline; background:transparent; }
 
ins { background-color:#ff9; color:#000; text-decoration:none; }
 
mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; }
 
del { text-decoration: line-through; }
 
abbr[title], dfn[title] { border-bottom:1px dotted #000; cursor:help; }
 
/* tables still need cellspacing="0" in the markup */
table { border-collapse:collapse; border-spacing:0; }
 
hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }
 
input, select { vertical-align:middle; }
/* END RESET CSS */
 
 
/*
fonts.css from the YUI Library: developer.yahoo.com/yui/
Please refer to developer.yahoo.com/yui/fonts/ for font sizing percentages
 
There are two custom edits:
* make the line-height relative and unit-less
* remove the pre,code styles as we use a recommendation from Eric Meyer instead
*/
body { font:13px arial,helvetica,"Nimbus Sans L", "Bitstream Vera Sans", sans-serif; *font-size:small; *font:x-small; line-height:1.22; }
 
table { font-size:inherit; font:100%; }
 
select, input, textarea { font:99% arial,helvetica,"Nimbus Sans L", "Bitstream Vera Sans", sans-serif; }
 
 
/* normalize monospace sizing
* meyerweb.com/eric/thoughts/2010/02/12/fixed-monospace-sizing/
*/
code, pre { font-family: "Courier New", monospace, serif; font-size: 1em; }
 
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* minimal base styles */
 
/* #444 looks better than black: twitter.com/H_FJ/statuses/11800719859 */
body, select, input, textarea { color:#444; }
 
/* Headers (h1,h2,etc) have no default font-size or margin,
you'll want to define those yourself. */
/* www.aestheticallyloyal.com/public/optimize-legibility/ */
h1,h2,h3,h4,h5,h6 { font-weight: bold; text-rendering: optimizeLegibility; }
 
/* maxvoltar.com/archive/-webkit-font-smoothing */
html { -webkit-font-smoothing: antialiased; }
 
/* Accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test */
a:active { outline: none; }
a:focus { outline: thin dotted; }
 
a, a:active, a:visited { color:#607890; }
a:hover { color:#036; }
 
ul { margin-left:30px; }
ol { margin-left:30px; list-style-type: decimal; }
 
small { font-size:85%; }
strong, th { font-weight: bold; }
 
td, td img { vertical-align:top; }
 
sub { vertical-align: sub; font-size: smaller; }
sup { vertical-align: super; font-size: smaller; }
 
pre {
padding: 15px;
/* www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap/ */
white-space: pre; /* CSS2 */
white-space: pre-wrap; /* CSS 2.1 */
white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
word-wrap: break-word; /* IE */}
 
/* align checkboxes, radios, text inputs with their label
by: Thierry Koblentz tjkdesign.com/ez-css/css/base.css */
input[type="radio"] { vertical-align: text-bottom; }
input[type="checkbox"] { vertical-align: bottom; *vertical-align: baseline; }
.ie6 input { vertical-align: text-bottom; }
 
/* hand cursor on clickable input elements */
label, input[type=button], input[type=submit], button { cursor: pointer; }
 
/* These selection declarations have to be separate.
No text-shadow: twitter.com/miketaylr/status/12228805301
Also: hot pink. */
::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
::selection { background:#FF5E99; color:#fff; text-shadow: none; }
 
/* j.mp/webkit-tap-highlight-color */
a:link { -webkit-tap-highlight-color: #FF5E99; }
 
/* always force a scrollbar in non-IE */
html { overflow-y: scroll; }
 
/* make buttons play nice in IE:
www.viget.com/inspire/styling-the-button-element-in-internet-explorer/ */
button { width: auto; overflow: visible; }
/* bicubic resizing for non-native sized IMG:
code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ */
.ie7 img { -ms-interpolation-mode: bicubic; }
 
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Non-semantic helper classes */
 
/* for image replacement */
.ir { display:block; text-indent:-999px; overflow:hidden; background-repeat: none; }
 
/* Hide for both screenreaders and browsers
css-discuss.incutio.com/wiki/Screenreader_Visibility */
.hidden { display:none; visibility:hidden; }
 
/* Hide only visually, but have it available for screenreaders
www.webaim.org/techniques/css/invisiblecontent/
Solution from: j.mp/visuallyhidden - Thanks Jonathan Neal! */
.visuallyhidden { position:absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px); }
 
/* Hide visually and from screenreaders, but maintain layout */
.invisible { visibility: hidden; }
 
/* >> The Magnificent CLEARFIX << */
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.clearfix { display: inline-block; }
* html .clearfix { height: 1%; } /* Hides from IE-mac \*/
.clearfix { display: block; }
 
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Primary Styles
Author:
*/
 
 
 
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Print styles : inlined to avoid required HTTP connection www.phpied.com/delay-loading-your-print-css/ */
@media print {
* { background: transparent !important; color: #444 !important; text-shadow: none; }
 
a, a:visited { color: #444 !important; text-decoration: underline; }
 
a:after { content: " (" attr(href) ")"; }
 
abbr:after { content: " (" attr(title) ")"; }
.ir a:after { content: ""; } /* Don't show links for images */
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
img { page-break-inside: avoid; }
 
@page { margin: 0.5cm; }
 
p, h2, h3 { orphans: 3; widows: 3; }
 
h2, h3{ page-break-after: avoid; }
}
 
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Media queries for responsive design */
 
@media all and (orientation:portrait) {
/* Style adjustments for portrait mode goes here */
}
 
@media all and (orientation:landscape) {
/* Style adjustments for landscape mode goes here */
}
 
/* Grade-A Mobile Browsers (Opera Mobile, iPhone Safari, Android Chrome)
Consider this: www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/ */
@media screen and (max-device-width: 480px) {
/* Prevent iOS, WinMobile from adjusting font size */
html {
-webkit-text-size-adjust:none;
-ms-text-size-adjust:none;}
}
/branches/v2.0-betulales/interfaces/squelettes/css/referentiel/referentiel.css
New file
0,0 → 1,629
@CHARSET "UTF-8";
/*--------------------------------------------------------------------------------------------------------------*/
/* Générique */
body {
font-family:Arial, Helvetica, Verdana, sans-serif;
font-size:0.85em;
background-color:#fff;
margin:2px;}
h1{
font-size:1.4em;
line-height:1.3em;
font-weight:bold;
padding:0 0 2px 5px;
margin:10px 0 4px 0;
background-color:#c38673;
color:white;}
h2{
font-size:1em;
font-weight:bold;
color:black;
text-transform:uppercase;
margin:10px 0 4px 0;
color:#AD5A40;}
h3{
font-size:0.95em;
color:black;
font-weight:bold;
margin:8px 0 4px 0;
text-transform:none;}
h4{
font-size:0.8em;
color:black;
font-weight:bold;
letter-spacing:0.1em;
margin:8px 0 2px 0;}
h5{
font-size:0.8em;
color:black;
font-style:italic;
margin:4px 0 1px 0;}
h6{
font-size:0.75em;
color:black;
font-style:italic;
margin:4px 0 1px 0;}
a{
color:black;
text-decoration:none;
background:url(images/img_underline_atelier.png) repeat-x center bottom;}
a:hover{
color:black;
text-decoration:none;
background:url(images/img_underline_hover_atelier.png) repeat-x center bottom;}
hr{
color:#62210F;}
table{
border-collapse: collapse;
width:100%;
margin:5px 0;}
td,th{
border:1px solid #36560B;
padding:7px 5px;
background-color:white;}
th{
background-color:#EEE;}
label[title]:after, th[title]:after, span[title]:after {
content: " " url("images/aide.png");
}
caption{
border:1px solid #36560B;
background-color:#EEE;
font-weight:bold;
padding:2px;}
img{
border:0;}
img a{
display:block;}
legend{
color:#AD5A40;}
.nettoyeur{
visibility:hidden;}
/*--------------------------------------------------------------------------------------------------------------*/
/* Disposition */
#zone-centrale {
text-align:center;}
#zone-logo{
left:18px;
margin:1px 10px;
position:absolute;
top:2px;
z-index:1;}
#zone-entete{
height:121px;
margin:0;
background:url("images/bandeau_atelier_fond.png") repeat-x scroll 0 0 transparent;}
#zone-entete-contenu{
height:120px;
background:url("images/bandeau_atelier.jpg") no-repeat scroll 0 0 transparent;}
#zone-titre-site{
height:38px;
margin:0;
text-align:right;}
#zone-titre-site h1{
margin:0 20px 0 0;
padding:0;
background-color:transparent;
font-size:28px;
font-weight:bold;}
#zone-corps{
margin:0;
text-align:left;}
#zone-navigation{
position:relative;
float:left;
height:21px;
width:100%;
margin:0;
padding:0;
text-align:left;
font-weight:bold;
border-bottom:1px solid #62210F;}
#zone-corps-contenu{
clear:both;
min-height:300px;
padding:0 2px;
text-align:justify;
border-top:medium none !important;
border:1px solid #62210F;}
#zone-fil-ariane{
font-weight:bold;
text-align:left;}
#zone-pied{
clear:both;
text-align:center;}
/*--------------------------------------------------------------------------------------------------------------*/
/* Logo */
#zone-logo img{
border:0;}
#zone-logo a{
position:absolute;
top:0;
left:0;}
#zone-logo a:hover{
border:1px dotted;}
#zone-logo a:hover:after{
content:" Retour à l'accueil ";}
/*--------------------------------------------------------------------------------------------------------------*/
/* Fil d'ariane */
#zone-fil-ariane{
padding:10px 5px;}
#zone-fil-ariane p{
font-weight:bold;
float:left;
margin:0;
padding-right:5px;}
.fil-ariane{
list-style-type:none;
margin:0;
padding:0;}
.fil-ariane li{
float:left;
margin:0;
padding:0;}
.fil-ariane li:before{
content: " > ";}
.fil-ariane a{
padding:0 5px;}
/*--------------------------------------------------------------------------------------------------------------*/
/* Navigation onglets */
#zone-navigation ul {
margin:0;
padding:0;
list-style:none;}
#zone-navigation li {
float:left;
margin:0;
padding:0;
background:url("images/norm_right_both.gif") no-repeat right top;}
#zone-navigation a {
float:left; /* ligne ajoutee pour compatibilite IE5-Mac */
display:block;
background:url("images/norm_left_both.gif") no-repeat left top;
width:.1em;
white-space:nowrap;/*2 lignes ajoutees pour compatibilite IE : extension de la zone cliquable a l'ensemble de l'onglet*/
padding:5px 15px 4px;
text-decoration:none;}
/* On retablit le float a sa valeur correct mais le hack de l'antislash commente cache cette regle a IE5-Mac \*/
#zone-navigation a {float:none;}
/* End IE5-Mac hack */
#zone-navigation > ul a {
width:auto;} /*propriete ajoutee pour contredire la ligne speciale IE (ci dessus) pour les autres navigateurs*/
#zone-navigation li:hover {
background-position:100% -150px;}
#zone-navigation li:hover a {
background-position:0% -150px;}
#zone-navigation .inactif {
border-bottom:medium none #62210F;}
#zone-navigation .inactif a{
border-bottom:1px solid;
line-height:12px;
font-weight:normal;}
#zone-navigation .actif{
position:relative;
background-position:100% -150px;
z-index:3;}
#zone-navigation .actif a{
position:relative;
background-position:0 -150px;
line-height:13px;
z-index:4;}
#zone-navigation .securise{
position:relative;
border-bottom:medium none #62210F;
background-position:100% -150px;
z-index:3;}
#zone-navigation .inactif.securise a{
background:url("images/norm_left_both_securise.png") no-repeat left top;}
#zone-navigation li.inactif.securise {
background:url("images/norm_right_both_securise.png") no-repeat right top;}
 
#zone-navigation li.inactif.securise:hover {
background-position:100% -150px;}
#zone-navigation li.inactif.securise:hover a {
background-position:0% -150px;}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Général */
.discretion{
color:#A9A9A9;
font-size:10px;
font-weight:normal;}
.description{
background-color:#f0f0f0;
white-space:pre-wrap;}
.resultat{
text-transform:uppercase;}
.ok{
background-color:#9ED30D !important;}
.ko{
background-color:#E9584C !important;}
.espace{
background-color:yellow !important;}
.obligatoire{
color:red;}
.attention {
display:block;
background: #ffffcc url("images/attention.png") no-repeat 2% 50%;
text-align:center;
border: 1px solid red;
min-height: 30px;
max-width: 800px;
padding:10px 5px 5px 50px;}
.information {
background: #e7ebfd url("images/information.png") no-repeat 2% 50%;
text-align:center;
border:1px solid #5D81BA;
max-width: 800px;
min-height:30px;
padding:10px 5px 5px 50px;}
hr.nettoyage{
clear:both;
width:0;}
/* Formulaire */
#zone-form fieldset{
margin:5px;
padding:5px;
float:left;}
#zone-form fieldset legend{
padding:0 10px;
border-left:#CCC 1px solid;
border-right:#CCC 1px solid;
background-color:white;
font-size:1.2em;
color:#999;}
#zone-form input{
margin:5px;}
#zone-form textarea{
with:100%;}
#zone-form input[type="submit"] {
width:auto !important;
margin:5px !important;}
#zone-form input:hover, #zone-form select:hover, #zone-form input:focus, #zone-form select:focus{
background-color:#DEF;}
.case-a-cocher-scroll {
clear:both;
height:6em;
padding:2px;
margin: 0 0 2px 0;
overflow:auto;
width:90%;
border:1px solid #ccc;
background-color:#FFF;}
.case-a-cocher-scroll label{
width:90% !important;}
.case-a-cocher-scroll input{
margin:0;
padding:0;
width:auto !important;}
.case-a-cocher-scroll label:after{
content:"" !important;}
.liste-simple li, ul.liste-simple, ul.liste-champs{
list-style-type:none;
padding:0;
margin:0 !important;}
.liste-champs li{
padding:2px;}
.defilant{
min-height:150px;
max-height:300px;
overflow-x: hidden;
overflow-y: auto;
padding-right: 17px;
width: 900px;
}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Largeurs à utiliser pour fixer les tailles des éléments (tableau, paragraphe...) */
.largeur-01{
width:60px;}
.largeur-01-5{
width:90px;}
.largeur-02{
width:120px;}
.largeur-02-5{
width:150px;}
.largeur-03{
width:180px;}
.largeur-03-5{
width:210px;}
.largeur-04{
width:240px;}
.largeur-05{
width:300px;}
.largeur-06{
width:360px;}
.largeur-07{
width:420px;}
.largeur-08{
width:480px;}
.largeur-09{
width:540px;}
.largeur-10{
width:600px;}
.largeur-11{
width:660px;}
.largeur-12{
width:720px;}
.largeur-13{
width:780px;}
.largeur-14{
width:840px;}
.largeur-15{
width:900px;}
.largeur-16{
width:960px;}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Demande de traitements */
.traitement-attente{
background-color:#F16158;}
.traitement-cours{
background-color:#FCCB54;}
.traitement-termine{
background-color:#BBEFA5;}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Traitement */
#resultats {
width:1024px;}
#resultats .numero{
font-weight:bold;
width:2%;}
#resultats .nom{
font-weight:bold;
width:30%;}
 
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Informations */
.lien_telechargement {
margin-bottom: 15px;
margin-top: 10px;
}
 
.lien_telechargement a {
border: 1px solid grey;
padding: 5px;
margin-right: 5px;
border-radius: 7px 7px 7px 7px;
background-color: #888;
background: -webkit-linear-gradient( #777, #F4F7F8);
background: -moz-linear-gradient( #777, #F4F7F8);
background: -ms-linear-gradient( #777, #F4F7F8);
background: -o-linear-gradient( #777, #F4F7F8);
background: linear-gradient( #777, #F4F7F8);
}
 
.lien_telechargement a:hover{
color: white;
background: #555;
background: -webkit-linear-gradient( #555, #666);
background: -moz-linear-gradient( #555, #666);
background: -ms-linear-gradient( #555, #666);
background: -o-linear-gradient( #555, #666);
background: linear-gradient( #555, #666);
}
 
.lien_telechargement a:active{
color: #000;
background: #444;
background: -webkit-linear-gradient( #555, #2C2C2C);
background: -moz-linear-gradient( #555, #2C2C2C);
background: -ms-linear-gradient( #555, #2C2C2C);
background: -o-linear-gradient( #555, #2C2C2C);
background: linear-gradient( #555, #2C2C2C);
box-shadow: 1px 1px 10px black inset,
0 1px 0 rgba( 255, 255, 255, 0.4);
}
 
.telecharger-resultat {
background-color: #C3D45D;
padding: 10px;
border: solid #505050 1px;
padding-top: 0;
}
 
.colonne-cases {
display: inline-block;
margin-right: 20px;
margin-top: 10px;
}
.curseur-pointeur {
cursor: pointer;
}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Résultat */
#ref-resultat .resultat{
width:20px;
padding:5px;}
#ref-resultat .description, #ref-resultat .message{
width:800px;
padding:5px;}
#ref-resultat .message p{
background-color:#f0f0f0;}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Résultat consultation*/
#ref-resultat-recherche {
padding : 5px;
}
.nom_retenu {
font-weight:bold;}
th {
background-color:#EFF3FF;}
.transmis td, .transmis{
background-color:#EAEDCD;}
.non_transmis td, .non_transmis{
background-color:#C4AFA8;}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Présentation Fiche Taxon*/
.txt-long{
white-space:pre-wrap;}
p.txt-long{
width:53.6em;
padding:.3em;
background-color:#FFF;}
#texte li{
margin:0;}
.ref-onglets{
font-size:0.9em;}
.ref-sommaire a{
background:none;}
.label-grand dt{
width:28em;}
.label-court dt{
width:12em;}
th.vide {
background-color:transparent;
border:none;}
#ref-ref-mail pre{
font-family:Arial, Helvetica, Verdana, sans-serif;
font-size:1em;
margin:1em 0;
border:none;}
#ref-ref-mail form{
text-align:center;
margin:1em 0;
padding:0;
}
#ref-ref-mail label{
display:inline-block;
width:150px;
padding:0 1em;
text-align:left;
vertical-align: top;}
#ref-ref-mail textarea{
width:600px;}
#ref-ref-mail .droite{
margin-left:130px;}
#ref-ref-mail .champs{
width:600px;}
#ref-ref-mail .valid{
float:center;
}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Fragmenteur : pagination */
.fragmenteur select, .fragmenteur a, .fragmenteur .frag_page_courrante, .fragmenteur .frag_resultats {
-moz-border-radius: 4px 4px 4px 4px;
color: white;
margin: 0 2px;
padding: 5px;}
.fragmenteur select, .fragmenteur a {
background-color: #C38673;
border: 1px solid black;}
.fragmenteur a:hover, .fragmenteur .frag_page_courrante, .fragmenteur .frag_resultats {
background-color: #AEDC43;
border: 1px solid #86A736;
font-weight: bold;}
.frag_separateur {
display: none;}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Versionnage */
#zone-form{
position:relative;
width:100%;}
#zone-form fieldset:hover{
background-color:#EFE0D1;}
#ref-demande-versionnage fieldset{
width:400px;}
#ref-demande-versionnage textarea{
width:95%;}
#ref-demande-versionnage label{
display:block;
float:left;
width:40%;
margin:2px 0;}
#ref-demande-versionnage #champs-domaine label{
width:90%;}
#ref-demande-versionnage input{
width:100%;
margin:0 0 2px 0;}
#case-a-cocher-scroll-licence, label[for="referencement"]{
width:90% !important;}
#case-a-cocher-scroll-licence label{
width:80%;}
#champs-contributeur{
clear:left;}
#ref-versionnage-ok{/*Pour IE6*/
width:auto !important;
margin:5px !important;}
#champs-contributeur p{
width:32%;
float:left;
font-size:0.8em;
padding:3px;}
#champs-contributeur div{
width:66%;
float:left;
margin-left:2px;
padding-left:5px;
border-left:1px dotted black;}
.imagette-plus {
background: url("images/ouvrir.png") no-repeat scroll 0 0 transparent;
display: inline;
float: left;
height: 15px;
margin-right: 3px;
width: 15px;
}
 
.imagette-moins {
background: url("images/fermer.png") no-repeat scroll 0 0 transparent;
display: inline;
float: left;
height: 15px;
margin-right: 3px;
width: 15px;
}
 
.icone-deplier-arbre {
cursor:pointer;
}
 
.arbre-chargement {
background: url("images/chargement.gif") no-repeat scroll 0 5px transparent;
margin-left: 17px;
padding: 5px 5px 5px 20px;
}
 
.arbre-nombre-familles {
padding-left: 30px;
}
 
.branche-arbre-taxo, .aucun-synonyme {
list-style-type:none;
}
 
.lien-voir-synonymes-taxo, .aucun-sous-taxon, .aucun-synonyme {
font-size: 0.8em;
}
 
.lien-voir-synonymes-taxo , .arbre-liste-synonymes a {
color: #666666;
}
 
#texte li.feuille-arbre-synonyme-taxo {
margin-top: 3px;
list-style-type: square;
}
 
.branche-arbre-taxo {
margin-top: 2px;
border-left: 1px solid;
margin-left: 7px;
margin-top: 2px;
padding-left: 20px;
}
 
#texte .feuille-arbre-taxo {
margin-top: 3px;
}
/* Nécessaire à IE 6 et 7 pour éviter un décalage vers le bas!*/
.ref-onglets {
margin:0;/*Pour IE*/
padding:0;/*Pour IE*/
height:auto !important;height:100%;/*Pour IE*/}
.droite {
float:right;
}
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/jquery-ui-1.8.7.custom.css
New file
0,0 → 1,312
/*
* jQuery UI CSS Framework 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/
 
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.ui-helper-clearfix { display: inline-block; }
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix { height:1%; }
.ui-helper-clearfix { display:block; }
/* end clearfix */
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
 
 
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
 
 
/* Icons
----------------------------------*/
 
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
 
 
/* Misc visuals
----------------------------------*/
 
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
 
 
/*
* jQuery UI CSS Framework 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/?tr=ffDefault=Helvetica,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=cb842e&bgTextureHeader=02_glass.png&bgImgOpacityHeader=25&borderColorHeader=d49768&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=f4f0ec&bgTextureContent=05_inset_soft.png&bgImgOpacityContent=100&borderColorContent=e0cfc2&fcContent=1e1b1d&iconColorContent=c47a23&bgColorDefault=ede4d4&bgTextureDefault=02_glass.png&bgImgOpacityDefault=70&borderColorDefault=cdc3b7&fcDefault=3f3731&iconColorDefault=f08000&bgColorHover=f5f0e5&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=f5ad66&fcHover=a46313&iconColorHover=f08000&bgColorActive=f4f0ec&bgTextureActive=04_highlight_hard.png&bgImgOpacityActive=100&borderColorActive=e0cfc2&fcActive=b85700&iconColorActive=f35f07&bgColorHighlight=f5f5b5&bgTextureHighlight=04_highlight_hard.png&bgImgOpacityHighlight=75&borderColorHighlight=d9bb73&fcHighlight=060200&iconColorHighlight=cb672b&bgColorError=fee4bd&bgTextureError=04_highlight_hard.png&bgImgOpacityError=65&borderColorError=f8893f&fcError=592003&iconColorError=ff7519&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=75&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=75&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
*/
 
 
/* Component containers
----------------------------------*/
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #e0cfc2; background: #f4f0ec url(images/ui-bg_inset-soft_100_f4f0ec_1x100.png) 50% bottom repeat-x; color: #1e1b1d; }
.ui-widget-content a { color: #1e1b1d; }
.ui-widget-header { border: 1px solid #d49768; background: #cb842e url(images/ui-bg_glass_25_cb842e_1x400.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
.ui-widget-header a { color: #ffffff; }
 
/* Interaction states
----------------------------------*/
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cdc3b7; background: #ede4d4 url(images/ui-bg_glass_70_ede4d4_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #3f3731; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #3f3731; text-decoration: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #f5ad66; background: #f5f0e5 url(images/ui-bg_glass_100_f5f0e5_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #a46313; }
.ui-state-hover a, .ui-state-hover a:hover { color: #a46313; text-decoration: none; }
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #e0cfc2; background: #f4f0ec url(images/ui-bg_highlight-hard_100_f4f0ec_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #b85700; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #b85700; text-decoration: none; }
.ui-widget :active { outline: none; }
 
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #d9bb73; background: #f5f5b5 url(images/ui-bg_highlight-hard_75_f5f5b5_1x100.png) 50% top repeat-x; color: #060200; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #060200; }
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #f8893f; background: #fee4bd url(images/ui-bg_highlight-hard_65_fee4bd_1x100.png) 50% top repeat-x; color: #592003; }
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #592003; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #592003; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
 
/* Icons
----------------------------------*/
 
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_c47a23_256x240.png); }
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_c47a23_256x240.png); }
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
.ui-state-default .ui-icon { background-image: url(images/ui-icons_f08000_256x240.png); }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_f08000_256x240.png); }
.ui-state-active .ui-icon {background-image: url(images/ui-icons_f35f07_256x240.png); }
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_cb672b_256x240.png); }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ff7519_256x240.png); }
 
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
 
 
/* Misc visuals
----------------------------------*/
 
/* Corner radius */
.ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; }
.ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; }
.ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; }
.ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; }
.ui-corner-top { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; }
.ui-corner-bottom { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; }
.ui-corner-right { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; }
.ui-corner-left { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; }
.ui-corner-all { -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; }
 
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_75_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_75_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
* jQuery UI Tabs 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Tabs#theming
*/
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_inset-soft_100_f4f0ec_1x100.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_inset-soft_100_f4f0ec_1x100.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_ff7519_256x240.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_ff7519_256x240.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_glass_100_f5f0e5_1x400.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_glass_100_f5f0e5_1x400.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_highlight-hard_65_fee4bd_1x100.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_highlight-hard_65_fee4bd_1x100.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_c47a23_256x240.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_c47a23_256x240.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_ffffff_256x240.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_ffffff_256x240.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_flat_75_aaaaaa_40x100.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_flat_75_aaaaaa_40x100.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_glass_25_cb842e_1x400.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_glass_25_cb842e_1x400.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_cb672b_256x240.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_cb672b_256x240.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-anim_basic_16x16.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-anim_basic_16x16.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_highlight-hard_100_f4f0ec_1x100.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_highlight-hard_100_f4f0ec_1x100.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_highlight-hard_75_f5f5b5_1x100.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_highlight-hard_75_f5f5b5_1x100.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_glass_70_ede4d4_1x400.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-bg_glass_70_ede4d4_1x400.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_f35f07_256x240.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_f35f07_256x240.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_f08000_256x240.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v2.0-betulales/interfaces/squelettes/css/humanity/images/ui-icons_f08000_256x240.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v2.0-betulales/interfaces/squelettes/fiche_taxon.tpl.html
New file
0,0 → 1,504
<!-- REF - DEBUT FICHE TAXON -->
<script type="text/javascript">
$(document).ready(function() {
$("#ref-ref").tabs({
cookie: {expires: 1}// Stocke un cookie pour 1 jour
});
});
</script>
<h2 style="text-transform: none;margin-left: 6px; margin-right: 6px; font-size:1.6em;">
<?="<i>".$nom."</i> ".$info['auteur']?>
<a href="http://inpn.mnhn.fr/espece/listeEspeces/<?=htmlentities($nom)?>/">
<img src="./interfaces/squelettes/css/referentiel/images/sites/inpn.png" alt="INPN" title="Rechercher dans Inventaire National du Patrimoine Naturel" />
</a>
<a href="http://www.theplantlist.org/tpl/search?q=<?=htmlentities($nom)?>">
<img src="./interfaces/squelettes/css/referentiel/images/sites/tpl.png" alt="The Plant List"
title="Rechercher dans The Plant List"/>
</a>
<a href="http://www.ipni.org/ipni/simplePlantNameSearch.do?find_wholeName=<?=htmlentities($nom)?>&amp;output_format=normal&amp;query_type=by_query&amp;back_page=query_ipni.html">
<img src="./interfaces/squelettes/css/referentiel/images/sites/ipni.png" alt="IPNI" title="Rechercher dans IPNI"/>
</a>
<a href="http://plants.jstor.org/search?plantName=%22<?=htmlentities($nom)?>%22&amp;syn=1">
<img src="./interfaces/squelettes/css/referentiel/images/sites/jstor.png" alt="JSTOR Plant Science" title="Rechercher dans JSTOR Plant Science" />
</a>
<a href="http://www.anbg.gov.au/cgi-bin/apni?TAXON_NAME=<?=htmlentities($nom)?>">
<img src="./interfaces/squelettes/css/referentiel/images/sites/anbg.png" alt="Australian Plant Name Index" title="Rechercher dans Australian Plant Name Index" />
</a>
<a href="http://sweetgum.nybg.org/vh/specimen_list.php?QueryName=BasicQuery&amp;QueryPage=http%3A%2F%2Fsciweb.nybg.org%2Fscience2%2Fvii2.asp&amp;Restriction=NybRecordType+%3D+%27Specimen%27&amp;StartAt=1&amp;any=SummaryData%7CAdmWebMetadata&amp;QueryOption=any&amp;Submit=Search&amp;QueryTerms=<?=htmlentities($nom)?>">
<img src="./interfaces/squelettes/css/referentiel/images/sites/nybg.png" alt="NYBG Virtual Herbarium" title="Rechercher dans NYBG Virtual Herbarium" />
</a>
<a href="http://collections.mnh.si.edu/search/botany/?qt=<?=htmlentities($nom)?>">
<img src="./interfaces/squelettes/css/referentiel/images/sites/si.png" alt="Type Specimen Register of the U.S. National Herbarium" title="Rechercher dans Type Specimen Register of the U.S. National Herbarium" />
</a>
<a href="http://herbarium.univie.ac.at/database/search.php?taxon=<?=htmlentities($nom)?>&amp;search=1">
<img src="./interfaces/squelettes/css/referentiel/images/sites/vha.png" alt="Virtual Herbaria Austria" title="Rechercher dans Virtual Herbaria Austria" />
</a>
<a href="http://swbiodiversity.org/seinet/taxa/index.php?taxon=<?=htmlentities($nom)?>">
<img src="./interfaces/squelettes/css/referentiel/images/sites/seinet.png" alt="SEINet" title="Rechercher dans SEINet" />
</a>
<a href="http://www.ville-ge.ch/musinfo/bd/cjb/africa/resultat.php?efFamille=&amp;projet%5B%5D=FSA&amp;projet%5B%5D=FTA&amp;projet%5B%5D=FNA&amp;projet%5B%5D=BDM&amp;langue=en&amp;pbRecherche=Rechercher&amp;efNom=<?=htmlentities($nom)?>">
<img src="./interfaces/squelettes/css/referentiel/images/sites/cjb.png" alt="African Plants Database" title="Rechercher dans African Plants Database du Jardin Botanique de Genève" />
</a>
<a href="http://www.tropicos.org/NameSearch.aspx?name=<?=htmlentities($nom)?>">
<img src="./interfaces/squelettes/css/referentiel/images/sites/tropicos.png" alt="Tropicos" title="Rechercher dans Tropicos" />
</a>
<a href="http://www.sfo-asso.com/pages/connaissances.php?parent=6&id=195">
<img src="./interfaces/squelettes/css/referentiel/images/sites/sfo.png" alt="SFO" title="Rechercher dans Société Française d'Orchidophilie" />
</a>
<a href="http://coldb.mnhn.fr/Consultation">
<img src="./interfaces/squelettes/css/referentiel/images/sites/mnhn.png" alt="MNHN" title="Rechercher dans Muséum national d'Histoire naturelle" />
</a>
<? if ($referentiel == "bdtxa") : ?>
<a href="http://collections.antilles.inra.fr/initCard.do?idEntityValue1=<?=htmlentities($nom);?>&idEntityValue2=&idEntityValue3=&idEntity=21">
<img src="./interfaces/squelettes/css/referentiel/images/sites/antilles.png" alt="INRA Antilles" title="Rechercher dans collections INRA Antilles" />
</a>
<? endif; ?>
<? if ($referentiel == "bdtre") : ?>
<a href="http://flore.cbnm.org/index.php?option=com_florereunion&view=search&layout=frmsearch&Itemid=5?>">
<img src="./interfaces/squelettes/css/referentiel/images/sites/cbnm.png" alt="CBNM" title="Rechercher dans Conservatoire Botanique National de Mascarin" />
</a>
<? endif; ?>
<? if ($referentiel == "bdlfx") : ?>
<a href="http://start1g.ovh.net/~mycofran/listeOuvrage.php?genre=<?=htmlentities($info['genre'])?>&espece=<?=htmlentities($info['epithete_sp'])?>">
<img src="./interfaces/squelettes/css/referentiel/images/sites/smf.png" alt="SMF" title="Rechercher dans mycodoc Société Mycologique de France" />
</a>
<a href="http://lichenologue.org/fr/docs/doc_details.php?&docid=227">
<img src="./interfaces/squelettes/css/referentiel/images/sites/lichen.png" alt="lichen" title="Rechercher sur lichenologue.oeg" />
</a>
<? endif; ?>
<span style="float:right;font-size:17px">
<?= ($num_nom != $num_nom_retenu) ?
'(nom retenu : <a href='.FicheTaxon::getUrlFicheTaxon($num_nom_retenu).'> '.$num_nom_retenu.'</a> )'
: ''; ?>
</span>
</h2>
 
<hr class="nettoyeur"/>
<div id="ref-ref" class="ref-onglets">
<ul class="ref-sommaire">
<li><a href="#ref-ref-nomenclature">Nomenclature/Classification</a></li>
<li><a href="#ref-ref-synonymie">Synonymie</a></li>
<li><a href="#ref-ref-note">Notes/Chorologie/Compléments</a></li>
<li><a href="#ref-ref-legende">Aide</a></li>
<li><a href="#ref-ref-mail">
<img src="./interfaces/squelettes/css/referentiel/images/mail.png" alt="mail" title="Transmettre un commentaire" style="height: 2em; margin-bottom: -9px; margin-top: -5px;"/>
</a></li>
</ul>
<div id="ref-ref-nomenclature">
<h2>Nomenclature</h2>
<? if (isset($info['biblio_origine'])) : ?>
<strong>Référence bibliographique :</strong> <?=$info['biblio_origine'];?>
<? if ($info['biblio_origine'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('bib:'.$info['biblio_origine'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>,
<? endif; ?>
<?=$info['annee'];?>
<? if ($info['annee'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('an:'.$info['annee'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?><br />
<? endif; ?>
<? if (isset($selectionne['bas_num'])) : ?>
<strong>Basionyme du nom séléctionné :</strong>
<a href="<?=FicheTaxon::getUrlFicheTaxon($selectionne, 'bas')?>">
<?=$selectionne['bas_nom'];?>
</a>
<? if ($selectionne['bas_nom'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche($selectionne['bas_nom'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
<?=$selectionne['bas_auteur'];?>
<? if ($selectionne['bas_auteur'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('au:'.$selectionne['bas_auteur'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>,
<? endif; ?>
<?=$selectionne['bas_annee'];?>
<? if ($selectionne['bas_annee'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('an:'.$selectionne['bas_annee'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?> <br />
<? endif; ?>
<? if ((isset($selectionne['nom_francais']) && $selectionne['nom_francais'] != '') ||
(isset($retenu['nom_francais']) && $retenu['nom_francais'] != '')) : ?>
<strong>Nom français :</strong>
<?= isset($retenu['nom_francais']) ? $retenu['nom_francais'] : $selectionne['nom_francais'];?>
<a href="<?=Recherche::getUrlRecherche($nom_francais, $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<br />
<? endif; ?>
<?= ($info['nom_addendum']) != "" ? "<strong>Nom addendum :</strong> ".$info['nom_addendum']."<br />" : "" ;?>
<strong>num_nom :</strong> <?=$num_nom;?><br />
<? if (isset($retenu) && $retenu['num_nom'] != $num_nom) : ?>
<strong>Nom retenu :</strong>
<a href="<?=Recherche::getUrlFicheTaxon($retenu)?>"><?=$retenu['nom_sci'];?></a>
<a href="<?=Recherche::getUrlRecherche($retenu['nom_sci'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<?=$retenu['auteur'];?>
<? if ($retenu['auteur'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('au:'.$retenu['auteur'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>,
<? endif; ?>
<?=$retenu['annee'];?>
<? if ($retenu['annee'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('an:'.$retenu['annee'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?> <br />
<? if (isset($retenu['bas_num'])) : ?>
<strong>Basionyme du nom retenu :</strong>
<a href="<?=FicheTaxon::getUrlFicheTaxon($retenu, 'bas')?>"><?=$retenu['bas_nom'];?></a>
<? if ($retenu['bas_nom'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche($retenu['bas_nom'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
<?=$retenu['bas_auteur'];?>
<? if ($retenu['bas_auteur'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('au:'.$retenu['bas_auteur'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>,
<? endif; ?>
<?=$retenu['bas_annee'];?>
<? if ($retenu['bas_annee'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('an:'.$retenu['bas_annee'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
<? endif; ?>
<? endif; ?>
<? if (isset($parents['p1_num'])) : ?>
<strong>Parent 01 :</strong>
<a href="<?=FicheTaxon::getUrlFicheTaxon($parents, 'p1')?>"><?=$parents['p1_nom'];?></a>
<? if ($parents['p1_nom'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche($parents['p1_nom'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
<?=$parents['p1_auteur'];?>
<? if ($parents['p1_auteur'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('au:'.$parents['p1_auteur'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>,
<? endif; ?>
<?=$parents['p1_annee'];?>
<? if ($parents['p1_annee'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('an:'.$parents['p1_annee'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
<? endif; ?> <br />
<? if (isset($parents['p2_num'])) : ?>
<strong>Parent 02 :</strong>
<a href="<?=FicheTaxon::getUrlFicheTaxon($parents, 'p2')?>"><?=$parents['p2_nom'];?></a>
<? if ($parents['p2_nom'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche($parents['p2_nom'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
<?=$parents['p2_auteur'];?>
<? if ($parents['p2_auteur'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('au:'.$parents['p2_auteur'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>,
<? endif; ?>
<?=$parents['p2_annee'];?>
<? if ($parents['p2_annee'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('an:'.$parents['p2_annee'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
<? endif; ?>
<br />
<h2>Classification</h2>
<?php if (isset($classification)) : ?>
<? foreach ($classification as $type=>$class) : ?>
<table class="largeur-16">
<thead>
<tr>
<th <?=($type == 'inférieurs') ? 'colspan="'.$niveau.'"' : '' ?>>
Taxons <?=$type;?>
<? if ($type == 'inférieurs') : ?><br />
(<? foreach ($noms_rang as $rang => $nb_noms) : ?>
<?= $nb_noms.' '.$valeur_rang[$rang].'s ';?>
<? endforeach; ?>)
<? endif; ?>
</th>
<th class="vide" colspan="6">&nbsp;</th>
</tr>
<tr>
<th <?=($type == 'inférieurs') ? 'colspan="'.$niveau.'"' : '' ?>>Rang</th>
<th>Nom scientifique</th>
<th>Auteur</th>
<th>Année</th>
<th>Référence bibliographique</th>
<th>Présence</th>
<th>Nom addendum</th>
<th title="Identifiant numérique du nom scientifique">num_nom</th>
</tr>
</thead>
<tbody>
<? if ($class != '') : ?>
<? foreach ($class as $rang => $taxon) : ?>
<tr>
<? if ($type == 'inférieurs') : ?>
<? for ($i = 1; $i <= $niveau; $i++) : ?>
<? if ($i == $taxon['niveau']) : ?>
<td><?=(isset($valeur_rang[$taxon['rang']])) ?
$valeur_rang[$taxon['rang']].' ('.$taxon['rang'].')' :
$taxon['rang'];?></td>
<? else : ?>
<td></td>
<? endif; ?>
<? endfor; ?>
<? else : ?>
<td><?=(isset($valeur_rang[$taxon['rang']])) ?
$valeur_rang[$taxon['rang']].' ('.$taxon['rang'].')' :
$taxon['rang'];?></td>
<? endif; ?>
<td>
<a href="<?=Recherche::getUrlFicheTaxon($taxon)?>"><?=$taxon['nom_sci'];?></a>
</td>
<td><?=$taxon['auteur'];?></td>
<td><?=$taxon['annee'];?></td>
<td><?=$taxon['biblio_origine'];?></td>
<td>
<?=(isset($valeur_presence[$taxon['presence']])) ?
$valeur_presence[$taxon['presence']].' ('.$taxon['presence'].')' :
$taxon['presence'];?>
</td>
<td><?=$taxon['nom_addendum'];?></td>
<td><?=$taxon['num_nom'];?></td>
</tr>
<? endforeach ?>
<? endif ?>
</tbody>
</table>
<? endforeach ?>
<? else : ?>
<p>Aucune indication</p>
<? endif ?>
<hr class="nettoyeur"/>
</div>
 
<div id="ref-ref-synonymie">
<h2>Synonymie</h2>
<? if (isset($syn)) : ?>
<table class="largeur-16">
<thead>
<tr>
<th class="largeur-03">Nom scientifique</th>
<th class="largeur-04">Auteur</th>
<th class="largeur-01">Année</th>
<th class="largeur-05">Référence bibliographique</th>
<th class="largeur-02">Nom addendum</th>
<th class="largeur-01" title="Identifiant numérique du nom scientifique">num_nom du basionyme</th>
<th class="largeur-01" title="Identifiant numérique du nom scientifique">num_nom</th>
</tr>
</thead>
<tbody>
<? foreach ($syn as $synonyme) : ?>
<?=($synonyme['num_nom'] == $synonyme['num_nom_retenu'])? '<tr class="nom_retenu">' : "<tr>";?>
<td>
<a href="<?=Recherche::getUrlFicheTaxon($synonyme)?>"><?=$synonyme['nom_sci'];?></a>
</td>
<td><?=$synonyme['auteur'];?></td>
<td><?=$synonyme['annee'];?></td>
<td><?=$synonyme['biblio_origine'];?></td>
<td><?=$synonyme['nom_addendum'];?></td>
<td><?=$synonyme['basionyme'];?></td>
<td><?=$synonyme['num_nom'];?></td>
</tr>
<? endforeach ?>
</tbody>
</table>
<? endif; ?>
<? if (isset($pp)) : ?>
<table class="largeur-16">
<thead>
<tr>
<th>Synonymie pro parte</th>
<th class="vide" colspan="5">&nbsp;</th>
</tr>
<tr>
<th>Nom scientifique</th>
<th>Auteur</th>
<th>Année</th>
<th>Référence bibliographique</th>
<th>Nom addendum</th>
<th title="Identifiant numérique du nom scientifique">num_nom</th>
</tr>
</thead>
<tbody>
<? foreach ($pp as $synonyme) : ?>
<?=($synonyme['num_nom'] == $synonyme['num_nom_retenu'])? '<tr class="nom_retenu">' : "<tr>";?>
<td>
<a href="<?=Recherche::getUrlFicheTaxon($synonyme)?>"><?=$synonyme['nom_sci'];?></a>
</td>
<td><?=$synonyme['auteur'];?></td>
<td><?=$synonyme['annee'];?></td>
<td><?=$synonyme['biblio_origine'];?></td>
<td><?=$synonyme['nom_addendum'];?></td>
<td><?=$synonyme['num_nom'];?></td>
</tr>
<? endforeach ?>
</tbody>
</table>
<? endif; ?>
<? if (isset($h)) : ?>
<table class="largeur-16">
<thead>
<tr>
<th>Homonymie (sensu)</th>
<th class="vide" colspan="6">&nbsp;</th>
</tr>
<tr>
<th>Statut</th>
<th>Nom scientifique</th>
<th>Auteur</th>
<th>Année</th>
<th>Référence bibliographique</th>
<th>Nom addendum</th>
<th title="Identifiant numérique du nom scientifique">num_nom</th>
</tr>
</thead>
<tbody>
<? foreach ($h as $synonyme) : ?>
<?=($synonyme['num_nom'] == $synonyme['num_nom_retenu'])? '<tr class="nom_retenu">' : "<tr>";?>
<td><?=$synonyme['statut']?></td>
<td>
<a href="<?=Recherche::getUrlFicheTaxon($synonyme)?>"><?=$synonyme['nom_sci'];?></a>
</td>
<td><?=$synonyme['auteur'];?></td>
<td><?=$synonyme['annee'];?></td>
<td><?=$synonyme['biblio_origine'];?></td>
<td><?=$synonyme['nom_addendum'];?></td>
<td><?=$synonyme['num_nom'];?></td>
</tr>
<? endforeach ?>
</tbody>
</table>
<? endif; ?>
 
</div>
 
<div id="ref-ref-note">
<h2>Chorologie</h2>
<? if (isset($chorologie)) : ?>
<table class="largeur-09">
<thead>
<tr>
<th class="largeur-03 vide">&nbsp;</th>
<? foreach ($chorologie['Présence'] as $lieu=>$valeur) : ?>
<th class="largeur-02"><?=$lieu?></th>
<? endforeach ?>
</tr>
</thead>
<tbody>
<? foreach ($chorologie as $param=>$lieux) : ?>
<tr>
<th><?=$param?></th>
<? foreach ($lieux as $lieu) : ?>
<td><?=($lieu['code'] != '') ? $lieu['valeur'].' ('.$lieu['code'].')' : '&nbsp;'?></td>
<? endforeach ?>
</tr>
<? endforeach ?>
</tbody>
</table>
<? else : ?>
<p>Aucune information disponible</p>
<? endif ?>
<h2>Notes</h2>
<?= $info['notes'] ? '<h3>Notes générales</h3>'.$info['notes'] : '';?>
<?= $info['hybride_parent_01_notes'] ? '<h3>Notes parent 01 hybride</h3>'.$info['hybride_parent_01_notes'] : '';?>
<?= $info['hybride_parent_02_notes'] ? '<h3>Notes parent 02 hybride</h3>'.$info['hybride_parent_02_notes'] : '';?>
<h2>Compléments</h2>
<?php if (isset($complement)) : ?>
<table class="largeur-16">
<? foreach ($complement as $champ=>$valeur) : ?>
<tr>
<th class="largeur-06"><?=$champ;?></th>
<td class="largeur-10"><?=$valeur;?></td>
</tr>
<? endforeach ?>
</table>
<?php else : ?>
<p>Pas de champ complémentaire</p>
<?php endif ?>
</div>
<div id="ref-ref-legende">
<h2>Légende</h2>
<p>
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="Icône lancer recherche"/> :
en cliquant sur cette icône, vous relancerez une recherche avec pour motif de recherche la valeur du champ où
elle se trouve.
</p>
<p>
<img src="./interfaces/squelettes/css/referentiel/images/aide.png" alt="Icône aide contextuelle" /> :
en survolant cette icône à l'aide de la souris, vous afficherez un message d'aide contextuel.
</p>
<h2>Informations</h2>
<p>
Lorsqu'un nom latin apparaît <strong>en gras</strong> dans la fiche, c'est qu'il correspond au nom retenu.
</p>
</div>
<div id="ref-ref-mail">
<form method="post" enctype="text/plain" action="mailto:referentiels@tela-botanica.org?subject=Modification de <?=$nom;?> (<?=$num_nom?>)">
<div class="fm-opt">
<span>
<label for="email" >E-mail :</label>
<input name="email" id="email" size="30" />
</span>
<span class="droite">
<label for="date">Date :</label>
<?$date=getDate(); $date = $date['mday'].'-'.$date['mon'].'-'.$date['year'];?>
<input name="date" id="date" size="8" value="<?=$date?>" />
</span>
</div><br />
<div class="fm-opt">
<span>
<label for="nom_sci" >Nom scientifique :</label>
<input name="nom_sci" id="nom_sci" size="30" value="<?=$nom;?>" />
</span>
<span class="droite">
<label for="num_nom" >Num_nom :</label>
<input name="num_nom" id="num_nom" size="8" value="<?=$num_nom;?>" />
</span>
</div><br />
<div class="fm-opt">
<label for="champs" >Champ(s) concerné(s) :</label> <input name="champs" id="champs" class="champs" />
</div><div class="fm-opt"><br />
<label for="motif" >Motif de la correction ou de l'addition :</label> <textarea name="motif" id="motif" rows="5" cols="63"></textarea>
</div><div class="fm-opt">
<label for="modif" >Modification proposée :</label> <textarea name="modifications" id="modif" rows="2" cols="63"></textarea>
</div><div class="fm-opt">
<label for="ref" >Références publications et/ou herbiers :</label> <textarea name="references" id="ref" rows="2" cols="63"></textarea>
</div><div class="fm-opt">
<label for="obs" >Observations autres auteurs :</label> <textarea name="observations" id="obs" rows="2" cols="63"></textarea>
</div><br /><br />
<div class="valid">
<input type="submit" value="Envoyer" />
<input type="reset" value="Effacer" />
</div>
</form>
</div>
</div>
<!-- REF - FIN FICHE TAXON -->
/branches/v2.0-betulales/interfaces/squelettes/form_version.tpl.html
New file
0,0 → 1,219
<!-- REF - DEBUT VERSIONNAGE -->
<script type="text/javascript">
$(document).ready(function() {
$('#ref-versionnage-ok').click(function(e) {
var ok = false;
if (confirm('Êtes vous sûr de vouloir versionner le référentiel actuellement en cours de travail ?')) {
ok = true;
}
return ok;
});
// Rend les tables portant la classe "defilante" srollable
$('.defilante').chromatable();
});
</script>
<h1>Versionnage du référentiel «&nbsp;<?=$nom_referentiel?>&nbsp;» (<?=$ref?>)</h1>
 
<?php if (isset($messages)) : ?>
<h2>Messages</h2>
<?php foreach ($messages as $message) : ?>
<p class="information"><?=$message?></p>
<?php endforeach; ?>
<?php endif; ?>
 
<h2>Formulaire</h2>
<p>1. Remplir le formulaire ci-dessous.</p>
<div id="zone-form">
<form id="ref-demande-versionnage" action="<?=$url_form?>" method="post">
<fieldset id="champs-general">
<legend>Général</legend>
<ul class="liste-champs">
<li>
<label for="titre" title="Le nom complet du référentiel.">Titre <span class="obligatoire">*</span></label>
<input id="titre" name="titre" type="text" value="<?=$version['titre']?>"/>
</li>
<li>
<label for="acronyme" title="Le code correspondant à l'abréviation ou à l'acronyme du titre.">Acronyme <span class="obligatoire">*</span></label>
<input id="acronyme" name="acronyme" type="text" value="<?=$version['acronyme']?>"/>
</li>
<li>
<label for="version" title="Numéro de version du référentiel sous la forme : version majeure.version mineure">Version <span class="obligatoire">*</span></label>
<input id="version" name="version" type="text" value="<?=$version['version']?>"/>
</li>
<li>
<label for="date_prod" title="Date correspondant à la dernière modification effectuée par le groupe de travail sur la version courante. Format : AAAA-MM-JJ">Date de production</label>
<input id="date_prod" name="date_prod" type="text" value="<?=$version['date_prod']?>" readonly="readonly"/>
</li>
</ul>
</fieldset>
<fieldset id="champs-contact">
<legend>Contacts</legend>
<ul class="liste-champs">
<li>
<label for="auteur_principal" title="Auteur principal ou liste des auteurs du référentiel sous la forme : Prénom1 NOM1 (Organisation1) [courriel1], Prénom2 NOM2 (Organisation2) [courriel2]">Auteur principal <span class="obligatoire">*</span></label>
<input type="text" id="auteur_principal" name="auteur_principal" value="<?=$version['auteur_principal']?>" />
</li>
<li>
<label for="coordinateur" title="Informations sur le coordinateur du référentiel sous la forme : Prénom1 NOM1 (Organisation1) [courriel1]">Coordinateur <span class="obligatoire">*</span></label>
<input type="text" id="coordinateur" name="coordinateur" value="<?=$version['coordinateur']?>" />
</li>
<li>
<label for="editeur" title="Le nom de l'organisation dans le cadre de laquelle le référentiel a été produit.">Éditeur</label>
<input type="text" id="editeur" name="editeur" value="Tela-Botanica, le réseau des Botanistes Francophones" readonly="readonly"/>
</li>
<li>
<label for="contact" title="Une adresse de courriel où il est possible de poser des questions, faire des remarques...">Courriel de contact <span class="obligatoire">*</span></label>
<input type="text" name="contact" value="<?=$version['contact']?>" />
</li>
</ul>
</fieldset>
<fieldset id="champs-contributeur" style="width:825px;">
<legend>Auteurs/Contributeurs</legend>
<p>
Liste des contributeurs au référentiel sous la forme : <br />
Prénom1 NOM1 (Organisation1) [courriel1],<br />
Prénom2 NOM2 (Organisation2) [courriel2].
</p>
<div>
<label for="contributeur">Auteurs/Contributeurs</label>
<textarea id="contributeur" name="contributeur" rows="5"><?=$version['contributeur']?></textarea>
</div>
</fieldset>
<hr class="nettoyage" />
<fieldset id="champs-domaine">
<legend>Domaines couverts par le référentiel</legend>
<p> Vous pouvez choisir plusieurs éléments par liste.</p>
<label for="classification" title="Le nom de la classification retenue">Classification par défaut <span class="obligatoire">*</span></label>
<p><input id="classification" name="classification" type="text" value="<?=$version['classification']?>"/></p>
<label for="ref-ver-dom-tax" title="Indiquer un ou plusieurs groupes taxonomiques dans lesquels le référentiel s'inscrit.">Domaine taxonomique <span class="obligatoire">*</span></label>
<div id="ref-ver-dom-tax" class="case-a-cocher-scroll" >
<ul class="liste-simple">
<? foreach ($domaine_taxo as $taxo) : ?>
<li><label><input type="checkbox" name="dom_tax[]" value="<?=$taxo?>" <?=(isset($version['dom_tax'][$taxo]) ? 'checked="checked"': '')?> /> <?=$taxo?></label></li>
<? endforeach; ?>
</ul>
</div>
<label for="ref-ver-dom-geo" title="Indiquer une ou plusieurs zones géographiques prises en compte par le référentiel.">Domaine géographique <span class="obligatoire">*</span></label>
<div id="ref-ver-dom-geo" class="case-a-cocher-scroll" >
<ul class="liste-simple">
<? foreach ($domaine_geo as $geo) : ?>
<li><label><input type="checkbox" name="dom_geo[]" value="<?=$geo?>" <?=(isset($version['dom_geo'][$geo]) ? 'checked="checked"': '')?> /> <?=$geo?></label></li>
<? endforeach; ?>
</ul>
</div>
<label for="ref-ver-dom-code" title="Indiquer les codes de nomenclature utilisé dans ce référentiel.">Codes botaniques utilisés <span class="obligatoire">*</span></label>
<div id="ref-ver-dom-code" class="case-a-cocher-scroll" >
<ul class="liste-simple">
<? foreach ($domaine_code as $code) : ?>
<li><label><input type="checkbox" name="dom_code[]" value="<?=$code?>" <?=(isset($version['dom_code'][$code]) ? 'checked="checked"': '')?> /> <?=$code?></label></li>
<? endforeach; ?>
</ul>
</div>
</fieldset>
<fieldset id="champs-citation">
<legend>Citation</legend>
<ul class="liste-champs">
<li>
<label for="source" title="Un permalien indiquant la page où l'on peut télécharger la présente version.">Source</label>
<input type="text" id="source" name="source" value="http://referentiels.tela-botanica.org/referentiel/index.php?module=Informations&ref=<?=$ref?>" readonly="readonly"/>
</li>
<li>
<label for="copyright" title="Mention légale (copyright)">Copyright</label>
<input type="text" id="copyright" name="copyright" value="Copyright © Tela Botanica (<?=date('Y')?>). Tous droits réservés." readonly="readonly"/>
</li>
<li>
<label for="licence" title="URL de la licence du document.">Licence</label>
<input type="text" id="licence" name="licence" value="http://creativecommons.org/licenses/by-sa/2.0/fr/" readonly="readonly"/>
</li>
<li>
<label for="referencement" title="Indique comment désigner le référentiel dans une bibliographie par exemple : « nom(s) du(des) auteur(s) principal(aux) ». Référentiel de « nom du groupe taxonomique concerné » de « nom de l’aire géographique concernée » réalisé dans le cadre d’une convention entre le Ministère chargé de l’écologie, le MNHN, la FCBN et Tela Botanica qui en a assuré la compilation, en partenariat avec « nom(s) de(s) l'institution(s) concernée(s) ». Version « numéro de la version » du « date de livraison du référentiel partiel au SPN ».">Comment citer ce référentiel? <span class="obligatoire">*</span></label>
<textarea id="referencement" name="referencement" rows="5"><?=$version['referencement']?></textarea>
</li>
</ul>
</fieldset>
<hr class="nettoyage" />
<fieldset id="champs-note" style="width:825px;">
<legend>Notes</legend>
<ul class="liste-champs">
<li>
<label for="errata" title="URL d'une page web contenant un errata de la version.">Errata (URL) <span class="obligatoire">*</span></label>
<input type="text" id="errata" name="errata" value="<?=$version['errata']?>" />
</li>
<li>
<label for="notes" title="Indiquer des informations sur les données de la version à publier.">Notes de version</label>
<textarea id="notes" name="notes" rows="10"><?=$version['notes']?></textarea>
</li>
</ul>
</fieldset>
<hr class="nettoyage" />
<p><span class="obligatoire">*</span> : champ obligatoire.</p>
<input id="ref-versionnage-ok" type="submit" value="2. Lancer le versionnage" />
</form>
<form id="ref-rafraichir" name="ref-rafraichir" action="<?=$url_form;?>" method="get">
<input name="module" type="hidden" value="<?=$url_module;?>" />
<input name="action" type="hidden" value="<?=$url_action_rafraichir;?>" />
<input name="ref" type="hidden" value="<?=$ref;?>" />
<input id="ref-raf-ok" type="submit" value="3. Rafraichir" />
</form>
</div>
 
 
<h2>Versions</h2>
 
<table class="defilante">
<caption>Versions <?=strftime('à %H:%M:%S le %d %B %Y')?></caption>
<thead>
<tr>
<th>Nom (#)</th>
<th>État</th>
<th>Date début</th>
<th>Date fin</th>
<th>Durée</th>
</tr>
</thead>
<tbody>
<?php if (isset($traitements_en_attente)) : ?>
<?php foreach ($traitements_en_attente as $traitement) : ?>
<tr>
<td><?=$traitement['nom']?> <span class="discretion">(id:<?=$traitement['id_traitement']?>)</span></td>
<td class="traitement-attente">En attente...</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php if (isset($traitements_en_cours)) : ?>
<?php foreach ($traitements_en_cours as $traitement) : ?>
<tr>
<td><?=$traitement['nom']?> <span class="discretion">(id:<?=$traitement['id_traitement']?>)</span></td>
<td class="traitement-cours">En cours...</td>
<td><?=$traitement['date_debut']?></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php if (isset($traitements_termines)) : ?>
<?php foreach ($traitements_termines as $traitement) : ?>
<tr>
<td><a href="<?=$traitement['url']?>"><?=$traitement['nom']?> <span class="discretion">(id:<?=$traitement['id_traitement']?>)</span></a></td>
<td class="traitement-termine">Terminé</td>
<td><?=$traitement['date_debut']?></td>
<td><?=$traitement['date_fin']?></td>
<td><?=$traitement['duree']?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
 
<!-- REF - FIN VERSIONNAGE -->
/branches/v2.0-betulales/interfaces/squelettes/fil_ariane.tpl.html
New file
0,0 → 1,9
<!-- REF - DEBUT FIL D'ARIANE -->
<?php if (isset($entrees)) : ?>
<ul class="fil-ariane">
<?php foreach ($entrees as $entree) : ?>
<li><a href="<?=$entree['url'];?>"><?=$entree['nom'];?></a></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<!-- REF - FIN FIL D'ARIANE -->
/branches/v2.0-betulales/interfaces/squelettes/js/referentiels.js
New file
0,0 → 1,28
$(document).ready(function() {
// page de téléchargement : cocher toutes les cases
$('#cocher-tous').click(function() {
cocherTous(true, ".colonne-cases");
});
$('#decocher-tous').click(function() {
cocherTous(false, ".colonne-cases");
});
$('#cocher-base').click(function() {
cocherTous(false, ".colonne-cases");
cocherTous(true, ".colonne-cases", "base");
});
 
// coche ou décoche toutes les cases à cocher de la page (brutal)
function cocherTous(cocher, parent, classe) {
var checkboxes;
if (classe == undefined) {
checkboxes = $(parent + ' input[type="checkbox"]');
} else {
checkboxes = $(parent + ' input.' + classe + '[type="checkbox"]');
}
if (cocher) {
checkboxes.attr("checked", "checked");
} else {
checkboxes.removeAttr("checked");
}
}
});
/branches/v2.0-betulales/interfaces/squelettes/js/jquery-ui-1.8.7.custom.min.js
New file
0,0 → 1,68
/*!
* jQuery UI 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI
*/
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.7",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
;/*!
* jQuery UI Widget 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Widget
*/
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*
* jQuery UI Tabs 1.8.7
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Tabs
*
* Depends:
* jquery.ui.core.js
* jquery.ui.widget.js
*/
(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]||
(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected=
this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+
g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};
this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=
-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=
d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b,
e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);
j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();
if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),function(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null,
this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,
"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.7"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
;
/branches/v2.0-betulales/interfaces/squelettes/moteur.tpl.html
New file
0,0 → 1,208
<!-- REF - DEBUT MOTEUR RECHERCHE -->
<script type="text/javascript">
// Function pour cacher / afficher les options de recherche
$(document).ready(function() {
// affichage lors du chargement de la page
$.cookie('AfficherCacherRech', <?=$affiche_moteur?>) ;
if ($.cookie('AfficherCacherRech') == null) {
$("#ref-rech-opt-toggle").html("Cacher la recherche avancée");
$('#ref-rech-opt').show();
$.cookie('AfficherCacherRech', 20);
} else if ($.cookie('AfficherCacherRech') == 10) {
$("#ref-rech-opt-toggle").html("Afficher la recherche avancée");
$('#ref-rech-opt').hide();
$.cookie('AfficherCacherRech', 10);
} else {
$("#ref-rech-opt-toggle").html("Cacher la recherche avancée");
$('#ref-rech-opt').show();
$.cookie('AfficherCacherRech', 20);
}
// changement d'affichage après un clic
$("#ref-rech-opt-toggle").click(function() {
if ($.cookie('AfficherCacherRech') == 20) {
$("#ref-rech-opt-toggle").html("Afficher la recherche avancée");
$('#ref-rech-opt').hide();
$.cookie('AfficherCacherRech', 10);
} else {
$("#ref-rech-opt-toggle").html("Cacher la recherche avancée");
$('#ref-rech-opt').show();
$.cookie('AfficherCacherRech', 20);
}
});
// Sélection du texte de la zone de recherche sur le focus
$("#recherche").focus(function(){
this.select();
});
});
</script>
<p>
Bienvenue dans l'espace de consultation de la <?=$nom_referentiel?> en cours d'actualisation.<br />
<?= ($forum_referentiel != false) ?
'Pour transmettre vos remarques au groupe de travail, veuillez utiliser le forum dédié : <b><a href="mailto:'.
$forum_referentiel.'">'.$forum_referentiel.'</a></b>.<br />'
: ''; ?>
<?= ($site_referentiel != false) ?
'Vous pouvez accéder au site de l\'auteur : <b><a href="'.
$site_referentiel.'">'.$site_referentiel.'</a></b>.<br />'
: ''; ?>
Pour les remarques concernant les fonctionnalités de l'interface de consultation, veuillez utiliser l'adresse : <b><a href="mailto:referentiels@tela-botanica.org">referentiels@tela-botanica.org</a></b>
</p>
<h1>Consultation de la <?=$nom_referentiel?> - Mis à jour le <?=$date_miseajour;?></h1>
<p><i>
Par défaut, la recherche est insensible à la casse (majuscule / minuscule) et s'effectue
en intercalant automatiquement le joker % avant et après le terme recherché.
</i></p>
<form id="ref-form" action="<?=$url_form;?>" method="get">
<p>
<input name="ref" type="hidden" value="<?=$url_referentiel;?>" />
<input name="module" type="hidden" value="<?=$url_module;?>" />
<input name="action" type="hidden" value="<?=$url_action;?>" />
<label id="ref-rech" for="recherche">Rechercher</label>
<input id="recherche" name="recherche" type="text" value="<?=$recherche;?>" size="75" maxlength="250"/>
<input id="ref-rech-ok" type="submit" value="OK" />
<a id="ref-rech-opt-toggle" href="#ref-rech-opt-txt" title="Précisions sur les options de recherche">Cacher la recherche avancée</a>
</p>
</form>
<div id="ref-rech-opt">
<h2 id="ref-rech-opt-titre">Options de recherche</h2>
<div id="ref-rech-opt-txt">
 
<p>
La recherche avancée permet de préciser la requête en associant des opérateurs au(x) terme(s) recherché(s). Les opérateurs sont listés dans
le tableau ci-dessous. <br />
</p>
<table class="largeur-14">
<thead>
<tr>
<th class="largeur-01">Opérateur</th>
<th class="largeur-10">Signification</th>
<th class="largeur-03">Exemples</th>
</tr>
</thead>
<tbody>
<tr>
<td>#</td>
<td>Afficher toute la base</td>
<td><a href="<?=Recherche::getUrlRecherche('#', $url_referentiel)?>">#</a></td>
</tr>
<tr>
<td>gen:</td>
<td>Genre</td>
<td><a href="<?=Recherche::getUrlRecherche('gen:abies', $url_referentiel)?>">gen:abies</a></td>
</tr>
<tr>
<td>sp:</td>
<td>Espèce</td>
<td><a href="<?=Recherche::getUrlRecherche('sp:maritimum', $url_referentiel)?>">
sp:maritimum</a></td>
</tr>
<tr>
<td>sg:</td>
<td>Famille, ordre, classe ("nom supra-générique")</td>
<td><a href="<?=Recherche::getUrlRecherche('sg:Adiantaceae', $url_referentiel)?>">sg:Adiantaceae</a></td>
</tr>
<tr>
<td>ssp:</td>
<td>Sous-espèce, variété, forme ("nom infra-spécifique")</td>
<td><a href="<?=Recherche::getUrlRecherche('ssp:cuprina', $url_referentiel)?>">ssp:cuprina</a></td>
</tr>
<tr>
<td>au:</td>
<td>Auteur</td>
<td><a href="<?=Recherche::getUrlRecherche('au:Tausch', $url_referentiel)?>">au:Tausch</a></td>
</tr>
<tr>
<td>an:</td>
<td>Année</td>
<td><a href="<?=Recherche::getUrlRecherche('an:2010', $url_referentiel)?>">an:2010</a></td>
</tr>
<tr>
<td>nn:</td>
<td>Numéro unique du nom scientifique</td>
<td><a href="<?=Recherche::getUrlRecherche('nn:7128,7547', $url_referentiel)?>">nn:7128,7547</a></td>
</tr>
<tr>
<td>bib:</td>
<td>Référence bibliographique de la publication d'origine du nom (sans l'année)</td>
<td><a href="<?=Recherche::getUrlRecherche('bib:Linnaea, 21 :', $url_referentiel)?>">bib:Linnaea, 21 :</a></td>
</tr>
<tr>
<td>nr:[1]</td>
<td>Afficher des noms retenus ([0] affiche les synonymes)</td>
<td><a href="<?=Recherche::getUrlRecherche('nr:1', $url_referentiel)?>">nr:1</a></td>
</tr>
<tr>
<td>tax:[1]</td>
<td>Afficher des synonymes sous les noms retenus correspondants</td>
<td><a href="<?=Recherche::getUrlRecherche('gen:scirpus tax:1', $url_referentiel)?>">gen:scirpus tax:1</a></td>
</tr>
<tr>
<td>pre:[1]</td>
<td>Afficher des taxons français (présent, supposé, douteux...),
inversement [0] ressort absents et non précisés</td>
<td><a href="<?=Recherche::getUrlRecherche('pre:1', $url_referentiel)?>">pre:1</a> ,<br />
<a href="<?=Recherche::getUrlRecherche('acer pre:1', $url_referentiel)?>">acer pre:1</a>
</td>
</tr>
<tr>
<td>taxref:[1]</td>
<td>Afficher des taxons qui seront envoyés au MNHN dans le cadre du programme TaxRef,
inversement [0] ressort les taxons mis en attente car non publiés ou non présents en France</td>
<td><a href="<?=Recherche::getUrlRecherche('taxref:1', $url_referentiel)?>">taxref:1</a> ,<br />
<a href="<?=Recherche::getUrlRecherche('acer taxref:0', $url_referentiel)?>">acer taxref:0</a>
</td>
</tr>
<tr>
<td>classif:[infra|supra]</td>
<td>Afficher les taxon inférieurs (-) ou supérieurs (+)</td>
<td><a href="<?=Recherche::getUrlRecherche('nn:182 classif:infra', $url_referentiel)?>">nn:182 classif:infra</a>,<br />
<a href="<?=Recherche::getUrlRecherche('nn:182 classif:supra', $url_referentiel)?>">nn:182 classif:supra</a>,<br />
<a href="<?=Recherche::getUrlRecherche('fabaceae classif:infra', $url_referentiel)?>">fabaceae classif:infra</a>
</td>
</tr>
<tr>
<td>rg:</td>
<td>Afficher la liste des noms d'un rang donné (famille 180, genre 220,
<a href="http://www.tela-botanica.org/wikini/RTaxMethodo/wakka.php?wiki=TaBle7">autres valeurs de rang)</a>.</td>
<td><a href="<?=Recherche::getUrlRecherche('rg:180', $url_referentiel)?>">rg:180</a>
</td>
</tr>
</tbody>
</table>
<p>
Si vous souhaitez utiliser deux opérateurs à la suite, ou un terme et un opérateur, pour
faire une recherche croisée, séparez-les uniquement par un espace.<br />
<em>Exemples&nbsp;:</em>
<a href="<?=Recherche::getUrlRecherche('l. gen:aba', $url_referentiel)?>">"l. gen:aba"</a>&nbsp; =>172 résultats;&nbsp;
<a href="<?=Recherche::getUrlRecherche('au:l. gen:aba', $url_referentiel)?>">"au:l. gen:aba"</a>&nbsp; => 25 résultats.
<br /><br />
Des "jokers" permettent d'élargir la recherche.
</p>
<table class="largeur-14">
<thead>
<tr>
<th class="largeur-01">Joker</th>
<th class="largeur-10">Explication</th>
<th class="largeur-03">Exemples</th>
</tr>
</thead>
<tbody>
<tr>
<td>%</td>
<td>Remplace n'importe quel nombre de caractères, y compris aucun.</td>
<td><a href="<?=Recherche::getUrlRecherche('gen:de%m sp:m%m', $url_referentiel)?>">
gen:de%m sp:m%m</a></td>
</tr>
<tr>
<td>_</td>
<td>Remplace exactement un caractère</td>
<td><a href="<?=Recherche::getUrlRecherche('gen:a_ar', $url_referentiel)?>">gen:a_ar</a></td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- REF - FIN MOTEUR RECHERCHE -->
/branches/v2.0-betulales/interfaces/squelettes/resultat_recherche.tpl.html
New file
0,0 → 1,101
<!-- REF - DEBUT RESULTAT -->
<div id="ref-resultat-recherche">
<? if (isset($resultats)) : ?>
<div>
<div style="float:left;"><?=$fragmenteur ?></div>
<div style="float:right; padding-right:20px;">
<br /><br />
<span class="transmis">à transmettre à taxref</span><br />
<span class="non_transmis">exclu de taxref</span><br />
<span class="nom_retenu">nom retenu</span><br />
</div>
<div style="float:right; padding-right:20px;">
<h2>Légende :</h2>
<span><img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
lancer une nouvelle<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;requête</span><br />
<span><img src="./interfaces/squelettes/css/referentiel/images/aide.png" alt="rechercher"/>
information</span>
</div>
</div>
<hr class="nettoyage">
<i style="float:left;">Les résultats sont affichés par ordre alphabétique. Cliquez sur le num_nom ou sur le nom pour accéder à la fiche.</i>
<table>
<thead>
<tr>
<th title="Identifiant numérique du nom scientifique">num_nom</th>
<th title="Identifiant numérique du nom scientifique retenu">num_nom_retenu</th>
<th>Nom scientifique</th>
<th>Auteur</th>
<th>Année</th>
<th>Référence bibliographique</th>
<th>Présence</th>
<th>Nom addendum</th>
</tr>
</thead>
<tbody>
<? foreach ($resultats as $resultat) : ?>
<tr <?=($resultat['exclure_taxref'] == 0) ? 'class="transmis' : 'class="non_transmis' ?>
<?=($resultat['num_nom'] == $resultat['num_nom_retenu']) ? ' nom_retenu"' : '"' ?>>
<td><a href="<?=Recherche::getUrlFicheTaxon($resultat)?>"><?=$resultat['num_nom']?></a></td>
<td><a href="<?=Recherche::getUrlFicheTaxon($resultat)?>"><?=$resultat['num_nom_retenu']?></a></td>
<td><a href="<?=Recherche::getUrlFicheTaxon($resultat)?>"><?=$resultat['nom_sci']?></a>
<? if ($resultat['nom_sci'] != '') : ?>
<a class="droite" href="<?=Recherche::getUrlRecherche('nn:'.$resultat['num_nom']." classif:infra", $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/inframoins.png" alt="Voir les taxons inférieurs"/>
</a>
<a class="droite" href="<?=Recherche::getUrlRecherche('nn:'.$resultat['num_nom']." classif:supra", $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/infraplus.png" alt="Voir les taxons supérieurs"/>
</a>
<a class="droite" href="<?=Recherche::getUrlRecherche($resultat['nom_sci'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$resultat['auteur']?>
<? if ($resultat['auteur'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('au:'.$resultat['auteur'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$resultat['annee']?>
<? if ($resultat['annee'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('an:'.$resultat['annee'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$resultat['biblio_origine']?>
<? if ($resultat['biblio_origine'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche('bib:'.$resultat['biblio_origine'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td>
<? if ($resultat['presence'] != '') : ?>
<span title="<?=$valeur_presence[$resultat['presence']];?>"><?=$resultat['presence'];?></span>
<a href="<?=Recherche::getUrlRecherche('pre:1', $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
<td><?=$resultat['nom_addendum']?>
<? if ($resultat['nom_addendum'] != '') : ?>
<a href="<?=Recherche::getUrlRecherche($resultat['nom_addendum'], $referentiel)?>">
<img src="./interfaces/squelettes/css/referentiel/images/data_query.png" alt="rechercher"/>
</a>
<? endif; ?>
</td>
</tr>
<? endforeach; ?>
</tbody>
</table>
<?=$fragmenteur ?>
<? endif; ?>
</div>
<!-- REF - FIN RESULTAT -->
/branches/v2.0-betulales/interfaces/squelettes/traitement.tpl.html
New file
0,0 → 1,61
<!-- REF - DEBUT TRAITEMENT -->
<h1>
Résultats du traitement
<?php if (isset($traitement)) : ?>
«&nbsp;<?=$traitement['nom'];?> <span class="discretion">(id:<?=$traitement['id_traitement']?>)</span>&nbsp;»
<?php endif; ?>
</h1>
 
<?php if (isset($messages)) : ?>
<h2>Messages</h2>
<?php foreach ($messages as $message) : ?>
<p class="information"><?=$message;?></p>
<?php endforeach; ?>
<?php endif; ?>
 
<?php if (isset($urls_zip)) : ?>
<h2>Téléchargements</h2>
<ul>
<?php foreach ($urls_zip as $nom => $url) : ?>
<li><a href="<?=$url?>"><?=$nom?></a></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
 
<h2>Résultats</h2>
<?php if (isset($resultats)) : ?>
<?php if ($traitement['script'] == 'tests') : ?>
<table id="resultats">
<caption>Résultats</caption>
<thead>
<tr>
<th>Numero</th>
<th>Nom</th>
<th>Résultat</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<?php $i=1; ?>
<?php foreach ($resultats as $resultat) : ?>
<tr>
<td class="numero <?=$resultat['resultat'] ? 'ok' : 'ko';?>" title="Id:<?=$resultat['id_resultat']?>"><?=$i++?></td>
<td class="nom <?=$resultat['resultat'] ? 'ok' : 'ko';?>"><a href="<?=$resultat['url']?>"><?=$resultat['nom']?></a></td>
<td class="<?=$resultat['resultat'] ? 'ok' : 'ko';?>"><span class="resultat"><?=$resultat['resultat'] ? 'ok' : 'ko';?></span></td>
<td class="description"><?=$resultat['description']?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php if ($traitement['script'] == 'versionnage') : ?>
<?php $i=1; ?>
<?php foreach ($resultats as $resultat) : ?>
<h3><?=$resultat['nom']?> (Id:<?=$resultat['id_resultat']?>)</h3>
<p><?=$resultat['message']?></p>
<?php endforeach; ?>
<?php endif; ?>
<?php else : ?>
<p class="information">Aucun resultat pour ce traitement.</p>
<?php endif; ?>
<!-- REF - FIN TRAITEMENT -->
/branches/v2.0-betulales/interfaces/controleurs/AppliControleur.php
New file
0,0 → 1,603
<?php
// declare(encoding='UTF-8');
/**
* Classe Controleur générale partagée par les différents modules de l'application.
*
* @package Referentiel
* @category Php5.2
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
abstract class AppliControleur extends Controleur {
const RENDU_TETE = 'tete';
const RENDU_CORPS = 'corps';
const RENDU_PIED = 'pied';
const RENDU_NAVIGATION = 'navigation';
const RENDU_MENU = 'menu';
// FIXME : voir s'il est plus intéressant d'utiliser une méthode dans les classes filles
protected $url = null;
private $parametres = array();
protected $manuel = null;
private $sortie = array();
private $messages = null;
//+----------------------------------------------------------------------------------------------------------------+
// Constructeur
public function __construct() {
$registre = Registre::getInstance();
$this->parametres = $registre->get('parametres');
$this->url = $this->parametres['url'];
// Chargement des infos du manuel technique des référentiels
$this->manuel = parse_ini_file(Config::get('chemin_appli').DS.'..'.DS.'configurations'.DS.Config::get('manuel'));
parent::__construct();
}
//+----------------------------------------------------------------------------------------------------------------+
// Accesseurs
 
/**
* Retourne le tableau de sortie à utiliser dans le controleur principal de l'application.
*/
public function getSortie() {
return $this->sortie;
}
 
/**
* Attribue à la bonne position de sortie un contenu.
*/
protected function setSortie($position, $contenu, $fusionner = false) {
if ($this->verifierExistencePosition($position)) {
if ($fusionner) {
$this->sortie[$position] .= $contenu;
} else {
$this->sortie[$position] = $contenu;
}
}
}
/**
* Retourne le tableau des messages
*/
protected function getMessages() {
return $this->messages;
}
/**
* Ajoute un message
*/
protected function addMessage($message) {
if ('' != $message) {
$this->messages[] = $message;
}
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Vérifie l'existence de la position indiquée pour son utilisation dans le tableau de sortie.
* @param string la position à tester.
* @return bool true si la position est valide, sinon false.
*/
private function verifierExistencePosition($position) {
$existe = true;
if ($position != self::RENDU_TETE &&
$position != self::RENDU_CORPS &&
$position != self::RENDU_PIED &&
$position != self::RENDU_NAVIGATION &&
$position != self::RENDU_MENU) {
trigger_error("La position '$position' n'est pas une valeur prédéfinie.", E_USER_WARNING);
$existe = false;
}
return $existe;
}
/**
* Execute l'action d'un module donnée et fusionne le résultat avec le tableau de sortie.
*/
protected function executerAction($ClasseModule, $action) {
$module = new $ClasseModule();
$module->$action();
$this->fusionnerSortie($module->getSortie());
}
protected function executerActionReferentiel($ClasseModule, $action, $referentiel, $afficheMoteur = null) {
$module = new $ClasseModule();
$module->$action($referentiel, $afficheMoteur);
$this->fusionnerSortie($module->getSortie());
}
/**
* Fusionne un tableau de sortie par défaut avec le tableau passé en paramêtre.
* @param array le tableau à fusionner
*/
private function fusionnerSortie($sortie) {
$this->sortie = array_merge($this->sortie, $sortie);
}
protected function postraiterDonnees(&$tableau) {
if (count($tableau) > 0) {
foreach ($tableau as $cle => &$valeur) {
if ($valeur == '') {
$valeur = '&nbsp;';
} else if (is_string($valeur)) {
$valeur = $this->remplacerEsperluette($valeur);
} else if (is_array($valeur)) {
$this->postraiterDonnees($valeur);
}
}
}
}
protected function traiterEsperluette(&$tableau) {
if (count($tableau) > 0) {
foreach ($tableau as $cle => &$valeur) {
if (is_string($valeur)) {
$valeur = $this->remplacerEsperluette($valeur);
} else if (is_array($valeur)) {
$this->traiterEsperluette($valeur);
}
}
}
}
protected function remplacerEsperluette($txt) {
$txt = preg_replace('/&(?!([a-z]+|#[0-9]+|#x[0-9a-f]+);)/i', '&amp;', $txt, -1);
return $txt;
}
protected function supprimerSlash($doc) {
if (is_string($doc)) {
$doc = stripslashes($doc);
} else if (is_array($doc) && count($doc) > 0) {
foreach ($doc as $cle => $valeur) {
$doc[$cle] = $this->supprimerSlash($valeur);
}
}
return $doc;
}
protected function initialiserModulePrincipal() {
$_SESSION['module_principal'] = null;
}
protected function definirCommeModulePrincipal($module_nom) {
$_SESSION['module_principal'] = $module_nom;
}
 
private function getModulePrincipalCourant() {
return $_SESSION['module_principal'];
}
/**
* Construction du menu et stockage dans le conteneur de sortie RENDU_MENU.
*
* @param string $referentiel code du référentiel.
*/
protected function construireMenu($referentiel) {
$menu['nom'] = 'Accueil';
$menu['url'] = $this->obtenirUrlMenuAccueil();
$menu['activite'] = (($this->getModulePrincipalCourant() == 'Accueil') ? 'actif' : 'inactif');
$menu['title'] = "Liste des référentiels consultables.";
$donnees['menus'][] = $menu;
$menu['nom'] = 'Consultation';
$menu['url'] = $this->obtenirUrlMenuConsultation($referentiel);
$menu['activite'] = ((preg_match('/^(?:Consultation|Recherche|FicheTaxon)$/', $this->getModulePrincipalCourant())) ? 'actif' : 'inactif');
$menu['title'] = "Interroger la base en cours de travail.";
$donnees['menus'][] = $menu;
$menu['nom'] = 'Arbre taxo';
$menu['url'] = $this->obtenirUrlMenuArbre($referentiel);
$menu['activite'] = (($this->getModulePrincipalCourant() == 'Arbre') ? 'actif' : 'inactif');
$menu['title'] = "Consulter l'aborescence du référentiel";
$donnees['menus'][] = $menu;
$menu['nom'] = 'Tests';
$menu['url'] = $this->obtenirUrlMenuTest($referentiel);
$menu['activite'] = (($this->getModulePrincipalCourant() == 'Test') ? 'actif' : 'inactif securise');
$menu['title'] = "Réservé aux coordinateurs. Contrôler les données saisies.";
$donnees['menus'][] = $menu;
$menu['nom'] = 'Versionnage';
$menu['url'] = $this->obtenirUrlMenuVersionnage($referentiel);
$menu['activite'] = (($this->getModulePrincipalCourant() == 'Versionnage') ? 'actif' : 'inactif securise');
$menu['title'] = "Réservé aux coordinateurs. Générer une version de la base.";
$donnees['menus'][] = $menu;
$menu['nom'] = 'Informations et téléchargements';
$menu['url'] = $this->obtenirUrlMenuInformations($referentiel);
$menu['activite'] = (($this->getModulePrincipalCourant() == 'Informations') ? 'actif' : 'inactif');
$menu['title'] = "Informations sur le projet et téléchargements.";
$donnees['menus'][] = $menu;
$this->setSortie(self::RENDU_MENU, $this->getVue('menu', $donnees), false);
}
/**
* Construction du fil d'ariane et stockage dans le conteneur de sortie RENDU_NAVIGATION.
*
* @param $referentiel code du référentiel
* @param $id_traitement id du traitement
* @param $id_resultat id du résultat
*/
protected function construireFilAriane($referentiel = null, $id_traitement = null, $id_resultat = null) {
$entree['nom'] = 'Accueil';
$entree['url'] = $this->obtenirUrlMenuAccueil();
$donnees['entrees'][] = $entree;
if (isset($referentiel)) {
$entree['nom'] = 'Informations '.strtoupper($referentiel);
$entree['url'] = $this->obtenirUrlDetailReferentiel($referentiel);
$donnees['entrees'][] = $entree;
$module_principal = $this->getModulePrincipalCourant();
if (isset($module_principal)) {
$entree['nom'] = $module_principal;
$entree['url'] = $this->obtenirUrlMenu($module_principal, $referentiel);
$donnees['entrees'][] = $entree;
}
if (isset($id_traitement)) {
$entree['nom'] = "Traitement #$id_traitement";
$entree['url'] = $this->obtenirUrlFicheTraitement($referentiel, $id_traitement);
$donnees['entrees'][] = $entree;
}
if (isset($id_resultat)) {
$entree['nom'] = "Résultat #$id_resultat";
$entree['url'] = $this->obtenirUrlFicheResultat($referentiel, $id_resultat);
$donnees['entrees'][] = $entree;
}
}
$this->setSortie(self::RENDU_NAVIGATION, $this->getVue('fil_ariane', $donnees), false);
}
protected function obtenirUrlDetailReferentiel($referentiel) {
$this->url->setRequete(false);
$this->url->setVariableRequete('module', 'Informations');
$this->url->setVariableRequete('ref', $referentiel);
$url = $this->url->getURL();
$this->url->unsetVariablesRequete(array('module', 'action', 'ref'));
return $url;
}
protected function obtenirUrlDetailReferentielTelechargement($referentiel) {
$this->url->setRequete(false);
$this->url->setVariableRequete('module', 'Informations');
$this->url->setVariableRequete('action', 'telecharger');
$this->url->setVariableRequete('ref', $referentiel);
$url = $this->url->getURL();
$this->url->unsetVariablesRequete(array('module', 'action', 'ref'));
return $url;
}
protected function obtenirUrlMenuInformations($referentiel) {
return $this->obtenirUrlMenu('Informations', $referentiel);
}
protected function obtenirUrlMenuAccueil() {
return $this->obtenirUrlMenu('Accueil');
}
protected function obtenirUrlMenuTest($referentiel) {
return $this->obtenirUrlMenu('Test', $referentiel);
}
protected function obtenirUrlMenuVersionnage($referentiel) {
return $this->obtenirUrlMenu('Versionnage', $referentiel);
}
protected function obtenirUrlDemandeVersionnage($referentiel) {
$this->url->setRequete(false);
$this->url->setVariableRequete('module', 'Versionnage');
$this->url->setVariableRequete('action', 'demanderTraitement');
$this->url->setVariableRequete('ref', $referentiel);
$url = $this->url->getURL();
$this->url->unsetVariablesRequete(array('module', 'action', 'ref'));
return $url;
}
protected function obtenirUrlMenuConsultation($referentiel) {
return $this->obtenirUrlMenu('Consultation', $referentiel);
}
protected function obtenirUrlMenuArbre($referentiel) {
return $this->obtenirUrlMenu('Arbre', $referentiel);
}
protected function obtenirUrlMenuBranche($referentiel, $num_nom) {
$this->url->setRequete(false);
$this->url->setVariableRequete('module', 'Arbre');
$this->url->setVariableRequete('action', 'afficherBranche');
$this->url->setVariableRequete('ref', $referentiel);
$this->url->setVariableRequete('num_nom', $num_nom);
$url = $this->url->getURL();
$this->url->unsetVariablesRequete(array('module', 'action', 'ref', 'num_nom'));
return $url;
}
protected function obtenirUrlMenuBrancheSynonyme($referentiel, $num_nom) {
$this->url->setRequete(false);
$this->url->setVariableRequete('module', 'Arbre');
$this->url->setVariableRequete('action', 'afficherBrancheSynonyme');
$this->url->setVariableRequete('ref', $referentiel);
$this->url->setVariableRequete('num_nom', $num_nom);
$url = $this->url->getURL();
$this->url->unsetVariablesRequete(array('module', 'action', 'ref', 'num_nom'));
return $url;
}
private function obtenirUrlMenu($menu, $referentiel = null) {
$this->url->setRequete(false);
$this->url->setVariableRequete('module', $menu);
if (isset($referentiel)) {
$this->url->setVariableRequete('ref', $referentiel);
}
$url = $this->url->getURL();
$this->url->unsetVariablesRequete(array('module', 'ref'));
return $url;
}
protected function obtenirUrlFicheTraitement($referentiel, $id_traitement) {
$this->url->setRequete(false);
$this->url->setVariableRequete('module', 'Traitement');
$this->url->setVariableRequete('id-t', $id_traitement);
$this->url->setVariableRequete('ref', $referentiel);
$url = $this->url->getURL();
$this->url->unsetVariablesRequete(array('module', 'id-t', 'ref'));
return $url;
}
protected function obtenirUrlFicheResultat($referentiel, $id_resultat) {
$this->url->setRequete(false);
$this->url->setVariableRequete('module', 'Resultat');
$this->url->setVariableRequete('id-r', $id_resultat);
$this->url->setVariableRequete('ref', $referentiel);
$url = $this->url->getURL();
$this->url->unsetVariablesRequete(array('module', 'id-r', 'ref'));
return $url;
}
protected function obtenirUrlRecherche($referentiel = null, $txt = null) {
$this->url->setRequete(false);
if (!is_null($referentiel)) {
$this->url->setVariableRequete('ref', $referentiel);
}
$this->url->setVariableRequete('module', 'Recherche');
$this->url->setVariableRequete('action', 'rechercher');
if (!is_null($txt)) {
$this->url->setVariableRequete('recherche', $txt);
}
$url = $this->url->getURL();
$this->url->unsetVariablesRequete(array('ref', 'module', 'action', 'recherche'));
return $url;
}
protected function obtenirUrlFicheTaxon($referentiel, $num_nom = null) {
$this->url->setRequete(false);
$this->url->setVariableRequete('ref', $referentiel);
$this->url->setVariableRequete('module', 'FicheTaxon');
if (!is_null($num_nom)) {
$this->url->setVariableRequete('num_nom', $num_nom);
}
$url = clone $this->url;
$this->url->unsetVariablesRequete(array('module', 'id'));
return $url->getURL();
}
/**
* Lance l'ajout d'un traitement
*/
protected function ajouterTraitement($referentiel_code, $script_nom) {
$this->ajouterTraitementParametre($referentiel_code, null, $script_nom);
}
/**
* Lance l'ajout d'un traitement
*/
protected function ajouterTraitementParametre($referentiel_code, $parametres_serialises, $script_nom) {
if (is_null($referentiel_code)) {
$this->addMessage("Aucun code de projet de référentiel n'est indiqué (Ex. bdtfx).");
} else {
$traitements_a_supprimer = null;
$traitementDao = new TraitementDao();
$resultat_traitement_en_attente = $traitementDao->getTraitementsEnAttente($referentiel_code, $script_nom);
if ($resultat_traitement_en_attente) {
foreach ($resultat_traitement_en_attente as $traitement) {
$difference = $this->differenceEnSecondeEntreDeuxDates($traitement['meta_date_creation'], date ("Y-m-d H:i:s"));
Debug::printr("Différence attente : $difference > ".Config::get('ddv_traitement_attente'));
if ($difference > Config::get('ddv_traitement_attente')) {
$traitements_a_supprimer[] = $traitement['id_traitement'];
$this->addMessage("Le traitement #{$traitement['id_traitement']} était en attente depuis plus de 5mn, il a été supprimé.");
} else {
$this->addMessage("Un traitement est déjà en attente...");
}
}
} else {
$resultat_traitement_en_cours = $traitementDao->getTraitementsEnCours($referentiel_code, $script_nom);
if ($resultat_traitement_en_cours) {
foreach ($resultat_traitement_en_cours as $traitement) {
$difference = $this->differenceEnSecondeEntreDeuxDates($traitement['date_debut'], date ("Y-m-d H:i:s"));
Debug::printr("Différence en cours : $difference > ".Config::get('ddv_traitement_en_cours'));
if ($difference > Config::get('ddv_traitement_en_cours')) {
$traitements_a_supprimer[] = $traitement['id_traitement'];
$this->addMessage("Le traitement #{$traitement['id_traitement']} était en cours depuis plus de 5mn, il a été supprimé.");
} else {
$this->addMessage("Un traitement est déjà en cours...");
}
}
} else {
$resultat = $traitementDao->ajouterTraitementParametre($referentiel_code, $parametres_serialises, $script_nom);
if ($resultat != false) {
$this->addMessage("Le traitement #'$resultat' a été ajouté.");
$this->lancerScript($referentiel_code, $script_nom);
} else {
$this->addMessage("Un problème est survenu lors de la tentative d'ajout du traitement.");
}
}
}
// Suppression des traitements posant problème
if (count($traitements_a_supprimer) > 0) {
$traitementDao->supprimer($traitements_a_supprimer);
}
}
}
private function differenceEnSecondeEntreDeuxDates($date_01, $date_02) {
if (floatval(phpversion()) >= 5.3 ) {
$d1 = new DateTime($date_01);
$d2 = new DateTime($date_02);
$difference_absolue = true;
$diff = $d1->diff($d2, $difference_absolue);
$nbre_secondes = $diff->format('s');
} else {
$nbre_secondes = abs(round((strtotime($date_01) - strtotime($date_02))));
}
return $nbre_secondes;
}
/**
* Lance le script d'execution des traitements
*/
protected function lancerScript($referentiel_code, $script_nom) {
$php = Config::get('chemin_bin_php');
$exe = Config::get('chemin_script');
$action = 'tout';
$log = Config::get('chemin_script_log');
$limite_memoire = Config::get('script_limite_memoire');
$commande = "$php -d memory_limit=$limite_memoire -f $exe $script_nom -p $referentiel_code -a $action > $log &";
if ($this->verifierSafeModeOff() === false) {
$e = "Le safe_mode est actif sur ce serveur.";
} else if ($this->verifierAccesFonctionExec() === false) {
$e = "La fonction 'exec()' fait partie des fonctions désactivées sur ce serveur (voir disable_functions).";
} else {
$this->addMessage("Lancement du script effectuant les traitements.");
exec($commande);
}
 
// Affichage des message de paramêtrage du serveur si nécessaire
if (Config::get('script_messages') == true) {
$message_erreur_tpl = "%s\n.".
"Il est nécessaire de configurer le lancement du script via une tache dans le cron.\n".
"La commande à lancer est : <code>$commande</code>";
$this->addMessage(sprintf($message_erreur_tpl, $e));
}
}
private function verifierSafeModeOff() {
return ('1' == ini_get('safe_mode')) ? false : true;
}
private function verifierAccesFonctionExec() {
$disabled = explode(', ', ini_get('disable_functions'));
return !in_array('exec', $disabled);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES FICHIERS A TELECHARGER
/**
* Crée la liste d'url des fichiers à télécharger pour un traitement donné
* @param Array $infos_traitement tableau contenant les informations du traitement
*
* @return Array un tableau contenant la liste des urls des fichiers à télécharger
*/
protected function obtenirUrlsZipPourTraitement($infos_traitement) {
$urls_zip = array();
if (isset($infos_traitement['script']) && $infos_traitement['script'] == 'versionnage') {
$meta = unserialize($infos_traitement['script_parametres']);
$projet = strtolower($infos_traitement['referentiel_code']);
$version = str_replace('.', '_', $meta['version']);
$fichier_zip_bdnt = $projet.'_v'.$version.'.zip';
$url_zip_bdnt = sprintf(Config::get('url_zip_tpl'), $fichier_zip_bdnt);
if ($this->testerUrl($url_zip_bdnt)) {
$urls_zip[$fichier_zip_bdnt] = $url_zip_bdnt;
}
}
return $urls_zip;
}
/**
* Teste une url donnée, en tentant de l'ouvrir et de la fermer
*
* @return boolean un booléen indiquant le succès ou non de l'opération
*/
protected function testerUrl($url) {
//TODO: voir si on peut inclure cette fonction dans le framework
ini_set('allow_url_fopen', '1');
return (@fclose(@fopen($url, 'r'))) ? true : false;
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DU CLIENT REST
protected function getRestClient() {
if (! isset($this->restClient)) {
$this->restClient = new RestClient();
}
return $this->restClient;
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DE L'IDENTIFICATION
protected function getAuthIdentifiant() {
$id = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : null;
return $id;
}
protected function getAuthMotDePasse() {
$mdp = (isset($_SERVER['PHP_AUTH_PW'])) ? $_SERVER['PHP_AUTH_PW'] : null;
return $mdp;
}
public function authentifierCoordinateur() {
$message_accueil = "Veuillez vous identifier avec votre compte Tela Botanica.";
$message_echec = "Accès limité aux coordinateurs du projet.\n".
"Votre tentative d'identification a échoué.\n".
"Actualiser la page pour essayer à nouveau si vous êtes bien inscrit comme coordinateur.";
return $this->authentifier($message_accueil, $message_echec);
}
private function authentifier($message_accueil, $message_echec) {
$id = $this->getAuthIdentifiant();
if (!isset($id)) {
$this->envoyerAuth($message_accueil, $message_echec);
} else {
$autorisation = $this->etreCoordinateurAutorise();
if ($autorisation == false) {
$this->envoyerAuth($message_accueil, $message_echec);
}
}
return true;
}
public function etreCoordinateurAutorise($identifiant) {
$identifiant = $this->getAuthIdentifiant();
$mdp = md5($this->getAuthMotDePasse());
$url = sprintf(Config::get('authentification.serviceUrlTpl'), $identifiant, $mdp);
$json = $this->getRestClient()->envoyerRequeteConsultation($url);
$existe = json_decode($json);
$admin = $this->etreCoordinateur($identifiant) ? true : false;
$autorisation = ($existe && $admin) ? true : false;
return $autorisation;
}
public function etreCoordinateur($courriel) {
$coordinateurs = Config::get('authentification.coordinateurs');
$courriels_autorises = explode(',', $coordinateurs);
 
$autorisation = (in_array($courriel, $courriels_autorises)) ? true : false ;
return $autorisation;
}
private function envoyerAuth($message_accueil, $message_echec) {
header('HTTP/1.0 401 Unauthorized');
header('WWW-Authenticate: Basic realm="'.mb_convert_encoding($message_accueil, 'ISO-8859-1', 'UTF-8').'"');
header('Content-type: text/plain; charset=UTF-8');
print $message_echec;
exit(0);
}
}
/branches/v2.0-betulales/interfaces/controleurs/Consultation.php
New file
0,0 → 1,43
<?php
// declare(encoding='UTF-8');
/**
* Classe Controleur du module Consultation.
* Permet de consultation la version de travail d'un référentiel.
*
* @package Referentiel
* @category Php5.2
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
class Consultation extends AppliControleur {
private $referentiel = null;
public function __construct() {
parent::__construct();
// Récupération de paramêtres
if (isset($_GET['ref'])) { // code du projet courrant
$this->referentiel = strtolower($_GET['ref']);
}
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Fonction d'affichage par défaut
*/
public function executerActionParDefaut() {
$this->definirCommeModulePrincipal(get_class($this));
$this->construireMenu($this->referentiel);
$this->construireFilAriane($this->referentiel);
$_GET['recherche'] = "#";
$this->executerActionReferentiel('Recherche', 'rechercher', $this->referentiel, 20);
}
}
?>
/branches/v2.0-betulales/interfaces/controleurs/Resultat.php
New file
0,0 → 1,86
<?php
// declare(encoding='UTF-8');
/**
* Classe Controleur du module Resultat.
* Affichage des infos sur un résultat de traitement.
*
* @package Referentiel
* @category Php5.2
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
class Resultat extends AppliControleur {
private $referentiel = null;
private $traitementId = null;
private $resultatId = null;
private $resultatDao = null;
public function __construct() {
parent::__construct();
// Récupération de paramêtres
if (isset($_GET['id-r'])) { // id du resultat courant
$this->resultatId = strtolower($_GET['id-r']);
}
if (isset($_GET['ref'])) { // code du projet courrant
$this->referentiel = strtolower($_GET['ref']);
}
// Chargement des DAO nécessaires
if (isset($this->resultatId)) {
$this->resultatDao = new ResultatDao();
}
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Fonction d'affichage par défaut
*/
public function executerActionParDefaut() {
return $this->afficherResultat();
}
/**
* Affiche le formulaire de demande de traitement
*/
public function afficherResultat() {
$donnees = array();
// Traitement de l'info sur le code du référentiel
if (isset($this->resultatId)) {
// Recherche d'info sur le résultat
$infos = $this->resultatDao->getInfos($this->resultatId);
if ($infos != false) {
$infos['message'] = $this->remplacerParametres($infos['message']);
$donnees['resultat'] = $infos;
$this->traitementId = $infos['ce_traitement'];
} else {
$this->addMessage("L'identifiant de résultat n'est pas indexé dans la base de données.");
}
} else {
$this->addMessage("Aucun identifiant de résultat n'a été indiqué.");
}
$donnees['messages'] = $this->getMessages();
$this->traiterEsperluette($donnees);
$this->setSortie(self::RENDU_CORPS, $this->getVue('resultat', $donnees), false);
$this->construireMenu($this->referentiel);
$this->construireFilAriane($this->referentiel, $this->traitementId, $this->resultatId);
}
/**
* Les tests génèrent des messages au format HTML qui peuvent contenir des paramètres à remplacer au moment de l'affichage.
*
* @param String $txt
*/
private function remplacerParametres($txt) {
return preg_replace('/{numNom::([0-9]+)}/', $this->obtenirUrlFicheTaxon($this->referentiel, "$1"), $txt);
}
}
?>
/branches/v2.0-betulales/interfaces/controleurs/Referentiel.php
New file
0,0 → 1,207
<?php
// declare(encoding='UTF-8');
/**
* Referentiel est le controlleur principal de l'application.
* Il repartit les demandes utilisateurs dans les différents modules, execute les actions et redistribue le code
* html dans les différentes fonctions d'affichage.
* C'est une Singleton.
*
* @package Referentiel
* @category Php5
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
 
class Referentiel extends Controleur {
/**
* Instance de la classe pointant sur elle même (pour le pattern singleton)
*/
private static $instance = null;
/**
* Paramètres pour les collections
*/
private static $parametres = array();
/**
* Constructeur vide
*/
public function __construct() {
$meta = array('titre' => '', 'description' => '', 'tags' => '');
$sortie = array('metadonnees' => $meta, 'corps' => '', 'tete' => '', 'pied' => '', 'navigation' => '', 'menu' => '');
$url = new Url(Config::get('url_base_index'));
self::$parametres = array( 'module' => 'Accueil',
'action' => 'executerActionParDefaut',
'sortie' => $sortie,
'url' => $url);
parent::__construct();
}
/**
* Initialisation du controleur principal en fonction des paramêtres de l'url.
*/
public static function initialiser() {
self::verifierCreationInstance();
self::gererSession();
restore_error_handler();
restore_exception_handler();
ini_set("display_errors", "1");
error_reporting(E_ALL);
if (isset($_GET['module'])) {
self::$parametres['module'] = $_GET['module'];
}
self::$parametres['url']->setVariableRequete('module', self::$parametres['module']);
if (isset($_GET['action'])) {
self::$parametres['action'] = $_GET['action'];
}
self::$parametres['url']->setVariableRequete('action', self::$parametres['action']);
$registre = Registre::getInstance();
$registre->set('parametres', self::$parametres);
$ClasseModule = self::$parametres['module'];
$action = self::$parametres['action'];
$module = new $ClasseModule();
$module->$action();
self::fusionnerSortie($module->getSortie());
}
private static function gererSession() {
if (Config::get('session_demarrage')) {
// Attribution d'un nom à la session
session_name(Config::get('session_nom'));
// Démarrage de la session
session_start();
}
}
/**
* Fusionne un tableau de sortie par défaut avec le tableau renvoyé par l'action du module.
* @param array le tableau à fusionner
*/
private static function fusionnerSortie($sortie) {
self::$parametres['sortie'] = array_merge(self::$parametres['sortie'], $sortie);
}
/**
* Vérifie si l'instance de classe à été crée, si non la crée.
*/
private static function verifierCreationInstance() {
if (empty(self::$instance)) {
self::$instance = new Referentiel();
}
}
/**
* Retourne le module courrant.
*/
public static function getModule() {
return self::$parametres['module'];
}
/**
* Retourne le titre du contenu de l'application.
*/
public static function getMetaTitre() {
return self::$parametres['sortie']['metadonnees']['titre'];
}
/**
* Retourne la description du contenu de l'application.
*/
public static function getMetaDescription() {
return self::$parametres['sortie']['metadonnees']['description'];
}
/**
* Retourne les mots-clés (tags) du contenu de l'application.
*/
public static function getMetaTags() {
return self::$parametres['sortie']['metadonnees']['tags'];
}
/**
* Retourne le contenu du corps de l'application.
*/
public static function getContenuCorps() {
$sortie = self::$parametres['sortie']['corps'];
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage'));
}
return $sortie;
}
/**
* Retourne le contenu de la tête de l'application.
*/
public static function getContenuTete() {
$sortie = self::$parametres['sortie']['tete'];
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage'));
}
return $sortie;
}
/**
* Retourne le contenu du pied de l'application.
*/
public static function getContenuPied() {
$sortie = self::$parametres['sortie']['pied'];
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage'));
}
return $sortie;
}
/**
* Retourne les éléments de navigation de l'application.
*/
public static function getContenuNavigation() {
$sortie = self::$parametres['sortie']['navigation'];
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage'));
}
return $sortie;
}
/**
* Retourne le menu de l'application.
*/
public static function getContenuMenu() {
$sortie = self::$parametres['sortie']['menu'];
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage'));
}
return $sortie;
}
/**
* Retourne les chronos pris dans l'appli
*/
public static function getChrono() {
$sortie = '';
if (Config::get('chronometrage')) {
$chrono = Chronometre::afficherChrono();
$sortie = mb_convert_encoding($chrono, Config::get('sortie_encodage'), Config::get('appli_encodage'));
}
return $sortie;
}
/**
* Retourne les messages d'exceptions et d'erreurs.
*/
public static function getExceptions() {
$sortie = (Config::get('fw_debogage')) ? GestionnaireException::getExceptions() : '';
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
$sortie = mb_convert_encoding($sortie, Config::get('sortie_encodage'), Config::get('appli_encodage'));
}
return $sortie;
}
}
?>
/branches/v2.0-betulales/interfaces/controleurs/Accueil.php
New file
0,0 → 1,71
<?php
// declare(encoding='UTF-8');
/**
* Classe Controleur du module Accueil.
* Affichage les infos sur l'ensemble des référentiels disponibles.
*
* @package Referentiel
* @category Php5.2
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
class Accueil extends AppliControleur {
private $referentiel = null;
private $referentielDao = null;
public function __construct() {
parent::__construct();
// Récupération de paramêtres
if (isset($_GET['ref'])) { // code du projet courrant
$this->referentiel = strtolower(strip_tags($_GET['ref']));
}
// Chargement des DAO nécessaires
$this->referentielDao = new ReferentielDao();
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Fonction d'affichage par défaut
*/
public function executerActionParDefaut() {
return $this->afficherAccueil();
}
/**
* Affiche la liste des référentiels
*/
public function afficherAccueil() {
$donnees = array();
$this->initialiserModulePrincipal();
$infos = $this->referentielDao->getReferentielsDispo();
if ($infos != false) {
$referentiel = array();
foreach ($infos as $info) {
$referentiel['nom'] = $info;
$referentiel['titre'] = $this->referentielDao->getNom($info);
$referentiel['url'] = $this->obtenirUrlMenuConsultation($info);
$referentiel['date'] = $this->referentielDao->getDateMiseAJour($info);
$donnees['referentiels'][] = $referentiel;
}
} else {
$this->addMessage("Aucun référentiel n'est disponible.");
}
$donnees['messages'] = $this->getMessages();
$this->traiterEsperluette($donnees);
$this->setSortie(self::RENDU_CORPS, $this->getVue('accueil', $donnees), false);
$this->construireFilAriane();
}
}
?>
/branches/v2.0-betulales/interfaces/controleurs/FicheTaxon.php
New file
0,0 → 1,256
<?php
// declare(encoding='UTF-8');
/**
* Classe Controleur du module Fiche Taxon.
*
* @category Php 5.2
* @package Taxon
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id: Fiche.php 96 2010-06-21 16:46:31Z jpm $
*/
class FicheTaxon extends AppliControleur {
private $donnees = array();
protected $taxonDao = null;
private $tableau_manuel = null;
private $num_taxon = array(0=>0,1=>0,2=>0);
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Fonction d'affichage par défaut
*/
public function executerActionParDefaut() {
return $this->afficherTaxon();
}
// +---------------------------------------------------------------------------------------------------------------+
// FICHE CONSULTATION TAXON
public function afficherTaxon() {
// Récupération du référentiel
if (isset($_GET['ref'])) {
$this->referentiel = strtolower($_GET['ref']);
}
// Gestion des actions par défaut
$this->taxonDao = new TaxonDao();
$this->definirCommeModulePrincipal(get_class($this));
$this->construireMenu($this->referentiel);
$this->construireFilAriane($this->referentiel);
$this->executerActionReferentiel('Recherche', 'chargerMoteurRecherche', $this->referentiel, 10);
// Gestion des données de la requête
if (!isset($_GET['num_nom'])) {
} else {
// Récupération des données
$this->donnees['referentiel'] = $this->referentiel;
$this->donnees['num_nom'] = $_GET['num_nom'];
$this->donnees['info'] = $this->taxonDao->getTaxon($this->referentiel, $this->donnees['num_nom']);
$this->donnees['num_nom_retenu'] = $this->donnees['info']['num_nom_retenu'];
$this->donnees['nom'] = $this->donnees['info']['nom_sci'];
$this->donnees['exclu_taxref'] = $this->donnees['info']['exclure_taxref'];
if ($this->donnees['info'] != '') {
// Chargement des données des onglets
$this->chargerNomenclature();
$this->chargerSynonymie();
$this->chargerClassification();
$this->chargerChorologie();
$this->chargerComplements();
}
$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_taxon', $this->donnees));
}
}
private function chargerNomenclature() {
$this->donnees['selectionne'] = $this->taxonDao->getNomenclature($this->referentiel, $this->donnees['num_nom']);
if ($this->donnees['num_nom'] != $this->donnees['num_nom_retenu'] && $this->donnees['num_nom_retenu'] != '') {
$this->donnees['retenu'] = $this->taxonDao->getNomenclature($this->referentiel, $this->donnees['num_nom_retenu']);
}
if ($this->donnees['info']['hybride_parent_01'] != '' && $this->donnees['info']['hybride_parent_02'] != '') {
$this->donnees['parents'] = $this->taxonDao->getParentsHybride($this->referentiel, $this->donnees['num_nom']);
} elseif ($this->donnees['info']['hybride_parent_01'] != '' || $this->donnees['info']['hybride_parent_02'] != ''){
$this->donnees['parents'] = $this->taxonDao->getParentsHybride($this->referentiel, $this->donnees['num_nom']);
}
}
// recherche les synonymes (à compléter)
private function chargerSynonymie() {
$rechercheDao = new RechercheDao();
// recherche des synonymes nomenclaturaux et taxonomiques
$parametres = $this->parserChaineDeRecherche('nn:'.$this->donnees['num_nom'].' tax:1');
$parametres['ref']= $this->referentiel;
$synonymes = $rechercheDao->chercher('ParTaxon', $parametres);
if ($synonymes != '') {
$this->donnees['syn'] = $synonymes;
}
// synonyme proparte
if ($this->donnees['info']['synonyme_proparte'] != ''){
$propartes = explode(',', $this->donnees['info']['synonyme_proparte']);
foreach ($propartes as $proparte) {
$this->donnees['pp'][] = $this->taxonDao->getTaxonAffichage($this->referentiel, trim($proparte));
}
}
// homonymie
$nom = $this->encodeChaine($this->donnees['info']['nom_sci']);
$homonymes = $this->taxonDao->getHomonyme($this->referentiel, $nom);
if (count($homonymes) > 1) {
foreach ($homonymes as $id => &$homonyme) {
$homonyme['statut'] = $homonyme['homonyme'];
}
$this->donnees['h'] = $homonymes;
}
}
private function chargerChorologie() {
$this->chargerTableauManuel('presence');
$this->chargerTableauManuel('statuts_origine');
$this->chargerTableauManuel('statuts_introduction');
$this->chargerTableauManuel('statuts_culture');
foreach ($this->donnees['info'] as $param => $valeur) {
if ($param == 'presence') {
$this->donnees['chorologie']['Présence']['France']['code'] = $valeur;
$this->donnees['chorologie']['Présence']['France']['valeur'] = $this->tableau_manuel['presence'][$valeur];
} elseif (preg_match('/presence_(.*)/', $param, $lieu)) {
$this->donnees['chorologie']['Présence'][$lieu['1']]['code'] = $valeur;
$this->donnees['chorologie']['Présence'][$lieu['1']]['valeur'] = $this->tableau_manuel['presence'][$valeur];
} elseif ($param == 'statut_origine') {
$this->donnees['chorologie']['Statut d\'origine']['France']['code'] = $valeur;
$this->donnees['chorologie']['Statut d\'origine']['France']['valeur'] =
$this->tableau_manuel['statuts_origine'][$valeur];
} elseif (preg_match('/statut_origine_(.*)/', $param, $lieu)) {
$this->donnees['chorologie']['Statut d\'origine'][$lieu['1']]['code'] = $valeur;
$this->donnees['chorologie']['Statut d\'origine'][$lieu['1']]['valeur'] =
$this->tableau_manuel['statuts_origine'][$valeur];
} elseif ($param == 'statut_introduction') {
$this->donnees['chorologie']['Statut d\'introduction']['France']['code'] = $valeur;
$this->donnees['chorologie']['Statut d\'introduction']['France']['valeur'] =
$this->tableau_manuel['statuts_introduction'][$valeur];
} elseif (preg_match('/statut_introduction_(.*)/', $param, $lieu)) {
$this->donnees['chorologie']['Statut d\'introduction'][$lieu['1']]['code'] = $valeur;
$this->donnees['chorologie']['Statut d\'introduction'][$lieu['1']]['valeur'] =
$this->tableau_manuel['statuts_introduction'][$valeur];
} elseif ($param == 'statut_culture') {
$this->donnees['chorologie']['Statut de culture']['France']['code'] = $valeur;
$this->donnees['chorologie']['Statut de culture']['France']['valeur'] =
$this->tableau_manuel['statuts_culture'][$valeur];
} elseif (preg_match('/statut_culture_(.*)/', $param, $lieu)) {
$this->donnees['chorologie']['Statut de culture'][$lieu['1']]['code'] = $valeur;
$this->donnees['chorologie']['Statut de culture'][$lieu['1']]['valeur'] =
$this->tableau_manuel['statuts_culture'][$valeur];
}
}
foreach ($this->donnees['chorologie']['Présence'] as $lieu => $valeur) {
if (!isset($this->donnees['chorologie']['Statut d\'origine'][$lieu])) {
$this->donnees['chorologie']['Statut d\'origine'][$lieu]['code'] = '';
}
if (!isset($this->donnees['chorologie']['Statut d\'introduction'][$lieu])) {
$this->donnees['chorologie']['Statut d\'introduction'][$lieu]['code'] = '';
}
if (!isset($this->donnees['chorologie']['Statut de culture'][$lieu])) {
$this->donnees['chorologie']['Statut de culture'][$lieu]['code'] = '';
}
}
}
private function chargerClassification() {
$this->chargerTableauManuel('signification_rang');
$this->chargerTableauManuel('presence');
$this->donnees['valeur_rang'] = $this->tableau_manuel['signification_rang'];
$this->donnees['valeur_presence'] = $this->tableau_manuel['presence'];
if ($this->donnees['info']['num_tax_sup'] != '' && $this->donnees['info']['num_tax_sup'] !== "0") {
$this->donnees['classification']['supérieurs'] = array_reverse($this->taxonDao->getClassification
('Superieur', $this->referentiel, $this->donnees['info']['num_tax_sup']));
} elseif (isset($this->donnees['retenu']['num_tax_sup']) && ($this->donnees['retenu']['num_tax_sup'] != '')) {
$this->donnees['classification']['supérieurs'] = array_reverse($this->taxonDao->getClassification
('Superieur', $this->referentiel, $this->donnees['retenu']['num_tax_sup']));
}
if ($this->donnees['num_nom_retenu'] != '') {
$class_inf = $this->taxonDao->getClassification
('Inferieur', $this->referentiel, $this->donnees['num_nom_retenu']);
if ($class_inf != '') {
$this->donnees['classification']['inférieurs'] = $class_inf['inf'];
$this->donnees['niveau'] = $class_inf['niveau'];
arsort($class_inf['nb_par_rang']);
$this->donnees['noms_rang'] = $class_inf['nb_par_rang'];
}
}
}
private function chargerComplements() {
$champs_manuel_technique = explode(',', $this->manuel['champs']);
$champs_base_donnees = key($this->donnees['info']);
$champs_supp_base = array_diff_key($this->donnees['info'], array_flip($champs_manuel_technique));
foreach ($champs_supp_base as $champ=>$valeur) {
if (!(preg_match('/presence_(.*)/',$champ) || preg_match('/statut_origine_(.*)/', $champ) ||
preg_match('/statut_introduction_(.*)/', $champ) || preg_match('/statut_culture_(.*)/', $champ))) {
$this->donnees['complement'][$champ] = $valeur;
}
}
}
private function parserChaineDeRecherche($chaine) {
$mots = preg_split('/ /i', $chaine, -1, PREG_SPLIT_NO_EMPTY);
$parametres = array('mots' => '');
$cle_precedente = null;
foreach ($mots as $mot) {
if (preg_match('/^(sg|gen|sp|ssp|au|an|nn|bib|nr|tax):(.*)$/', $mot, $match)) {
$cle = $match[1];
$cle_precedente = $cle;
$valeur = $match[2];
$parametres[$cle] = $valeur;
} else if (!is_null($cle_precedente)) {
$parametres[$cle_precedente] .= ' '.$mot;
} else if (is_null($cle_precedente)) {
if (empty($parametres['mots'])) {
$parametres['mots'] = $mot;
} else {
$parametres['mots'] .= ' '.$mot;
}
}
}
return $parametres;
}
public function encodeChaine($chaine) {
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
$chaine = mb_convert_encoding($chaine, Config::get('sortie_encodage'), Config::get('appli_encodage'));
}
$chaine = urlencode($chaine);
return $chaine;
}
// retourne l'url de la fiche taxon pour les liens
public static function getUrlFicheTaxon($params, $type = '') {
$taxon = null;
switch ($type) {
case 'bas' :
$taxon['num_nom'] = $params['bas_num'];
break;
case 'p1' :
$taxon['num_nom'] = $params['p1_num'];
break;
case 'p2' :
$taxon['num_nom'] = $params['p2_num'];
break;
default : $taxon['num_nom'] = $params;
break;
}
return Recherche::getUrlFicheTaxon($taxon);
}
// charger tableau de $this->manuel
private function chargerTableauManuel($titreTableau) {
$champs = explode(',', $this->manuel[$titreTableau]);
foreach ($champs as $champ) {
list($champ_nom, $type) = explode('=', trim($champ));
$this->tableau_manuel[$titreTableau][$champ_nom] = $type;
}
}
 
}
/branches/v2.0-betulales/interfaces/controleurs/Informations.php
New file
0,0 → 1,231
<?php
// declare(encoding='UTF-8');
/**
* Classe Controleur du module Accueil.
* Affichage les infos sur l'ensemble des référentiels disponibles.
*
* @package Referentiel
* @category Php5.2
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
class Informations extends AppliControleur {
private $referentiel = null;
private $referentielDao = null;
private $traitementDao = null;
private $resultatDao = null;
private $metaDao = null;
private $colonnesOrdonnees = array();
public function __construct() {
parent::__construct();
// Récupération de paramêtres
if (isset($_GET['ref'])) { // code du projet courrant
$this->referentiel = strtolower(strip_tags($_GET['ref']));
}
// Chargement des DAO nécessaires
$this->resultatDao = new ResultatDao();
$this->traitementDao = new TraitementDao();
$this->referentielDao = new ReferentielDao();
$this->metaDao = new MetaDao();
// tableau colonnesOrdonnees à modifier aussi dans service/Recherche.php
$this->colonnesOrdonnees = array("nn" => array("Numéro nomenclatural","checked","Identifiant numérique du nom scientifique"),
"nr" => array("Numéro nomenclatural du nom retenu","checked","Identifiant numérique du nom scientifique (num_nom) retenu pour désigner le taxon"),
"nt" => array("Numéro taxonomique","checked","Identifiant numérique du taxon auquel est rattaché le nom"),
"cd" => array("Numéro INPN","checked","Identifiant numérique unique du nom scientifique attribué par l’INPN"),
"rg" => array("Code rang","checked","Code numérique indiquant le rang du nom scientifique (voir tableau 7 du manuel technique)"),
"fam" => array("Famille (APG III)","checked","Nom de la famille dans APG III"),
"nsc" => array("Nom avec auteur","checked","Nom scientifique avec auteur(s)"),
"bibc" => array("Année et bibliographie","checked","Format à étudier celui de Tela : 1868, Brev. Pl. Nov., 2 : 70 ou celui de Kew : Brev. Pl. Nov., 2 : 70 (1868)"),
"nsrc" => array("Nom retenu avec auteur","checked","Nom retenu pour tous les taxons (identique si le nom est édjà le nom retenu)"),
"nf" => array("Nom français normalisé","checked","Nom français conseillé pour ce taxon (à venir)"),
"extax" => array("Présent dans Taxref","checked",""),
"lien" => array("Permalien","checked","Lien http vers la fiche nomenclaturale"),
"ntsup" => array("Numéro nomenclatural rang supérieur","","Identifiant numérique du nom (num_nom) de rang supérieur dans la classification par défaut de l'index"),
"pre" => array("Répartition géographique","","Code indiquant si le taxon est présent dans la zone géographique définie par le référentiel (tableau 9)"),
"ns" => array("Nom sans auteur","","Nom scientifique sans auteur"),
"aut" => array("Auteur","","Intitulé de(s) l'auteur(s) du nom (abréviations standards de Brummitt et Powell)"),
"ann" => array("Année publication","","Année de la publication effective du support papier"),
"bib" => array("Bibliographie","","Référence bibliographique de la publication d'origine du nom"),
"ntype" => array("Numéro du type","","Identifiant numérique (num_nom) du 1er basionyme appliqué à la planche d'herbier"),
"nbas" => array("Numéro du basionyme","","Identifiant numérique (num_nom) du basionyme du nom"),
"genre" => array("Genre","","Nom d'un genre dans le cas d'un monôme du rang genre ou d'une combinaison"),
"esp" => array("Epithète espèce","","Épithète de l'espèce"),
"eing" => array("Epithète infragénérique","","Épithète infra-générique d'une combinaison dont le rang est situé entre le genre et l'espèce"),
"te" => array("Type d'épithète infraspécifique","","Abréviation indiquant le type de l'épithète infra-spécifique"),
"einsp" => array("Epithète infraspécifique","","Épithète infra-spécifique d'une combinaison"),
"hybp01" => array("Hybride parent 1","","Identifiant du nom (num_nom) du parent numéro 1 (dans le cas d'un hybride)"),
"nomsupgen" => array("Nom supra générique","","Monôme dont le rang est supérieur au genre"),
"hybp02" => array("Hybride parent 2","","Identifiant du nom (num_nom) du parent numéro 2 (dans le cas d'un hybride)"),
"stori" => array("Statut d'origine","","Code indiquant le statut d'origine du taxon dans la zone géographique définie par le référentiel (tableau 10)"),
"stint" => array("Statut d'introduction","","Code indiquant le statut d'introduction du taxon dans la zone géographique définie par le référentiel (tableau 11)"),
"stcult" => array("Statut de culture","","Code indiquant le statut de culture du taxon dans la zone géographique définie par le référentiel (tableau 12)"),
"notes" => array("Remarques","","Notes complémentaires"),
"nomadd" => array("Commentaires nomenclaturaux","","Commentaires nomenclaturaux pouvant être associés à un nom (voir tableau 8 du manuel technique)"),
"nsr" => array("Nom retenu sans auteur","","Nom scientifique du nom retenu sans auteur"),
"hom" => array("Homonymie","","Contient la valeur 1 si le nom possède un homonyme ou si le nom est un homonyme. Dans le cas contraire"),
"synprop" => array("Synonyme proprate","","Contient plusieurs identifiants numériques (num_nom) dans le cas d'un nom obtenu suite à la division d'un taxon. Contient un seul identifiant numérique (num_nom) dans le cas d'un nom obtenu suite à la fusion de plusieurs taxons."),
"syndout" => array("Synonyme douteux","","Contient la valeur 1 si le nom est un synonyme douteux. Dans le cas contraire"),
"synmapp" => array("Synonyme mal appliqué","","Contient la valeur 1 si le nom est un synonyme mal appliqué (cas des sensu). Dans le cas contraire"),
"synorth" => array("Synonyme orthographique","","Contient l'identifiant numérique du nom (num_nom) correctement orthographié"),
"orthori" => array("Orthographe originelle","","Contient la graphie originelle d'un nom non-conforme faisant l'objet d'une correction orthographique obligatoire"),
"hybp01n" => array("Hybride parent 1 notes","","Notes éventuelles sur l'hybridité et le parent numéro 1"),
"hybp02n" => array("Hybride parent 2 notes","","Notes éventuelles sur l'hybridité et le parent numéro 2"),
"cultgp" => array("Groupe de cultivar","","Nom d'un groupe de cultivar (sansl'abréviation « Gp »)"),
"cult" => array("Nom cultivar","","Nom d'un cultivar (sans les guillemets simple ou abréviation « cv. »)"),
"nomcomm" => array("Nom commercial","","Nom commercial d'une plante (en majuscule"),
"autres" => array("Autres","","colonnes spécifiques au référentiel"));
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Fonction d'affichage par défaut
*/
public function executerActionParDefaut() {
return $this->afficherDetail();
}
 
/**
* Affiche le détail d'un référentiel et la liste des actions possibles
*/
public function afficherDetail() {
$this->definirCommeModulePrincipal('Informations');
$donnees = $this->preparerPagePourDetailReferentielEtTelechargement();
 
$donnees['messages'] = $this->getMessages();
$this->traiterEsperluette($donnees);
$this->setSortie(self::RENDU_CORPS, $this->getVue('detail_referentiel', $donnees), false);
}
 
public function telecharger() {
$dossier = Config::get('chemin_tmp');
$parametres['ref'] = $this->referentiel;
$parametres['version'] = $_POST["version"];
$parametres['version'] = str_replace(".", "_", $parametres['version']);
if (isset($_POST["champs"])) $parametres['champs'] = implode(",",$_POST["champs"]);
if (isset($_POST["filtres"])) $parametres['filtres'] = implode(",",$_POST["filtres"]);
$this->supprimerAncienExport($dossier);
$ref = $this->referentielDao->exporter($parametres);
$meta = $this->metaDao->exporter($parametres);
 
$dossierDateEtNomDeFichier = date('Y_m_d').'/'.$this->referentiel.time().'.zip';
$cheminZip = $dossier.$dossierDateEtNomDeFichier;
$zip = new ZipArchive();
if($zip->open($cheminZip, ZipArchive::CREATE) === true) {
// Ajout des fichiers métadonnées, référentiel et manuel technique
$meta = str_replace("\\/", "/", $meta);
if (file_exists($meta)) {
$metazip = $zip->addFile($meta, "informations.csv");
}
if (file_exists($ref)) {
$refzip = $zip->addFile($ref, "referentiel.csv");
}
if (file_exists($dossier.'mtpr_V4_4.pdf')) {
$zip->addFile($dossier.'mtpr_V4_4.pdf', 'manuel_technique.pdf');
}
// Et on referme l'archive
$zip->close();
} else {
echo "Erreur : impossible d'ouvrir le fichier [$cheminZip]<br/>";
}
 
// on revient à la page de détail, avec un lien de téléchargement en prime
$donnees = $this->preparerPagePourDetailReferentielEtTelechargement();
if (file_exists($cheminZip)) {
$urlLien = Config::get("base_url_telechargements") . $dossierDateEtNomDeFichier;
$donnees['url_telechargement_zip'] = $urlLien;
}
$this->setSortie(self::RENDU_CORPS, $this->getVue('detail_referentiel', $donnees), false);
}
 
// exécute la partie commune entre l'action "detail" et l'action "telecharger"
protected function preparerPagePourDetailReferentielEtTelechargement() {
$donnees = array();
// Traitement de l'info sur le code du référentiel
if (isset($this->referentiel)) {
$this->construireMenu($this->referentiel);
$this->construireFilAriane($this->referentiel);
$donnees['referentiel'] = $this->referentiel;
$donnees['nom_referentiel'] = $this->referentielDao->getNom($this->referentiel);
$donnees['url_menu_test'] = $this->obtenirUrlMenuTest($this->referentiel);
$donnees['url_menu_versionnage'] = $this->obtenirUrlMenuVersionnage($this->referentiel);
$donnees['url_menu_consultation'] = $this->obtenirUrlMenuConsultation($this->referentiel);
$donnees['url_form_telech'] = $this->obtenirUrlDetailReferentielTelechargement($this->referentiel);
// suppression du téléchargement pour bdbfx
if ($this->referentiel != 'bdbfx') {
$donnees['versions'] = $this->afficherFormulaireTelechargementsReferentiels();
$donnees['infos_telechargements'] = $this->afficherTelechargementsReferentiels();
$donnees['colonnesOrdonnees'] = $this->colonnesOrdonnees;
}
} else {
$this->addMessage("Aucun code de projet de référentiel n'est indiqué (Ex. bdtfx).");
}
return $donnees;
}
 
private function supprimerAncienExport($dossier) {
$pointeur = opendir($dossier);
// si pas d'erreur d'ouverture du dossier on lance le scan
if( $pointeur != false ) {
// Parcours du repertoire
while( $ss_dossier = readdir($pointeur)) {
if($ss_dossier != "." && $ss_dossier != "..") {
$chemin_complet = $dossier . $ss_dossier;
if (is_dir($chemin_complet) && $ss_dossier < date('Y_m_d')) {
$fichiers = scandir($chemin_complet);
foreach ($fichiers as $fichier) {
if($fichier != "." && $fichier != "..") {
unlink($chemin_complet."/".$fichier);
}
}
rmdir($chemin_complet);
}
}
}
closedir($pointeur);
}
}
private function afficherFormulaireTelechargementsReferentiels() {
$versions = $this->traitementDao->getTraitementsTermines($this->referentiel, 'versionnage');
if ($versions != null) {
foreach ($versions as $id => $version) {
$versions[$id] = (unserialize($versions[$id]["script_parametres"]));
}
}
return $versions;
}
private function afficherTelechargementsReferentiels() {
$infos_telechargements = array();
// Recherche des traitements déjà effectué
$resultat = $this->traitementDao->getTraitementsTermines($this->referentiel, 'versionnage');
if (is_array($resultat)) {
foreach ($resultat as &$traitement) {
$infos_traitement = $this->traitementDao->getInfos($traitement['id_traitement']);
if ($infos_traitement != false) {
// Recherche des fichiers disponibles
$infos_zip = $this->obtenirUrlsZipPourTraitement($infos_traitement);
$infos_telechargements[] = array(
'infos_traitement' => $traitement,
'description' => $this->creerDescriptionTelechargement($traitement),
'urls_zip' => $infos_zip);
}
}
}
return $infos_telechargements;
}
private function creerDescriptionTelechargement($traitement) {
return strftime('%e %B %Y', strtotime($traitement['meta_date_creation'])).' ('.$this->referentielDao->getNom($this->referentiel).') ';
}
}
?>
/branches/v2.0-betulales/interfaces/controleurs/Recherche.php
New file
0,0 → 1,232
<?php
// declare(encoding='UTF-8');
/**
* classe Controleur du module Recherche.
*
* @package Referentiel
* @category Php5
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id: Recherche.php 147 2010-09-06 09:37:22Z jpm $
*/
class Recherche extends AppliControleur {
private $chaine_recherche = null;
private static $url_recherche = null;
private static $url_fiche_taxon = null;
private $referentiel = null;
private $donnees_par_page;
private $donnees_par_page_choix;
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Fonction d'affichage par défaut
*/
public function executerActionParDefaut() {
return $this->rechercher();
}
/**
* Charge le moteur de recherche et l'envoie à la vue.
*/
public function chargerMoteurRecherche($ref = null, $affiche_rech_avancee = null) {
$donnees = array();
$this->referentiel = $ref;
// Gestion des données de la requête
$donnees['recherche'] = htmlspecialchars($this->obtenirChaineRecherche());
 
// Gestion des urls
$donnees['url_form'] = $this->obtenirUrlRecherche($this->referentiel);
$donnees['url_referentiel'] = $this->referentiel;
$referentielDao = new ReferentielDao();
$donnees['nom_referentiel'] = strtolower($referentielDao->getNom($this->referentiel));
$donnees['code_referentiel'] = strtoupper($this->referentiel);
$donnees['date_miseajour'] = $referentielDao->getDateMiseAJour($this->referentiel);
$donnees['forum_referentiel'] = Config::get('forum.'.$this->referentiel);
$donnees['site_referentiel'] = Config::get('site.'.$this->referentiel);
$donnees['url_module'] = 'Recherche';
$donnees['url_action'] = 'rechercher';
$donnees['affiche_moteur'] = $affiche_rech_avancee;
self::$url_recherche = $this->obtenirUrlRecherche('%s','%s');
self::$url_fiche_taxon = $this->obtenirUrlFicheTaxon($this->referentiel, '%s');
// Gestion du squelette et de la sortie
$this->setSortie(self::RENDU_TETE, $this->getVue('moteur', $donnees));
}
private function obtenirChaineRecherche() {
$chaine = '';
if (!is_null($this->chaine_recherche)) {
$chaine = $this->chaine_recherche;
} else if (isset($_GET['recherche'])) {
// Pré-traitement de la chaine de recherche
$chaine = $_GET['recherche'];
// Suppression des slash ajouté automatiquement par PHP devant les guillemets
$chaine = stripslashes($chaine);
// Mémorisation de la chaine
$this->memoriserChaineRecherche($chaine);
// Stockage dans la classe pour éviter d'effectuer à nouveau le traitement ci-dessus
$this->chaine_recherche = $chaine;
} else if (isset($_SESSION['ref']['recherche'])) {
$chaine = $_SESSION['ref']['recherche'];
}
return $chaine;
}
private function memoriserChaineRecherche($chaine) {
$_SESSION['ref']['recherche'] = $chaine;
}
 
// url pour les exemples du moteur de recherche
public static function getUrlRecherche($chaine, $referentiel = null) {
$url = '';
if ($referentiel == null) $referentiel = $this->referentiel;
if (!is_null(self::$url_recherche)) {
// L'utilisation d'urlencode nécessiate de pré-encodé la chaine dans le format de sortie si nécessaire
if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
$chaine = mb_convert_encoding($chaine, Config::get('sortie_encodage'), Config::get('appli_encodage'));
}
$chaine = urlencode($chaine);
$url = sprintf(self::$url_recherche, $referentiel, $chaine);
}
return $url;
}
public static function getUrlFicheTaxon($taxon) {
$url = '';
if (!is_null(self::$url_fiche_taxon)) {
$url = sprintf(self::$url_fiche_taxon, $taxon['num_nom']);
}
return $url;
}
/**
* Recherche sur référentiel.
* @return string la vue correspondante
*/
public function rechercher() {
// Paramétres de pagination par défault
$this->donnees_par_page = Config::get('resultat_par_page_defaut');
$this->donnees_par_page_choix = Config::get('resultat_par_page_choix');
$donnees = array();
$rechercheDao = new RechercheDao();
$parametres = array('mots' => '*');
// code du référentiel courant
if (isset($_GET['ref'])) {
$this->referentiel = strtolower($_GET['ref']);
}
// Gestion des squelettes
$this->definirCommeModulePrincipal(get_class($this));
$this->construireMenu($this->referentiel);
$this->construireFilAriane($this->referentiel);
$this->chargerMoteurRecherche($this->referentiel, 10);
// Récupération des paramètres de l'url
$chaine_de_recherche = $this->obtenirChaineRecherche();
if (!empty($chaine_de_recherche)) {
$this->url->setVariablesRequete(array('module' => 'Recherche',
'action' => 'rechercher',
'ref' => $this->referentiel,
'recherche' => $chaine_de_recherche));
}
$parametres = $this->parserChaineDeRecherche($chaine_de_recherche);
$parametres['ref'] = $this->referentiel;
// requête spéciale de recherche de tous les synonymes et du nom retenu d'un paramétre
if (isset($parametres['tax']) && ($parametres['tax'] == 1)) {
$resultat = $this->chercherSynonymes($rechercheDao, $parametres);
} else if (isset($parametres['classif'])) {
$this->chargerTableauManuel('presence');
$donnees['valeur_presence'] = $this->tableau_manuel['presence'];
$donnees['referentiel'] = $this->referentiel;
$donnees['fragmenteur'] = $this->gererFragmenteur($rechercheDao, $parametres, 'NombreClassif');
$donnees['resultats'] = $rechercheDao->chercher('Classification', $parametres);
$resultat = $this->getVue('resultat_recherche', $donnees);
} else {
$this->chargerTableauManuel('presence');
$donnees['valeur_presence'] = $this->tableau_manuel['presence'];
$donnees['referentiel'] = $this->referentiel;
$donnees['fragmenteur'] = $this->gererFragmenteur($rechercheDao, $parametres);
$donnees['resultats'] = $rechercheDao->chercher('ParDefaut', $parametres);
$resultat = $this->getVue('resultat_recherche', $donnees);
}
$this->setSortie(self::RENDU_CORPS, $resultat);
}
private function chercherSynonymes($rechercheDao, $parametres){
$this->donnees_par_page = 2;
$this->donnees_par_page_choix = '1,2,5,10';
$donnees['referentiel'] = $this->referentiel;
$donnees['fragmenteur'] = $this->gererFragmenteur($rechercheDao, $parametres, 'NombreTaxon');
$resultats = $rechercheDao->chercher('ParTaxon', $parametres);
foreach ($resultats as $res) {
if ($res['num_nom'] == $res['num_nom_retenu']) {
$donnees['resultats']['nom_retenu'][$res['num_nom_retenu']] = $res;
} else {
$donnees['resultats'][$res['num_nom_retenu']][$res['num_nom']] = $res;
}
}
$resultat = $this->getVue('resultat_recherche_taxon', $donnees);
return $resultat;
}
private function gererFragmenteur($rechercheDao, $parametres, $type = 'Nombre') {
// Gestion du nombre de résultats
$donnees_total = $rechercheDao->chercherStructureNbre($type, $parametres);
// Gestion du fragmenteur
$options = array(
'url' => $this->url,
'donnees_total' => $donnees_total,
'donnees_par_page' => $this->donnees_par_page,
'donnees_par_page_choix' => $this->donnees_par_page_choix);
$fragmenteur = Composant::fabrique('fragmenteur', $options);
$donnees['fragmenteur'] = $fragmenteur->executer();
list($de, $a) = $fragmenteur->getDeplacementParPageId();
$this->url->unsetVariablesRequete(array('recherche', 'page'));
// Gestion de l'accès aux données
$rechercheDao->setLimitation(($de - 1), $fragmenteur->getDonneesParPage());
$rechercheDao->setDistinction(1);
return $donnees['fragmenteur'];
}
private function parserChaineDeRecherche($chaine) {
$mots = preg_split('/ /i', $chaine, -1, PREG_SPLIT_NO_EMPTY);
$parametres = array('mots' => '');
$cle_precedente = null;
foreach ($mots as $mot) {
if (preg_match('/^(sg|gen|sp|ssp|au|an|nn|bib|nr|tax|pre|taxref|classif|rg):(.*)$/', $mot, $match)) {
$cle = $match[1];
$cle_precedente = $cle;
$valeur = $match[2];
$parametres[$cle] = $valeur;
} else if (!is_null($cle_precedente)) {
$parametres[$cle_precedente] .= ' '.$mot;
} else if (is_null($cle_precedente)) {
if (empty($parametres['mots'])) {
$parametres['mots'] = $mot;
} else {
$parametres['mots'] .= ' '.$mot;
}
}
}
return $parametres;
}
// charger tableau de $this->manuel
private function chargerTableauManuel($titreTableau) {
$champs = explode(',', $this->manuel[$titreTableau]);
foreach ($champs as $champ) {
list($champ_nom, $type) = explode('=', trim($champ));
$this->tableau_manuel[$titreTableau][$champ_nom] = $type;
}
}
}
/branches/v2.0-betulales/interfaces/controleurs/Arbre.php
New file
0,0 → 1,141
<?php
// declare(encoding='UTF-8');
/**
* Classe Arbre du module Consultation.
* Permet de consultater un référentiel sous forme d'arbre
*
* @package Referentiel
* @category Php5.2
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
class Arbre extends AppliControleur {
private $referentiel = null;
private $rechercheDao = null;
public function __construct() {
parent::__construct();
// Récupération de paramètres
if (isset($_GET['ref'])) { // code du projet courant
$this->referentiel = strtolower($_GET['ref']);
}
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Fonction d'affichage par défaut
*/
public function executerActionParDefaut() {
$this->definirCommeModulePrincipal(get_class($this));
$this->construireMenu($this->referentiel);
$this->construireFilAriane($this->referentiel);
$this->executerActionReferentiel('Arbre', 'afficherArbre', $this->referentiel, false);
}
public function afficherArbre() {
$donnees = array();
$donnees['resultats'] = $this->chercherFamilles();
$nns = array();
foreach($donnees['resultats'] as $resultat) {
$nns[] = $resultat['num_nom'];
}
$donnees['resultats_nb_infra'] = $this->chercherNombreInfras($nns);
$donnees['resultats_nb_syn'] = $this->chercherNombreSynonymes($nns);
$donnees['url_service_tpl'] = Config::get('url_jrest');
$donnees['url_sous_taxons_tpl'] = $this->obtenirUrlMenuBranche($this->referentiel, '');
$donnees['url_synonymes_tpl'] = $this->obtenirUrlMenuBrancheSynonyme($this->referentiel, '');
$donnees['url_fiche_taxon_tpl'] = $this->obtenirUrlFicheTaxon($this->referentiel, '%s');
$donnees['referentiel'] = $this->referentiel;
$resultat = $this->getVue('arbre_taxon', $donnees);
$this->setSortie(self::RENDU_CORPS, $resultat);
}
public function afficherBranche() {
$donnees = array();
$donnees['resultats_infra'] = $this->chercherInfras($_GET['num_nom']);
foreach($donnees['resultats_infra'] as $resultat) {
$nns[] = $resultat['num_nom'];
}
$donnees['resultats_nb_infra'] = $this->chercherNombreInfras($nns);
$donnees['resultats_nb_syn'] = $this->chercherNombreSynonymes($nns);
$resultat = json_encode($donnees);
header('Content-type: application/json');
echo $resultat;
exit;
}
public function afficherBrancheSynonyme() {
$donnees['resultats_syn'] = $this->chercherSynonymes($_GET['num_nom']);
$resultat = json_encode($donnees);
header('Content-type: application/json');
echo $resultat;
exit;
}
private function getDao() {
if($this->rechercheDao == null) {
$this->rechercheDao = new RechercheDao();
}
return $this->rechercheDao;
}
private function chercherFamilles() {
$rechercheDao = $this->getDao();
$rechercheDao->setLimitation(0,10000);
$parametres = array('mots' => '*',
'ref' => $this->referentiel,
'rg' => 180);
$resultats = $rechercheDao->chercher('ParDefaut', $parametres);
return $resultats;
}
private function chercherNombreSynonymes($tableau_nn) {
$rechercheDao = $this->getDao();
$parametres_syn = array('mots' => '*',
'ref' => $this->referentiel,
'nn' => implode(',', $tableau_nn));
$resultats_nb_syn = $rechercheDao->chercher('NombreSynonymeParTaxon', $parametres_syn);
return $resultats_nb_syn;
}
private function chercherSynonymes($num_nom) {
$rechercheDao = $this->getDao();
$parametres_syn = array('mots' => '*',
'ref' => $this->referentiel,
'nn' => $num_nom);
$resultats_syn = $rechercheDao->chercher('ParTaxon', $parametres_syn);
return $resultats_syn;
}
private function chercherNombreInfras($tableau_nn) {
$rechercheDao = $this->getDao();
$parametres_infra = array('mots' => '*',
'ref' => $this->referentiel,
'classif' => 'infra',
'nn' => implode(',', $tableau_nn));
$resultats_nb_infra = $rechercheDao->chercher('NombreClassifParTaxon', $parametres_infra);
return $resultats_nb_infra;
}
private function chercherInfras($num_nom) {
$rechercheDao = $this->getDao();
$parametres = array('mots' => '*',
'ref' => $this->referentiel,
'classif' => 'infra',
'nn' => $num_nom);
$resultats_infra = $rechercheDao->chercher('Classification', $parametres);
return $resultats_infra;
}
}
?>
/branches/v2.0-betulales/interfaces/controleurs/Traitement.php
New file
0,0 → 1,90
<?php
// declare(encoding='UTF-8');
/**
* Classe Controleur du module Traitement.
* Affichage les infos sur l'ensemble des résultats d'un traitement.
*
* @package Referentiel
* @category Php5.2
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
class Traitement extends AppliControleur {
private $referentiel = null;
private $traitement = null;
private $traitementId = null;
private $traitementDao = null;
private $resultatDao = null;
public function __construct() {
parent::__construct();
// Récupération de paramêtres
if (isset($_GET['id-t'])) { // id du traitement courant
$this->traitementId = strtolower($_GET['id-t']);
}
if (isset($_GET['ref'])) { // code du projet courrant
$this->referentiel = strtolower($_GET['ref']);
}
// Chargement des DAO nécessaires
if (isset($this->traitementId)) {
$this->traitementDao = new TraitementDao();
$this->resultatDao = new ResultatDao();
}
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Fonction d'affichage par défaut, elle appelle la liste des administrateurs
*/
public function executerActionParDefaut() {
return $this->afficherTraitement();
}
/**
* Affiche le formulaire de demande de traitement
*/
public function afficherTraitement() {
$donnees = array();
// Traitement de l'info sur le code du référentiel
if (isset($this->traitementId)) {
// Recherche d'info sur le traitement
$infos = $this->traitementDao->getInfos($this->traitementId);
if ($infos != false) {
$this->traitement = $infos;
$donnees['traitement'] = $this->traitement;
} else {
$this->addMessage("L'identifiant de traitement n'est pas indexé dans la base de données.");
}
 
// Spécificité du script de versionnage
$donnees['urls_zip'] = $this->obtenirUrlsZipPourTraitement($this->traitement);
// Recherche des résultats du traitement
$infos = $this->resultatDao->getResultatsTraitement($this->traitementId);
if ($infos != false) {
// Ajout de l'url vers la fiche du resultat
foreach ($infos as &$resultat) {
$resultat['url'] = $this->obtenirUrlFicheResultat($this->referentiel, $resultat['id_resultat']);
}
$donnees['resultats'] = $infos;
}
} else {
$this->addMessage("Aucun identifiant de traitement n'a été indiqué.");
}
$donnees['messages'] = $this->getMessages();
$this->traiterEsperluette($donnees);
$this->setSortie(self::RENDU_CORPS, $this->getVue('traitement', $donnees), false);
$this->construireMenu($this->referentiel);
$this->construireFilAriane($this->referentiel, $this->traitementId);
}
}
?>
/branches/v2.0-betulales/interfaces/controleurs/Test.php
New file
0,0 → 1,119
<?php
// declare(encoding='UTF-8');
/**
* Classe Controleur du module Test.
*
* TODO : refactoriser l'ensemble des tests!
*
* @package Referentiel
* @category Php5.2
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
class Test extends AppliControleur {
const SCRIPT_A_LANCER = 'tests';
private $referentiel = null;
private $referentielDao = null;
private $traitementDao = null;
public function __construct() {
parent::__construct();
// Récupération de paramêtres
if (isset($_GET['ref'])) { // code du projet courrant
$this->referentiel = strtolower($_GET['ref']);
}
// Chargement des DAO nécessaires
$this->referentielDao = new ReferentielDao();
$this->traitementDao = new TraitementDao();
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Fonction d'affichage par défaut, elle appelle la liste des administrateurs
*/
public function executerActionParDefaut() {
return $this->afficherInterface();
}
/**
* Affiche le formulaire de demande de traitement
*/
public function afficherInterface() {
if ($this->authentifierCoordinateur()) {
$donnees = array();
$this->definirCommeModulePrincipal(get_class($this));
$this->url->unsetVariablesRequete(array('module', 'action', 'ref'));
$donnees['url_form'] = $this->url->getUrl();
$donnees['url_module'] = 'Test';
$donnees['url_action_demande'] = 'demanderTraitement';
$donnees['url_action_rafraichir'] = 'afficherInterface';
$donnees['url_action_importer'] = 'importerReferentiel';
$donnees['url_importation'] = $donnees['url_form'].
'?module='.$donnees['url_module'].'&action='.$donnees['url_action_importer'].'&ref='.$this->referentiel;
// Traitement de l'info sur le code du référentiel
if (isset($this->referentiel)) {
// Récupération du nom du référentiel courrant
$donnees['nom_referentiel'] = $this->referentielDao->getNom($this->referentiel);
// Récupération du référentiel courrant
$donnees['ref'] = $this->referentiel;
// Recherche des traitements en attente
$donnees['traitements_en_attente'] = $this->traitementDao->getTraitementsEnAttente($this->referentiel, self::SCRIPT_A_LANCER);
// Recherche des traitements en cours d'éxecution
$donnees['traitements_en_cours'] = $this->traitementDao->getTraitementsEnCours($this->referentiel, self::SCRIPT_A_LANCER);
// Recherche des traitements déjà effectué
$resultat = $this->traitementDao->getTraitementsTermines($this->referentiel, self::SCRIPT_A_LANCER);
if (is_array($resultat)) {
// Ajout de l'url vers la fiche du traitement
foreach ($resultat as &$traitement) {
$traitement['url'] = $this->obtenirUrlFicheTraitement($this->referentiel, $traitement['id_traitement']);
}
$donnees['traitements_termines'] = $resultat;
}
} else {
$this->addMessage("Aucun code de projet de référentiel n'est indiqué (Ex. bdtfx).");
}
$donnees['messages'] = $this->getMessages();
$this->setSortie(self::RENDU_CORPS, $this->getVue('form_tests', $donnees), false);
$this->construireMenu($this->referentiel);
$this->construireFilAriane($this->referentiel);
}
}
/**
* Lance l'ajout d'un traitement
*/
public function demanderTraitement() {
$this->ajouterTraitement($this->referentiel, self::SCRIPT_A_LANCER);
$this->afficherInterface();
}
/**
* Lance l'importation d'un référentiel au format taxref dans une table bdnt_taxref
*/
public function importerReferentiel() {
if (isset($_FILES['nom_fichier']) && $_FILES['nom_fichier']['name'] != '') {
$destination = Config::get('chemin_tmp').$_FILES['nom_fichier']['name'];
move_uploaded_file($_FILES['nom_fichier']['tmp_name'], $destination);
$this->ajouterTraitementParametre($this->referentiel, $destination, 'importation');
} else {
$this->addMessage("Aucun fichier n'a été précisé.");
}
$this->afficherInterface();
}
}
?>
/branches/v2.0-betulales/interfaces/controleurs/Versionnage.php
New file
0,0 → 1,273
<?php
// declare(encoding='UTF-8');
/**
* Classe Controleur du module Versionnage.
* Permet de publier une nouvelle version d'un référentiel de travail.
*
* @package Referentiel
* @category Php5.2
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
class Versionnage extends AppliControleur {
const SCRIPT_A_LANCER = 'versionnage';
private $version = array('titre', 'acronyme', 'version', 'date_prod',
'auteur_principal', 'coordinateur', 'editeur', 'contact',
'contributeur',
'classification', 'dom_tax', 'dom_geo', 'dom_code',
'source', 'copyright', 'licence', 'referencement',
'errata', 'notes');
private $referentiel = null;
private $referentielDao = null;
private $traitementDao = null;
public function __construct() {
parent::__construct();
// Récupération de paramêtres
if (isset($_GET['ref'])) { // code du projet courrant
$this->referentiel = strtolower($_GET['ref']);
}
// Chargement des DAO nécessaires
$this->referentielDao = new ReferentielDao();
$this->traitementDao = new TraitementDao();
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
* Fonction d'affichage par défaut
*/
public function executerActionParDefaut() {
return $this->afficherInterface();
}
 
/**
* Affiche le formulaire de demande de versionnage
*/
public function afficherInterface() {
if ($this->authentifierCoordinateur()) {
$donnees = array();
$this->definirCommeModulePrincipal(get_class($this));
// Paramêtres pour l'url du formulaire
$this->url->unsetVariablesRequete(array('module', 'action', 'ref'));
$donnees['url_form'] = $this->obtenirUrlDemandeVersionnage($this->referentiel);
$donnees['url_module'] = 'Versionnage';
$donnees['url_action_rafraichir'] = 'afficherInterface';
$donnees['version'] = $this->instancierChampsVersionnage();
$donnees['version'] = $this->traiterCasesACocher($donnees['version']);
// Récupération des paramètres de configuration du manuel des référentiels
$donnees['domaine_geo'] = explode(';', $this->manuel['domaine_geo']);
$donnees['domaine_taxo'] = explode(';', $this->manuel['domaine_taxo']);
$donnees['domaine_code'] = explode(';', $this->manuel['domaine_code']);
// Traitement de l'info sur le code du référentiel
if (isset($this->referentiel)) {
// Récupération du nom du référentiel courrant
$donnees['nom_referentiel'] = $this->referentielDao->getNom($this->referentiel);
// Récupération du référentiel courrant
$donnees['ref'] = $this->referentiel;
// Recherche des traitements en attente
$donnees['traitements_en_attente'] = $this->traitementDao->getTraitementsEnAttente($this->referentiel, self::SCRIPT_A_LANCER);
// Recherche des traitements en cours d'éxecution
$donnees['traitements_en_cours'] = $this->traitementDao->getTraitementsEnCours($this->referentiel, self::SCRIPT_A_LANCER);
// Recherche des traitements déjà effectué
$resultat = $this->traitementDao->getTraitementsTermines($this->referentiel, self::SCRIPT_A_LANCER);
if (is_array($resultat)) {
// Ajout de l'url vers la fiche du traitement
foreach ($resultat as &$traitement) {
$traitement['url'] = $this->obtenirUrlFicheTraitement($this->referentiel, $traitement['id_traitement']);
}
$donnees['traitements_termines'] = $resultat;
}
} else {
$this->addMessage("Aucun code de projet de référentiel n'est indiqué (Ex. bdtfx).");
}
$donnees['messages'] = $this->getMessages();
$this->traiterEsperluette($donnees);
$this->setSortie(self::RENDU_CORPS, $this->getVue('form_version', $donnees), false);
$this->construireMenu($this->referentiel);
$this->construireFilAriane($this->referentiel);
}
}
public function instancierChampsVersionnage() {
$version = array();
foreach ($this->version as $champ) {
if (isset($_POST[$champ])) {
$version[$champ] = $this->supprimerSlash($_POST[$champ]);
} else {
$version[$champ] = $this->getValeurParDefaut($champ);
}
}
return $version;
}
public function getValeurParDefaut($champ) {
$valeur = '';
if ('date_prod' == $champ) {
$valeur = date('Y-m-d');
}
return $valeur;
}
 
private function traiterCasesACocher(Array $donnees) {
foreach ($donnees as $cle => $valeur) {
if (is_array($valeur)) {
$this->traiterEsperluette($valeur);
$donnees[$cle] = array_flip($valeur);
}
}
return $donnees;
}
/**
* Lance l'ajout d'un traitement
*/
public function demanderTraitement() {
if ($this->verifierMetadonnees()) {
$parametres = $this->instancierChampsVersionnage();
$parametres_serialises = serialize($parametres);
$this->ajouterTraitementParametre($this->referentiel, $parametres_serialises, self::SCRIPT_A_LANCER);
}
$this->afficherInterface();
}
/**
* Vérifie les données du formulaire
*/
public function verifierMetadonnees() {
$ok = true;
if (! $this->verifierChampsObligatoires()) {
$ok = false;
}
if (! $this->verifierChampsMajuscule()) {
$ok = false;
}
if (! $this->verifierChampsContact()) {
$ok = false;
}
if (! $this->verifierChampsCourriel()) {
$ok = false;
}
return $ok;
}
public function verifierChampsObligatoires() {
$ok = true;
$champs_obligatoires = array('titre' => 'Titre',
'acronyme' => 'Acronyme',
'version' => 'Version',
'auteur_principal' => 'Auteur Principal',
'coordinateur' => 'coordinateur',
'contact' => 'Courriel de contact',
'classification' => 'Classification par défaut',
'dom_tax' => 'Domaine taxonomique',
'dom_geo' => 'Domaine géographique',
'dom_code' => 'Codes botaniques utilisés',
'referencement' => 'Comment citer ce référentiel?',
'errata' => 'Errata (URL)');
foreach ($champs_obligatoires as $champ_id => $champ_nom) {
if (!isset($_POST[$champ_id]) || empty($_POST[$champ_id])) {
$this->addMessage("Le champ '$champ_nom' doit être obligatoirement rempli.");
$ok = false;
}
}
return $ok;
}
public function verifierChampsMajuscule() {
$ok = true;
$champs_en_majuscule = array('acronyme' => 'Acronyme');
foreach ($champs_en_majuscule as $champ_id => $champ_nom) {
if (isset($_POST[$champ_id]) && ! $this->verifierMajusculeSansAccent($_POST[$champ_id])) {
$this->addMessage("Le champ '$champ_nom' doit être obligatoirement composé de majuscules non accentuées.");
$ok = false;
}
}
return $ok;
}
/**
* Vérifie la mise en majuscule
*/
public function verifierMajusculeSansAccent($txt) {
$ok = (preg_match('/^[A-Z]+$/', $txt)) ? true : false;
return $ok;
}
public function verifierChampsContact() {
$ok = true;
$champs_contact = array('auteur_principal' => 'Auteur Principal',
'coordinateur' => 'coordinateur',
'contributeur' => 'Auteurs/Contributeurs');
foreach ($champs_contact as $champ_id => $champ_nom) {
if (isset($_POST[$champ_id]) && ! $this->verifierContact($_POST[$champ_id])) {
$this->addMessage("Le champ '$champ_nom' n'est pas au format : Prénom1 NOM1 (Organisation1) [courriel1], Prénom2 NOM2 (Organisation2) [courriel2].");
$ok = false;
}
}
return $ok;
}
/**
* Vérifie que le texte est au format :
* Prénom1 NOM1 (Organisation1) <courriel1>,
* Prénom2 NOM2 (Organisation2) <courriel2>.
*/
public function verifierContact($txt) {
$ok = true;
if ($txt != '') {
$pp = Pattern::PRENOM;
$pn = Pattern::NOM;
$po = "\([^\)]+\)";// Pattern organisation
$pc = Pattern::COURRIEL;
 
$contacts = explode(',', $txt);
foreach ($contacts as $contact) {
$contact = trim($contact);
if (! preg_match("/^$pp $pn $po \[$pc\](?:|.)$/u", $contact)) {
$ok = false;
}
}
}
return $ok;
}
public function verifierChampsCourriel() {
$ok = true;
$champs_courriel = array('contact' => 'Courriel de contact');
foreach ($champs_courriel as $champ_id => $champ_nom) {
if (isset($_POST[$champ_id]) && ! $this->verifierCourriel($_POST[$champ_id])) {
$this->addMessage("Le champ '$champ_nom' ne comptient pas une adresse de courriel valide.");
$ok = false;
}
}
return $ok;
}
/**
* Vérifie que le texte est une adresse de courriel valide.
*/
public function verifierCourriel($txt) {
$pattern_courriel = Pattern::COURRIEL;
$ok = (preg_match('/^'.$pattern_courriel.'+$/', $txt)) ? true : false;
return $ok;
}
}
?>
/branches/v2.0-betulales/interfaces/.
New file
Property changes:
Added: svn:ignore
+framework.php