Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 1148 → Rev 1149

/trunk/papyrus/applettes/nouveaute/langues/nouv_langue_fr.inc.php
New file
0,0 → 1,92
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 5.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of papyrus_bp. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: nouv_langue_fr.inc.php,v 1.1 2006-12-12 17:16:22 jp_milcent Exp $
/**
* papyrus_bp - nouv_langue_fr.inc.php
*
* Description :
*
*@package papyrus_bp
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 1999-2006
*@version $Revision: 1.1 $ $Date: 2006-12-12 17:16:22 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTÊTE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Texte affiché quand le paramètre "nombre" est abscent.*/
define('NOUV_LG_ERREUR_NOMBRE', "Applette NOUVEAUTÉ : le paramètre 'nombre' est obligatoire dans %s !");
/** Texte affiché quand le type ne convient.*/
define('NOUV_LG_ERREUR_TYPE', "Applette NOUVEAUTÉ : le paramètre 'type' peut prendre les valeurs 'majeure' ou 'mineure' dans : %s !");
/** Texte affiché quand on n'a pas de page à afficher.*/
define('NOUV_LG_INFO_ZERO_PAGE', "Applette NOUVEAUTÉ : aucune page n'a été trouvée pour : %s !");
 
/** Texte affiché quand l'auteur est inconnu.*/
define('NOUV_LG_INCONNU_AUTEUR', 'Anonyme');
/** Texte affiché quand le titre est vide.*/
define('NOUV_LG_INCONNU_TITRE', 'Titre inconnu');
 
/** Mois de janvier.*/
define('NOUV_LG_MOIS_01', 'janvier');
/** Mois de février.*/
define('NOUV_LG_MOIS_02', 'février');
/** Mois de mars.*/
define('NOUV_LG_MOIS_03', 'mars');
/** Mois d'avril.*/
define('NOUV_LG_MOIS_04', 'avril');
/** Mois de mai.*/
define('NOUV_LG_MOIS_05', 'mai');
/** Mois de juin.*/
define('NOUV_LG_MOIS_06', 'juin');
/** Mois de juillet.*/
define('NOUV_LG_MOIS_07', 'juillet');
/** Mois d'août'.*/
define('NOUV_LG_MOIS_08', 'août');
/** Mois de septembre.*/
define('NOUV_LG_MOIS_09', 'septembre');
/** Mois d'octobre.*/
define('NOUV_LG_MOIS_10', 'octobre');
/** Mois de novembre.*/
define('NOUV_LG_MOIS_11', 'novembre');
/** Mois de décembre.*/
define('NOUV_LG_MOIS_12', 'décembre');
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/papyrus/applettes/nouveaute/squelettes/nouv_liste.tpl.html
New file
0,0 → 1,42
<!-- MOT CLES - DEBUT -->
<?php if ($erreurs) : ?>
<?php foreach ($erreurs as $erreur) : ?>
<p class="pap_erreur"><?=$erreur;?></p>
<?php endforeach; ?>
<?php elseif ($informations) : ?>
<?php foreach ($informations as $information) : ?>
<p class="pap_info"><?=$information;?></p>
<?php endforeach; ?>
<?php else : ?>
 
<ul class="page_liste">
<?php foreach ($pages as $page) : ?>
<li class="page_modification_<?=$page['type'];?>">
<h2 class="page_titre"><a href="<?=$page['url'];?>"><span class="page_titre"><?=$page['titre'];?></span></a></h2>
<dl>
<dt class="page_auteur">Auteur(s)&nbsp;:</dt>
<dd><?=$page['auteur'];?></dd>
<dt class="page_contributeur">Contributeur(s)&nbsp;:</dt>
<dd><?=$page['contributeur'];?></dd>
<dt class="page_modification_date">Modifié le&nbsp;:</dt>
<dd>
<span class="page_creation_heure"><?=$page['heure'];?></span>
<span class="page_separateur_heure">:</span>
<span class="page_creation_minute"><?=$page['minute'];?></span>
<span class="page_separateur_heure">:</span>
<span class="page_creation_seconde"><?=$page['seconde'];?></span>
<span class="page_separateur_date_heure"> - </span>
<span class="page_creation_jour"><?=$page['jour'];?></span>
<span class="page_creation_mois"><?=$page['mois'];?></span>
<span class="page_creation_annee"><?=$page['annee'];?></span>
</dd>
<dt class="page_description">Description&nbsp;:</dt>
<dd><?=$page['description'];?></dd>
<dt class="page_resumer_modification_">Résumer modification&nbsp;:</dt>
<dd><?=$page['resumer'];?></dd>
</dl>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<!-- MOT CLES - FIN -->
/trunk/papyrus/applettes/nouveaute/nouveaute.php
New file
0,0 → 1,281
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 5.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of papyrus_bp. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: nouveaute.php,v 1.1 2006-12-12 17:16:22 jp_milcent Exp $
/**
* papyrus_bp - nouveaute.php
*
* Description :
*
*@package papyrus_bp
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 1999-2006
*@version $Revision: 1.1 $ $Date: 2006-12-12 17:16:22 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTÊTE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherNouveaute';
$GLOBALS['_GEN_commun']['info_applette_balise'] = '\{\{[Nn]ouveaute'.
'(?:\s*'.
'(?:'.
'(nombre="[^"]+")|'.
'(categorie="[^"]+")|'.
'(type="[^"]+")|'.
'(site="[^"]+")|'.
')'.
')+'.
'\s*\}\}';
 
// --------------------------------------------------------------------------------------------------------
/** Inclusion du fichier de configuration de cette application.*/
require_once GEN_CHEMIN_APPLETTE.'nouveaute'.GEN_SEP.'configuration'.GEN_SEP.'nouv_configuration.inc.php';
 
// Inclusion des fichiers de traduction de l'applette NOUV de Papyrus
if (file_exists(NOUV_CHEMIN_LANGUE.'nouv_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
require_once NOUV_CHEMIN_LANGUE.'nouv_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
} else {
/** Inclusion du fichier de traduction par défaut.*/
require_once NOUV_CHEMIN_LANGUE.'nouv_langue_'.NOUV_I18N_DEFAUT.'.inc.php';
}
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Fonction afficherNouveaute() - Retourne la liste des pages modifiées récement.
*
* Cette fonction retourne la liste des pages modifiées récement.
*
* @param array contient les arguments de la fonction.
* @param array tableau global de Papyrus.
* @return string HTML la liste de menus.
*/
function afficherNouveaute($tab_applette_arguments, $_GEN_commun)
{
// Initialisation des variables
$sortie = '';
$GLOBALS['_NOUVEAUTE_']['erreurs'] = array();
$GLOBALS['_NOUVEAUTE_']['informations'] = array();
$GLOBALS['_NOUVEAUTE_']['pages'] = array();
//+----------------------------------------------------------------------------------------------------------------+
// Gestion des arguments
$balise = $tab_applette_arguments[0];
$tab_arguments = $tab_applette_arguments;
unset($tab_arguments[0]);
foreach($tab_arguments as $argument) {
if ($argument != '') {
$tab_parametres = explode('=', $argument);
$options[$tab_parametres[0]] = trim($tab_parametres[1], '"');
}
}
//+----------------------------------------------------------------------------------------------------------------+
// Gestion des erreurs de paramètrage
if (!isset($options['nombre'])) {
$GLOBALS['_NOUVEAUTE_']['erreurs'][] = sprintf(NOUV_LG_ERREUR_NOMBRE, $balise);
}
if (!isset($options['type'])) {
$options['type'] = '';
}
if (isset($options['type']) && $options['type'] != '' && $options['type'] != 'mineure' && $options['type'] != 'majeure') {
$GLOBALS['_NOUVEAUTE_']['erreurs'][] = sprintf(NOUV_LG_ERREUR_TYPE, $balise);
} else {
if ($options['type'] == 'mineure') {
$options['type'] = 1;
} else if ($options['type'] == 'majeure') {
$options['type'] = 2;
}
}
if (!isset($options['site'])) {
$options['site'] = '';
}
if (!isset($options['categorie'])) {
$options['categorie'] = '';
}
//+----------------------------------------------------------------------------------------------------------------+
// Récupération des données
if (count($GLOBALS['_NOUVEAUTE_']['erreurs']) == 0) {
$aso_info_menu = GEN_lireInfoMenuContenuDate($GLOBALS['_GEN_commun']['pear_db'], $options['type'], $options['site'], $options['categorie']);
if (count($aso_info_menu) == 0) {
$GLOBALS['_NOUVEAUTE_']['informations'][] = sprintf(NOUV_LG_INFO_ZERO_PAGE, $options['mots']);
} else {
$i = 0;
foreach ($aso_info_menu as $id_menu => $un_menu) {
// On stope l'affichage si le nombre de nouveauté demandé est atteint.
if ($i == $options['nombre']) {
break;
} else {
$i++;
}
// Initialisation
$aso_page = array();
$aso_page['url'] = '#';
$aso_page['auteur'] = NOUV_LG_INCONNU_AUTEUR;
$aso_page['contributeur'] = '';
$aso_page['titre'] = NOUV_LG_INCONNU_TITRE;
$aso_page['heure'] = '';
$aso_page['minute'] = '';
$aso_page['seconde'] = '';
$aso_page['jours'] = '';
$aso_page['mois'] = '';
$aso_page['annee'] = '';
$aso_page['description'] = '';
$aso_page['resumer'] = '';
// Création de l'url
$une_url =& new Pap_URL();
$une_url->setId($id_menu);
$aso_page['url'] = $une_url->getURL();
// Affichage du type de modification de la page
if ($un_menu->gmc_ce_type_modification = 1) {
$aso_page['type'] = 'mineure';
} elseif ($un_menu->gmc_ce_type_modification = 2) {
$aso_page['type'] = 'majeure';
}
// Affichage de l'auteur(s)
if ($un_menu->gm_auteur != '') {
$aso_page['auteur'] = $un_menu->gm_auteur;
}
// Affichage des contributeur(s)
if (!empty($un_menu->gm_contributeur)) {
$sortie .= '<dt class="page_contributeur"> Contributeur(s)&nbsp;: '.'</dt>'."\n";
$sortie .= '<dd>'.$un_menu->gm_contributeur.'</dd>'."\n";
$aso_page['contributeur'] = $un_menu->gm_contributeur;
}
// Affichage du titre
if (!empty($un_menu->gm_titre)) {
$aso_page['titre'] = $un_menu->gm_titre;
} elseif (!empty($un_menu->gm_titre_alternatif)) {
$aso_page['titre'] = $un_menu->gm_titre_alternatif;
} else {
$aso_page['titre'] = $un_menu->gm_nom;
}
// Affichage de l'horaire de la création de la page
if (($heure = date('G', strtotime($un_menu->gm_date_creation)) ) != 0 ) {
$aso_page['heure'] = $heure;
$minute = date('i', strtotime($un_menu->gm_date_creation));
$aso_page['minute'] = $minute;
if (($seconde = date('s', strtotime($un_menu->gm_date_creation)) ) != 0 ) {
$aso_page['seconde'] = $seconde;
}
}
// Affichage de la date de la création de la page
if (($jour = date('d', strtotime($un_menu->gm_date_creation)) ) != 0 ) {
$aso_page['jour'] = $jour;
}
if (($mois = _traduireMois(date('m', strtotime($un_menu->gm_date_creation))) ) != '' ) {
$aso_page['mois'] = $mois;
}
if (($annee = date('Y', strtotime($un_menu->gm_date_creation)) ) != 0 ) {
$aso_page['annee'] = $annee;
}
// Affichage de la description
if (!empty($un_menu->gm_description_libre)) {
$aso_page['decription'] = $un_menu->gm_description_libre;
}
// Affichage du résumé de la modification
if (!empty($un_menu->gmc_resume_modification)) {
$aso_page['resumer'] = $un_menu->gmc_resume_modification;
}
$GLOBALS['_NOUVEAUTE_']['pages'][] = $aso_page;
}
}
}
//+----------------------------------------------------------------------------------------------------------------+
// Extrait les variables et les ajoutes à l'espace de noms local
// Gestion des squelettes
extract($GLOBALS['_NOUVEAUTE_']);
// Démarre le buffer
ob_start();
// Inclusion du fichier
include(NOUV_CHEMIN_SQUELETTE.NOUV_SQUELETTE_LISTE);
// Récupérer le contenu du buffer
$sortie = ob_get_contents();
// Arrête et détruit le buffer
ob_end_clean();
//+----------------------------------------------------------------------------------------------------------------+
// Sortie
return $sortie;
}
 
if (!function_exists('_traduireMois')) {
function _traduireMois($mois_numerique)
{
switch ($mois_numerique) {
case '01' :
return NOUV_LG_MOIS_01;
case '02' :
return NOUV_LG_MOIS_02;
case '03' :
return NOUV_LG_MOIS_03;
case '04' :
return NOUV_LG_MOIS_04;
case '05' :
return NOUV_LG_MOIS_05;
case '06' :
return NOUV_LG_MOIS_06;
case '07' :
return NOUV_LG_MOIS_07;
case '08' :
return NOUV_LG_MOIS_08;
case '09' :
return NOUV_LG_MOIS_09;
case '10' :
return NOUV_LG_MOIS_10;
case '11' :
return NOUV_LG_MOIS_11;
case '12' :
return NOUV_LG_MOIS_12;
default:
return '';
}
}
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/papyrus/applettes/nouveaute/configuration/nouv_configuration.inc.php
New file
0,0 → 1,70
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 5.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of papyrus_bp. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: nouv_configuration.inc.php,v 1.1 2006-12-12 17:16:22 jp_milcent Exp $
/**
* papyrus_bp - nouv_configuration.inc.php
*
* Description :
*
*@package papyrus_bp
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 1999-2006
*@version $Revision: 1.1 $ $Date: 2006-12-12 17:16:22 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTÊTE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$GLOBALS['_NOUVEAUTE_'] = array();
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Constante stockant la valeur de la langue par défaut pour l'applette NOUV.*/
define('NOUV_I18N_DEFAUT', GEN_I18N_ID_DEFAUT);
 
// Chemin vers les dossiers de l'applette
/** Chemin vers l'applette Nouveauté de Papyrus.*/
define('NOUV_CHEMIN_APPLETTE', GEN_CHEMIN_APPLETTE.'nouveaute'.GEN_SEP);
/** Chemin vers les fichiers de traduction de l'applette Nouveauté de Papyrus.*/
define('NOUV_CHEMIN_LANGUE', NOUV_CHEMIN_APPLETTE.'langues'.GEN_SEP);
/** Chemin vers les fichiers de la bibliotheque de l'applette Nouveauté de Papyrus.*/
define('NOUV_CHEMIN_BIBLIO', NOUV_CHEMIN_APPLETTE.'bibliotheque'.GEN_SEP);
/** Chemin vers les fichiers squelettes de l'applette Nouveauté de Papyrus.*/
define('NOUV_CHEMIN_SQUELETTE', NOUV_CHEMIN_APPLETTE.'squelettes'.GEN_SEP);
 
// Configuration du rendu
/** Nom du fichier de squelette à utiliser pour la liste des pages.*/
define('NOUV_SQUELETTE_LISTE', 'nouv_liste.tpl.html');
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>