Subversion Repositories Applications.projet

Compare Revisions

No changes between revisions

Ignore whitespace Rev 429 → Rev 430

/tags/2014_06_04/projet_derniers_telechargements.php
New file
0,0 → 1,202
<?php
 
/* +-----------------------------------------------------------------------+
* |projet_derniers_telechargement.php |
* +-----------------------------------------------------------------------+
* | Copyright (c) 2001 - 2005 Tela Botanica |
* +-----------------------------------------------------------------------+
* | Affiche les derniers fichiers uploader dans le module projet |
* +-----------------------------------------------------------------------+
* | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
* +-----------------------------------------------------------------------+
 
* $Id: projet_derniers_telechargements.php,v 1.5 2007-06-25 12:15:06 alexandre_tb Exp $
*/
 
// Cette application affiche les derniers documents uploades dans le module projet
// ainsi que tous les documents du module
 
// ===========================================================
// Configuration
// ===========================================================
 
 
// Le nombre a afficher
define ("PROJET_TELECHARGEMENT_NOMBRE", 8) ;
 
//==================== Les labels =======================================
define ("PROJET_TELECHARGEMENT_TITRE", "Page de t&eacute;l&eacute;chargements rapides") ;
define ("PROJET_TELECHARGEMENT_DERNIERS", "Derniers documents mis en ligne") ;
define ("PROJET_TELECHARGEMENT_TOUS", "Tous les documents, par projet") ;
 
//=============bibliotheques PEAR ===================================
include_once 'HTML/Table.php' ;
 
// ========== Bibliotheque Projet ====================================
include_once 'configuration/projet.config.inc.php' ;
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
include_once PROJET_CHEMIN_APPLI.'langues/pro_langue_fr.inc.php' ;
 
 
function afficherContenuCorps() {
global $id_projet, $repcourant, $baseURL, $projet ;
if (isset($_GET['service'])) {
if ($_GET['service'] == 'ecouteArbreFichier') {
include_once PROJET_CHEMIN_APPLI.'/services/ecouteArbreFichier.php';
}
if ($_GET['service'] == 'telechargement') {
include_once PROJET_CHEMIN_APPLI.'/services/telechargement.php';
}
}
// a remplacer par un div pour genesia
$res = "<h1>".PROJET_TELECHARGEMENT_TITRE."</h1>\n" ;
$res .= "<h2>".PROJET_TELECHARGEMENT_DERNIERS."</h2>\n" ;
$liste_documents = document::getDocumentsRecents( $nombre = 10, $GLOBALS['projet_db'], PROJET_CHEMIN_FICHIER,PROJET_CHEMIN_ICONES) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_Liste.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
$vue_liste_document = new HTML_listeDocuments($GLOBALS['url'], false, '', $GLOBALS['projet_auth']) ;
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
$vue_liste_document->construitEntete($entete_liste) ;
$vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $GLOBALS['projet_db']) ;
$res .= $vue_liste_document->toHTML('', PROJET_DROIT_AUCUN) ;
$res .= "<h2>".PROJET_TELECHARGEMENT_TOUS."</h2>\n" ;
 
// Les noms des fichiers graphiques
$icon = 'folder.gif';
$expandedIcon = 'folder-expanded.gif';
$i = 0 ;
// Requete sur les projets
$requete = "SELECT p_titre, p_id FROM projet ORDER BY p_titre" ;
$resultat = $GLOBALS['projet_db']->query ($requete) or die ("Echec <br />".mysql_error()."<br />$requete") ;
$noeudProjet = '' ;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$titre = $ligne->p_titre ;
$i++ ;
$noeudProjet .= '<div dojoType="TreeNode" title="'.$ligne->p_titre.'" widgetId="projet_'.
$ligne->p_id.'" objectId="projet_'.$ligne->p_id.'" isFolder="true"></div>'."\n";
}
GEN_stockerFichierScript('dojo', 'api/js/dojo/dojo.js', 'text/javascript');
GEN_stockerFichierScript('dojoScriptProjet', PROJET_CHEMIN_APPLI.'js/telechargement.js');
//$res .= '<p>' ;
$RCPUrl = PROJET_CHEMIN_APPLI.'services/ecouteArbreFichier.php?id_projet='.$id_projet;
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_SERVICE, 'ecouteArbreFichier');
$RCPUrl = $GLOBALS['url']->getURL();
$res .= '<div dojoType="TreeLoadingController" RPCUrl="'.$RCPUrl.'" widgetId="treeController" DNDController="create"></div>
<div dojoType="TreeSelector" widgetId="treeSelector"></div>
<div dojoType="Tree" DNDMode="between" selector="treeSelector" widgetId="bandTree" controller="treeController">
<div dojoType="TreeNode" title="Racine" widgetId="rootNode" objectId="root" isFolder="true">'."\n".
$noeudProjet.'</div></div>';
//$res .= '</p>';
return $res ;
}
 
/** fonction projet_fichiers() - Remplie un noeud avec les fichiers et repertoires
*
* Le noeud est passe en reference. Ainsi, cette fonction ne retourne rien mais modifie le tableau des
* noeuds passe en reference.
*
* return void
*/
 
function projet_fichiers ($noeud, $id_rep, $pere = 0)
{
//Recuperation de l'identifiant du repertoire courant
//La fonction est appele recursivement quand $pere ne vaut pas null
//$id_rep prend donc la valeur de $pere transmise par l'appel precedent de la fonction.
// Les noms des fichiers graphiques
$icon = 'folder.gif';
$expandedIcon = 'folder-expanded.gif';
//Requête pour récupérer les noms des répertoires contenus dans le répertoire courant ($id_rep)
$queryRep = ' SELECT projet_documents.*'.
' FROM projet_documents'.
' WHERE projet_documents.pd_pere = '.$GLOBALS['projet_db']->escapeSimple($pere).
' AND projet_documents.pd_visibilite = "public" and pd_ce_projet='.$GLOBALS['projet_db']->escapeSimple($id_rep).' and pd_ce_type=0'.
' ORDER BY projet_documents.pd_nom ASC' ;
 
$resultRep = $GLOBALS['projet_db']->query($queryRep) ;
if (DB::isError ($resultRep)) {
die ('Echec de la requete : '.$queryRep.'<br />'.$resultRep->getMessage()) ;
}
//Stockage des informations sur les répertoires contenu dans le répertoire courant pour affichage dans un arbre.
//Et appel récursif de la fonction pour examiner le contenu de chaque répertoire du répertoire courant.
if ( $resultRep->numRows() != 0 ) {
while ( $ligneRep = $resultRep->fetchRow(DB_FETCHMODE_OBJECT) ) {
//Stockage des informations sur le répertoire courant
$noeud1_1 = &$noeud->addItem(new HTML_TreeNode(
array(
'text' => trim ($ligneRep->pd_nom),
'link' => "", 'icon' => $icon,
'expandedIcon' => $expandedIcon ) ) );
//Appel récursif de fonction courante
projet_fichiers (&$noeud1_1, $id_rep, $ligneRep->pd_id) ;
}
}
// Requête pour récupérer les fichiers du répertoire courant ($id_rep) et leurs informations
$requete_fichiers = 'SELECT projet_documents.*, gen_type_de_fichier.gtf_type_icone'.
' FROM projet_documents, gen_type_de_fichier'.
' WHERE projet_documents.pd_ce_type= gen_type_de_fichier.gtf_id_type'.
' AND projet_documents.pd_visibilite= "public" ' ;
if ($pere == 0) {
$requete_fichiers .= ' AND projet_documents.pd_ce_projet= '.$GLOBALS['projet_db']->escapeSimple($id_rep).' and pd_pere=0 and pd_ce_type <> 0' ;
} else {
$requete_fichiers .= ' AND projet_documents.pd_pere= '.$GLOBALS['projet_db']->escapeSimple($pere).' and pd_ce_type<>0' ;
}
$requete_fichiers .= ' ORDER BY projet_documents.pd_nom ASC' ;
 
$resultat_fichiers = $GLOBALS['projet_db']->query($requete_fichiers) ;
if (DB::isError ($resultat_fichiers)) {
die ('Echec de la requete : '.$requete_fichiers.'<br />'.$resultat_fichiers->getMessage()) ;
}
//Stockage des informations sur les fichiers du répertoires courant pour affichage dans un arbre
if ( $resultat_fichiers->numRows() != 0 ) {
while ( $ligne_fichiers = $resultat_fichiers->fetchRow(DB_FETCHMODE_OBJECT) ) {
//Ajout de slash devant les caractères spéciaux et suppression des caractères invisibles en début et fin des noms de fichier.
$lien = trim( $ligne_fichiers->pd_nom );
$noeud_1_2 = &$noeud->addItem (new HTML_TreeNode (
array (
"text" => $lien,
"link" => PROJET_CHEMIN_FICHIER.$ligne_fichiers->pd_lien,
'icon' => $ligne_fichiers->gtf_type_icone,
"linkTarget" => "_blank" ))) ;
}
}
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2007/04/19 09:17:35 alexandre_tb
* utilisation de dojo pour afficher l arbre des derniers documents
*
* Revision 1.3 2005/10/06 08:23:48 alexandre_tb
* Ajout de commentaires
*
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
?>
/tags/2014_06_04/icones/opendir.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/opendir.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/folder-expanded.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/folder-expanded.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/docimg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/docimg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/ico-disk.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/ico-disk.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/doc.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/doc.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/etoile_verte.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/etoile_verte.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/openclose-plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/openclose-plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/bbdel.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/bbdel.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/switch-off.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/switch-off.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/docpsd.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/docpsd.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/img.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/img.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/see.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/see.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/web.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/web.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/sgbd.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/sgbd.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/bomb.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/bomb.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/hasnomsg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/hasnomsg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/multimed.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/multimed.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/left-arrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/left-arrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/up.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/up.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/default.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/default.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/nav-end.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/nav-end.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/lock.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/lock.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/openclose-plus-trait.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/openclose-plus-trait.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/cut.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/cut.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/newflech.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/newflech.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/bbadd.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/bbadd.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/print.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/print.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/document.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/document.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/ico-cd.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/ico-cd.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/repertoire.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/repertoire.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/newmsg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/newmsg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/minus16.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/minus16.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/less.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/less.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/down.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/down.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/cross.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/cross.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/pdf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/pdf.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/up-arrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/up-arrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/logoff.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/logoff.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/repertoire.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/repertoire.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/trash.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/trash.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/mail.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/mail.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/bbreturn.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/bbreturn.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/ico-perio.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/ico-perio.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/php.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/php.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/texte.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/texte.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/docppt.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/docppt.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/docxls.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/docxls.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/Tela.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/Tela.jpg
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/nav-next.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/nav-next.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/replymsg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/replymsg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/bbmodif.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/bbmodif.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/right-arrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/right-arrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/doctxt.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/doctxt.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/switch-on.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/switch-on.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/modifier.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/modifier.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/nav-start.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/nav-start.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/haut.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/haut.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/openclose-minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/openclose-minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/bbnext.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/bbnext.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/hasmsg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/hasmsg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/nav-last.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/nav-last.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/webadd.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/webadd.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/ecrire.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/ecrire.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/doczip.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/doczip.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/bbfasc-ind.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/bbfasc-ind.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/add.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/add.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/ico-livre.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/ico-livre.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/validate.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/validate.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/unlock.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/unlock.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/trait-fin.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/trait-fin.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/son.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/son.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/square.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/square.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/openclose-minus-trait.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/openclose-minus-trait.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/dn.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/dn.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/etoile_rouge.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/etoile_rouge.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/more.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/more.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/idea.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/idea.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/addcross.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/addcross.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/menu.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/menu.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/droite.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/droite.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/bblast.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/bblast.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/prog.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/prog.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/copy.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/copy.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/gauche.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/gauche.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/paste.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/paste.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/modif.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/modif.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/hasunreadmsg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/hasunreadmsg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/trait.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/trait.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/cancel.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/cancel.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/moins.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/moins.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/etoile_grise.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/etoile_grise.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/plus16.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/plus16.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/docdoc.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/docdoc.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/upper.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/upper.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/ideared.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/ideared.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/modif.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/modif.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/icones/down-arrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/icones/down-arrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/projetRSS.php
New file
0,0 → 1,77
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projetRSS.php,v 1.2 2005-10-28 07:34:32 florian Exp $
/**
* Générateur de flux RSS à partir du bazar
*
*@package bazar
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
*
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once 'configuration/projet.inc.php'; //fichier de configuration de Bazar
include_once 'bibliotheque/projet.fonct.rss.php'; //fichier des fonctions RSS de Bazar
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS DU PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
if (isset($_GET['domaine'])) {
$domaine=$_GET['domaine'];
}
else {
$domaine='';
}
if (isset($_GET['nbitem'])) {
$nbitem=$_GET['nbitem'];
}
else {
$nbitem='';
}
if (isset($_GET['liste'])) {
$liste=$_GET['liste'];
}
else {
$liste='';
}
 
echo html_entity_decode(gen_RSS($domaine, $nbitem, $liste));
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2005/10/25 13:50:34 alexandre_tb
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/services/projet_statistiques.php
New file
0,0 → 1,405
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projet_statistiques.php,v 1.3 2008-08-25 14:59:22 alexandre_tb Exp $
/**
* Application projet
*
* Script pour calculer les statistiques
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Julien Grillot <julien.grillot@gmail.com>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
/** AVERTISSEMENT
*
* Ce programme n est pas appele par l application projet
* Il faut le lancer en ligne de commande
*/
define ('PROJET_STATISTIQUE_MODE_LIGNE_COMMANDE', true);
/** Chemin vers les programmes ezmlm en PHP */
define ('PROJET_CHEMIN_EZMLM_PHP', '/home/vpopmail/www/');
/** Chemin vers le site hebergeant l appli projet*/
define ('PROJET_CHEMIN_SITE_APPLI_PROJET', '/home/telabotap/www/');
/** Chemin vers les wikinis pour les flux rss */
define('PROJET_URL_WIKINI', "http://www.tela-botanica.org/wikini/");
/** Chemin vers les flux rss de Yahoo! */
define ('PROJET_URL_RSS_YAHOO', 'http://rss.groups.yahoo.com/group/');
/** Chemin vers les groupes Yahoo! */
define ('PROJET_URL_GROUPES_YAHOO', 'http://fr.groups.yahoo.com/group/');
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
/** Connexion base de donne */
 
if (PROJET_STATISTIQUE_MODE_LIGNE_COMMANDE) {
set_include_path(get_include_path().':'.PROJET_CHEMIN_SITE_APPLI_PROJET.'api/pear/');
define ('GEN_CHEMIN_API', '/home/telabotap/www/api/');
include_once PROJET_CHEMIN_SITE_APPLI_PROJET.'papyrus/configuration/pap_config.inc.php';
$dsn = PAP_DSN;
include_once 'DB.php';
$GLOBALS['projet_db'] = DB::connect($dsn);
if (PEAR::isError($GLOBALS['projet_db'])) die ("\n".'Erreur de connexion a la BD.'."\n".$GLOBALS['projet_db']->getMessage());
else echo "\n"."connection ok...";
// Quelques constantes de chemin
include_once PROJET_CHEMIN_SITE_APPLI_PROJET.'client/projet/configuration/projet.config.inc.php';
 
if (DB::isError($GLOBALS['projet_db'])) die ("\n".'Erreur de connexion a la BD.'."\n".$GLOBALS['projet_db']->getMessage());
} else {
$GLOBALS['projet_db'] = &$this->_db;
}
 
 
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/XML/RSS.php';
 
// Ne pas changer : les groupes Yahoo se basent toujours sur la semaine
define("NB_SEC_INSERT", 7*24*3600);
define("NB_SEC_UPDATE", 2*3600);
 
 
function is_natural($val, $acceptzero = false) {
$return = ((string)$val === (string)(int)$val);
if ($acceptzero)
$base = 0;
else
$base = 1;
if ($return && intval($val) < $base)
$return = false;
return $return;
}
if(!is_natural($_GET['start']))$_GET['start']='0';
 
 
 
 
/**
* Procedure retrouvant le nombre de contribution, de message et le contenu de la page a partir des informations de la BDD
* @param object $ligne resultat d'un fetch row contenant l'url du document a analyser
* @param int $nombre_contrib recupere le nombre de contributions du projet
* @param int $nombre_message recupere le nombre de nouveaux messages du projet
* @param int $nombre_membre recupere le nombre de nouveaux messages du projet
* @param int $nombre_photo recupere le nombre de nouveaux messages du projet
* @return false si la fonction echoue lors de la tentative de recuperation des donnees utiles
*/
function analyser($ligne, &$nombre_contrib, &$nombre_message, &$nombre_nouveau_membre, &$nombre_photo, &$nombre_membre) {
$nombre_contrib='0';
$nombre_msg='0';
$r=false;
 
// Recuperation du nbre de message
$domaine = $ligne->pl_domaine;
$liste = $ligne->pl_nom_liste;
if ($domaine != '' && $liste != '') {
ob_start();
include PROJET_CHEMIN_EZMLM_PHP.'nombre_messages.php';
$xml = ob_get_contents();
ob_end_clean();
if (isset($xml) && $xml != '' && $xml != 0) {
$simpleXML = simplexml_load_string($xml);
$nombre_message = $simpleXML[0];
}
}
if(!$nombre_message)$nombre_message='0';
// Si AGO_A_NOMGRP existe, la liste est sur Yahoo
// on essaie de parser la page d accueil du groupe
// poue recuperer les
if($ligne->AGO_A_NOMGRP) {
$url = PROJET_URL_GROUPES_YAHOO.$ligne->AGO_A_NOMGRP;
 
// Recherche du schema retrouvant le nombre de nouveaux message dans la semaine
$pattern_membres = '(: ([0-9]+) </li>)((<li>Rubriqu)|( <li>Cr))';
$pattern_nouveaux_membres = '>([0-9]+)</span> .ouveaux? .embres?';
$pattern_message = '>([0-9]+)</span> .ouveaux? .essages?';
$pattern3 = '>([0-9]+)</span> .ouvelles? .hotos?';
$contenu = @file_get_contents($url);
// en cas d echec, ce qui est frequent
// on lit le flux rss
if ($contenu) {
sleep(2);
$r=($contenu?true:false);
ereg($pattern_message, $contenu, $registre_message);
$nombre_message=$registre_message[1];
ereg($pattern_nouveaux_membres, $contenu, $registre_nouveau_membre);
$nombre_nouveau_membre=$registre_nouveau_membre[1];
ereg($pattern3, $contenu, $no);
$nombre_photo=$no[1];
ereg ($pattern_membres, $contenu, $registre_membre);
$nombre_membre = $registre_membre[2];
} else {
// Parse le flux RSS genere par wikini
$rss =& new XML_RSS(PROJET_URL_RSS_YAHOO.$ligne->AGO_A_NOMGRP.'/rss');
if (PEAR::isError($rss)) {
echo $rss->getMessage()."\n";
return;
}
$rss->parse();
// On va compter le nombre de modification depuis les x derniers jours (voirs constantes)
foreach ($rss->getItems() as $item) {
// Le script doit etre compatiable avec plusieurs formats de date
if ($item['pubDate']) {
if (strtotime($item['pubDate'])>time()-NB_SEC_INSERT) $nombre_message++;
} else {
$date = substr($item['title'], strlen($item['title'])-18);
if ($date>date("Y m d - H:i", time()-NB_SEC_INSERT)) $nombre_message++;
}
}
// On met une * dans les autres variables pour indiquer que ca ne fonctionne pas
$nombre_membre = '*';
$nombre_photo = '*';
}
} else {
// Parse le flux RSS genere par wikini
$rss =& new XML_RSS(PROJET_URL_WIKINI.$ligne->p_wikini.'/wakka.php?wiki=DerniersChangementsRSS/xml');
$rss->parse();
// On va compter le nombre de modification depuis les x derniers jours (voirs constantes)
foreach ($rss->getItems() as $item) {
// Le script doit etre compatiable avec plusieurs formats de date
if ($item['pubDate']) {
if (strtotime($item['pubDate'])>time()-NB_SEC_INSERT) $nombre_contrib++;
} else {
$date = substr($item['title'], strlen($item['title'])-18);
if ($date>date("Y m d - H:i", time()-NB_SEC_INSERT)) $nombre_contrib++;
}
}
// On recupere le nombre de nouveaux inscrit au projet
$r=true;
// Nombre de derniers messages de la semaine
$domaine = $ligne->pl_domaine;
$liste = $ligne->pl_liste;
ob_start();
include_once PROJET_CHEMIN_EZMLM_PHP.'dernier_messages.php';
ob_end_clean();
$nombre_message = $num; // $num est une variable du fichier dernier_messages.php
}
return $r;
}
 
// Pour calculer le temps d'execution du script
$start=microtime(true);
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// requete pour recuperer la liste des projets
$requete = 'select count(distinct psu_id_utilisateur) as nb_utilisateur, count(distinct pil_id_utilisateur) as nb_utilisateur_liste, count(distinct projet_documents.pd_id) as nb_doc, p_wikini, ' .
'p_id, p_titre, p_resume, projet_lien_liste.pl_id_liste, pl_domaine,pl_nom_liste,AGO_A_NOMGRP ' .
'from projet left join projet_lien_liste on p_id=projet_lien_liste.pl_id_projet ' .
'left join projet_liste on projet_lien_liste.pl_id_liste=projet_liste.pl_id_liste ' .
'left join projet_inscription_liste on (projet_inscription_liste.pil_id_liste=projet_liste.pl_id_liste and pil_date_inscription > date_sub(now(), interval 1 week)) ' .
'left join projet_documents on (p_id=pd_ce_projet and pd_date_de_mise_a_jour > date_sub(now(), interval 1 week)) ' .
'left join projet_statut_utilisateurs on p_id=psu_id_projet ' .
'left join projet_lien_liste_externe on plle_id_projet=p_id ' .
'left join agora on plle_id_liste=AGO_A_ID ' .
'group by p_id order by p_titre' ;
 
$resultat = $GLOBALS['projet_db']->query($requete) ;
if (DB::isError($resultat)) {
echo ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
echo "\n".'Statistiques des projets';
echo "\n".'Requete : '."\n\n".$requete."\n";
 
 
$calculs = false;
 
 
printf ("\n%-56s %-35s %-12s %-12s %-12s %-12s %-12s %-12s",
"Nom du projet", "Nom liste", "Nouv inscrits", "Utilisateurs", "Nb messages", "Nb doc", "Nb contrib", 'Nombre inscrit Yahoo');
$nombre_photo = 0;
 
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$nombre_contrib = 0;
$nombre_message = 0;
$nombre_nouveau_membre = 0;
$nombre_membre_yahoo = 0;
// On verifie la date de derniere mise a jour
$requete_verif='SELECT * FROM projet_statistiques WHERE ps_ce_projet="'.$ligne->p_id.'" ORDER BY ps_date DESC LIMIT 1';
$resultat_verif = $GLOBALS['projet_db']->query($requete_verif);
if (DB::isError($resultat_verif)) {
echo $resultat_verif->getMessage().$resultat_verif;
}
$ligne_verif = $resultat_verif->fetchRow(DB_FETCHMODE_OBJECT);
// Si elle remonte a plus de deux heure, on sauvegarde, et a plus de 7 jours, on archive et cree une nouvelle entree
if($ligne_verif->ps_date > date("Y-m-d H:i:s", time()-NB_SEC_INSERT)) {
if($ligne_verif->ps_maj < date("Y-m-d H:i:s", time()-NB_SEC_UPDATE)) {
// Recupere nombre_contrib et nombre_message
$calculs=analyser($ligne, $nombre_contrib, $nombre_message, $nombre_nouveau_membre, $nombre_photo, $nombre_membre_yahoo);
$requete_maj = 'UPDATE projet_statistiques SET ps_msg_derniere_semaine="'.$nombre_message.'", ps_doc_derniere_semaine="'.
$ligne->nb_doc.'", ps_nombre_inscrit_derniere_semaine="'.$nombre_nouveau_membre.'", ps_nombre_inscrit="'.$ligne->nb_utilisateur.
'", ps_nombre_inscrit_liste="'.
$ligne->nb_utilisateur_liste.'", ps_modifwiki_derniere_semaine="'.$nombre_contrib.
'", ps_maj=NOW(), ps_nombre_membre_yahoo="'.$nombre_membre_yahoo.'" WHERE ps_ce_projet="'.
$ligne->p_id.'" AND ps_dernier="1"';
$resultat_maj = $GLOBALS['projet_db']->query($requete_maj);
if (DB::isError($resultat_maj)) {
echo $resultat_maj->getMessage().$requete_maj;
}
} else {
$nombre_contrib = $ligne_verif->ps_modifwiki_derniere_semaine;
$nombre_message = $ligne_verif->ps_msg_derniere_semaine;
}
} else {
// Recupere nombre_contrib et nombre_message
$calculs=analyser($ligne, $nombre_contrib, $nombre_message, $nombre_nouveau_membre, $nombre_photo, $nombre_membre_yahoo);
// On place ps_dernier a O pour les stats de la semaine precedente
$requete_stat_prec = 'update projet_statistiques set ps_dernier=0 where ps_ce_projet='.$ligne->p_id;
$resultat_stat_prec = $GLOBALS['projet_db']->query($requete_stat_prec);
$requete_maj = 'INSERT INTO projet_statistiques set ps_ce_projet="'.$ligne->p_id.'", ps_msg_derniere_semaine="'.$nombre_message
.'", ps_doc_derniere_semaine="'.$ligne->nb_doc.'", ps_nombre_inscrit_derniere_semaine="'.$nombre_nouveau_membre.
'", ps_nombre_inscrit= "'.$ligne->nb_utilisateur.'", ps_nombre_inscrit_liste="'.$ligne->nb_utilisateur_liste.
'", ps_modifwiki_derniere_semaine="'.$nombre_contrib.'", ps_date=now(), ps_maj=now(), ps_dernier=1'.
', ps_nombre_membre_yahoo="'.$nombre_membre_yahoo.'"';
$resultat_maj = $GLOBALS['projet_db']->query($requete_maj);
if (DB::isError($resultat_maj)) {
echo $resultat_maj->getMessage().$requete_maj;
}
}
// Et on affiche les stats courantes
$format = "\n%-56s %-35s %-12d %-12d %-12d %-12d %-12d %-12d";
printf ($format, html_entity_decode($ligne->p_titre), ($ligne->pl_nom_liste?$ligne->pl_nom_liste:$ligne->AGO_A_NOMGRP.' (Yahoo)'),
$nombre_nouveau_membre, $ligne->nb_utilisateur, $nombre_message, $ligne->nb_doc, $nombre_contrib, $nombre_membre_yahoo);
 
}
//$res .= '</table>';
 
// Met a jour les statistiques et somme d'activite
$sql="update `projet_statistiques` set ps_somme=(ps_msg_derniere_semaine +5*ps_doc_derniere_semaine+ps_nombre_inscrit_liste+ps_modifwiki_derniere_semaine);";
$resultat = $GLOBALS['projet_db']->query($sql);
if (DB::isError($resultat)) {
return $resultat->getMessage().$sql;
}
 
// On cherche le max pour ponderer les sommes
$sql='SELECT MAX( LN(ps_somme+1) ) AS max FROM projet_statistiques WHERE ps_dernier=1';
$resultat = $GLOBALS['projet_db']->query($sql);
if (DB::isError($resultat)) {
return $resultat->getMessage().$sql;
}
$tresultat = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
$max = $tresultat->max;
// On pondere
$sql = 'UPDATE projet_statistiques SET ps_pourcent=LN(ps_somme+1) / '.$max.' * 100 WHERE ps_dernier=1';
$resultat = $GLOBALS['projet_db']->query($sql);
if (DB::isError($resultat)) {
return $resultat->getMessage().$sql;
}
 
// Calcul de al dormance de certains projets
$requete_dormance = 'select ps_ce_projet from projet_statistiques where ps_ce_projet not in '.
'(SELECT ps_ce_projet FROM `projet_statistiques` WHERE `ps_somme` <> 0 group by ps_ce_projet) group by ps_ce_projet';
$resultat_dormance = $GLOBALS['projet_db']->query ($requete_dormance);
 
echo "\n".'Mise a jour de la dormance...'."\n";
 
while ($ligne_dormance = $resultat_dormance->fetchRow(DB_FETCHMODE_OBJECT)) {
// Comme les statistiques n'ont pas un an, on verifie s'il n'y pas de documents
$requete_complementaire = 'select pd_id from projet_documents where pd_date_de_mise_a_jour > date_sub(now(), interval 1 year) and pd_ce_projet = '
.$ligne_dormance->ps_ce_projet;
$resultat_complementaire = $GLOBALS['projet_db']->query ($requete_complementaire);
if (DB::isError($resultat_complementaire)) {
echo $resultat_complementaire->getMessage()."\n".$resultat_complementaire->getDebugInfo()."\n".'Requete : '.$requete_complementaire."\n";
}
if ($resultat_complementaire->numRows() !=0) { // Le projet a eu una activite meme infime depuis un an
$requete_projet = 'update projet set p_en_dormance=0 where p_id='.$ligne_dormance->ps_ce_projet;
$GLOBALS['projet_db']->query($requete_projet);
// Suppression puis insertion
$requete_avoir_theme = 'delete from projet_avoir_theme where pat_id_projet='.$ligne_dormance->ps_ce_projet.' and pat_id_theme=9';
$GLOBALS['projet_db']->query ($requete_avoir_theme);
} else { // Le projet dort on fait les mises a jour sur projet et projet_avoir_theme
$requete_projet = 'update projet set p_en_dormance=1 where p_id='.$ligne_dormance->ps_ce_projet;
$GLOBALS['projet_db']->query($requete_projet);
// Suppression puis insertion
$requete_avoir_theme = 'delete from projet_avoir_theme where pat_id_projet='.$ligne_dormance->ps_ce_projet.' and pat_id_theme=9';
$GLOBALS['projet_db']->query ($requete_avoir_theme);
$requete_avoir_theme = 'insert into projet_avoir_theme set pat_id_projet='.$ligne_dormance->ps_ce_projet.', pat_id_theme=9'; // Le theme en dormance
$GLOBALS['projet_db']->query ($requete_avoir_theme);
}
}
 
// On affiche quelques infos inutiles mais indispensables
echo "\n";
if(!$calculs) $res .= 'Les variables nb_msg et nb_contrib n\'ont pas &eacute;t&eacute; calcul&eacute;es (datent de moins de '.round(NB_SEC_UPDATE/3600).' heures)'."\n";
echo 'Execut&eacute; en '.(round((microtime(true)-$start)*1000)/1000).' secondes.'."\n";
 
if (PROJET_STATISTIQUE_MODE_LIGNE_COMMANDE) {
 
} else {
return $res;
}
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log: not supported by cvs2svn $
* +--Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/services/telechargement.php
New file
0,0 → 1,104
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: telechargement.php,v 1.4 2008-08-25 15:00:10 alexandre_tb Exp $
/**
* Application projet
*
* Service de telechargement recoie un id de document et renvoie le document
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
if (is_object ($this) && $this->_id_document == '') {
return 'aucun fichier demand&eacute;';
} else {
if (!is_object($this) && isset ($_GET['id_document'])) {
$id_document = $_GET['id_document'];
}
}
 
if (is_object ($this)) {
$id_document = $this->_id_document;
}
 
include_once PROJET_CHEMIN_CLASSES.'projet.class.php';
include_once PROJET_CHEMIN_CLASSES.'document.class.php';
 
 
$document = new document ($id_document, $GLOBALS['projet_db'], PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
$projet = new projet ($document->_id_projet);
// Soit le document est public et on le renvoie, soit il est prive
// et on teste les droits
 
if ($document->getVisibilite() == 'prive') {
// On teste le login
if ($GLOBALS['projet_auth']->getAuth()) {
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$id_utilisateur = $GLOBALS['projet_auth']->getAuthData(PROJET_CHAMPS_ID);
$participant = new participe($GLOBALS['projet_db']) ;
if ($participant->isAdministrateur($id_utilisateur) || $participant->isCoordinateur($id_utilisateur, $document->_id_projet)
|| $participant->isContributeur($id_utilisateur, $document->_id_projet)) {
$ok = true ;
} else {
$ok = false ;
return '<h1>'.$projet->getTitre($document->_id_projet).'</h1>'.
'<p class="information">Vous devez participer &agrave; ce projet pour acc&eacute;der &agrave; ce document</p>';
}
} else {
return '<h1>'.$projet->getTitre($document->_id_projet).'</h1>'.
'<p class="information">Vous devez participer &agrave; ce projet pour acc&eacute;der &agrave; ce document</p>';
}
} else {
$ok = true ;
}
 
// Recherche de l extension
$nom_de_fichier = pathinfo ($projet->getNomRepertoire().'/'.$document->getChemin()) ;
$extension = $nom_de_fichier['extension'];
 
header('Expires: Wen, 01 Dec 1999 01:00:00 GMT');// Date du passe
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');// toujours modifie
header('Cache-Control: Public, must-revalidate');// HTTP/1.1
header('Pragma: hack');
header ('Content-Type: '.$document->getTypeMime()) ;
header('Content-Length: '.(string) $document->getTaille());
header ('Content-Disposition: attachment; filename="'.$document->getNomLong().'.'.$extension.'"');
header("Content-Transfer-Encoding: binary\n");
 
readfile (PROJET_CHEMIN_FICHIER.$document->getChemin());
 
exit();
 
 
?>
/tags/2014_06_04/services/ecouteArbreFichier.php
New file
0,0 → 1,170
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: ecouteArbreFichier.php,v 1.3 2008-10-29 15:53:06 alexandre_tb Exp $
/**
* Application projet
*
* Service d ecoute de l arbre du porte document, renvoie les donnees du repertoire demande
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// ATTENTION - le programme suivant doit renvoyer un tableau, meme vide
// sinon l arbre dojo ne fonctionnera pas (ligne 117 $returnArray = array)
 
 
include_once (GEN_CHEMIN_API.'json/JSON.php');
 
$action = $_REQUEST["action"];
$data = $_REQUEST["data"];
$cache = $_REQUEST["dojo.preventCache"];
 
$data = str_replace("\\\"","\"",$data);
 
// instanciation d un json-php
 
$json = new services_JSON();
 
if ( $action == "getChildren") {
$jsonData = $json->decode($data);
// get the node object
$node = $jsonData->node;
}
 
if ( $action == "getChildren") {
$jsonData = $json->decode($data);
// get the node object
$node = $jsonData->node;
// on recupere le noeud parent
$parent = $node->objectId;
if (isset($_REQUEST['id_projet'])) $id_projet = $_REQUEST['id_projet'];
if (preg_match ('/projet_([0-9]+)/', $node->objectId, $match)) $id_projet = $match[1];
// correspondance entre l objectid de dojo et id_parent de projet_document
if ( $parent == "root" || preg_match ('/projet_([0-9]+)/', $node->objectId, $match)) {
$id_parent = 0 ;
} else {
$id_parent = $node->objectId;
}
$sql = 'select * from projet_documents where pd_pere='.$id_parent ;
if (isset($id_projet)) $sql .= ' and pd_ce_projet='.$id_projet.' and pd_visibilite="public"';
$sql .= ' order by pd_nom';
$resultat = $GLOBALS['projet_db']->query($sql);
 
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$nodeArray = array();
$i = 0;
include_once PROJET_CHEMIN_CLASSES.'document.class.php';
if ($GLOBALS['projet_auth']->getAuth() && is_object($this)) {
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($GLOBALS['projet_db']) ;
$id_u = $GLOBALS['projet_auth']->getAuthData(PROJET_CHAMPS_ID) ;
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $GLOBALS['projet_db']) ;
if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
$isAdm = participe::isAdministrateur($GLOBALS['projet_auth']->getAuthData(PROJET_CHAMPS_ID), $GLOBALS['projet_db']) ;
if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
if ($isAdm) $isCoord = true ;
$isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $GLOBALS['projet_db']);
if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR;
$statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
// si participant, on ajoute le champs visibilite
} else {
$droits = PROJET_DROIT_AUCUN;
}
// Recuperation de l'auteur
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
while ( $ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$document = new document($ligne['pd_id'], $GLOBALS['projet_db'], PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES);
$GLOBALS['url']->addQueryString('id_projet', $id_projet);
$GLOBALS['url']->addQueryString('id_document', $document->getIdDocument());
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_SERVICE, 'telechargement');
// json attend de l utf8, en lui fournissant des donnees au format htmlentities,
// ca passe
$annuaire = new annuaire($objetDB, array('table' => PROJET_ANNUAIRE, 'identifiant' => PROJET_CHAMPS_ID,
'nom' => PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
$annuaire->setId($document->_id_proprietaire) ;
$nom_prenom = $annuaire->getInfo('nom').' '.$annuaire->getInfo('prenom') ;
// On regarde si l utilisateur a les droits pour deplacer
if ($droits <= PROJET_DROIT_COORDINATEUR ||
$GLOBALS['projet_auth']->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) {
$actions = 'MOVE,REMOVE,EDIT' ;
if ($document->isRepertoire()) $actions .= ',ADDCHILD';
}
else $actions = '';
$node = array(
'title'=> iconv('ISO-8859-1', 'UTF-8', $document->getNomLong()),
'widgetId' => 'document_'.$document->getIdDocument(),
'objectId'=> $document->getIdDocument(),
'isFolder'=> $document->isRepertoire(),
'link' => str_replace ('&amp;', '&', $GLOBALS['url']->getURL()),
'childIconSrc' => $document->getCheminIcone(),
'expandIcon' => PROJET_CHEMIN_ICONES.'folder-expanded.gif',
'afterLabel' => ' '.$document->getTailleFormatee().' '.iconv('ISO-8859-1', 'UTF-8',$nom_prenom),
);
// On regarde si l utilisateur a les droits pour deplacer
/*
if ($droits <= PROJET_DROIT_COORDINATEUR ||
$GLOBALS['projet_auth']->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) {
$actions = 'MOVE,REMOVE,EDIT' ;
if ($document->isRepertoire()) $actions .= ',ADDCHILD';
$node['actions'] = $actions;
}
else {
$node['actions'] = '';
}*/
$nodeArray[$i] = $node;
$i++;
unset ($document);
}
if (!is_null($nodeArray)) {
header ('Content-type: json');
print $json->encode($nodeArray);
exit();
}
}
 
 
 
 
 
?>
/tags/2014_06_04/services/serviceDeplacementFichier.php
New file
0,0 → 1,71
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: serviceDeplacementFichier.php,v 1.1 2007-04-19 09:37:50 alexandre_tb Exp $
/**
* Application projet
*
* Service pour deplacer un fichier, recoie l id du fichier a deplacer et l id du repertoire cible
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2007
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// effectue le deplacement d un fichier, repond a un appel d arbreDocument.js
 
// On se situe dans la methode run() de projetControleur
 
// L url contient
// id_projet=id_projet&service=serviceDeplacement&enfant=id_du_doc_a_deplacer&parent=id_du_repertoire_cible
 
// $_GET['parent'] peut valoir 'root' auquel cas on remplace par 0, cela signifie
// qu on deplace un fichier vers le repertoire racine du projet
 
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
 
header ('Content-type:text/json');
if (isset($_GET['enfant'])) {
$document = new document($_GET['enfant'], $this->_db, PROJET_CHEMIN_FICHIER) ;
// On traite le cas où l'on vient de déplacer un fichier
if (isset ($_GET['parent'])) {
if ($_GET['parent'] == 'root') $id_cible = 0 ; else $id_cible = $_GET['parent'];
if (!$document -> deplace ($id_cible, $projet->getNomRepertoire())) {
echo 'echec du déplacement' ;
}
exit() ;
}
}
exit();
?>
/tags/2014_06_04/jrest/services/Modification.php
New file
0,0 → 1,69
<?php
/**
* PHP Version 5
*
* @category PHP
* @package projet_bp
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/projet_bp/
*/
 
 
class Modification extends ProjetService {
 
public function getElement($uid){
 
$id_utilisateur = (isset($_GET['id_utilisateur'])) ? $_GET['id_utilisateur'] : false;
$mail = (isset($_GET['mail'])) ? $_GET['mail'] : false;
$nouveau_mail = (isset($_GET['nouveau_mail'])) ? $_GET['nouveau_mail'] : false;
 
if(!$mail || !$id_utilisateur) {
$this->envoyer("false");
}
 
$ancien_mail = $mail;
$nouveau_mail = $nouveau_mail;
 
// si le mail n'a pas changé, on ne change rien
if($ancien_mail == $nouveau_mail) {
$this->envoyer("OK");
return;
}
 
$projets = $this->obtenirProjetsPourParticipant($id_utilisateur);
 
// si pas de projets, rien à faire
if(count($projets) <= 0) {
$this->envoyer("OK");
return;
}
 
// sinon on récupère la liste associée à chaque projet
foreach($projets as $projet) {
 
$id_projet = $projet['p_id'];
$listes = $this->obtenirListesAssocieesAuProjet($id_projet);
 
// si pas de liste, rien à faire
if(count($listes) <= 0) {
continue;
}
 
$nom_liste = $listes[0]['pl_nom_liste'];
 
// on modifie l'abonnement
if($this->estAbonneAListe($nom_liste, $mail)) {
if(!$this->modifierMailPourListe($nom_liste, $ancien_mail, $nouveau_mail)) {
$this->envoyer("false");
}
}
}
 
$this->envoyer("OK");
return;
}
}
?>
/tags/2014_06_04/jrest/services/Gestion.php
New file
0,0 → 1,52
<?php
/**
* PHP Version 5
*
* @category PHP
* @package papyrus_bp
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/papyrus_bp/
*/
 
Class Gestion extends JRestService {
 
public function getElement($uid){
 
$id_utilisateur = $uid[0];
$mail_utilisateur = $uid[1];
 
// on selectionne la liste des projets auxquel on est inscrit
$requete_projets = 'SELECT DISTINCT *'.
' FROM projet'.
' WHERE p_id'.
' IN '.
'(SELECT psu_id_projet FROM projet_statut_utilisateurs'.
' WHERE psu_id_utilisateur = '.$this->bdd->quote($id_utilisateur).')'.
' GROUP BY p_id';
 
$resume = array();
 
$resume['titre'] = 'Gestion de mes projets';
$resume['info'] = 'Vous souhaitez vous inscrire à d\'autres projets ? <a href="http://www.tela-botanica.org/page:liste_projets" > Consultez la liste des projets et forums </a>';
 
$projets = $this->bdd->query($requete_projets)->fetchAll();
 
if(!$projets) {
$resume['message'] = 'Vous n\'&ecirc;tes inscrit &agrave; aucun projet';
} else {
foreach($projets as $projet) {
 
$cible_lien_desinscrire = 'http://www.tela-botanica.org/client/projet/jrest/DesinscriptionProjet/?id_projet='.$projet['p_id'].'&id_utilisateur='.$id_utilisateur.'&mail='.$mail_utilisateur;
$cible_lien = 'http://www.tela-botanica.org/page:liste_projets?id_projet='.$projet['p_id'];
$resume_item = array('element' => $projet['p_titre'], 'lien_desinscrire' => $cible_lien_desinscrire, 'lien' => $cible_lien, 'intitule_lien' => 'Se d&eacute;sinscrire');
$resume['elements'][] = $resume_item;
}
}
 
$this->envoyer($resume);
}
}
?>
/tags/2014_06_04/jrest/services/JRestService.php
New file
0,0 → 1,238
<?php
/**
* Classe mère abstraite contenant les méthodes génériques des services.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
abstract class JRestService {
 
public $config;
protected $bdd;
protected $log = array();
protected $messages = array();
protected $debug = array();
protected $distinct = false;
protected $orderby = null;
protected $formatRetour = 'objet';
protected $start = 0;
protected $limit = 150;
 
public function __construct($config, $demarrer_session = true) {
// Tableau contenant la config de Jrest
$this->config = $config;
 
// Connection à la base de données
$this->bdd = $this->connecterPDO($this->config, 'appli');
 
// Nettoyage du $_GET (sécurité)
if (isset($_GET)) {
$get_params = array('orderby', 'distinct', 'start', 'limit', 'formatRetour');
foreach ($get_params as $get) {
$verifier = array('NULL', "\n", "\r", "\\", "'", '"', "\x00", "\x1a", ';');
$_GET[$get] = str_replace($verifier, '', $_GET[$get]);
if (isset($_GET[$get]) && $_GET[$get] != '') {
$this->$get = $_GET[$get];
} else {
$_GET[$get] = null;
}
}
}
}
 
/**
* Méthode appelée quand aucun paramètre n'est passé dans l'url et avec une requête de type GET.
*/
public function getRessource() {
$this->getElement(array());
}
 
protected function envoyer($donnees = null, $mime = 'text/html', $encodage = 'utf-8', $json = true) {
// Traitements des messages d'erreurs et données
if (count($this->messages) != 0) {
header('HTTP/1.1 500 Internal Server Error');
$mime = 'text/html';
$encodage = 'utf-8';
$json = true;
$sortie = $this->messages;
} else {
$sortie = $donnees;
if (is_null($donnees)) {
$sortie = 'OK';
}
}
 
// Gestion de l'envoie du déboguage
$this->envoyerDebogage();
 
// Encodage au format et JSON et envoie sur la sortie standard
$contenu = $json ? json_encode($sortie) : $sortie;
$this->envoyerContenu($encodage, $mime, $contenu);
}
 
protected function envoyerDebogage() {
if (!is_array($this->debug)) {
$this->debug[] = $this->debug;
}
if (count($this->debug) != 0) {
foreach ($this->debug as $cle => $val) {
if (is_array($val)) {
$this->debug[$cle] = print_r($val, true);
}
}
header('X-DebugJrest-Data:'.json_encode($this->debug));
}
}
 
protected function envoyerContenu($encodage, $mime, $contenu) {
header("Content-Type: $mime; charset=$encodage");
print $contenu;
}
 
private function connecterPDO($config, $base = 'database') {
$cfg = $config[$base];
$dsn = $cfg['phptype'].':dbname='.$cfg['database'].';host='.$cfg['hostspec'];
try {
$PDO = new PDO($dsn, $cfg['username'], $cfg['password']);
} catch (PDOException $e) {
echo 'La connexion à la base de donnée via PDO a échouée : ' . $e->getMessage();
}
// Passe en UTF-8 la connexion à la BDD
$PDO->exec("SET NAMES 'utf8'");
// Affiche les erreurs détectées par PDO (sinon mode silencieux => aucune erreur affiché)
$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $PDO;
}
 
protected function getTxt($id) {
$sortie = '';
switch ($id) {
case 'sql_erreur' : $sortie = 'Requête echec. Fichier : "%s". Ligne : "%s". Message : %s'; break;
default : $sortie = $id;
}
return $sortie;
}
 
protected function traiterParametresUrl($params_attendu, $params, $pourBDD = true) {
$sortie = array();
foreach ($params_attendu as $num => $nom) {
if (isset($params[$num]) && $params[$num] != '*') {
if ($pourBDD) {
$params[$num] = $this->bdd->quote($params[$num]);
}
$sortie[$nom] = $params[$num];
}
}
return $sortie;
}
 
protected function traiterParametresPost($params) {
$sortie = array();
foreach ($params as $cle => $valeur) {
$sortie[$cle] = $this->bdd->quote($valeur);
}
return $sortie;
}
 
protected function getIdentification(&$params) {
// Initialisation des variables
$utilisateur = array(0, session_id());
 
// L'id utilisateur est soit passé par le POST soit dans l'url
if (is_array($params) && isset($params['cmhl_ce_modifier_par'])) {
$utilisateur[0] = $params['cmhl_ce_modifier_par'];
unset($params['cmhl_ce_modifier_par']);
} else if (is_string($params)) {
$utilisateur[0] = $params;
}
 
return $utilisateur;
}
 
protected function etreAutorise($id_utilisateur) {
$autorisation = false;
if (($_SESSION['coel_utilisateur'] != '') && $_SESSION['coel_utilisateur']['id'] != $id_utilisateur) {
$this->messages[] = 'Accès interdit.';
} else if ($_SESSION['coel_utilisateur'] == '') {
$this->messages[] = 'Veuillez vous identifiez pour accéder à cette fonction.';
} else {
$autorisation = true;
}
return $autorisation;
}
 
private function gererIdentificationPermanente() {
// Pour maintenir l'utilisateur tjrs réellement identifié nous sommes obligé de recréer une SESSION et de le recharger depuis la bdd
if ($this->getUtilisateur() == ''
&& isset($_COOKIE['coel_login'])
&& ($utilisateur = $this->chargerUtilisateur($_COOKIE['coel_login'], $_COOKIE['coel_mot_de_passe']))) {
$this->setUtilisateur($utilisateur, $_COOKIE['coel_permanence']);
}
}
 
protected function getUtilisateur() {
return (isset($_SESSION['coel_utilisateur']) ? $_SESSION['coel_utilisateur'] : '');
}
 
/**
* Méthode prenant en paramètre un chemin de fichier squelette et un tableau associatif de données,
* en extrait les variables, charge le squelette et retourne le résultat des deux combinés.
*
* @param String $fichier le chemin du fichier du squelette
* @param Array $donnees un tableau associatif contenant les variables a injecter dans le squelette.
*
* @return boolean false si le squelette n'existe pas, sinon la chaine résultat.
*/
public static function traiterSquelettePhp($fichier, Array $donnees = array()) {
$sortie = false;
if (file_exists($fichier)) {
// Extraction des variables du tableau de données
extract($donnees);
// Démarage de la bufferisation de sortie
ob_start();
// Si les tags courts sont activés
if ((bool) @ini_get('short_open_tag') === true) {
// Simple inclusion du squelette
include $fichier;
} else {
// Sinon, remplacement des tags courts par la syntaxe classique avec echo
$html_et_code_php = self::traiterTagsCourts($fichier);
// Pour évaluer du php mélangé dans du html il est nécessaire de fermer la balise php ouverte par eval
$html_et_code_php = '?>'.$html_et_code_php;
// Interprétation du html et du php dans le buffer
echo eval($html_et_code_php);
}
// Récupèration du contenu du buffer
$sortie = ob_get_contents();
// Suppression du buffer
@ob_end_clean();
} else {
$msg = "Le fichier du squelette '$fichier' n'existe pas.";
trigger_error($msg, E_USER_WARNING);
}
// Retourne le contenu
return $sortie;
}
 
/**
* Fonction chargeant le contenu du squelette et remplaçant les tags court php (<?= ...) par un tag long avec echo.
*
* @param String $chemin_squelette le chemin du fichier du squelette
*
* @return string le contenu du fichier du squelette php avec les tags courts remplacés.
*/
private static function traiterTagsCourts($chemin_squelette) {
$contenu = file_get_contents($chemin_squelette);
// Remplacement de tags courts par un tag long avec echo
$contenu = str_replace('<?=', '<?php echo ', $contenu);
// Ajout systématique d'un point virgule avant la fermeture php
$contenu = preg_replace("/;*\s*\?>/", "; ?>", $contenu);
return $contenu;
}
}
?>
/tags/2014_06_04/jrest/services/DocumentsRss.php
New file
0,0 → 1,81
<?php
/**
* PHP Version 5
*
* @category PHP
* @package papyrus_bp
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/papyrus_bp/
*/
 
Class DocumentsRss extends ProjetService {
public function __construct($config, $demarrer_session= true) {
parent::__construct($config, $demarrer_session);
}
// TODO: gérer plusieurs format et utiliser les mêmes classes communes que
// celles du cel
public function getElement($uid){
$format = 'rss2';
 
// on selectionne les projets les plus actifs
$requete_docs_projets = 'SELECT * FROM projet_documents '.
'WHERE pd_ce_type != 0 AND pd_visibilite = "public" '.
'ORDER BY pd_date_de_mise_a_jour DESC '.
'LIMIT 0,5';
$resume = array();
 
$titre = htmlspecialchars('Derniers documents publics ');
$lien = 'http://www.tela-botanica.org/page:liste_projets';
 
$docs = $this->bdd->query($requete_docs_projets)->fetchAll();
$rss = '<?xml version="1.0" encoding="UTF-8"?>'.
'<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>'.$titre.'</title>
<link>'.$lien.'</link>
<atom:link href="" rel="self" type="application/rss+xml" />
<description>'.$titre.'</description>';
foreach($docs as $doc) {
$infos_projet = $this->obtenirInformationsProjet($doc['pd_ce_projet']);
$date_modification_timestamp = strtotime($doc['pd_date_de_mise_a_jour']);
$date_maj_doc = date(DATE_RSS, $date_modification_timestamp);
$nom_projet = 'Dans le projet '.$infos_projet[0]['p_titre'];
$id_doc = $doc['pd_id'];
$nom_doc = $doc['pd_nom'];
$description = preg_replace('/&(?!(a-z+|#0-9+|#x0-9a-f+);)/i', '&amp;', $nom_projet);
$description = preg_replace('/000null/i', '', $nom_projet);
$description = htmlspecialchars($description);
$lien_doc = 'http://www.tela-botanica.org/projets/'.$doc['pd_ce_projet'].'/telechargement/'.$doc['pd_id'];
$rss .='<item>
<guid>'.$id_doc.'</guid>
<title>'.$nom_doc.'</title>
<link>'.$lien_doc.'</link>
<description>'.$description.'</description>
<category>Document</category>
<pubDate>'.$date_maj_doc.'</pubDate>
</item>';
}
$rss .= '</channel>'.
'</rss>';
 
echo $rss;
}
}
?>
/tags/2014_06_04/jrest/services/Suppression.php
New file
0,0 → 1,69
<?php
/**
* PHP Version 5
*
* @category PHP
* @package projet_bp
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/projet_bp/
*/
 
class Suppression extends ProjetService {
 
public function getElement($uid) {
 
$id_utilisateur = (isset($_GET['id_utilisateur'])) ? $_GET['id_utilisateur'] : false;
$mail = (isset($_GET['mail'])) ? $_GET['mail'] : false;
 
if(!$id_utilisateur) {
return false;
}
 
// on selectionne la liste des projets auxquel on est inscrit
$projets = $this->obtenirProjetsPourParticipant($id_utilisateur);
// si pas de projets, rien à faire
if(count($projets) <= 0) {
$this->envoyer("OK");
return;
}
 
// sinon on itère sur chaque projet
foreach($projets as $projet) {
 
$id_projet = $projet['p_id'];
// et on le supprime du projet
$suppression_participant = $this->supprimerParticipantAProjet($id_utilisateur, $id_projet);
 
// ainsi que des listes associées
if($mail) {
$id_projet = $projet['p_id'];
$listes = $this->obtenirListesAssocieesAuProjet($id_projet);
// si pas de liste, rien à faire
if(count($listes) <= 0) {
continue;
}
 
$nom_liste = $listes[0]['pl_nom_liste'];
$id_liste = $listes[0]['pl_id_liste'];
$suppression_liste = $this->supprimerInscriptionAListeProjet($id_utilisateur, $id_liste);
 
// on supprime l'abonnement
if($this->estAbonneAListe($nom_liste, $mail)) {
if(!$this->desinscriptionListe($nom_liste, $mail)) {
$this->envoyer("false");
}
}
}
}
 
$this->envoyer("OK");
return;
}
}
?>
/tags/2014_06_04/jrest/services/.directory
New file
0,0 → 1,5
[Dolphin]
Timestamp=2010,5,25,17,11,22
 
[Settings]
ShowDotFiles=true
/tags/2014_06_04/jrest/services/MigrationWiki.php
New file
0,0 → 1,273
<?php
 
class MigrationWiki extends ProjetService {
const dry_run = false;
public function __construct($config, $demarrer_session= true) {
parent::__construct($config, $demarrer_session);
define('NL',"\n");
}
private function executerRequeteManip($requete, $mode_fetch = false) {
// Fonction de commodité pour afficher les requetes au lieu de les executer
if (self::dry_run) {
echo '<pre>'.str_replace('),','),'.NL, $requete).'</pre>';
return true;
} else {
if($mode_fetch) {
return $this->bdd->query($requete)->fetchAll($mode_fetch);
} else {
return $this->bdd->query($requete);
}
}
}
private function executerRequete($requete, $mode_fetch = false) {
if (self::dry_run) {
echo '<pre>'.str_replace('),','),'.NL, $requete).'</pre>'.NL.NL;
}
return $this->bdd->query($requete)->fetchAll($mode_fetch);
}
public function getElement($uid){
$nom_admin = $this->config['appli']['nom_admin_wiki'];
$mail_admin = $this->config['appli']['adresse_admin_wiki'];
$pass_admin = $this->config['appli']['pass_admin_wiki'];
 
$requete_projets_wikinis = 'SELECT * FROM gen_wikini';
$wikinis_projets = $this->executerRequete($requete_projets_wikinis, PDO::FETCH_ASSOC);
foreach($wikinis_projets as $wikini) {
 
// test sur un wiki
/*if($wikini['gewi_code_alpha_wikini'] != 'bibliobota') {
continue;
}*/
 
$base = $wikini['gewi_bdd_nom'];
$prefixe = $wikini['gewi_table_prefix'];
$chemin_wiki_sur_site = $this->config['appli']['chemin_wikis_integres'];
//$chemin_wiki = $wikini['gewi_chemin'];
$chemin_wiki = '/home/aurelien/web/wikini/'.$wikini['gewi_code_alpha_wikini'];
echo NL.'Traitement du wiki '.$chemin_wiki.NL;
echo NL.$chemin_wiki.NL;
if(!file_exists($chemin_wiki)) {
echo 'Impossible de migrer le wikini '.$wikini['gewi_code_alpha_wikini'].' : le dossier n\'existe pas'.NL.NL.NL.NL;
continue;
}
$chemin_base_wiki_defaut = $this->config['appli']['chemin_wiki_defaut'];
$infos_admin = array('name' =>$nom_admin, 'email' => $mail_admin, 'password' => $pass_admin);
if(!$this->verifierPresenceTableTriple($base, $prefixe)) {
echo 'migration du wiki '.$wikini['gewi_code_alpha_wikini'].NL;
$this->creerTableTriple($base, $prefixe);
$this->ajouterUtilisateurAdmin($base,$prefixe, $infos_admin);
$this->copierFichiersWikini($chemin_base_wiki_defaut, $chemin_wiki);
$this->changerVersionWakkaConfig($chemin_wiki);
echo 'migration du wiki '.$wikini['gewi_code_alpha_wikini'].' effectuée '.NL.NL.NL.NL;
} else {
echo 'wiki dejà à jour '.$wikini['gewi_code_alpha_wikini'].NL.NL.NL.NL;
}
$this->ajoutPageFormatees($chemin_wiki, $infos_admin);
}
}
 
private function verifierPresenceTableTriple($base, $prefixe) {
$requete_presence_table = 'SELECT COUNT(*) as table_existe FROM information_schema.tables
WHERE TABLE_SCHEMA = "'.$base.'" AND TABLE_NAME = "'.$prefixe.'triples"';
$resultat_presence_table = $this->executerRequete($requete_presence_table);
$presence_table = false;
foreach($resultat_presence_table as $table_est_presente) {
if($table_est_presente['table_existe'] >= 1) {
$presence_table = true;
break;
}
}
return $presence_table;
}
 
private function creerTableTriple($base, $prefixe) {
echo 'Création de la table triple '.NL;
$requete_creation_table = 'CREATE TABLE '.$base.'.'.$prefixe.'triples (' .
' id int(10) unsigned NOT NULL auto_increment,' .
' resource varchar(255) NOT NULL default \'\',' .
' property varchar(255) NOT NULL default \'\',' .
' value text NOT NULL default \'\',' .
' PRIMARY KEY (id),' .
' KEY resource (resource),' .
' KEY property (property)' .
') TYPE=MyISAM';
 
return $this->executerRequeteManip($requete_creation_table);
}
private function verifierPresenceTableUsers($base, $prefixe) {
$requete_presence_table = 'SELECT COUNT(*) as table_existe FROM information_schema.tables
WHERE TABLE_SCHEMA = "'.$base.'" AND TABLE_NAME = "'.$prefixe.'users"';
$resultat_presence_table = $this->executerRequete($requete_presence_table);
$presence_table = false;
foreach($resultat_presence_table as $table_est_presente) {
if($table_est_presente['table_existe'] >= 1) {
$presence_table = true;
break;
}
}
return $presence_table;
}
private function ajouterUtilisateurAdmin($base, $prefixe, $infos_admin) {
if(!$this->verifierPresenceTableUsers($base, $prefixe)) {
echo 'Impossible d\'ajouter l\'adminwiki : '.$prefixe.'_users n\'existe_pas'.NL;
return;
}
echo 'Ajout de l\'utilisateur wikiAdmin '.NL;
$requete_suppression_si_admin_present = 'DELETE FROM '.$base.'.'.$prefixe.'users '.
'WHERE name ="'.$infos_admin['name'].'"';
$this->executerRequeteManip($requete_suppression_si_admin_present);
$requete_creation_admin = "insert into ".$base.'.'.$prefixe."users set ".
"signuptime = now(), ".
"name = '".$infos_admin['name']."', ".
"email = '".$infos_admin['email']."', ".
"password = md5('".$infos_admin['password']."')";
return $this->executerRequeteManip($requete_creation_admin);
}
private function changerVersionWakkaConfig($chemin_wikini) {
 
if(file_exists($chemin_wikini.'wakka.config.php')) {
$contenu_wakka_config = file_get_contents($chemin_wikini.'wakka.config.php');
$contenu_wakka_config_maj = str_replace('"wikini_version" => "0.4.3"','"wikini_version" => "0.5.0"',$contenu_wakka_config);
$contenu_wakka_config_maj = str_replace("'wikini_version' => '0.4.3'","'wikini_version' => '0.5.0'",$contenu_wakka_config_maj);
if(self::dry_run) {
echo 'Wakka Config mis à jour '.$contenu_wakka_config_maj.NL;
} else {
//file_put_contents($chemin_wikini.'wakka.config.php', $contenu_wakka_config_maj);
}
echo 'Changement de la version de wikini '.NL;
} else {
echo 'Attention ! le fichier '.$chemin_wikini.'wakka.config.php n\'existe pas '.NL;
}
}
private function copierFichiersWikini($chemin_base_wiki_defaut, $chemin_wiki_dest) {
if(self::dry_run) {
echo 'copie de '.$chemin_base_wiki_defaut.' vers '.$chemin_wiki_dest.NL;
$copie_recursive = true;
} else {
if(trim($chemin_base_wiki_defaut) != '/' && trim($chemin_wiki_dest) != '/') {
$copie_recursive = shell_exec( " cp -Rf -a ".$chemin_base_wiki_defaut."* ".$chemin_wiki_dest." 2>&1 " );
}
}
return $copie_recursive;
}
private function ajoutPageFormatees($chemin_wikini, $utilisateur) {
$chemin_base_wiki_defaut = $this->config['appli']['chemin_wiki_defaut'];
require_once($chemin_base_wiki_defaut.'wakka_class.php');
$nom_admin = $this->config['appli']['nom_admin_wiki'];
$chemin_wikini = rtrim($chemin_wikini,'/');
require_once($chemin_wikini.'/wakka.config.php');
// la variable $wakkaConfig est contenu dans le fichier wakka.config.php
$config = $wakkaConfig;
$wiki = new Wiki($config);
$wiki->SetGroupACL("admins", $nom_admin);
$wiki->setUser($utilisateur);
//insertion des pages de documentation et des pages standards
$d = dir($chemin_base_wiki_defaut.'/setup/doc/');
while ($doc = $d->read()){
if (is_dir($doc) || substr($doc, -4) != '.txt') {continue;}
$pagecontent = implode ('', file($chemin_base_wiki_defaut.'/setup/doc/'.$doc));
$pagecontent = mb_convert_encoding($pagecontent,'UTF-8','ISO-8859-15');
if ($doc=='_root_page.txt'){
$pagename = $config["root_page"];
}else{
$pagename = substr($doc,0,strpos($doc,'.txt'));
}
$base = $config['mysql_database'];
$requete_existence_page = "Select tag from ".$base.".".$config['table_prefix']."pages where tag='$pagename'";
$existence_page = $this->executerRequete($requete_existence_page);
if (is_array($existence_page) && count($existence_page) > 0) {
echo 'la page '.$pagename.' existe déjà '.NL;
} else {
echo 'Ajout de la page '.$pagename.NL;
$requete_maj_pages_anciennes = "UPDATE ".$base.".".$config['table_prefix']."pages ".
"SET ".
"latest = 'N'".
"WHERE tag = '$pagename'";
$reussite = $this->executerRequeteManip($requete_maj_pages_anciennes);
$requete_insertion_page = "INSERT INTO ".$base.".".$config['table_prefix']."pages ".
"SET tag = '$pagename', ".
"body = ".$this->bdd->quote($pagecontent).", ".
"user = '".$nom_admin."', ".
"owner = '".$nom_admin."', " .
"time = now(), ".
"latest = 'Y'";
$reussite = $this->executerRequeteManip($requete_insertion_page);
if(!$reussite) {
echo 'echec de l\'ajout de la page '.$pagename.NL;
} else {
// mise à jour des liens entre pages
$wiki->SetPage($wiki->LoadPage($pagename,"",0));
$wiki->ClearLinkTable();
$wiki->StartLinkTracking();
$wiki->TrackLinkTo($pagename);
$wiki->StopLinkTracking();
$wiki->WriteLinkTable();
$wiki->ClearLinkTable();
}
}
}
}
}
?>
/tags/2014_06_04/jrest/services/Resume.php
New file
0,0 → 1,108
<?php
/**
* PHP Version 5
*
* @category PHP
* @package papyrus_bp
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/papyrus_bp/
*/
 
Class Resume extends ProjetService {
public function __construct($config, $demarrer_session= true) {
parent::__construct($config, $demarrer_session);
}
 
public function getElement($uid){
 
$id_utilisateur = $uid[0];
$mail_utilisateur = $uid[1];
 
// on selectionne les projets les plus actifs
$requete_projets = 'SELECT DISTINCT *'.
' FROM projet_statistiques'.
' WHERE ps_ce_projet'.
' IN '.
'(SELECT psu_id_projet FROM projet_statut_utilisateurs'.
' WHERE psu_id_utilisateur = '.$this->bdd->quote($id_utilisateur).')'.
' GROUP BY ps_ce_projet'.
' ORDER BY ps_msg_derniere_semaine DESC'.
' LIMIT 0,5';
$resume = array();
 
$resume['titre'] = 'Vos projets les plus actifs';
$resume['lien_appli'] = '<a href="http://www.tela-botanica.org/page:liste_projets"> Voir tous les projets </a>';
 
$projets = $this->bdd->query($requete_projets)->fetchAll();
 
if(!$projets) {
$resume['message'] = 'Vous n\'êtes inscrit à aucun projet';
} else {
foreach($projets as $projet) {
 
$requete_info_projet = 'SELECT p_titre'.
' FROM projet'.
' WHERE p_id = '.$this->bdd->quote($projet['ps_ce_projet']);
 
$projet_infos = $this->bdd->query($requete_info_projet)->fetchAll();
 
$infos_messages = '';
 
if($projet['ps_msg_derniere_semaine'] > 0) {
$infos_messages = ' (+ '.$projet['ps_msg_derniere_semaine'].' nouveaux messages) ';
} else {
$infos_messages = ' (aucun nouveau message) ';
}
 
$cible_lien = 'http://www.tela-botanica.org/page:liste_projets?id_projet='.$projet['ps_ce_projet'];
$resume_item = array('element' => $projet_infos[0]['p_titre'].$infos_messages, 'lien' => $cible_lien);
$resume['elements'][] = $resume_item;
}
}
 
$this->envoyer($resume);
}
 
public function gererInscription($id_utilisateur, $mail_utilisateur) {
 
$requete_projets_utilisateur = 'SELECT * FROM projet_statut_utilisateurs'.
' WHERE psu_id_utilisateur = '.$this->bdd->quote($id_utilisateur);
 
$resume = '';
$projets = $this->requeteTous($requete_projets_utilisateur);
 
if($projets <= 0) {
$resume = '<h3> Vous n\'êtes inscrit à aucun projet </h3>';
} else {
$resume = '<h3> Vos projets </h3>';
$resume .= '<ul id="liste_projets">';
foreach($projets as $projet) {
 
$requete_info_projet = 'SELECT *'.
' FROM projet'.
' WHERE p_id = '.$this->bdd->quote($projet['psu_id_projet']);
 
$projet_infos = $this->requeteUn($requete_info_projet);
$infos_messages = '';
 
$resume .= '<li>
<a href="http://www.tela-botanica.org/page:liste_projets?id_projet='.$projet_infos['p_id'].'" >'.
'<b>'.$projet_infos['p_titre'].'</b>
</a>
<a onclick="javascript:return confirm(\'Se désinscrire du projet ?\');" href="http://www.tela-botanica.org/page:mes_preferences_des_projets?id_projet=7&amp;act=26">
Se désinscrire du projet
</a>
</li>';
}
$resume .= '</ul>';
}
 
return $resume;
}
}
?>
/tags/2014_06_04/jrest/services/DesinscriptionProjet.php
New file
0,0 → 1,45
<?php
 
Class DesinscriptionProjet extends ProjetService {
public function getElement($uid) {
 
$id_utilisateur = (isset($_GET['id_utilisateur'])) ? $_GET['id_utilisateur'] : false;
$mail = (isset($_GET['mail'])) ? $_GET['mail'] : false;
$id_projet = (isset($_GET['id_projet'])) ? $_GET['id_projet'] : false;
 
if(!$id_utilisateur || !$id_projet) {
return false;
}
 
// et on le supprime du projet
$suppression_participant = $this->supprimerParticipantAProjet($id_utilisateur, $id_projet);
 
// ainsi que des listes associées
if($mail) {
$listes = $this->obtenirListesAssocieesAuProjet($id_projet);
// si pas de liste, rien à faire
if(count($listes) <= 0) {
continue;
}
 
$nom_liste = $listes[0]['pl_nom_liste'];
$id_liste = $listes[0]['pl_id_liste'];
$suppression_liste = $this->supprimerInscriptionAListeProjet($id_utilisateur, $id_liste);
 
// on supprime l'abonnement
if($this->estAbonneAListe($nom_liste, $mail)) {
if(!$this->desinscriptionListe($nom_liste, $mail)) {
$this->envoyer("false");
}
}
}
 
$this->envoyer("OK");
return;
}
}
 
?>
/tags/2014_06_04/jrest/services/Documents.php
New file
0,0 → 1,63
<?php
/**
* PHP Version 5
*
* @category PHP
* @package papyrus_bp
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/papyrus_bp/
*/
 
Class Documents extends ProjetService {
public function __construct($config, $demarrer_session= true) {
parent::__construct($config, $demarrer_session);
}
 
public function getElement($uid){
$id_utilisateur = $uid[1];
$mail_utilisateur = $uid[2];
if($id_utilisateur == "") {
return;
}
 
// on selectionne les projets les plus actifs
$requete_docs_projets = 'SELECT * FROM projet_documents WHERE pd_ce_utilisateur = '.$this->bdd->quote($id_utilisateur).' '.
'AND pd_ce_type != 0 AND pd_visibilite = "public" '.
'ORDER BY pd_date_de_mise_a_jour DESC '.
'LIMIT 0,5';
$resume = array();
 
$resume['titre'] = 'Vos derniers documents déposés';
//$resume['lien_appli'] = '<a href="http://www.tela-botanica.org/page:liste_projets"> Voir tous les projets </a>';
 
$docs = $this->bdd->query($requete_docs_projets)->fetchAll();
 
if(!$docs) {
$resume['message'] = 'Vous n\'avez déposé aucun document';
} else {
foreach($docs as $doc) {
$infos_projet = $this->obtenirInformationsProjet($doc['pd_ce_projet']);
$nom_projet = $infos_projet[0]['p_titre'];
$date_formatee = strftime( "%d/%m/%Y" , strtotime( $doc['pd_date_de_mise_a_jour'] ) );
 
$infos_messages = ' ('.$nom_projet.' le '.$date_formatee.') ';
$cible_lien = 'http://www.tela-botanica.org/projets/'.$doc['pd_ce_projet'].'/telechargement/'.$doc['pd_id'];
$resume_item = array('element' => $doc['pd_nom'].$infos_messages, 'lien' => $cible_lien);
$resume['elements'][] = $resume_item;
}
}
 
$this->envoyer($resume);
}
}
?>
/tags/2014_06_04/jrest/services/Inscription.php
New file
0,0 → 1,21
<?php
/**
* PHP Version 5
*
* @category PHP
* @package papyrus_bp
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/papyrus_bp/
*/
 
Class Inscription extends JRestService {
 
public function getElement($uid){
 
$this->envoyer("OK");
}
}
?>
/tags/2014_06_04/jrest/services/ProjetService.php
New file
0,0 → 1,174
<?php
/**
* PHP Version 5
*
* @category PHP
* @package projet_bp
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/projet_bp/
*/
 
class ProjetService extends JRestService {
public function __construct($config, $demarrer_session= true) {
parent::__construct($config, $demarrer_session);
}
 
protected function obtenirProjetsPourParticipant($id_utilisateur) {
 
// on selectionne la liste des projets auxquel on est inscrit
$requete_projets = 'SELECT DISTINCT *'.
' FROM projet'.
' WHERE p_id'.
' IN '.
'(SELECT psu_id_projet FROM projet_statut_utilisateurs'.
' WHERE psu_id_utilisateur = '.$this->bdd->quote($id_utilisateur).')'.
' GROUP BY p_id';
 
try {
$projets = $this->bdd->query($requete_projets)->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
Log::getInstance()->ajouterEntree('projet','Fichier: '.$e->getFile().' Ligne: '.$e->getLine().' '.$e->getMessage());
return array();
}
 
// pas de projets ? alors c'est fait !
if(!$projets || count($projets) <= 0) {
return array();
}
 
return $projets;
}
protected function obtenirInformationsProjet($id_projet) {
$requete_informations_projet = 'SELECT DISTINCT *'.
' FROM projet'.
' WHERE p_id = '.$this->bdd->quote($id_projet) ;
try {
$projet = $this->bdd->query($requete_informations_projet)->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
Log::getInstance()->ajouterEntree('projet','Fichier: '.$e->getFile().' Ligne: '.$e->getLine().' '.$e->getMessage());
return false;
}
 
// pas de projets ? alors c'est fait !
if(!$projet) {
return false;
}
 
return $projet;
}
 
protected function obtenirListesAssocieesAuProjet($id_projet) {
 
$requete_liste_projets = 'SELECT * FROM projet_liste '.
'WHERE pl_id_liste IN '.
'(SELECT pl_id_liste from projet_lien_liste '.
'WHERE pl_id_projet='.$this->bdd->quote($id_projet).')' ;
 
try {
$listes_projets = $this->bdd->query($requete_liste_projets)->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
Log::getInstance()->ajouterEntree('projet','Fichier: '.$e->getFile().' Ligne: '.$e->getLine().' '.$e->getMessage());
return array();
}
 
 
if(!$listes_projets || count($listes_projets) <= 0) {
return array();
}
 
return $listes_projets;
}
protected function obtenirListesExternesAssocieesAuProjet($id_projet) {
 
$requete_liste_projets = 'SELECT * FROM agora '.
'WHERE plle_id_liste IN '.
'(SELECT plle_id_liste from projet_lien_liste_externe '.
'WHERE plle_id_projet='.$this->bdd->quote($id_projet).')' ;
 
try {
$listes_projets = $this->bdd->query($requete_liste_projets)->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
Log::getInstance()->ajouterEntree('projet','Fichier: '.$e->getFile().' Ligne: '.$e->getLine().' '.$e->getMessage());
return array();
}
 
 
if(!$listes_projets || count($listes_projets) <= 0) {
return array();
}
 
return $listes_projets;
}
protected function supprimerInscriptionAListeProjet($id_utilisateur, $id_liste) {
$requete_suppression_liste = 'DELETE FROM projet_inscription_liste '.
'WHERE pil_id_utilisateur='.$this->bdd->quote($id_utilisateur).' and pil_id_liste='.$this->bdd->quote($id_liste);
 
try {
$requete_suppression_liste = $this->bdd->query($requete_suppression_liste);
} catch (PDOException $e) {
Log::getInstance()->ajouterEntree('projet','Fichier: '.$e->getFile().' Ligne: '.$e->getLine().' '.$e->getMessage().' '.$requete_suppression_liste);
return false;
}
}
 
protected function supprimerParticipantAProjet($id_utilisateur, $id_projet) {
$requete_suppression_projets = 'DELETE FROM projet_statut_utilisateurs '.
'WHERE psu_id_utilisateur='.$this->bdd->quote($id_utilisateur).' and psu_id_projet='.$this->bdd->quote($id_projet);
 
try {
$requete_suppression_projets = $this->bdd->query($requete_suppression_projets);
} catch (PDOException $e) {
Log::getInstance()->ajouterEntree('projet','Fichier: '.$e->getFile().' Ligne: '.$e->getLine().' '.$e->getMessage().' '.$requete_suppression_projets);
return false;
}
return true;
}
 
protected function estAbonneAListe($nom_liste, $mail) {
 
try {
$est_abonne = '0' ;
// TODO: externaliser l'adresse
$xml_abonne = new SimpleXMLElement(file_get_contents('http://vpopmail.tela-botanica.org/est_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail)) ;
$est_abonne = $xml_abonne[0] ;
 
if($est_abonne == '1') {
return true;
} else {
return false;
}
}
catch(Exception $e) {
trigger_error($e->getMessage()) ;
return false;
}
 
}
 
protected function modifierMailPourListe($nom_liste, $ancien_mail, $nouveau_mail) {
return ($this->desinscriptionListe($nom_liste, $ancien_mail) && $this->inscriptionListe($nom_liste, $nouveau_mail));
}
 
protected function inscriptionListe($nom_liste, $mail) {
// TODO: externaliser l'adresse
return $inscription_abonne = file_get_contents('http://vpopmail.tela-botanica.org/ajout_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail) ;
}
 
protected function desinscriptionListe($nom_liste, $mail) {
// TODO: externaliser l'adresse
return $suppression_abonne = file_get_contents('http://vpopmail.tela-botanica.org/suppression_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail) ;
}
}
?>
/tags/2014_06_04/jrest/.htaccess
New file
0,0 → 1,4
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /projet_bp/jrest/index.php/
/tags/2014_06_04/jrest/jrest.ini.php
New file
0,0 → 1,39
;<?/*
[settings]
baseURL = "/projet_bp/jrest/"
 
; Default
[appli]
phptype = mysql
username = aurelien
password = Canard
hostspec = localhost
database = papyrus_bp
url_service_liste = vpopmail.tela-botanica.org/
domaine_service_liste = tela-botanica.org
adresse_appli_projet = http://www.tela-botanica.org/page:liste_projets
addresse_telechargement_docs = http://www.tela-botanica.org/projets/%s/telechargement/%s
 
; Identification
[database_ident]
phptype = mysql
username = aurelien
password = Canard
hostspec = localhost
database = tela_prod
annuaire = annuaire_tela
ann_id = U_MAIL
ann_pwd = U_PASSWD
pass_crypt_funct = md5
 
 
; LOGS
[log]
cheminlog = "/home/aurelien/Logs/"
timezone = "Europe/Paris"
taillemax = 100000
 
; ADMIN
[jrest_admin]
admin = aurelien@tela-botanica.org,david.delon@clapas.net,jpm@tela-botanica.org,marie@tela-botanica.org
;*/?>
/tags/2014_06_04/jrest/JRest.php
New file
0,0 → 1,304
<?php
// In : utf8 url_encoded (get et post)
// Out : utf8
 
// TODO : gerer les retours : dans ce controleur : code retour et envoi ...
class JRest {
 
/** Parsed configuration file */
private $config;
 
/** The HTTP request method used. */
private $method = 'GET';
 
/** The HTTP request data sent (if any). */
private $requestData = NULL;
 
/** Array of strings to convert into the HTTP response. */
private $output = array();
 
/** Nom resource. */
private $resource = NULL;
 
/** Identifiant unique resource. */
private $uid = NULL;
 
/**
* Constructor. Parses the configuration file "JRest.ini", grabs any request data sent, records the HTTP
* request method used and parses the request URL to find out the requested resource
* @param str iniFile Configuration file to use
*/
public function JRest($iniFile = 'jrest.ini.php') {
 
$this->config = parse_ini_file($iniFile, TRUE);
if (isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && isset($_SERVER['QUERY_STRING'])) {
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > 0) {
$this->requestData = '';
$httpContent = fopen('php://input', 'r');
while ($data = fread($httpContent, 1024)) {
$this->requestData .= $data;
}
fclose($httpContent);
}
if (strlen($_SERVER['QUERY_STRING']) == 0) {
$len = strlen($_SERVER['REQUEST_URI']);
} else {
$len = -(strlen($_SERVER['QUERY_STRING']) + 1);
}
$urlString = substr($_SERVER['REQUEST_URI'], strlen($this->config['settings']['baseURL']), $len);
 
$urlParts = explode('/', $urlString);
 
if (isset($urlParts[0])) $this->resource = $urlParts[0];
if (count($urlParts) > 1 && $urlParts[1] != '') {
array_shift($urlParts);
foreach ($urlParts as $uid) {
if ($uid != '') {
$this->uid[] = urldecode($uid);
}
}
}
 
$this->method = $_SERVER['REQUEST_METHOD'];
} else {
trigger_error('I require the server variables REQUEST_URI, REQUEST_METHOD and QUERY_STRING to work.', E_USER_ERROR);
}
}
 
/**
* Execute the request.
*/
function exec() {
 
switch ($this->method) {
case 'GET':
$this->get();
break;
case 'POST':
$this->post();
break;
case 'DELETE':
$this->delete();
break;
case 'PUT':
$this->add();
break;
}
}
 
/**
* Execute a GET request. A GET request fetches a list of resource when no resource name is given, a list of element
* when a resource name is given, or a resource element when a resource and resource unique identifier are given. It does not change the
* database contents.
*/
private function get() {
if ($this->resource) {
$resource_file = 'services/'.ucfirst($this->resource).'.php';
$resource_class = ucfirst($this->resource);
if (file_exists($resource_file)) {
include_once $resource_file;
if (class_exists($resource_class)) {
$service = new $resource_class($this->config);
if ($this->uid) { // get a resource element
if (method_exists($service, 'getElement')) {
$service->getElement($this->uid);
}
} elseif (method_exists($service, 'getRessource')) { // get all elements of a ressource
$service->getRessource();
}
}
}
} else { // get resources
// include set.jrest.php, instanticiation et appel
}
}
 
private function post() {
$pairs = array();
// Récupération des paramètres passés dans le contenu de la requête HTTP (= POST)
if ($this->requestData) {
$pairs = $this->parseRequestData();
}
 
// Ajout des informations concernant l'upload de fichier passées dans la variable $_FILE
if(isset($_FILES)) {
foreach ($_FILES as $v) {
$pairs[$v['name']] = $v;
}
 
// Ne pas effacer cette ligne ! Elle est indispensable pour les services du Carnet en ligne
// qui n'utilisent que le tableau pairs dans les posts
$pairs = array_merge($pairs, $_POST);
}
 
// gestion du contenu du post
if(isset($_POST))
{
// Safari ne sait pas envoyer des DELETE avec gwt...
// Nous utilisons le parametre "action" passé dans le POST qui doit contenir DELETE pour lancer la supression
if ($pairs['action'] == 'DELETE') {
$this->delete();
return;
}
 
if (count($pairs) != 0) {
if ($this->uid) { // get a resource element
$resource_file = 'services/'.ucfirst($this->resource).'.php';
$resource_class = ucfirst($this->resource);
if (file_exists($resource_file)) {
include_once $resource_file;
if (class_exists($resource_class)) {
$service = new $resource_class($this->config);
if (method_exists($service,'updateElement')) { // Update element
// TODO : a voir le retour ...
if ($service->updateElement($this->uid, $pairs)) {
$this->created();
}
}
}
}
} else { // get all elements of a ressource
$this->add($pairs);
}
} else {
$this->lengthRequired();
}
}
}
 
private function delete() {
$resource_file = 'services/'.ucfirst($this->resource).'.php';
$resource_class = ucfirst($this->resource);
if (file_exists($resource_file)) {
include_once $resource_file;
if (class_exists($resource_class)) {
$service = new $resource_class($this->config);
if ($this->uid) { // get a resource element
if (method_exists($service, 'deleteElement')) { // Delete element
if ($service->deleteElement($this->uid)) {
$this->noContent();
}
}
}
}
}
}
 
private function add($pairs = null) {
if (is_null($pairs)) {
$pairs = array();
// Récupération des paramètres passés dans le contenu de la requête HTTP (= POST)
// FIXME : vérifier que l'on récupère bien les données passées par PUT
if ($this->requestData) {
$pairs = $this->parseRequestData();
}
}
 
if (count($pairs) != 0) {
$resource_file = 'services/'.ucfirst($this->resource).'.php';
$resource_class = ucfirst($this->resource);
if (file_exists($resource_file)) {
include_once $resource_file;
if (class_exists($resource_class)) {
$service = new $resource_class($this->config);
if (method_exists($service,'createElement')) { // Create a new element
if ($service->createElement($pairs)) {
$this->created();
}
}
}
}
} else {
$this->lengthRequired();
}
}
 
/**
* Parse the HTTP request data.
* @return str[] Array of name value pairs
*/
private function parseRequestData() {
$values = array();
$pairs = explode('&', $this->requestData);
foreach ($pairs as $pair) {
$parts = explode('=', $pair);
if (isset($parts[0]) && isset($parts[1])) {
$parts[1] = rtrim(urldecode($parts[1]));
$values[$parts[0]] = $parts[1];
}
}
return $values;
}
 
/**
* Send a HTTP 201 response header.
*/
private function created($url = FALSE) {
header('HTTP/1.0 201 Created');
if ($url) {
header('Location: '.$url);
}
}
 
/**
* Send a HTTP 204 response header.
*/
private function noContent() {
header('HTTP/1.0 204 No Content');
}
 
/**
* Send a HTTP 400 response header.
*/
private function badRequest() {
header('HTTP/1.0 400 Bad Request');
}
 
/**
* Send a HTTP 401 response header.
*/
private function unauthorized($realm = 'JRest') {
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) {
header('WWW-Authenticate: Basic realm="'.$realm.'"');
}
header('HTTP/1.0 401 Unauthorized');
}
 
/**
* Send a HTTP 404 response header.
*/
private function notFound() {
header('HTTP/1.0 404 Not Found');
}
 
/**
* Send a HTTP 405 response header.
*/
private function methodNotAllowed($allowed = 'GET, HEAD') {
header('HTTP/1.0 405 Method Not Allowed');
header('Allow: '.$allowed);
}
 
/**
* Send a HTTP 406 response header.
*/
private function notAcceptable() {
header('HTTP/1.0 406 Not Acceptable');
echo join(', ', array_keys($this->config['renderers']));
}
 
/**
* Send a HTTP 411 response header.
*/
private function lengthRequired() {
header('HTTP/1.0 411 Length Required');
}
 
/**
* Send a HTTP 500 response header.
*/
private function internalServerError() {
header('HTTP/1.0 500 Internal Server Error');
}
}
?>
/tags/2014_06_04/jrest/index.php
New file
0,0 → 1,38
<?php
 
// Decommenter ces lignes si version de php < 5
//require_once 'lib/JSON.php';
 
// Lazy require
// TODO : voir si on ne peut pas dépacer ces inclusions directement dans les services.
//require_once 'lib/DBAccessor.php';
//require_once 'lib/SpreadsheetProductor.php';
//require_once 'lib/PDFProductor.php';
//require 'JRest.php';
 
/**
* La fonction __autoload() charge dynamiquement les classes trouvées dans le code.
*
* Cette fonction est appelée par php5 quand il trouve une instanciation de classe dans le code.
*
*@param string le nom de la classe appelée.
*@return void le fichier contenant la classe doit être inclu par la fonction.
*/
function __autoload($classe)
{
if (class_exists($classe)) {
return null;
}
 
$chemins = array('', 'services/', 'services/include/', 'lib/');
foreach ($chemins as $chemin) {
$chemin = $chemin.$classe.'.php';
if (file_exists($chemin)) {
require_once $chemin;
}
}
}
 
$jRest =& new JRest();
$jRest->exec();
?>
/tags/2014_06_04/fichier_attache.php
New file
0,0 → 1,144
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: fichier_attache.php,v 1.2 2008-08-25 15:27:32 alexandre_tb Exp $
/**
* Application projet
*
* Fichier pour afficher les pièces jointes
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// A faire
set_include_path(get_include_path().':../../api/pear/');
include_once 'configuration/projet.config.inc.php' ;
include_once ('classes/ezmlmAccessObject.class.php') ;
include_once 'Mail/mimeDecode.php' ;
include_once 'Net/URL.php' ;
 
$num_rep = array_shift ($actionargs) ;
$num_message = array_shift($actionargs) ;
 
$xml_parser = &new ezmlmAccessObject('message', PROJET_DOMAINE_LISTE,
$nom_liste, $GLOBALS['lang']) ;
$xml_parser->setIdMessage($num_rep, $num_message) ;
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$mail = ob_get_contents() ;
ob_end_clean();
/*
$mail = file_get_contents (PROJET_CHEMIN_LISTES.PROJET_DOMAINE_LISTE.'/'.$nom_liste.'/'.'archive/'.$num_rep.'/'.$num_message) ;
*/
 
$decodeur = new Mail_mimeDecode($mail) ;
$mailDecode = $decodeur->decode(array ('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
 
//var_dump ($mailDecode) ;
function getParts(&$part, $num_part) {
$part = $part->parts[$num_part] ;
return $part ;
}
 
for ($i = 0; $i < count ($actionargs); $i++) {
$part = getParts($mailDecode, $actionargs[$i]) ;
}
$content_type = $part->ctype_primary.'/'.$part->ctype_secondary ;
 
// Certain fichiers attaché n'ont pas de ctype_primary et ctype_secondary
if ($content_type == '/') {
$content_type = $part->content_type;
}
 
$tableau_type_image = array ('jpg', 'jpeg', 'pjpeg');
 
if (isset($_GET['min']) && (in_array ($part->ctype_secondary, $tableau_type_image))) {
$chemin = $PHP_SELF.'?'.$_SERVER["QUERY_STRING"]; // le chemin en absolu
$url = new Net_URL($chemin);
$url->removeQueryString('min');
$chemin = $url->getURL();
 
// vous pouvez travailler en url relative aussi: img.jpg
$x = 500; # largeur a redimensionner
$y = 150; # hauteur a redimensionner
//echo $chemin;
$im = imagecreatefromjpeg($chemin);
$ow = imagesx($im);
$oh = imagesy($im);
$mw = 200; // max width
$mh = 200; // max height
if( $ow > $mw || $oh > $mh ) {
if( $ow > $oh ) {
$tnw = $mw;
$tnh = $tnw * $oh / $ow;
} else {
$tnh = $mh;
$tnw = $tnh * $ow / $oh;
}
} else {
$tnw = $ow;
$tnh = $oh;
}
$imtn = imagecreatetruecolor($tnw, $tnh);
if (!imagecopyresized($imtn, $im, 0, 0, 0, 0, $tnw, $tnh, $ow, $oh)) {
$erreur = 'Photo %s. Redimensionnement impossible : %s.'."\n";
}
Header("Content-type: image/jpeg");
if (!imagejpeg($imtn)) {
$erreur = 'Photo %s. Création de l\'image redimenssionnée impossible : %s.'."\n";
}
imagedestroy($im);
imagedestroy($imtn);
exit();
}
 
 
$nom_du_fichier = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : $part->ctype_parameters['name'] ;
//var_dump ($part);
 
header('Expires: Wen, 01 Dec 1999 01:00:00 GMT');// Date du passé
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');// toujours modifié
header('Cache-Control: Public');// HTTP/1.1
header('Content-Type: '.$content_type) ;
header('Content-Length: '.strlen($part->body).";");
header('Content-Disposition: attachment; filename="'.$nom_du_fichier.'"');
//header('Content-Transfer-Encoding: '.$part->content-transfer-encoding);
echo $part->body ;
exit(0) ;
 
?>
/tags/2014_06_04/projet.php
New file
0,0 → 1,284
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projet.php,v 1.17 2008-10-22 08:21:58 aperonnet Exp $
/**
* Application projet
*
* Fichier d'appel pour papyrus
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.17 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once 'configuration/projet.config.inc.php' ;
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
 
// Inclusion des styles selon papyrus
if (function_exists("GEN_stockerStyleExterne")) {
if (file_exists('client/projet/projet.css')) GEN_stockerStyleExterne('projet','client/projet/projet.css') ;
}
 
// Nettoyage de la variable logout de papyrus
$GLOBALS['url']->removeQueryString('logout');
 
// Nous indiquons à Papyrus de ne pas chercher de balises d'applettes dans le contenu généré par l'appli
$GLOBALS['_PAPYRUS_']['applette']['analyse'] = true;
// +------------------------------------------------------------------------------------------------------+
// | LISTE des constantes |
// +------------------------------------------------------------------------------------------------------+
 
define ("PROJET_DEFAUT", 1) ;
define ("PROJET_VOIR", 2) ;
define ('PROJET_MENU_AFFICHER_CONTENU_CORPS', 1) ;
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
if (isset($_REQUEST[PROJET_VARIABLE_ID_PROJET])) {
function afficherContenuNavigation () {
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ID_PROJET, $_REQUEST[PROJET_VARIABLE_ID_PROJET]) ;
if (empty($_REQUEST[PROJET_VARIABLE_ACTION])) {
$_REQUEST[PROJET_VARIABLE_ACTION] = PROJET_ACTION_VOIR_RESUME ;
}
$res = '' ;
if (isset($GLOBALS['_GEN_commun']['info_application']->presentation)) {
$res .= '<ul class="onglets">';
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_RESUME);
$res .= '<li id="projet_resume" class="'.cma(PROJET_ACTION_VOIR_RESUME).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_SYNTHESE.'</a></li>';
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DESCRIPTION);
$res .= '<li id="projet_description" class="'.cma(PROJET_ACTION_VOIR_DESCRIPTION).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_DESCRIPTION.'</a></li>';
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_WIKINI);
$res .= '<li id="projet_wikini" class="'.cma(PROJET_ACTION_VOIR_WIKINI).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_WIKINI.'</a></li>';
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT) ;
$res .= '<li id="projet_documents" class="'.cma(PROJET_ACTION_VOIR_DOCUMENT).'"><a href="'.$GLOBALS['url']->getURL().'">Documents</a></li>';
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM) ;
$res .= '<li id="projet_forum" class="'.cma(PROJET_ACTION_VOIR_FORUM).'"><a href="'.$GLOBALS['url']->getURL().'">Forum</a></li>';
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
$res .= '<li id="projet_participants" class="'.cma(PROJET_ACTION_VOIR_PARTICIPANT).'"><a href="'.$GLOBALS['url']->getURL().'">Participants</a></li>';
$res .= '</ul>';
//$GLOBALS['url']->removeQueryString (PROJET_VARIABLE_ACTION) ;
}
if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) {
$res = '' ;
}
return $res ;
}
}
 
function afficherContenuMenu()
{
$sortie = '';
// on fait de meme pour id_projet
$id_projet = isset($_REQUEST[PROJET_VARIABLE_ID_PROJET]) ? $_REQUEST[PROJET_VARIABLE_ID_PROJET] : '';
// On recherche une action dans la variable $action, s'il n'y a pas, on envoie defaut
$action = isset($_REQUEST[PROJET_VARIABLE_ACTION]) ? $_REQUEST[PROJET_VARIABLE_ACTION] : PROJET_DEFAUT;
// et pour id_repertoire
$id_repertoire = isset($_REQUEST['id_repertoire']) ? $_REQUEST['id_repertoire'] : '';
 
$controleur = new projetControleur($GLOBALS['projet_db'], $GLOBALS['projet_auth'], $GLOBALS['url']) ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
if ($id_projet != '' && projet::projetExiste($GLOBALS['projet_db'], $id_projet)) {
$controleur->setIdProjet($id_projet) ;
}
if ($id_repertoire != "") {
$controleur->setIdRepertoire($id_repertoire) ;
}
if (isset ($GLOBALS['_GEN_commun']['info_application']->prive)) {
$controleur->setPrive() ;
}
// Dans le cas de la presentation par arbre, on met les menus
if (isset($GLOBALS['_GEN_commun']['info_application']->presentation) || isset($controleur->_presentation)){
 
$sortie .= $controleur->menuGeneral() ;
}
if (isset($GLOBALS['_GEN_commun']['info_application']->seulement)) {
$controleur->setIdProjet($GLOBALS['_GEN_commun']['info_application']->seulement) ;
}
if (isset($GLOBALS['_GEN_commun']['info_application']->telechargement)) {
// L'action "Mettre un fichier en ligne"
$controleur->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER) ;
$res = "<ul><li><a href=\"".$controleur->_url->getURL()."\">".PROJET_METTRE_FICHIER."</a></li>\n" ;
 
// L'action creer un repertoire
$controleur->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE) ;
$res .= "<li><a href=\"".$controleur->_url->getURL()."\">".PROJET_CREER_REP."</a></li>\n" ;
$res .= '</ul></li>' ;
$sortie .= $res ;
}
// Dans le cas d'un forum simple, on ne met pas les menus
if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) {
return ;
}
return $sortie;
}
 
function afficherContenuCorps() {
 
// On recherche une action dans la variable $action, s'il n'y a pas, on envoie defaut
$action = isset($_REQUEST[PROJET_VARIABLE_ACTION]) ? $_REQUEST[PROJET_VARIABLE_ACTION] : PROJET_DEFAUT;
// on fait de meme pour id_projet
$id_projet = isset($_REQUEST[PROJET_VARIABLE_ID_PROJET]) ? $_REQUEST[PROJET_VARIABLE_ID_PROJET] : '';
 
$service = isset($_REQUEST[PROJET_VARIABLE_SERVICE]) ? $_REQUEST[PROJET_VARIABLE_SERVICE] : '';
// et pour id_repertoire
$id_repertoire = isset($_REQUEST['id_repertoire']) ? $_REQUEST['id_repertoire'] : '';
 
// et pour id_document
$id_document = isset($_REQUEST['id_document']) ? $_REQUEST['id_document'] : '';
 
// On construit le controleur en lui passant en parametre l'identifiant de connexion a la BD
// l'objet d'authentification et l'url de la page
$controleur = new projetControleur(&$GLOBALS['projet_db'], &$GLOBALS['projet_auth'], &$GLOBALS['url']) ;
$controleur->setAction ($action) ;
$controleur->setService($service);
// On indique au controleur sur quel projet on travaille
if ($id_projet != "") {
$controleur->setIdProjet($id_projet) ;
 
}
if ($id_repertoire != "") {
$controleur->setIdRepertoire($id_repertoire) ;
}
if ($id_document != "") {
$controleur->setIdDocument($id_document) ;
}
// recuperation des parametres de l'appli
if (isset($GLOBALS['_GEN_commun']['info_application']->presentation)) {
$controleur->setPresentation($GLOBALS['_GEN_commun']['info_application']->presentation) ;
}
if (isset($GLOBALS['_GEN_commun']['info_application']->projet_type)) {
$controleur->setType($GLOBALS['_GEN_commun']['info_application']->projet_type) ;
}
if (isset ($GLOBALS['_GEN_commun']['info_application']->exclure)) {
$a_exclure = explode (',', $GLOBALS['_GEN_commun']['info_application']->exclure) ;
foreach ($a_exclure as $valeur) $controleur->exclure($valeur) ;
}
if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) {
$controleur->setIdProjet($GLOBALS['_GEN_commun']['info_application']->seulement_forum) ;
// S'il n'y a pas d'action en mode forum, on affiche l'onglet Forum
if (!isset($_REQUEST[PROJET_VARIABLE_ACTION])) $controleur->setAction (PROJET_ACTION_VOIR_FORUM) ;
}
if (isset($GLOBALS['_GEN_commun']['info_application']->telechargement)) {
if (!isset($_REQUEST[PROJET_VARIABLE_ACTION])) $controleur->setAction (PROJET_ACTION_VOIR_DOCUMENT) ;
}
if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement)) {
$controleur->setIdProjet($GLOBALS['_GEN_commun']['info_application']->seulement) ;
}
// Si le parametre prive est passe, les inscriptions sont moderes
// TODO : permettre la demande d'inscription
if (isset ($GLOBALS['_GEN_commun']['info_application']->prive)) {
$controleur->setPrive() ;
}
$res = $controleur->run() ;
 
return $res ;
}
 
/** cma() calcule menu actif
*
*
* @return
*/
 
function cma ($var) {
$class = $_REQUEST[PROJET_VARIABLE_ACTION] == $var ? 'menu_actif' : 'menu_inactif' ;
return $class ;
}
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.16 2008-08-25 15:26:18 alexandre_tb
* encodage
*
* Revision 1.15 2007-06-25 12:15:06 alexandre_tb
* merge from narmer
*
* Revision 1.14 2007/04/19 15:34:35 neiluj
* preparration release (livraison) "Narmer" - v0.25
*
* Revision 1.13 2007/04/19 09:18:46 alexandre_tb
* ajout de la variable $service pour appeler les services (dans la cadre de liaisons asynchrones
*
* Revision 1.12 2006/07/04 09:35:04 alexandre_tb
* Simplification du code et ajout de controle
*
* Revision 1.11 2006/04/28 12:41:28 florian
* corrections erreurs chemin
*
* Revision 1.10 2005/12/01 16:38:32 alexandre_tb
* ajout de l'action telechargement
*
* Revision 1.9 2005/11/25 14:48:44 alexandre_tb
* ajout de la gestion de la présentation tela
*
* Revision 1.8 2005/10/25 13:50:13 alexandre_tb
* Ajout de la gestion des projets privés
*
* Revision 1.7 2005/10/17 16:22:28 alexandre_tb
* rien
*
* Revision 1.6 2005/10/06 14:54:06 alexandre_tb
* ajout de la gestion du paramètre seulement_forum
*
* Revision 1.5 2005/10/04 10:06:32 alexandre_tb
* ajout du parametre seulement_forum
*
* Revision 1.4 2005/09/28 16:29:39 ddelon
* Merge modification projet
*
* Revision 1.3 2005/09/27 16:31:06 alexandre_tb
* ??
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
 
?>
/tags/2014_06_04/wikini/ACEdImages/listenum.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/listenum.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/separator.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/separator.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/strike.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/strike.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/italic.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/italic.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/hr.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/hr.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/code.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/code.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/link.old.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/link.old.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/bold.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/bold.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/image.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/image.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/t1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/t1.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/underline.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/underline.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/t2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/t2.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/crlf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/crlf.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/listealpha.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/listealpha.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/t3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/t3.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/php.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/php.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/t4.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/t4.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/t5.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/t5.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/link.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/link.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/ACEdImages/listepuce.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/wikini/ACEdImages/listepuce.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/wikini/LICENSE
New file
0,0 → 1,36
Copyright (c) 2002, 2003 Hendrik Mans <hendrik@mans.de>
All rights reserved.
Copyright 2003 Carlo ZOTTMANN
Copyright 2002, 2003, 2004 David DELON
Copyright 2002, 2003, 2004 Charles NEPOTE
Copyright 2002, 2003, 2004 Patrick PAUL
Copyright 2003 Eric DELORD
Copyright 2003, 2004 Eric FELDSTEIN
Copyright 2003 Jean-Pascal MILCENT
Copyright 2003 Jérôme DESQUILBET
Copyright 2003 Erus UMBRAE
Copyright 2004 David VANTYGHEM
Copyright 2004 Jean Christophe ANDRE
 
 
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 AUTHOR 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.
/tags/2014_06_04/wikini/wakka.php
New file
0,0 → 1,846
<?php
/* encoding: iso-8859-1
wakka.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2003 Carlo Zottmann
Copyright 2002, 2003 David DELON
Copyright 2002, 2003, 2004 Charles NÉPOTE
Copyright 2002, 2003 Patrick PAUL
Copyright 2003 Éric DELORD
Copyright 2003 Éric FELDSTEIN
Copyright 2004 Jean-Christophe ANDRÉ
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
 
/*
Yes, most of the formatting used in this file is HORRIBLY BAD STYLE. However,
most of the action happens outside of this file, and I really wanted the code
to look as small as what it does. Basically. Oh, I just suck. :)
*/
 
 
 
// do not change this line, you fool. In fact, don't change anything! Ever!
define("WAKKA_VERSION", "0.1.1");
define("WIKINI_VERSION", "0.4.3 + contributions");
// start the compute time
list($g_usec, $g_sec) = explode(" ",microtime());
define ("t_start", (float)$g_usec + (float)$g_sec);
$t_SQL=0;
 
 
 
class Wiki
{
var $dblink;
var $page;
var $tag;
var $parameter = array();
var $queryLog = array();
var $interWiki = array();
var $VERSION;
var $CookiePath = '/';
 
 
// constructor
function Wiki($config)
{
$this->config = $config;
// some host do not allow mysql_pconnect
$this->dblink = @mysql_connect (
$this->config["mysql_host"],
$this->config["mysql_user"],
$this->config["mysql_password"]);
if ($this->dblink)
{
if (!@mysql_select_db($this->config["mysql_database"], $this->dblink))
{
@mysql_close($this->dblink);
$this->dblink = false;
}
}
$this->VERSION = WAKKA_VERSION;
 
//determine le chemin pour le cookie
$a = parse_url($this->GetConfigValue('base_url'));
$this->CookiePath = dirname($a['path']);
if ($this->CookiePath != '/') $this->CookiePath .= '/';
}
 
 
 
// DATABASE
function Query($query)
{
if($this->GetConfigValue("debug")) $start = $this->GetMicroTime();
if (!$result = mysql_query($query, $this->dblink))
{
ob_end_clean();
die("Query failed: ".$query." (".mysql_error().")");
}
if($this->GetConfigValue("debug"))
{
$time = $this->GetMicroTime() - $start;
$this->queryLog[] = array(
"query" => $query,
"time" => $time);
}
return $result;
}
function LoadSingle($query) { if ($data = $this->LoadAll($query)) return $data[0]; }
function LoadAll($query)
{
$data=array();
if ($r = $this->Query($query))
{
while ($row = mysql_fetch_assoc($r)) $data[] = $row;
mysql_free_result($r);
}
return $data;
}
 
 
 
// MISC
function GetMicroTime() { list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); }
function IncludeBuffered($filename, $notfoundText = "", $vars = "", $path = "")
{
if ($path) $dirs = explode(":", $path);
else $dirs = array("");
 
foreach($dirs as $dir)
{
if ($dir) $dir .= "/";
$fullfilename = $dir.$filename;
if (file_exists($fullfilename))
{
if (is_array($vars)) extract($vars);
 
ob_start();
include($fullfilename);
$output = ob_get_contents();
ob_end_clean();
return $output;
}
}
if ($notfoundText) return $notfoundText;
else return false;
}
 
 
 
// VARIABLES
function GetPageTag() { return $this->tag; }
function GetPageTime() { return $this->page["time"]; }
function GetMethod() { return $this->method; }
function GetConfigValue($name) { return $this->config[$name]; }
function GetWakkaName() { return $this->GetConfigValue("wakka_name"); }
function GetWakkaVersion() { return $this->VERSION; }
function GetWikiNiVersion() { return WIKINI_VERSION; }
 
 
 
// PAGES
function LoadPage($tag, $time = "", $cache = 1) {
// retrieve from cache
if (!$time && $cache && ($cachedPage = $this->GetCachedPage($tag))) { $page = $cachedPage;}
// load page
if (!isset($page)) $page = $this->LoadSingle("select * from ".$this->config["table_prefix"]."pages where tag = '".mysql_escape_string($tag)."' ".($time ? "and time = '".mysql_escape_string($time)."'" : "and latest = 'Y'")." limit 1");
// cache result
if (!$time) $this->CachePage($page);
return $page;
}
function GetCachedPage($tag) {return (isset($this->pageCache[$tag]) ? $this->pageCache[$tag] : ''); }
function CachePage($page) { $this->pageCache[$page["tag"]] = $page; }
function SetPage($page) { $this->page = $page; if ($this->page["tag"]) $this->tag = $this->page["tag"]; }
function LoadPageById($id) { return $this->LoadSingle("select * from ".$this->config["table_prefix"]."pages where id = '".mysql_escape_string($id)."' limit 1"); }
function LoadRevisions($page) { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where tag = '".mysql_escape_string($page)."' order by time desc"); }
function LoadPagesLinkingTo($tag) { return $this->LoadAll("select from_tag as tag from ".$this->config["table_prefix"]."links where to_tag = '".mysql_escape_string($tag)."' order by tag"); }
function LoadRecentlyChanged($limit=50) {
$limit= (int) $limit;
if ($pages = $this->LoadAll("select tag, time, user, owner from ".$this->config["table_prefix"]."pages where latest = 'Y' and comment_on = '' order by time desc limit $limit"))
{
foreach ($pages as $page)
{
$this->CachePage($page);
}
return $pages;
}
}
function LoadAllPages() { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where latest = 'Y' order by tag"); }
function FullTextSearch($phrase) { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where latest = 'Y' and match(tag, body) against('".mysql_escape_string($phrase)."')"); }
function LoadWantedPages() { return $this->LoadAll("select distinct ".$this->config["table_prefix"]."links.to_tag as tag,count(".$this->config["table_prefix"]."links.from_tag) as count from ".$this->config["table_prefix"]."links left join ".$this->config["table_prefix"]."pages on ".$this->config["table_prefix"]."links.to_tag = ".$this->config["table_prefix"]."pages.tag where ".$this->config["table_prefix"]."pages.tag is NULL group by tag order by count desc"); }
function LoadOrphanedPages() { return $this->LoadAll("select distinct tag from ".$this->config["table_prefix"]."pages left join ".$this->config["table_prefix"]."links on ".$this->config["table_prefix"]."pages.tag = ".$this->config["table_prefix"]."links.to_tag where ".$this->config["table_prefix"]."links.to_tag is NULL and ".$this->config["table_prefix"]."pages.comment_on = '' order by tag"); }
function IsOrphanedPage($tag) { return $this->LoadAll("select distinct tag from ".$this->config["table_prefix"]."pages left join ".$this->config["table_prefix"]."links on ".$this->config["table_prefix"]."pages.tag = ".$this->config["table_prefix"]."links.to_tag where ".$this->config["table_prefix"]."links.to_tag is NULL and ".$this->config["table_prefix"]."pages.comment_on ='' and tag='".mysql_escape_string($tag)."'"); }
function DeleteOrphanedPage($tag) {
$this->Query("delete from ".$this->config["table_prefix"]."pages where tag='".mysql_escape_string($tag)."' ");
$this->Query("delete from ".$this->config["table_prefix"]."links where from_tag='".mysql_escape_string($tag)."' ");
$this->Query("delete from ".$this->config["table_prefix"]."acls where page_tag='".mysql_escape_string($tag)."' ");
$this->Query("delete from ".$this->config["table_prefix"]."referrers where page_tag='".mysql_escape_string($tag)."' ");
}
function SavePage($tag, $body, $comment_on = "") {
// get current user
$user = $this->GetUserName();
 
//die($tag);
 
// TODO: check write privilege
if ($this->HasAccess("write", $tag))
{
// is page new?
if (!$oldPage = $this->LoadPage($tag))
{
// create default write acl. store empty write ACL for comments.
$this->SaveAcl($tag, "write", ($comment_on ? "" : $this->GetConfigValue("default_write_acl")));
 
// create default read acl
$this->SaveAcl($tag, "read", $this->GetConfigValue("default_read_acl"));
 
// create default comment acl.
$this->SaveAcl($tag, "comment", $this->GetConfigValue("default_comment_acl"));
 
// current user is owner; if user is logged in! otherwise, no owner.
if ($this->GetUser()) $owner = $user;
}
else
{
// aha! page isn't new. keep owner!
$owner = $oldPage["owner"];
}
 
 
// set all other revisions to old
$this->Query("update ".$this->config["table_prefix"]."pages set latest = 'N' where tag = '".mysql_Escape_string($tag)."'");
 
// add new revision
$this->Query("insert into ".$this->config["table_prefix"]."pages set ".
"tag = '".mysql_escape_string($tag)."', ".
($comment_on ? "comment_on = '".mysql_escape_string($comment_on)."', " : "").
"time = now(), ".
"owner = '".mysql_escape_string($owner)."', ".
"user = '".mysql_escape_string($user)."', ".
"latest = 'Y', ".
"body = '".mysql_escape_string(chop($body))."'");
}
}
function PurgePages() {
if ($days = $this->GetConfigValue("pages_purge_time")) {
// Selection of pages which can be deleted
$pages = $this->LoadAll("select distinct tag, time from ".$this->config["table_prefix"]."pages where time < date_sub(now(), interval '".mysql_escape_string($days)."' day) and latest = 'N' order by time asc");
foreach ($pages as $page) {
// Deletion if there are more than 2 versions avalaible (TODO : parameter ?)
$tags=$this->LoadAll("select distinct tag from ".$this->config["table_prefix"]."pages where tag = '".mysql_escape_string($page[tag])."' group by tag having count(*) > 2 order by tag");
foreach ($tags as $tag) {
$this->Query("delete from ".$this->config["table_prefix"]."pages where time = '".mysql_escape_string($page[time])."' and tag = '".mysql_escape_string($tag[tag])."'");
}
}
}
}
 
 
 
// COOKIES
function SetSessionCookie($name, $value) { SetCookie($name, $value, 0, $this->CookiePath); $_COOKIE[$name] = $value; }
function SetPersistentCookie($name, $value, $remember = 0) { SetCookie($name, $value, time() + ($remember ? 90*24*60*60 : 60 * 60), $this->CookiePath); $_COOKIE[$name] = $value; }
function DeleteCookie($name) { SetCookie($name, "", 1, $this->CookiePath); $_COOKIE[$name] = ""; }
function GetCookie($name) { return $_COOKIE[$name]; }
 
 
 
// HTTP/REQUEST/LINK RELATED
function SetMessage($message) { $_SESSION["message"] = $message; }
function GetMessage()
{
if (isset($_SESSION["message"])) $message = $_SESSION["message"];
else $message = "";
$_SESSION["message"] = "";
return $message;
}
function Redirect($url)
{
header("Location: $url");
exit;
}
// returns just PageName[/method].
function MiniHref($method = "", $tag = "")
{
if (!$tag = trim($tag)) $tag = $this->tag;
return $tag.($method ? "/".$method : "");
}
// returns the full url to a page/method.
function Href($method = "", $tag = "", $params = "")
{
$href = $this->config["base_url"].$this->MiniHref($method, $tag);
if ($params)
{
$href .= ($this->config["rewrite_mode"] ? "?" : "&amp;").$params;
} // ajout TEla
return $href;
}
function Link($tag, $method = "", $text = "", $track = 1) {
$tag=htmlspecialchars($tag); //avoid xss
$text=htmlspecialchars($text); //paranoiac again
if (!$text) $text = $tag;
 
// is this an interwiki link?
if (preg_match("/^([A-Z][A-Z,a-z]+)[:]([A-Z,a-z,0-9]*)$/s", $tag, $matches))
{
$tag = $this->GetInterWikiUrl($matches[1], $matches[2]);
return "<a href=\"$tag\">$text (interwiki)</a>";
}
// is this a full link? ie, does it contain non alpha-numeric characters?
// Note : [:alnum:] is equivalent [0-9A-Za-z]
// [^[:alnum:]] means : some caracters other than [0-9A-Za-z]
// For example : "www.adress.com", "mailto:adress@domain.com", "http://www.adress.com"
else if (preg_match("/[^[:alnum:]]/", $tag))
{
// check for email addresses
if (preg_match("/^.+\@.+$/", $tag))
{
$tag = "mailto:".$tag;
}
// check for protocol-less URLs
else if (!preg_match("/:\/\//", $tag))
{
$tag = "http://".$tag; //Very important for xss (avoid javascript:() hacking)
}
// is this an inline image (text!=tag and url ends png,gif,jpeg)
if ($text!=$tag and preg_match("/.(gif|jpeg|png|jpg)$/i",$tag))
{
return "<img src=\"$tag\" alt=\"$text\" />";
}
else
{
return "<a href=\"$tag\">$text</a>";
}
}
else
{
// it's a Wiki link!
if (isset($_SESSION["linktracking"]) && $track) $this->TrackLinkTo($tag);
return ($this->LoadPage($tag) ? "<a href=\"".$this->href($method, $tag)."\">".$text."</a>" : "<span class=\"missingpage\">".$text."</span><a href=\"".$this->href("edit", $tag)."\">?</a>");
}
}
function ComposeLinkToPage($tag, $method = "", $text = "", $track = 1) {
if (!$text) $text = $tag;
$text = htmlentities($text);
if (isset($_SESSION["linktracking"]) && $track)
$this->TrackLinkTo($tag);
return '<a href="'.$this->href($method, $tag).'">'.$text.'</a>';
}
// function PregPageLink($matches) { return $this->Link($matches[1]); }
function IsWikiName($text) { return preg_match("/^[A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*$/", $text); }
function TrackLinkTo($tag) { $_SESSION["linktable"][] = $tag; }
function GetLinkTable() { return $_SESSION["linktable"]; }
function ClearLinkTable() { $_SESSION["linktable"] = array(); }
function StartLinkTracking() { $_SESSION["linktracking"] = 1; }
function StopLinkTracking() { $_SESSION["linktracking"] = 0; }
function WriteLinkTable() {
// delete old link table
$this->Query("delete from ".$this->config["table_prefix"]."links where from_tag = '".mysql_escape_string($this->GetPageTag())."'");
if ($linktable = $this->GetLinkTable())
{
$from_tag = mysql_escape_string($this->GetPageTag());
foreach ($linktable as $to_tag)
{
$lower_to_tag = strtolower($to_tag);
if (!$written[$lower_to_tag])
{
$this->Query("insert into ".$this->config["table_prefix"]."links set from_tag = '".$from_tag."', to_tag = '".mysql_escape_string($to_tag)."'");
$written[$lower_to_tag] = 1;
}
}
}
}
function Header() { return $this->Action($this->GetConfigValue("header_action"), 1); }
function Footer() { return $this->Action($this->GetConfigValue("footer_action"), 1); }
 
 
 
// FORMS
function FormOpen($method = "", $tag = "", $formMethod = "post") {
/* Debut de la modif ACeditor */
// ACEditor: id=\"ACEditor\" name=\"ACEditor\" ci-dessous le if a été ajouté (initialement, seule la ligne du else existait)
// si l'url se termine par edit (expression régulière edit$), on est en mode édition et dans ce cas on donne les id et name au formulaire
// Sinon surtout pas car ça marche plus dans la mesure ou plusieurs formulaires auraient ces ID et name et dans ce cas
// il semble que le dernier soit considéré, c'est à dire pas le bon :o(
 
if (ereg('edit$', $this->href($method, $tag))) {
$result = "<form id=\"ACEditor\" name=\"ACEditor\" action=\"".$this->href($method, $tag)."\" method=\"".$formMethod."\">\n";
} else {
$result = "<form action=\"".$this->href($method, $tag)."\" method=\"".$formMethod."\">\n";
}
 
/* fin de la modif ACeditor */
if (!$this->config["rewrite_mode"]) $result .= "<input type=\"hidden\" name=\"wiki\" value=\"".$this->MiniHref($method, $tag)."\" />\n";
return $result;
}
function FormClose() {
return "</form>\n";
}
 
 
 
// INTERWIKI STUFF
function ReadInterWikiConfig() {
if ($lines = file("interwiki.conf"))
{
foreach ($lines as $line)
{
if ($line = trim($line))
{
list($wikiName, $wikiUrl) = explode(" ", trim($line));
$this->AddInterWiki($wikiName, $wikiUrl);
}
}
}
}
function AddInterWiki($name, $url) {
$this->interWiki[$name] = $url;
}
function GetInterWikiUrl($name, $tag) {
if (isset($this->interWiki[$name]))
{
return $this->interWiki[$name].$tag;
} else {
return 'http://'.$tag; //avoid xss by putting http:// in front of JavaScript:()
}
}
 
 
 
// REFERRERS
function LogReferrer($tag = "", $referrer = "") {
// fill values
if (!$tag = trim($tag)) $tag = $this->GetPageTag();
if (!$referrer = trim($referrer) AND isset($_SERVER["HTTP_REFERER"])) $referrer = $_SERVER["HTTP_REFERER"];
// check if it's coming from another site
if ($referrer && !preg_match("/^".preg_quote($this->GetConfigValue("base_url"), "/")."/", $referrer))
{
$this->Query("insert into ".$this->config["table_prefix"]."referrers set ".
"page_tag = '".mysql_escape_string($tag)."', ".
"referrer = '".mysql_escape_string($referrer)."', ".
"time = now()");
}
}
function LoadReferrers($tag = "") {
return $this->LoadAll("select referrer, count(referrer) as num from ".$this->config["table_prefix"]."referrers ".($tag = trim($tag) ? "where page_tag = '".mysql_escape_string($tag)."'" : "")." group by referrer order by num desc");
}
function PurgeReferrers() {
if ($days = $this->GetConfigValue("referrers_purge_time")) {
$this->Query("delete from ".$this->config["table_prefix"]."referrers where time < date_sub(now(), interval '".mysql_escape_string($days)."' day)");
}
}
 
 
 
// PLUGINS
function Action($action, $forceLinkTracking = 0)
{
$action = trim($action); $vars=array();
// stupid attributes check
if ((stristr($action, "=\"")) || (stristr($action, "/")))
{
// extract $action and $vars_temp ("raw" attributes)
preg_match("/^([A-Za-z0-9]*)\/?(.*)$/", $action, $matches);
list(, $action, $vars_temp) = $matches;
// match all attributes (key and value)
$this->parameter[$vars_temp]=$vars_temp;
preg_match_all("/([A-Za-z0-9]*)=\"(.*)\"/U", $vars_temp, $matches);
 
// prepare an array for extract() to work with (in $this->IncludeBuffered())
if (is_array($matches))
{
for ($a = 0; $a < count($matches[1]); $a++)
{
$vars[$matches[1][$a]] = $matches[2][$a];
$this->parameter[$matches[1][$a]]=$matches[2][$a];
}
}
}
if (!$forceLinkTracking) $this->StopLinkTracking();
$result = $this->IncludeBuffered(strtolower($action).".php", "<i>Action inconnue \"$action\"</i>", $vars, $this->config["action_path"]);
$this->StartLinkTracking();
if (isset($parameter)) unset($this->parameter[$parameter]);
unset($this->parameter);
return $result;
}
function Method($method) {
if (!$handler = $this->page["handler"]) $handler = "page";
$methodLocation = $handler."/".$method.".php";
return $this->IncludeBuffered($methodLocation, "<i>M&eacute;thode inconnue \"$methodLocation\"</i>", "", $this->config["handler_path"]);
}
function Format($text, $formatter = "wakka") {
return $this->IncludeBuffered("formatters/".$formatter.".php", "<i>Impossible de trouver le formateur \"$formatter\"</i>", compact("text"));
}
 
 
 
// USERS
//============================= Lignes modifiées pour Tela Botanica ===================================
function LoadUser($name, $password = 0) { return $this->LoadSingle("select * from ".$this->config["common_table_prefix"]."users where name = '".mysql_escape_string($name)."' ".($password === 0 ? "" : "and password = '".mysql_escape_string($password)."'")." limit 1"); }
function LoadUsers() { return $this->LoadAll("select * from ".$this->config["common_table_prefix"]."users order by name"); }
//===============================================================================================
function GetUserName() { if ($user = $this->GetUser()) $name = $user["name"]; else if (!$name = gethostbyaddr($_SERVER["REMOTE_ADDR"])) $name = $_SERVER["REMOTE_ADDR"]; return $name; }
function UserName() { /* deprecated! */ return $this->GetUserName(); }
function GetUser() { return (isset($_SESSION["user"]) ? $_SESSION["user"] : '');}
function SetUser($user, $remember=0) { $_SESSION["user"] = $user; $this->SetPersistentCookie("name", $user["name"], $remember); $this->SetPersistentCookie("password", $user["password"], $remember); $this->SetPersistentCookie("remember", $remember, $remember); }
function LogoutUser() { $_SESSION["user"] = ""; $this->DeleteCookie("name"); $this->DeleteCookie("password"); }
function UserWantsComments() { if (!$user = $this->GetUser()) return false; return ($user["show_comments"] == "Y"); }
function GetParameter($parameter, $default = '') { return (isset($this->parameter[$parameter]) ? $this->parameter[$parameter] : $default); }
 
 
// COMMENTS
function LoadComments($tag) { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where comment_on = '".mysql_escape_string($tag)."' and latest = 'Y' order by time"); }
function LoadRecentComments() { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where comment_on != '' and latest = 'Y' order by time desc"); }
function LoadRecentlyCommented($limit = 50) {
// NOTE: this is really stupid. Maybe my SQL-Fu is too weak, but apparently there is no easier way to simply select
// all comment pages sorted by their first revision's (!) time. ugh!
// load ids of the first revisions of latest comments. err, huh?
$pages=array();
$comments=array();
if ($ids = $this->LoadAll("select min(id) as id from ".$this->config["table_prefix"]."pages where comment_on != '' group by tag order by id desc"))
{
// load complete comments
foreach ($ids as $id)
{
$comment = $this->LoadSingle("select * from ".$this->config["table_prefix"]."pages where id = '".$id["id"]."' limit 1");
$num=0;
if (!isset($comments[$comment["comment_on"]])) $comments[$comment["comment_on"]]='';
if (!$comments[$comment["comment_on"]] && $num < $limit)
{
$comments[$comment["comment_on"]] = $comment;
$num++;
}
}
// now load pages
if ($comments)
{
// now using these ids, load the actual pages
foreach ($comments as $comment)
{
$page = $this->LoadPage($comment["comment_on"]);
$page["comment_user"] = $comment["user"];
$page["comment_time"] = $comment["time"];
$page["comment_tag"] = $comment["tag"];
$pages[] = $page;
}
}
}
// load tags of pages
//return $this->LoadAll("select comment_on as tag, max(time) as time, tag as comment_tag, user from ".$this->config["table_prefix"]."pages where comment_on != '' group by comment_on order by time desc");
return $pages;
}
 
 
 
// ACCESS CONTROL
// returns true if logged in user is owner of current page, or page specified in $tag
function UserIsOwner($tag = "") {
// check if user is logged in
if (!$this->GetUser()) return false;
 
// set default tag
if (!$tag = trim($tag)) $tag = $this->GetPageTag();
// check if user is owner
if ($this->GetPageOwner($tag) == $this->GetUserName()) return true;
}
function GetPageOwner($tag = "", $time = "") { if (!$tag = trim($tag)) $tag = $this->GetPageTag(); if ($page = $this->LoadPage($tag, $time)) return $page["owner"]; }
function SetPageOwner($tag, $user) {
// check if user exists
if (!$this->LoadUser($user)) return;
// updated latest revision with new owner
$this->Query("update ".$this->config["table_prefix"]."pages set owner = '".mysql_escape_string($user)."' where tag = '".mysql_escape_string($tag)."' and latest = 'Y' limit 1");
}
function LoadAcl($tag, $privilege, $useDefaults = 1) {
if ((!$acl = $this->LoadSingle("select * from ".$this->config["table_prefix"]."acls where page_tag = '".mysql_escape_string($tag)."' and privilege = '".mysql_escape_string($privilege)."' limit 1")) && $useDefaults)
{
$acl = array("page_tag" => $tag, "privilege" => $privilege, "list" => $this->GetConfigValue("default_".$privilege."_acl"));
}
return $acl;
}
function SaveAcl($tag, $privilege, $list) {
if ($this->LoadAcl($tag, $privilege, 0)) $this->Query("update ".$this->config["table_prefix"]."acls set list = '".mysql_escape_string(trim(str_replace("\r", "", $list)))."' where page_tag = '".mysql_escape_string($tag)."' and privilege = '".mysql_escape_string($privilege)."' limit 1");
else $this->Query("insert into ".$this->config["table_prefix"]."acls set list = '".mysql_escape_string(trim(str_replace("\r", "", $list)))."', page_tag = '".mysql_escape_string($tag)."', privilege = '".mysql_escape_string($privilege)."'");
}
// returns true if $user (defaults to current user) has access to $privilege on $page_tag (defaults to current page)
function HasAccess($privilege, $tag = "", $user = "") {
// set defaults
if (!$tag = trim($tag)) $tag = $this->GetPageTag();
if (!$user = $this->GetUserName());
// load acl
$acl = $this->LoadAcl($tag, $privilege);
// if current user is owner, return true. owner can do anything!
if ($this->UserIsOwner($tag)) return true;
// fine fine... now go through acl
foreach (explode("\n", $acl["list"]) as $line)
{
$line = trim($line);
 
// check for inversion character "!"
if (preg_match("/^[!](.*)$/", $line, $matches))
{
$negate = 1;
$line = $matches[1];
}
else
{
$negate = 0;
}
 
// if there's still anything left... lines with just a "!" don't count!
if ($line)
{
switch ($line[0])
{
// comments
case "#":
break;
// everyone
case "*":
return !$negate;
// aha! a user entry.
case "+":
if (!$this->LoadUser($user))
{
return $negate;
}
else
{
return !$negate;
}
default:
if ($line == $user)
{
return !$negate;
}
}
}
}
// tough luck.
return false;
}
 
 
 
// MAINTENANCE
function Maintenance() {
// purge referrers
$this->PurgeReferrers();
// purge old page revisions
$this->PurgePages();
}
 
 
 
// THE BIG EVIL NASTY ONE!
function Run($tag, $method = "") {
if(!($this->GetMicroTime()%3)) $this->Maintenance();
 
$this->ReadInterWikiConfig();
 
// do our stuff!
if (!$this->method = trim($method)) $this->method = "show";
if (!$this->tag = trim($tag)) $this->Redirect($this->href("", $this->config["root_page"]));
if ((!$this->GetUser() && isset($_COOKIE["name"])) && ($user = $this->LoadUser($_COOKIE["name"], $_COOKIE["password"]))) $this->SetUser($user, $_COOKIE["remember"]);
$this->SetPage($this->LoadPage($tag, (isset($_REQUEST["time"]) ? $_REQUEST["time"] :'')));
$this->LogReferrer();
 
//correction pour un support plus facile de nouveaux handlers
print($this->Method($this->method));
}
}
 
 
 
// stupid version check
if (!isset($_REQUEST)) die('$_REQUEST[] not found. Wakka requires PHP 4.1.0 or higher!');
 
// workaround for the amazingly annoying magic quotes.
function magicQuotesSuck(&$a)
{
if (is_array($a))
{
foreach ($a as $k => $v)
{
if (is_array($v))
magicQuotesSuck($a[$k]);
else
$a[$k] = stripslashes($v);
}
}
}
set_magic_quotes_runtime(0);
if (get_magic_quotes_gpc())
{
magicQuotesSuck($_POST);
magicQuotesSuck($_GET);
magicQuotesSuck($_COOKIE);
}
 
 
// default configuration values
$wakkaConfig= array();
$wakkaDefaultConfig = array(
'wakka_version' => '',
'wikini_version' => '',
'debug' => 'no',
"mysql_host" => "localhost",
"mysql_database" => "wikini",
"mysql_user" => "wikini",
"mysql_password" => '',
"table_prefix" => "wikini_",
"root_page" => "PagePrincipale",
"wakka_name" => "MonSiteWikiNi",
"base_url" => "http://".$_SERVER["SERVER_NAME"].($_SERVER["SERVER_PORT"] != 80 ? ":".$_SERVER["SERVER_PORT"] : "").$_SERVER["REQUEST_URI"].(preg_match("/".preg_quote("wakka.php")."$/", $_SERVER["REQUEST_URI"]) ? "?wiki=" : ""),
"rewrite_mode" => (preg_match("/".preg_quote("wakka.php")."$/", $_SERVER["REQUEST_URI"]) ? "0" : "1"),
'meta_keywords' => '',
'meta_description' => '',
"action_path" => "actions",
"handler_path" => "handlers",
"header_action" => "header",
"footer_action" => "footer",
"navigation_links" => "DerniersChangements :: DerniersCommentaires :: ParametresUtilisateur",
"referrers_purge_time" => 24,
"pages_purge_time" => 90,
"default_write_acl" => "*",
"default_read_acl" => "*",
"default_comment_acl" => "*",
"menu_page" => "PageMenu",
"preview_before_save" => "0");
 
// load config
if (!$configfile = GetEnv("WAKKA_CONFIG")) $configfile = "wakka.config.php";
if (file_exists($configfile)) include($configfile);
$wakkaConfigLocation = $configfile;
$wakkaConfig = array_merge($wakkaDefaultConfig, $wakkaConfig);
 
// check for locking
if (file_exists("locked")) {
// read password from lockfile
$lines = file("locked");
$lockpw = trim($lines[0]);
// is authentification given?
if (isset($_SERVER["PHP_AUTH_USER"])) {
if (!(($_SERVER["PHP_AUTH_USER"] == "admin") && ($_SERVER["PHP_AUTH_PW"] == $lockpw))) {
$ask = 1;
}
} else {
$ask = 1;
}
if ($ask) {
header("WWW-Authenticate: Basic realm=\"".$wakkaConfig["wakka_name"]." Install/Upgrade Interface\"");
header("HTTP/1.0 401 Unauthorized");
echo "Ce site est en cours de mise &agrave; jour. Veuillez essayer plus tard." ;
exit;
}
}
 
 
// compare versions, start installer if necessary
if ($wakkaConfig["wakka_version"] && (!$wakkaConfig["wikini_version"])) { $wakkaConfig["wikini_version"]=$wakkaConfig["wakka_version"]; }
if (($wakkaConfig["wakka_version"] != WAKKA_VERSION) || ($wakkaConfig["wikini_version"] != WIKINI_VERSION)) {
// start installer
if (!isset($_REQUEST["installAction"]) OR !$installAction = trim($_REQUEST["installAction"])) $installAction = "default";
include("setup/header.php");
if (file_exists("setup/".$installAction.".php")) include("setup/".$installAction.".php"); else echo "<i>Invalid action</i>" ;
include("setup/footer.php");
exit;
}
 
 
// configuration du cookie de session
//determine le chemin pour le cookie
$a = parse_url($wakkaConfig['base_url']);
$CookiePath = dirname($a['path']);
if ($CookiePath != '/') $CookiePath .= '/';
$a = session_get_cookie_params();
session_set_cookie_params($a['lifetime'],$CookiePath);
unset($a);
unset($CookiePath);
 
// start session
session_start();
 
// fetch wakka location
if (!isset($_REQUEST["wiki"])) $_REQUEST["wiki"] = '';
$wiki = $_REQUEST["wiki"];
 
// remove leading slash
$wiki = preg_replace("/^\//", "", $wiki);
 
// split into page/method
if (preg_match("#^(.+?)/([A-Za-z0-9_]*)$#", $wiki, $matches)) list(, $page, $method) = $matches;
else if (preg_match("#^(.*)$#", $wiki, $matches)) list(, $page) = $matches;
 
// create wiki object
$wiki = new Wiki($wakkaConfig);
// check for database access
if (!$wiki->dblink)
{
echo "<p>Pour des raisons ind&eacute;pendantes de notre volont&eacute;, le contenu de ce Wiki est temporairement inaccessible. Veuillez r&eacute;essayer ult&eacute;rieurement, merci de votre compr&eacute;hension.</p>";
exit;
}
 
function compress_output($output)
{
return gzencode($output);
}
 
// Check if the browser supports gzip encoding, HTTP_ACCEPT_ENCODING
if (strstr ($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') )
{
// Start output buffering, and register compress_output() (see
// below)
ob_start ("compress_output");
 
// Tell the browser the content is compressed with gzip
header ("Content-Encoding: gzip");
}
 
 
// go!
if (!isset($method)) $method='';
 
// Security (quick hack) : Check method syntax
if (!(preg_match('#^[A-Za-z0-9_]*$#',$method))) {
$method='';
}
 
$wiki->Run($page, $method);
?>
/tags/2014_06_04/wikini/wakka.css
New file
0,0 → 1,108
/*Début modification sytle TELA BOTANICA*/
body
{
background-color: #D7F2D7;
color: black;
background-image: url(bibliotheque/images/telabotanica/logo_tb_pr_wikini.png);
background-repeat: no-repeat;
background-position: top left;
}
 
h1 { margin: 0px; padding: 0px; font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; font-size: 1.6em; font-style: normal; background-color: #2B8648; border-style: none; color: #FFFFFF; text-align: center;}
h2 { margin: 0px; padding: 0px; font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; font-size: 1.4em; font-style: oblique;}
h3 { margin: 0px; padding: 0px; font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; font-size: 1.2em; font-style: normal;}
h4 { margin: 0px; padding: 0px; font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; font-size: 1.1em; font-style: oblique;}
h5 { margin: 0px; padding: 0px; font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; font-size: 1.1em; font-style: normal; font-weight: bold; color : #2B8648;}
 
a { color: #993333; text-decoration: none; font-weight: bold;}
a:hover { text-decoration: underline;}
 
.wiki_name { float: left; padding-left: 60px; margin: 0px 15px 0px 10px; font-size: 150%; font-weight: bold; background-color: transparent; color: black;}
.page_name { font-size: 150%; background-color: transparent;}
.header { padding: 10px; padding-top: 5px; padding-left: 75px;}
/*Fin modification sytle TELA BOTANICA*/
 
body, p, td, li, input, select, textarea { font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.3; }
ul { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; }
ol { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; }
form { margin: 0px; padding: 0px; }
tt { color: Navy; }
hr { border: 0px; color: Black; /* Internet Explorer */ background-color: Black; height: 1px; }
 
.error { color: #CC3333; font-weight: bold; }
.indent { margin-left: 40px; }
.additions { color: #008800; }
.deletions { color: #880000; }
.add { font-weight: bold; color: #c00; text-decoration: underline; }
.del { font-style: italic; color: #c00; text-decoration: line-through; }
.page { background-color: #FFFFFF; padding: 10px; border: 1px inset; border-bottom: none; }
.prev_alert { background-color: red; color: white; font-size: 1.7em; font-weight: bold; margin-bottom: 5px; }
.edit { width: 100%; height: 400px; }
.footer { background-color: #DDDDDD; padding: 5px 10px; border: 1px inset; border-top: none; border-top: 1px solid #CCCCCC }
.code { background: #FFFFFF; border: solid #888888 2px; font-family: 'Courier New', Courier; color: black; font-size: 10pt; width: 100%; height: 400px; overflow: scroll; padding: 3px; }
.revisioninfo { color: #AAAAAA; padding-bottom: 20px; }
 
.commentsheader { background-color: #DDDDDD; padding: 2px 10px; border-left: 1px inset; border-right: 1px inset; border-top: 1px solid #CCCCCC }
.comment { background-color: #EEEEEE; padding: 10px; border-left: 1px inset; border-right: 1px inset; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #EEEEEE; }
.commentinfo { color: #AAAAAA; }
.commentform { background-color: #EEEEEE; padding: 10px; border-left: 1px inset; border-right: 1px inset; border-top: 1px solid #CCCCCC }
 
.copyright { font-size: 11px; color: #AAAAAA; text-align: right; }
.copyright A { color: #AAAAAA; }
.searchbox { background: #FFFFF8; border: 0px; border-bottom: 1px solid #CCCCAA; padding: 0px; margin: 0px; }
.debug { font-size: 11px; color: #888888; }
 
.hr_clear { clear: both; visibility: hidden; }
.include_right { float: right; width: 17%; } /* bloc flotant à droite */
.include_left { float: left; width: 17%; } /* bloc flotant à gauche */
.include_solid_border { border: solid; padding: 2px; } /* encadré noir */
.include_gray_background { background-color: #DDDDDD; } /* fond gris */
.include_small_fonts { font-size: 0.8em; } /* petites polices */
.include_big_fonts { font-size: 1.2em; } /* grandes polces */
.include_height10em { height: 10em; overflow: scroll; } /* boite de 10em de hauteur, avec ascenseur */
.include_height15em { height: 15em; overflow: scroll; }
.include_height30em { height: 30em; overflow: scroll; }
.include_height60em { height: 60em; overflow: scroll; }
 
.trail_table { line-height: 30px;}
.trail_button { color: #993333; }
 
/*Spécifique TELA BOTANICA*/
.rouge { color: red; font-weight: bold; }
.jaune { color: #D8D100; font-weight: bold; }
.vert { color: green; font-weight: bold; }
.pair { background-color: #FFF6D5; }
.impair { background-color: #F4FFEF; }
 
/* CONTRIBUTION MENU GAUCHE */
 
 
 
 
.page_table {margin: 0; padding: 0 ; border: none; height: 100%;width: 100%;}
.menu_column {display:none;}
/*.menu_column {background-color: #FFFFCC; vertical-align: top; width: 200px; border: 1px solid #000000; padding:0.2em; margin-top: 50px; }
.menu_column a {font-size: 0.8em;}
.menu_column ul { padding-left: 5px; margin-left: 5px; list-style-type: none;}
.body_column {vertical-align: top; border: none;padding:5px;}*/
 
/* CONTRIBUTION ACTION ATTACH */
/* - les images */
.attach_margin05em { margin: 0.5em;} /* marge de 0.5 em autour de l'image*/
.attach_margin1em { margin: 1em;} /* marge de 1em autour de l'image*/
.attach_left {float: left;} /* bloc flotant à gauche */
.attach_right {float: right;} /* bloc flotant à droite */
.attach_noborder {border-width: 0px;} /* pas de bordure */
.attach_vmiddle {vertical-align: text-bottom;} /* aligenement vertical au milieu */
/* - le gestionnaire des uploads */
.tableFM {border: thin solid Black; width: 100%; }
.tableFM THEAD { background-color: Silver; font-weight: bold; text-align: center; }
.tableFM TFOOT { background-color: Silver; font-weight: bold; text-align: left; }
.tableFM TBODY TR { text-align: center; }
.tableFMCol1 { background-color: Aqua; }
.tableFMCol2 { background-color: Yellow; }
 
/* CONTRIBUTION ACeditor */
.image_left {float: left;} /* bloc flotant à  gauche */
.image_right {float: right;} /* bloc flotant à  droite */
.image_center {text-align:center;} /* bloc centré */
/tags/2014_06_04/wikini/formatters/tableaux.php
New file
0,0 → 1,87
<?php
function parsetable($thing)
{
$tableattr = 'border="1"';
// echo "parsetable debut : \$thing = $thing<br>";
// recuperation des attributs
preg_match("/^\[\|(.*)$/m",$thing,$match);
// echo "parsetable : \$match = ";var_dump($match);echo "<br>";
if ($match[1]){
$tableattr = $match[1];
}
$table = "<table $tableattr >\n";
//suppression de [|xxxx et de |]
$thing = preg_replace("/^\[\|(.*)$/m","",$thing);
$thing = trim(preg_replace("/\|\]/m","",$thing));
// echo "parsetable suppression [| |]: \$thing = $thing<br>";
//recuperation de chaque ligne
$rows = preg_split("/$/m",$thing,-1,PREG_SPLIT_NO_EMPTY);
// echo "parsetable preg_split:";var_dump($rows);echo "<br>";
//analyse de chaque ligne
foreach ($rows as $row){
$table .= parsetablerow($row);
}
$table.= "</table>";
return $table;
}
//parse la definition d'une ligne
function parsetablerow($row)
{
$rowattr = "";
$row = trim($row);
// echo "parsetablerow debut : \$row = $row<br>";
//detection des attributs de ligne => si la ligne ne commence pas par | alors attribut
if (!preg_match("/^\|/",$row,$match)){
preg_match("/^!([^\|]*)!\|/",$row,$match);
$rowattr = $match[1];
// echo "\$rowattr = $rowattr<br>";
$row = trim(preg_replace("/^!([^\|]*)!/","",$row));
}
$result .= " <tr $rowattr>\n";
$row = preg_replace("/^\|/","",$row);
$row = preg_replace("/\|$/","",$row);
// echo "parsetablerow sans attribut : \$row = $row<br>";
//recuperation de chaque cellule
$cells = explode("|",$row); //nb : seule les indices impaire sont significatif
// echo "parsetablerow preg_split \$cells:";var_dump($cells);echo "<br>";
$i=0;
foreach ($cells as $cell){
// if ($i % 2){
// echo "\$cell = $cell<br>";
$result .= parsetablecell($cell);
// }
$i++;
}
$result .= " </tr>\n";
return $result;
}
//parse la definition d'une cellule
function parsetablecell($cell)
{
global $wiki;
$cellattr = "";
if (preg_match("/^!(.*)!/",$cell,$match)){
$cellattr = $match[1];
}
$cell = preg_replace("/^!(.*)!/","",$cell);
//si espace au debut => align=right
//si espace a la fin => align=left
//si espace debut et fin => align=center
if (preg_match("/^\s(.*)/",$cell)){
$align="right";
}
if (preg_match("/^(.*)\s$/",$cell)){
$align="left";
}
if (preg_match("/^\s(.*)\s$/",$cell)){
$align="center";
}
if ($align) $cellattr .= " align=\"$align\"";
// echo "\$this->classname = ".get_class($wiki)."<br>";
return " <td $cellattr>".$wiki->Format($cell)."</td>\n";
}
 
?>
/tags/2014_06_04/wikini/formatters/php.php
New file
0,0 → 1,3
<?php
highlight_string($text)
?>
/tags/2014_06_04/wikini/formatters/hightlighter.class.inc
New file
0,0 → 1,250
<?php
/*
* $Id: hightlighter.class.inc,v 1.1 2005-09-22 14:02:49 ddelon Exp $
*
* Souligneur générique pour colorier la syntaxe de langage de programmation
*
* copyrigth Eric Feldstein 2004 mailto:garfield_fr@tiscali.fr
*
* Licence : la meme que wikini(voir le fichier LICENCE).
* Vous êtes libre d'utiliser et de modifier ce code à condition de laisser le copyright
* d'origine. Vous pouvez bien sur vous ajouter à la liste des auteurs.
*
* INSTALLATION : copier le fichier dans le repertoire "formatters" de WikiNi
* UTILISATION : importer la classe dans le script de coloration
* ATTRIBUTS DE LA CLASSE :
* - isCaseSensitiv : booleen - indique si la syntaxe est sensible a la casse
* - comment : array - tableau d'expressions regulieres definissant les commentaires multiligne
* ex : array('({[^$][^}]*})', //commentaires: { ... }
* '(\(\*[^$](.*)\*\))' //commentaires: (* ... *)
* );
* - commentLine : array tableau d'expressions regulieres definissant les commentaires monoligne
* ex : array('(//.*\n)'); //commentaire //
* - commentStyle : string - style CSS inline a utiliser pour la coloration(utilisé dans une
* balise <SPAN style="..."></SPAN>)
* - directive : array - tableau d'expression reguliere pour definir les directive de
* compilation
* - directiveStyle : string - style CSS inline a utiliser pour la coloration
* - string : array - tableau d'expression reguliere pour definir les chaine de caracteres
* - stringStyle : string - style CSS inline a utiliser pour la coloration
* - number : array - tableau d'expression reguliere pour definir les nombres
* - numberStyle : string - style CSS inline a utiliser pour la coloration
* - keywords : array - tableau asociatif contenant des tableaux de liste de mots avec leur style. Ex :
* $oHightlighter->keywords['Liste1']['words'] = array('liste1mot1','liste1mot2','liste1mot3');
* $oHightlighter->keywords['Liste1']['style'] = 'color: red';
* $oHightlighter->keywords['Liste2']['words'] = array('liste2mot1','liste2mot2');
* $oHightlighter->keywords['Liste2']['style'] = 'color: yellow';
* chaque tableau keywords['...'] DOIT posseder les 2 clé 'words' et 'style'.
* - symboles : array - tableau conteant la liste des symboles
* - symbolesStyle : string - style CSS inline a utiliser pour la coloration
* - identifier : array - tableau d'expression reguliere pour definir les identifiants
* - identStyle : string - style CSS inline a utiliser pour la coloration
* METHODE PUBLIQUE DE LA CLASSE :
* - Analyse($text) : $text string Chaine a analyser
* renvoie le texte colorié.
*
* NOTES IMPORTANTES
* - Les expressions reguliere doivent être entre parenthèse capturante pour etre utilisé
* dans une fonction de remplacement. Voir le fichier coloration_delphi.php pour un exemple
* - Lorsque un style est defini à vide, l'expression reguliere n'est pas prise en compte dans
* l'analyse.
* - L'option de recherche est msU : multiligne, le . peut être un \n et la recherche
* est 'not greedy' qui inverse la tendance à la gourmandise des expressions régulières.
*/
 
class Hightlighter{
//sensibilite majuscule/minuscule
var $isCaseSensitiv = false;
//commentaires
var $comment = array(); //commentaire multiligne
var $commentLine = array(); //commentaire monoligne
var $commentStyle = '';//'color: red';
//directives de compilation
var $directive = array();
var $directiveStyle = '';//'color: green';
//chaine de caracteres
var $string = array();
var $stringStyle = '';
//nombre
var $number = array();
var $numberStyle = '';
//mots clé
var $keywords = array();
//séparateurs
var $symboles = array();
var $symbolesStyle = '';
//identifiant
var $identifier = array();
var $identStyle = '';
//*******************************************************
// Variable privées
//*******************************************************
var $_patOpt = 'msU'; //option de recherche
var $_pattern = ''; //modele complet
var $_commentPattern = ''; //modele des commentaires
var $_directivePattern = '';//modele des directives
var $_numberPattern = ''; //modele des nombres
var $_stringPattern = ''; //modele des chaine de caracteres
var $_keywordPattern = ''; //modele pour le mots cle
var $_symbolesPattern = ''; //modele pour les symbole
var $_separatorPattern = '';//modele pour les sparateurs
var $_identPattern = ''; //modele pour les identifiants
/********************************************************
Methodes de la classe
*********************************************************/
/**
* Renvoie le pattern pour les commentaires
*/
function _getCommentPattern(){
$a = array_merge($this->commentLine,$this->comment);
return implode('|',$a);
}
/**
* Renvoie le pattern pour les directives de compilation
*/
function _getDirectivePattern(){
return implode('|',$this->directive);
}
/**
* Renvoie le pattern pour les chaine de caracteres
*/
function _getStringPattern(){
return implode('|',$this->string);
}
/**
* Renvoie le pattern pour les nombre
*/
function _getNumberPattern(){
return implode('|',$this->number);
}
/**
* Renvoie le pattern pour les mots clé
*/
function _getKeywordPattern(){
$aResult = array();
foreach($this->keywords as $key=>$keyword){
$aResult = array_merge($aResult, $keyword['words']);
$this->keywords[$key]['pattern'] = '\b'.implode('\b|\b',$keyword['words']).'\b';
}
return '\b'.implode('\b|\b',$aResult).'\b';
}
/**
* Renvoie le pattern pour les symboles
*/
function _getSymbolesPattern(){
$a = array();
foreach($this->symboles as $s){
$a[] = preg_quote($s,'`');
}
return implode('|',$a);
}
/**
* Renvoie le pattern pour les identifiants
*/
function _getIdentifierPattern(){
return implode('|',$this->identifier);
}
/**
* Liste des separateur d'apres la liste des symboles
*/
function _getSeparatorPattern(){
$a = array_unique(preg_split('//', implode('',$this->symboles), -1, PREG_SPLIT_NO_EMPTY));
$pattern = '['.preg_quote(implode('',$a),'`').'\s]+';
return $pattern;
}
/**
* Renvoie le modele a utiliser dans l'expression regulière
*
* @return string Modele de l'expression régulière
*/
function _getPattern(){
$this->_separatorPattern = $this->_getSeparatorPattern();
$this->_symbolesPattern = $this->_getSymbolesPattern();
$this->_commentPattern = $this->_getCommentPattern();
$this->_directivePattern = $this->_getDirectivePattern();
$this->_stringPattern = $this->_getStringPattern();
$this->_numberPattern = $this->_getNumberPattern();
$this->_keywordPattern = $this->_getKeywordPattern();
$this->_identPattern = $this->_getIdentifierPattern();
//construction du modele globale en fonction de l'existance d'un style(optimisation)
if($this->commentStyle){ $a[] = $this->_commentPattern; }
if($this->directiveStyle){ $a[] = $this->_directivePattern; }
if($this->stringStyle){ $a[] = $this->_stringPattern; }
if($this->numberStyle){ $a[] = $this->_numberPattern; }
if(count($this->keywords)>0){ $a[] = $this->_keywordPattern; }
if($this->symbolesStyle){ $a[] = $this->_symbolesPattern; }
if($this->identStyle){ $a[] = $this->_identPattern; }
$this->_pattern = implode('|',$a);
return $this->_pattern;
}
/**
* Fonction de remplacement de chaque élement avec leur style.
*/
function replacecallback($match){
$text = $match[0];
$pcreOpt = $this->_patOpt;
$pcreOpt .= ($this->isCaseSensitiv)?'':'i';
//commentaires
if($this->commentStyle){
if (preg_match('`'.$this->_commentPattern."`$pcreOpt",$text,$m)){
return "<span style=\"$this->commentStyle\">".$match[0].'</span>';
}
}
//directive de compilation
if ($this->directiveStyle){
if (preg_match('`'.$this->_directivePattern."`$pcreOpt",$text,$m)){
return "<span style=\"$this->directiveStyle\">".$match[0].'</span>';
}
}
//chaine de caracteres
if ($this->stringStyle){
if (preg_match('`'.$this->_stringPattern."`$pcreOpt",$text,$m)){
return "<span style=\"$this->stringStyle\">".$match[0].'</span>';
}
}
//nombres
if ($this->numberStyle){
if (preg_match('`'.$this->_numberPattern."`$pcreOpt",$text,$m)){
return "<span style=\"$this->numberStyle\">".$match[0].'</span>';
}
}
//mot clé
if (count($this->keywords)>0){
foreach($this->keywords as $key=>$keywords){
if ($keywords['style']){
if(preg_match('`'.$keywords['pattern']."`$pcreOpt",$text,$m)){
return "<span style=\"".$keywords['style']."\">".$match[0].'</span>';
}
}
}
}
//symboles
if ($this->symbolesStyle){
if (preg_match('`'.$this->_symbolesPattern."`$pcreOpt",$text,$m)){
return "<span style=\"$this->symbolesStyle\">".$match[0].'</span>';
}
}
//identifiants
if ($this->identStyle){
if (preg_match('`'.$this->_identPattern."`$pcreOpt",$text,$m)){
return "<span style=\"$this->identStyle\">".$match[0].'</span>';
}
}
return $match[0];
}
/**
* renvois le code colorié
*
* @param $text string Texte a analyser
* @return string texte colorié
*/
function Analyse($text){
$pattern = '`'.$this->_getPattern()."`$this->_patOpt";
if (!$this->isCaseSensitiv){
$pattern .= 'i';
}
$text = preg_replace_callback($pattern,array($this,'replacecallback'),$text);
return $text;
}
} //class Hightlighter
?>
/tags/2014_06_04/wikini/formatters/raw.php
New file
0,0 → 1,31
<?php
/*
raw.php
 
Copyright 2002, 2003 David DELON
 
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
if ($test=$_REQUEST["text"]) {
echo "";
}
else if ($lines = file($text)) {
foreach ($lines as $line) {
// To avoid loop:ignore inclusion of other raw link
if (!(preg_match("/^\[\[\|(\S*)(\s+(.+))?\]\]$/", $line, $matches)))
echo $line;
}
}
?>
/tags/2014_06_04/wikini/formatters/code.php
New file
0,0 → 1,33
 
<pre>
<?php
/*
code.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002 Charles NEPOTE
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
echo htmlentities($text)."\n";
?>
</pre>
/tags/2014_06_04/wikini/formatters/action.php
New file
0,0 → 1,64
<?php
/*
action.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2003 David DELON
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// This may look a bit strange, but all possible formatting tags have to be in a single regular expression for this to work correctly. Yup!
 
if (!function_exists("wakka2callback"))
{
function wakka2callback($things)
{
$thing = $things[1];
 
global $wiki;
// events
if (preg_match("/^\{\{(.*?)\}\}$/s", $thing, $matches))
{
if ($matches[1])
return $wiki->Action($matches[1]);
else
return "{{}}";
}
else if (preg_match("/^.*$/s", $thing, $matches))
{
return "";
}
 
// if we reach this point, it must have been an accident.
return $thing;
}
}
 
 
$text = str_replace("\r", "", $text);
$text = trim($text)."\n";
$text = preg_replace_callback(
"/(\{\{.*?\}\}|.*)/msU", "wakka2callback", $text);
 
echo $text ;
?>
/tags/2014_06_04/wikini/formatters/coloration_delphi.php
New file
0,0 → 1,77
<?php
/*
* $Id: coloration_delphi.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $
*
* Souligneur syntaxique Delphi
*
* copyrigth Eric Feldstein 2003 2004 mailto:garfield_fr@tiscali.fr
*
* Licence : la meme que wikini (voir le fichier LICENCE).
* Vous êtes libre d'utiliser et de modifier ce code à condition de laisser le copyright
* d'origine. Vous pouvez bien sur vous ajouter à la liste des auteurs.
*
* Installation : copier le fichier dans le repertoire "formatters" de WikiNi
*/
include_once('formatters/hightlighter.class.inc');
 
$DH = new Hightlighter();
$DH->isCaseSensitiv = false;
 
//************* commentaires *************
$DH->comment = array('({[^$][^}]*})', //commentaires: { ... }
'(\(\*[^$](.*)\*\))' //commentaires: (* ... *)
);
$DH->commentLine = array('(//.*\n)'); //commentaire //
$DH->commentStyle = "color: red; font-style: italic"; //style CSS pour balise SPAN
 
//************* directives de compilation *************
$DH->directive = array('({\\$[^{}]*})', //directive {$....}
'(\(\*\\$(.*)\*\))' //directive (*$....*)
);
$DH->directiveStyle = "color: green"; //style CSS pour balise SPAN
 
//************* chaines de caracteres *************
$DH->string = array("('[^']*')",'(#\d+)'); //chaine = 'xxxxxxxx' ou #23
$DH->stringStyle = "background: yellow";
 
//************* nombres *************
$DH->number[] = '(\b\d+(\.\d*)?([eE][+-]?\d+)?)'; //123 ou 123. ou 123.456 ou 123.E-34 ou 123.e-34 123.45E+34 ou 4e54
$DH->number[] = '(\$[0-9A-Fa-f]+\b)'; //ajout des nombres hexadecimaux : $AF
$DH->numberStyle = 'color: blue';
 
//************* mots clé *************
$DH->keywords['MotCle']['words'] = array('absolute','abstract','and','array','as','asm',
'begin',
'case','class','const','constructor',
'default','destructor','dispinterface','div','do','downto',
'else','end','except','exports','external',
'file','finalization','finally','for','function',
'goto',
'if','implementation','inherited','initialization','inline','interface','is',
'label','library','loop','message',
'mod',
'nil','not',
'object','of','or','out','overload','override',
'packed','private','procedure','program','property','protected','public','published',
'raise','read','record','repeat','resourcestring',
'set','shl','shr','stdcall','string',
'then','threadvar','to','try','type','unit','until',
'use','uses',
'var','virtual','while',
'with','write',
'xor'
);
$DH->keywords['MotCle']['style'] = 'font-weight: bold'; //style CSS pour balise SPAN
 
//************* liste des symboles *************
$DH->symboles = array('#','$','&','(','(.',')','*','+',',','-','.','.)','..',
'/',':',':=',';','<','<=','<>','=','>','>=','@','[',']','^');
$DH->symbolesStyle = '';
 
//************* identifiants *************
$DH->identifier = array('[_A-Za-z]?[_A-Za-z0-9]+');
$DH->identStyle = '';
 
echo "<pre>".$DH->Analyse($text)."</pre>";
unset($DH);
?>
/tags/2014_06_04/wikini/formatters/wakka.php
New file
0,0 → 1,340
<?php
/*
wakka.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2002, 2003 Patrick PAUL
Copyright 2003 Eric DELORD
Copyright 2003 Eric FELDSTEIN
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// This may look a bit strange, but all possible formatting tags have to be in a single regular expression for this to work correctly. Yup!
 
if (!function_exists("wakka2callback"))
{
include("formatters/tableaux.php"); //EF => tableaux
function wakka2callback($things)
{
$thing = $things[1];
$result='';
 
static $oldIndentLevel = 0;
static $oldIndentLength= 0;
static $indentClosers = array();
static $newIndentSpace= array();
static $br = 1;
 
$brf=0;
global $wiki;
// convert HTML thingies
if ($thing == "<")
return "&lt;";
else if ($thing == ">")
return "&gt;";
//EF=> tableaux
else if (preg_match("/^\[\|(.*)\|\]/s", $thing))
{
return parsetable($thing);
} //end tableaux
// bold
else if ($thing == "**")
{
static $bold = 0;
return (++$bold % 2 ? "<b>" : "</b>");
}
// italic
else if ($thing == "//")
{
static $italic = 0;
return (++$italic % 2 ? "<i>" : "</i>");
}
// underlinue
else if ($thing == "__")
{
static $underline = 0;
return (++$underline % 2 ? "<u>" : "</u>");
}
// monospace
else if ($thing == "##")
{
static $monospace = 0;
return (++$monospace % 2 ? "<tt>" : "</tt>");
}
// Deleted
else if ($thing == "@@")
{
static $deleted = 0;
return (++$deleted % 2 ? "<span class=\"del\">" : "</span>");
}
// Inserted
else if ($thing == "££")
{
static $inserted = 0;
return (++$inserted % 2 ? "<span class=\"add\">" : "</span>");
}
// urls
else if (preg_match("/^([a-z]+:\/\/\S+?)([^[:alnum:]^\/])?$/", $thing, $matches)) {
$url = $matches[1];
if (!isset($matches[2])) $matches[2] = '';
return "<a href=\"$url\">$url</a>".$matches[2];
}
// header level 5
else if ($thing == "==")
{
static $l5 = 0;
$br = 0;
return (++$l5 % 2 ? "<h5>" : "</h5>");
}
// header level 4
else if ($thing == "===")
{
static $l4 = 0;
$br = 0;
return (++$l4 % 2 ? "<h4>" : "</h4>");
}
// header level 3
else if ($thing == "====")
{
static $l3 = 0;
$br = 0;
return (++$l3 % 2 ? "<h3>" : "</h3>");
}
// header level 2
else if ($thing == "=====")
{
static $l2 = 0;
$br = 0;
return (++$l2 % 2 ? "<h2>" : "</h2>");
}
// header level 1
else if ($thing == "======")
{
static $l1 = 0;
$br = 0;
return (++$l1 % 2 ? "<h1>" : "</h1>");
}
// forced line breaks
else if ($thing == "---")
{
return "<br />";
}
// escaped text
else if (preg_match("/^\"\"(.*)\"\"$/s", $thing, $matches))
{
return $matches[1];
}
// code text
else if (preg_match("/^\%\%(.*)\%\%$/s", $thing, $matches))
{
// check if a language has been specified
$code = $matches[1];
$language='';
if (preg_match("/^\((.+?)\)(.*)$/s", $code, $matches))
{
list(, $language, $code) = $matches;
}
//Select formatter for syntaxe hightlighting
if (file_exists("formatters/coloration_".$language.".php")){
$formatter = "coloration_".$language;
}else{
$formatter = "code";
}
 
$output = "<div class=\"code\">";
$output .= $wiki->Format(trim($code), $formatter);
$output .= "</div>";
 
return $output;
}
// raw inclusion from another wiki
// (regexp documentation : see "forced link" below)
else if (preg_match("/^\[\[\|(\S*)(\s+(.+))?\]\]$/", $thing, $matches))
{
list (,$url,,$text) = $matches;
if (!$text) $text = "404";
if ($url)
{
$url.="/wakka.php?wiki=".$text."/raw";
return $wiki->Format($wiki->Format($url, "raw"),"wakka");
}
else
{
return "";
}
}
// forced links
// \S : any character that is not a whitespace character
// \s : any whitespace character
else if (preg_match("/^\[\[(\S*)\s+(.+)?\]\]$/", $thing, $matches))
{
list (, $url, $text) = $matches;
if ($url)
{
if ($url!=($url=(preg_replace("/@@|££|\[\[/","",$url))))$result="</span>";
if (!$text) $text = $url;
$text=preg_replace("/@@|££|\[\[/","",$text);
return $result.$wiki->Link($url, "", $text);
}
else
{
return "";
}
}
// indented text
else if ((preg_match("/\n(\t+|([ ]{1})+)(-|([0-9,a-z,A-Z]+)\))?/s", $thing, $matches))
|| (preg_match("/^(\t+|([ ]{1})+)(-|([0-9,a-z,A-Z]+)\))?/s", $thing, $matches) && $brf=1))
{
// new line
if ($brf) $br=0;
$result .= ($br ? "<br />\n" : "");
 
// we definitely want no line break in this one.
$br = 0;
 
// find out which indent type we want
if (!isset($matches[3])) $matches[3] = '';
$newIndentType = $matches[3];
if (!$newIndentType) { $opener = "<div class=\"indent\">"; $closer = "</div>"; $br = 1; }
else if ($newIndentType == "-") { $opener = "<ul>\n"; $closer = "</li>\n</ul>"; $li = 1; }
else { $opener = "<ol type=\"".$matches[4]."\">\n"; $closer = "</li>\n</ol>"; $li = 1; }
 
// get new indent level
if (strpos($matches[1],"\t")) $newIndentLevel = strlen($matches[1]);
else
{
$newIndentLevel=$oldIndentLevel;
$newIndentLength = strlen($matches[1]);
if ($newIndentLength>$oldIndentLength)
{
$newIndentLevel++;
$newIndentSpace[$newIndentLength]=$newIndentLevel;
}
else if ($newIndentLength<$oldIndentLength)
$newIndentLevel=$newIndentSpace[$newIndentLength];
}
$op=0;
if ($newIndentLevel > $oldIndentLevel)
{
for ($i = 0; $i < $newIndentLevel - $oldIndentLevel; $i++)
{
$result .= $opener;
$op=1;
array_push($indentClosers, $closer);
}
}
else if ($newIndentLevel < $oldIndentLevel)
{
for ($i = 0; $i < $oldIndentLevel - $newIndentLevel; $i++)
{
$op=1;
$result .= array_pop($indentClosers);
if ($oldIndentLevel && $li) $result .= "</li>";
}
}
 
if (isset($li) && $op) $result .= "<li>";
else if (isset($li))
$result .= "</li>\n<li>";
 
$oldIndentLevel = $newIndentLevel;
$oldIndentLength= $newIndentLength;
 
return $result;
}
// new lines
else if ($thing == "\n")
{
// if we got here, there was no tab in the next line; this means that we can close all open indents.
$c = count($indentClosers);
for ($i = 0; $i < $c; $i++)
{
$result .= array_pop($indentClosers);
$br = 0;
}
$oldIndentLevel = 0;
$oldIndentLength= 0;
$newIndentSpace=array();
 
$result .= ($br ? "<br />\n" : "\n");
$br = 1;
return $result;
}
// events
else if (preg_match("/^\{\{(.*?)\}\}$/s", $thing, $matches))
{
if ($matches[1])
return $wiki->Action($matches[1]);
else
return "{{}}";
}
// interwiki links!
else if (preg_match("/^[A-Z][A-Z,a-z]+[:]([A-Z,a-z,0-9]*)$/s", $thing))
 
{
return $wiki->Link($thing);
}
// wiki links!
else if (preg_match("/^[A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*$/s", $thing))
{
return $wiki->Link($thing);
}
// separators
else if (preg_match("/-{4,}/", $thing, $matches))
{
// TODO: This could probably be improved for situations where someone puts text on the same line as a separator.
// Which is a stupid thing to do anyway! HAW HAW! Ahem.
$br = 0;
return "<hr />";
}
// if we reach this point, it must have been an accident.
return $thing;
}
}
 
 
$text = str_replace("\r", "", $text);
$text = chop($text)."\n";
$text = preg_replace_callback(
"/(\%\%.*?\%\%|".
"^\[\|.*?\|\]|". //EF => tableaux
"\"\".*?\"\"|".
"\[\[.*?\]\]|".
"\b[a-z]+:\/\/\S+|".
"\*\*|\#\#|@@|££|__|<|>|\/\/|".
"======|=====|====|===|==|".
"-{4,}|---|".
"\n(\t+|([ ]{1})+)(-|[0-9,a-z,A-Z]+\))?|".
"^(\t+|([ ]{1})+)(-|[0-9,a-z,A-Z]+\))?|".
"\{\{.*?\}\}|".
"\b[A-Z][A-Z,a-z]+[:]([A-Z,a-z,0-9]*)\b|".
"\b([A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*)\b|".
"\n)/ms", "wakka2callback", $text);
 
// we're cutting the last <br />
$text = preg_replace("/<br \/>$/","", trim($text));
echo $text ;
?>
/tags/2014_06_04/wikini/formatters/coloration_php.php
New file
0,0 → 1,30
<?php
/*
coloration_php.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2003 Eric FELDSTEIN
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
highlight_string($text)
?>
/tags/2014_06_04/wikini/wakka.config.php
New file
0,0 → 1,35
<?php
// wakka.config.php cr&eacute;&eacute;e Fri Mar 18 11:37:11 2005
// ne changez pas la wikini_version manuellement!
 
$nom_wiki = $_GET['wikini'] ;
//echo $nom_wiki ;
$wakkaConfig = array(
"wakka_version" => "0.1.1",
"wikini_version" => "0.4.3 + contributions",
"debug" => "no",
"mysql_host" => "localhost",
"mysql_database" => "tela_prod_wikini",
"mysql_user" => "telabotap",
"mysql_password" => "ppo50cvb",
"table_prefix" => strtolower($nom_wiki)."_",
"root_page" => "PagePrincipale",
"wakka_name" => $nom_wiki,
"base_url" => "http://www.tela-botanica.org/client/projet/wikini/wakka.php?wikini=$nom_wiki&wiki=",
"rewrite_mode" => "0",
"meta_keywords" => "",
"meta_description" => "",
"action_path" => "actions",
"handler_path" => "handlers",
"header_action" => "header",
"footer_action" => "footer",
"navigation_links" => "[[DerniersChangementsPages Derniers changements ]] :: [[TableauDeBord Tableau de bord ]]\n[[ParametresUtilisateur Paramêtres utilisateur ]]",
"referrers_purge_time" => "24",
"pages_purge_time" => "365",
"default_write_acl" => "*",
"default_read_acl" => "*",
"default_comment_acl" => "*",
"menu_page" => "PageMenu",
"preview_before_save" => "0",
"common_table_prefix" => "interwikini_");
?>
/tags/2014_06_04/wikini/interwiki.conf
New file
0,0 → 1,91
AbbeNormal http://www.ourpla.net/cgi-bin/pikie.cgi?
Acronym http://www.acronymfinder.com/af-query.asp?String=exact&Acronym=
AcadWiki http://xarch.tu-graz.ac.at/autocad/wiki/
Advogato http://www.advogato.org/
ArtificialLife http://www.alife.org/wiki/
AndStuff http://andstuff.org/
BenefitsWiki http://www.benefitslink.com/cgi-bin/wiki.cgi?
Bible http://bible.gospelcom.net/bible?
BrianLane http://www.brianlane.com/wiki/
BridgesWiki http://c2.com/w2/bridges/
CLiki http://ww.telent.net/cliki/
CmWiki http://www.ourpla.net/cgi-bin/wiki.pl?
ColdWiki http://coldstore.sourceforge.net/wiki/
CreationMatters http://www.ourpla.net/cgi-bin/wiki.pl?
CsWiki http://cs.messiah.edu/~scmoonen/index.php?
DejaNews http://www.deja.com/=dnc/getdoc.xp?AN=
Dictionary http://www.dictionary.com/cgi-bin/dict.pl?term=
DolphinWiki http://www.object-arts.com/wiki/html/Dolphin/
EfnetCppWiki http://www.encrypted.net/~jh/cpp-wiki/moin.cgi/
EfnetPythonWiki http://www.encrypted.net/~jh/python-wiki/moin.cgi/
EfnetXmlWiki http://www.encrypted.net/~jh/xml-wiki/moin.cgi/
EmacsWiki http://www.emacswiki.org/cgi-bin/wiki.pl?
Foldoc http://www.foldoc.org/foldoc/foldoc.cgi?
FoxWiki http://fox.wikis.com/wc.dll?Wiki~
Google http://www.google.com/search?q=
GoogleGroups http://groups.google.com/groups?q=
GreenCheese http://www.greencheese.org/
H2G2 http://www.h2g2.com/Search?searchstring=
HammondWiki http://www.dairiki.org/HammondWiki/index.php?
IAwiki http://www.IAwiki.net/
ICQ http://wwp.icq.com/
IMDB http://us.imdb.com/Title?
JargonFile http://sunir.org/apps/meta.pl?wiki=JargonFile&redirect=
JiniWiki http://www.cdegroot.com/cgi-bin/jini?
JustDoItWiki http://www.just-do.it/
KnowHow http://www2.iro.umontreal.ca/~paquetse/cgi-bin/wiki.cgi?
LegoWiki http://www.object-arts.com/wiki/html/Lego-Robotics/
LiveJournal http://www.livejournal.com/users/
MbTest http://www.usemod.com/cgi-bin/mbtest.pl?
MeatBall http://www.usemod.com/cgi-bin/mb.pl?
MetaWiki http://sunir.org/apps/meta.pl?words=
MoinMoin http://purl.net/wiki/moin/
MuWeb http://www.dunstable.com/scripts/MuWebWeb?
OpenWiki http://openwiki.com/?
OrgPatterns http://www.bell-labs.com/cgi-user/OrgPatterns/OrgPatterns?
PeerCastWiki http://www.peercastwiki.com/
PersonalTelco http://www.personaltelco.net/index.cgi/
PGPKey http://keys.pgp.dk:11371/pks/lookup?op=get&search=
PPR http://c2.com/cgi/wiki?
PhpWiki http://phpwiki.sourceforge.net/phpwiki/index.php?
Pikie http://pikie.darktech.org/cgi/pikie?
PolitizenWiki http://www.politizen.com/wiki.asp?
PyWiki http://www.voght.com/cgi-bin/pywiki?
PythonInfo http://www.python.org/cgi-bin/moinmoin/
Raging http://ragingsearch.altavista.com/cgi-bin/query?q=
RFC http://www.rfc.org.uk/cgi-bin/lookup.cgi?rfc=
RichmondFreeWireless http://www.richmondfreewireless.org/index.php?page=
SeattleWireless http://seattlewireless.net/?
SenseisLibrary http://senseis.xmp.net/?
SourceForge http://sourceforge.net/
SourceMage http://wiki.sourcemage.org/
Squeak http://minnow.cc.gatech.edu/squeak/
SquirrelMail http://squirrelmail.org/wiki/wiki.php?
Stikki http://steaky.dhs.org/tavi/
StrikiWiki http://ch.twi.tudelft.nl/~mostert/striki/teststriki.pl?
Tavi http://tavi.sourceforge.net/
Thesaurus http://www.thesaurus.com/cgi-bin/search?config=roget&words=
Thinki http://www.thinkware.se/cgi-bin/thinki.cgi/
TWiki http://twiki.sourceforge.net/cgi-bin/view/
UseMod http://www.usemod.com/cgi-bin/wiki.pl?
VisualWorks http://wiki.cs.uiuc.edu/VisualWorks/
Webster http://m-w.com/cgi-bin/dictionary?va=
Why http://clublet.com/c/c/why?
Wiki http://c2.com/cgi/wiki?
WikiFind http://c2.com/cgi/wiki?FindPage&value=
WikiPedia http://www.wikipedia.com/wiki/wiki.phtml?title=
ZWiki http://www.zwiki.org/
ZigZag http://zigzag.adsl.dk/zwiki/
ZooKeeper http://zookeeper.sourceforge.net/index.php?
RussellFreedom http://www.russellfreedom.com/
JTF http://www.justthefaqs.org/?page=
Wiki-Wiki-Wireless http://www.andaluciawireless.net/
WebDevWikiNL http://www.promo-it.nl/WebDevWiki/index.php?page=
IfDef http://ifdef.undef.net/
MACCAWS http://www.maccaws.com/wiki/
AviSynth http://www.avisynth.org/
WakkaWiki http://www.wakkawiki.com/
WikiNi http://www.wikini.net/wakka.php?wiki=
WikkiTikkiTavi http://tavi.sourceforge.net/
WackoWiki http://wiki.oversite.ru/
CraoWiki http://wiki.crao.net/index.php/
/tags/2014_06_04/wikini/index.php
New file
0,0 → 1,30
<?php
/*
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
 
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
header("Location: wakka.php");
exit;
?>
/tags/2014_06_04/wikini/README
New file
0,0 → 1,23
Wakka
 
A Wiki-esque website toolkit by Hendrik Mans.
 
Not much to read here. For some quick installation instructions, please
check out INSTALL.
 
Most of the Wakka documentation is available online only. Please visit
the official Wakka homepage at <http://www.wakkawiki.com>. You'll
find everything else there.
 
- Hendrik Mans <hendrik@mans.de>, 2002-09-04
 
 
Wikini, a fork of Wakka.
 
The original code and derived work is under modified BSD license (see header).
New code is either under modified BSD licence or GPL license (see header of each program).
 
Please visit the official Wikini homepage at <http://www/wikini.net>.
 
- Wikini Team : David Delon, Charles Nepote, Patrick Paul, Eric Feldstein,
Jean-Christophe Andre. 2004-02-17
/tags/2014_06_04/wikini/actions/orphanedpages.php
New file
0,0 → 1,35
<?php
/*
orphanedpages.php
 
Copyright 2002, 2003 David DELON
Copyright 2002 Charles NEPOTE
Copyright 2002 Patrick PAUL
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
if ($pages = $this->LoadOrphanedPages())
{
foreach ($pages as $page)
{
echo $this->ComposeLinkToPage($page["tag"], "", "", 0),"<br />\n" ;
}
}
else
{
echo "<i>Pas de pages orphelines</i>" ;
}
 
?>
/tags/2014_06_04/wikini/actions/recentlycommented.php
New file
0,0 → 1,76
<?php
/*
recentlycommented.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003, 2004 Charles NEPOTE
Copyright 2002 Patrick PAUL
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
// Which is the max number of pages to be shown ?
if ($max = $this->GetParameter("max"))
{
if ($max=="last") $max=50; else $last = (int) $max;
}
else
{
$max = 50;
}
 
// Show recently commented pages
if ($pages = $this->LoadRecentlyCommented($max))
{
if ($this->GetParameter("max"))
{
foreach ($pages as $page)
{
// echo entry
echo "(",$page["comment_time"],") <a href=\"",$this->href("", $page["tag"], "show_comments=1"),"#",$page["comment_tag"],"\">",$page["tag"],"</a> . . . . dernier commentaire par ",$this->Format($page["comment_user"]),"<br />\n" ;
}
}
else
{
$curday='';
foreach ($pages as $page)
{
// day header
list($day, $time) = explode(" ", $page["comment_time"]);
if ($day != $curday)
{
if ($curday) echo "<br />\n" ;
echo "<b>$day&nbsp;:</b><br />\n" ;
$curday = $day;
}
 
// echo entry
echo "&nbsp;&nbsp;&nbsp;(",$time,") <a href=\"",$this->href("", $page["tag"], "show_comments=1"),"#",$page["comment_tag"],"\">",$page["tag"],"</a> . . . . dernier commentaire par ",$this->Format($page["comment_user"]),"<br />\n" ;
}
}
}
else
{
echo "<i>Aucune page n'a &eacute;t&eacute; comment&eacute;e r&eacute;cemment.</i>" ;
}
 
?>
/tags/2014_06_04/wikini/actions/include.php
New file
0,0 → 1,55
<?php
/*
include.php : Permet d'inclure une page Wiki dans un autre page
 
Copyright 2003 Eric FELDSTEIN
Copyright 2003 Charles NEPOTE
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
/* Paramètres :
-- page : nom wiki de la page a inclure (obligatoire)
-- class : nom de la classe de style à inclure (facultatif)
*/
 
 
// récuperation du parametres
$incPageName = $this->GetParameter("page");
// TODO : améliorer le traitement des classes
if ($this->GetParameter("class")) {
$classes='';
$array_classes = explode(" ", $this->GetParameter("class"));
foreach ($array_classes as $c) { $classes = $classes . "include_" . $c . " "; }
}
 
// Affichage de la page ou d'un message d'erreur
if (empty($incPageName)) {
echo $this->Format("//Le paramètre \"page\" est manquant.//");
} else {
if (eregi("^".$incPageName."$",$this->GetPageTag())) {
echo $this->Format("//Impossible à une page de s'inclure dans elle même.//");
} else {
if (!$this->HasAccess("read",$incPageName)){
echo $this->Format("//Lecture de la page inclue $page non autorisée.//");
} else {
$incPage = $this->LoadPage($incPageName);
$output = $this->Format($incPage["body"]);
if ($classes) echo "<div class=\"", $classes,"\">\n", $output, "</div>\n";
else echo $output;
}
}
}
 
?>
/tags/2014_06_04/wikini/actions/recentcomments.php
New file
0,0 → 1,54
<?php
/*
recentcomments.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002 Charles NEPOTE
Copyright 2002 Patrick PAUL
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
 
if ($comments = $this->LoadRecentComments())
{
foreach ($comments as $comment)
{
// day header
list($day, $time) = explode(" ", $comment["time"]);
if ($day != $curday)
{
if ($curday) echo "<br />\n" ;
echo "<b>$day:</b><br />\n" ;
$curday = $day;
}
 
// echo entry
echo "&nbsp;&nbsp;&nbsp;(",$comment["time"],") <a href=\"",$this->href("", $comment["comment_on"], "show_comments=1"),"#",$comment["tag"],"\">",$comment["comment_on"],"</a> . . . . ",$this->Format($comment["user"]),"<br />\n" ;
}
}
else
{
echo "<i>Pas de commentaires r&eacute;cents.</i>" ;
}
 
?>
/tags/2014_06_04/wikini/actions/attachfm.php
New file
0,0 → 1,38
<?php
/*
attachfm.php
Code original de ce fichier : Eric FELDSTEIN
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2003,2004 Eric FELDSTEIN
Copyright 2003 Jean-Pascal MILCENT
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
/*
 
*/
$url = $this->href('filemanager',$this->GetPageTag());
echo '<a href="'.$url.'"><span class="attachfm"><span>Gestion des fichiers attachés</span></span></a>';
?>
/tags/2014_06_04/wikini/actions/header.php
New file
0,0 → 1,115
<?php
/* header.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003, 2004 Charles NEPOTE
Copyright 2002 Patrick PAUL
Copyright 2003 Eric DELORD
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
$message = $this->GetMessage();
$user = $this->GetUser();
?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 
 
<head>
<title><?php echo $this->GetWakkaName().":".$this->GetPageTag(); ?></title>
<?php if ($this->GetMethod() != 'show')
echo "<meta name=\"robots\" content=\"noindex, nofollow\"/>\n";?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta name="keywords" content="<?php echo $this->GetConfigValue("meta_keywords") ?>" />
<meta name="description" content="<?php echo $this->GetConfigValue("meta_description") ?>" />
<link rel="stylesheet" type="text/css" media="screen" href="wakka.basic.css" />
<link rel="stylesheet" type="text/css" media="print" href="wakka.print.css" />
<style type="text/css" media="screen"> @import "<?php echo (!$_COOKIE["sitestyle"])?'wakka':$_COOKIE["sitestyle"] ?>.css";</style>
<style type="text/css" media="print"> @import "wakka.print.css";</style>
<script type="text/javascript">
function fKeyDown() {
if (event.keyCode == 9) {
event.returnValue= false;
document.selection.createRange().text = String.fromCharCode(9) } }
</script>
<!-- Début modif ACeditor -->
<style type="text/css">
.buttons { background: #ccc; border: 1px solid #ccc; margin: 1; float:left; }
.raise{ border-top: 1px solid buttonhighlight; border-left: 1px solid buttonhighlight; border-bottom: 1px solid buttonshadow; border-right: 1px solid buttonshadow; background: #ccc; margin:1; float:left; }
.press { border-top: 1px solid buttonshadow; border-left: 1px solid buttonshadow; border-bottom: 1px solid buttonhighlight; border-right: 1px solid buttonhighlight; background: #ccc; margin:1; float:left; }
/* ci dessous les petits champs */
.ACsearchbox { background: #FFFFF8; border: 0px; border-bottom: 1px solid #CCCCAA; padding: 0px; margin: 0px; font-size: 10px; }
.texteChampsImage {font-size: 10px; }
#toolbar { margin: 0; width: 450px; padding: 0; height:20px; background: #ccc; border-top: 1px solid buttonhighlight; border-left: 1px solid buttonhighlight; border-bottom: 1px solid buttonshadow; border-right: 1px solid buttonshadow; text-align:left; }
</style>
 
<script type="text/javascript" src="ACeditor.js"></script>
<!-- Fin modif ACeditor -->
</head>
 
 
<body <?php echo (!$user || ($user["doubleclickedit"] == 'Y')) && ($this->GetMethod() == "show") ? "ondblclick=\"document.location='".$this->href("edit")."';\" " : "" ?>
<?php
/*Début modif ACeditor*/
echo $message ? "onLoad=\"alert('".$message."');thisForm=document.ACEditor;\" " : "onLoad=\"thisForm=document.ACEditor;\""
/*Fin modif ACeditor*/
?> >
 
 
<div style="display: none;"><a href="<?php echo $this->href() ?>/resetstyle" accesskey="7"></a></div>
 
<h1 class="wiki_name"><?php echo $this->config["wakka_name"] ?></h1>
 
 
<h1 class="page_name">
<a href="<?php echo $this->config["base_url"] ?>RechercheTexte&amp;phrase=<?php echo urlencode($this->GetPageTag()); ?>">
<?php echo $this->GetPageTag(); ?>
</a>
</h1>
 
 
<div class="header">
<?php echo $this->ComposeLinkToPage($this->config["root_page"]); ?> ::
<?php echo $this->config["navigation_links"] ? $this->Format($this->config["navigation_links"])." :: \n" : "" ?>
Vous &ecirc;tes <?php echo $this->Format($this->GetUserName()); if ($user = $this->GetUser()) echo " (<a href=\"".$this->config["base_url"] ."ParametresUtilisateur&amp;action=logout\">D&eacute;connexion</a>)\n"; ?>
</div>
 
<?
/*Début modif Menu Page*/
$menu_page=$this->config["menu_page"];
if (isset($menu_page) and ($menu_page!=""))
{
// Ajout Menu de Navigation
echo '<table class="page_table">';
echo '<tr><td class="menu_column">';
$wikiMenu = $this;
$wikiMenu->tag=$menu_page;
$wikiMenu->SetPage($wikiMenu->LoadPage($wikiMenu->tag));
echo $wikiMenu->Format($wikiMenu->page["body"], "wakka");
echo '</td>';
echo '<td class="body_column">';
}
/*Fin modif Menu Page*/
?>
 
/tags/2014_06_04/wikini/actions/listpages.php
New file
0,0 → 1,85
<?php
/*
listpages.php
 
Copyright 2002 David DELON
Copyright 2003 Patrick PAUL
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
if (!function_exists("TreeView"))
{
function TreeView($node,$level,$indent=0)
{
global $wiki;
if ($level>0) {
$head=split(" :: ",$wiki->GetConfigValue("navigation_links"));
// we don't want page from the header
if (!in_array($node, $head, TRUE))
{
if (($indent>0) && (!($wiki->GetConfigValue("root_page")==$node)) || ($indent==0) )
{
// Ignore users too ...
if (!$wiki->LoadUser($node))
{
if ($indent)
echo (str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",$indent)),$wiki->Link($node),"<br/>\n";
$pages = $wiki->LoadAll("select to_tag from ".$wiki->config["table_prefix"]."links where from_tag='".mysql_escape_string($node)."' order by to_tag asc");
 
if (is_array($pages)) {
foreach ($pages as $page)
{
$wiki->CachePage($page);
TreeView($page["to_tag"],$level-1,$indent+1);
}
}
}
}
}
}
}
}
 
if($sortkey = $this->GetParameter("sort")) {
if (($sortkey != "tag") && ($sortkey != "time") && ($sortkey != "owner") && ($sortkey != "user")) $sortkey = "tag";
$pages = $this->LoadAll("select tag, owner, user from ".$this->config["table_prefix"]."pages where latest = 'Y' and comment_on = '' order by $sortkey asc");
foreach ($pages as $page) {
$this->CachePage($page);
$owner=$page["owner"]?$page["owner"]:"Inconnu";
echo "&nbsp;&nbsp;&nbsp;",$this->ComposeLinkToPage($page["tag"], "", "", 0)," . . . . ",$this->Format($owner),". . . . derni&egrave;re modification par " , $this->Format($page["user"]) , "<br/>\n" ;
}
}
// Tree display
else if ($sortkey = $this->GetParameter("tree"))
{
// No rootpage specified, assume root_page
if ($sortkey=="tree") $sortkey=$this->GetConfigValue("root_page");
echo $this->ComposeLinkToPage($sortkey),"<br /><br/>\n" ;
 
// 3 levels displayed, It should be parameter ...
TreeView($sortkey,3);
 
}
// Default Action : sort by tag
else
{
$pages = $this->LoadAll("select tag, owner, user from ".$this->config["table_prefix"]."pages where latest = 'Y' and comment_on = '' order by tag asc");
foreach ($pages as $page) {
$this->CachePage($page);
$owner=$page["owner"]?$page["owner"]:"Inconnu";
echo "&nbsp;&nbsp;&nbsp;",$this->ComposeLinkToPage($page["tag"], "", "", 0)," . . . . ",$this->Format($owner),"<br/>\n" ;
}
}
?>
/tags/2014_06_04/wikini/actions/listusers.php
New file
0,0 → 1,45
<?php
/*
listusers.php
 
Copyright 2002 Patrick PAUL
Copyright 2003 David DELON
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
 
if ($last = $this->GetParameter("last"))
{
if ($last=="last") $last=150; else $last= (int) $last;
if ($last)
{
$last_users = $this->LoadAll("select name, signuptime from ".$this->config["table_prefix"]."users order by signuptime desc limit $last");
foreach($last_users as $user) { echo $this->Format($user["name"])," . . . ",$user["signuptime"],"<br />\n" ; }
}
}
 
else
{
if ($last_users = $this->LoadAll("select name, signuptime from ".$this->config["table_prefix"]."users order by name asc")
)
{
foreach($last_users as $user)
{
echo $this->Format($user["name"])," . . . ",$user["signuptime"],"<br />\n" ;
}
}
}
 
?>
/tags/2014_06_04/wikini/actions/footer.php
New file
0,0 → 1,105
 
 
<div class="footer">
<?php
/* footer.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003, 2004 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2002, 2003 Patrick PAUL
Copyright 2003 Eric DELORD
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
echo $this->FormOpen("", "RechercheTexte", "get");
echo $this->HasAccess("write") ? "<a href=\"".$this->href("edit")."\" title=\"Cliquez pour &eacute;diter cette page.\">&Eacute;diter cette page</a> ::\n" : "";
echo $this->GetPageTime() ? "<a href=\"".$this->href("revisions")."\" title=\"Cliquez pour voir les derni&egrave;res modifications sur cette page.\">".$this->GetPageTime()."</a> ::\n" : "";
// if this page exists
if ($this->page)
{
// if owner is current user
if ($this->UserIsOwner())
{
echo
"Propri&eacute;taire&nbsp;: vous :: \n",
"<a href=\"",$this->href("acls")."\" title=\"Cliquez pour &eacute;diter les permissions de cette page.\">&Eacute;diter permissions</a> :: \n",
"<a href=\"",$this->href("deletepage")."\">Supprimer</a> :: \n",
"<a href=\"",$this->href("filemanager")."\">Fichiers &amp; images</a> :: \n";//Gestion de l'action ATTACH
}
else
{
if ($owner = $this->GetPageOwner())
{
echo "Propri&eacute;taire : ",$this->Format($owner);
}
else
{
echo "Pas de propri&eacute;taire ";
echo ($this->GetUser() ? "(<a href=\"".$this->href("claim")."\">Appropriation</a>)" : "");
}
echo " :: \n";
}
}
?>
<a href="<?php echo $this->href("referrers") ?>" title="Cliquez pour voir les URLs faisant r&eacute;f&eacute;rence &agrave; cette page.">
R&eacute;f&eacute;rences</a> ::
Recherche : <input name="phrase" size="15" class="searchbox" />
<?php echo $this->FormClose(); ?>
</div>
 
 
<div class="copyright">
<a href="http://validator.w3.org/check/referer">XHTML 1.0 valide ?</a> ::
<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS valide ?</a> ::
-- Fonctionne avec <?php echo $this->Link("WikiNi:PagePrincipale", "", "WikiNi ".$this->GetWikiNiVersion()) . "\n"; ?>
</div>
 
 
<?php
if ($this->GetConfigValue("debug")=="yes")
{
echo "<span class=\"debug\"><b>Query log :</b><br />\n";
$t_SQL=0;
foreach ($this->queryLog as $query)
{
echo $query["query"]." (".round($query["time"],4).")<br />\n";
$t_SQL = $t_SQL + $query["time"];
}
echo "</span>\n";
 
echo "<span class=\"debug\">".round($t_SQL, 4)." s (total SQL time)</span><br />\n";
list($g2_usec, $g2_sec) = explode(" ",microtime());
define ("t_end", (float)$g2_usec + (float)$g2_sec);
echo "<span class=\"debug\"><b>".round(t_end-t_start, 4)." s (total time)</b></span><br />\n";
 
echo "<span class=\"debug\">SQL time represent : ".round((($t_SQL/(t_end-t_start))*100),2)."% of total time</span>\n";
}
?>
 
<?
$menu_page=$this->config["menu_page"];
if (isset($menu_page) and ($menu_page!="")) echo '</td></tr></table>';
?>
</body>
</html>
/tags/2014_06_04/wikini/actions/usersettings.php
New file
0,0 → 1,256
<?php
/*
usersettings.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2002 Patrick PAUL
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
if (!isset($_REQUEST["action"])) $_REQUEST["action"] = '';
if ($_REQUEST["action"] == "logout")
{
$this->LogoutUser();
$this->SetMessage("Vous &ecirc;tes maintenant d&eacute;connect&eacute; !");
$this->Redirect($this->href());
}
else if ($user = $this->GetUser())
{
// is user trying to update?
if ($_REQUEST["action"] == "update")
{
$this->Query("update ".$this->config["table_prefix"]."users set ".
"email = '".mysql_escape_string($_POST["email"])."', ".
"doubleclickedit = '".mysql_escape_string($_POST["doubleclickedit"])."', ".
"show_comments = '".mysql_escape_string($_POST["show_comments"])."', ".
"revisioncount = '".mysql_escape_string($_POST["revisioncount"])."', ".
"changescount = '".mysql_escape_string($_POST["changescount"])."', ".
"motto = '".mysql_escape_string($_POST["motto"])."' ".
"where name = '".$user["name"]."' limit 1");
$this->SetUser($this->LoadUser($user["name"]));
// forward
$this->SetMessage("Param&egrave;tres sauvegard&eacute;s !");
$this->Redirect($this->href());
}
if ($_REQUEST["action"] == "changepass")
{
// check password
$password = $_POST["password"];
if (preg_match("/ /", $password)) $error = "Les espaces ne sont pas permis dans les mots de passe.";
else if (strlen($password) < 5) $error = "Mot de passe trop court.";
else if ($user["password"] != md5($_POST["oldpass"])) $error = "Mauvais mot de passe.";
else
{
$this->Query("update ".$this->config["table_prefix"]."users set "."password = md5('".mysql_escape_string($password)."') "."where name = '".$user["name"]."'");
$this->SetMessage("Mot de passe chang&eacute; !");
$user["password"]=md5($password);
$this->SetUser($user);
$this->Redirect($this->href());
}
}
// user is logged in; display config form
echo $this->FormOpen();
?>
<input type="hidden" name="action" value="update" />
<table>
<tr>
<td align="right"></td>
<td>Bonjour, <?php echo $this->Link($user["name"]) ?>&nbsp;!</td>
</tr>
<tr>
<td align="right">Votre adresse de messagerie &eacute;lectronique&nbsp;:</td>
<td><input name="email" value="<?php echo htmlentities($user["email"]) ?>" size="40" /></td>
</tr>
<tr>
<td align="right">&Eacute;dition en double-cliquant&nbsp;:</td>
<td><input type="hidden" name="doubleclickedit" value="N" /><input type="checkbox" name="doubleclickedit" value="Y" <?php echo $user["doubleclickedit"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">Par d&eacute;faut, montrer les commentaires&nbsp;:</td>
<td><input type="hidden" name="show_comments" value="N" /><input type="checkbox" name="show_comments" value="Y" <?php echo $user["show_comments"] == "Y" ? "checked\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">Nombre maximum de derniers commentaires&nbsp;:</td>
<td><input name="changescount" value="<?php echo htmlentities($user["changescount"]) ?>" size="40" /></td>
</tr>
<tr>
<td align="right">Nombre maximum de versions&nbsp;:</td>
<td><input name="revisioncount" value="<?php echo htmlentities($user["revisioncount"]) ?>" size="40" /></td>
</tr>
<tr>
<td align="right">Votre devise&nbsp;:</td>
<td><input name="motto" value="<?php echo htmlentities($user["motto"]) ?>" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Mise &agrave; jour" /> <input type="button" value="D&eacute;connexion" onclick="document.location='<?php echo $this->href("", "", "action=logout"); ?>'" /></td>
</tr>
 
<?php
echo $this->FormClose();
 
echo $this->FormOpen();
?>
<input type="hidden" name="action" value="changepass" />
 
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right"></td>
<td><?php echo $this->Format("Changement de mot de passe"); ?></td>
</tr>
<?php
if (isset($error))
{
echo "<tr><td></td><td><div class=\"error\">", $this->Format($error), "</div></td></tr>\n";
}
?>
<tr>
<td align="right">Votre ancien mot de passe&nbsp;:</td>
<td><input type="password" name="oldpass" size="40" /></td>
</tr>
<tr>
<td align="right">Nouveau mot de passe&nbsp;:</td>
<td><input type="password" name="password" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Changer" size="40" /></td>
</tr>
</table>
<?php
echo $this->FormClose();
 
}
else
{
// user is not logged in
// is user trying to log in or register?
if ($_REQUEST["action"] == "login")
{
// if user name already exists, check password
if ($existingUser = $this->LoadUser($_POST["name"]))
{
// check password
if ($existingUser["password"] == md5($_POST["password"]))
{
$this->SetUser($existingUser, $_POST["remember"]);
$this->Redirect($this->href());
}
else
{
$error = "Mauvais mot de passe&nbsp;!";
}
}
// otherwise, create new account
else
{
$name = trim($_POST["name"]);
$email = trim($_POST["email"]);
$password = $_POST["password"];
$confpassword = $_POST["confpassword"];
 
// check if name is WikkiName style
if (!$this->IsWikiName($name)) $error = "Votre nom d'utilisateur doit &ecirc;tre format&eacute; en NomWiki.";
else if (!$email) $error = "Vous devez sp&eacute;cifier une adresse de messagerie &eacute;lectronique.";
else if (!preg_match("/^.+?\@.+?\..+$/", $email)) $error = "Ceci ne ressemble pas &agrave; une adresse de messagerie &eacute;lectronique.";
else if ($confpassword != $password) $error = "Les mots de passe n'&eacute;taient pas identiques";
else if (preg_match("/ /", $password)) $error = "Les espaces ne sont pas permis dans un mot de passe.";
else if (strlen($password) < 5) $error = "Mot de passe trop court. Un mot de passe doit contenir au minimum 5 caract&egrave;res alphanum&eacute;riques.";
else
{
$this->Query("insert into ".$this->config["table_prefix"]."users set ".
"signuptime = now(), ".
"name = '".mysql_escape_string($name)."', ".
"email = '".mysql_escape_string($email)."', ".
"password = md5('".mysql_escape_string($_POST["password"])."')");
 
// log in
$this->SetUser($this->LoadUser($name));
 
// forward
$this->Redirect($this->href());
}
}
}
echo $this->FormOpen();
?>
<input type="hidden" name="action" value="login" />
<table>
<tr>
<td></td>
<td><?php echo $this->Format("Si vous &ecirc;tes d&eacute;j&agrave; enregistr&eacute;, identifiez-vous ici"); ?></td>
</tr>
<?php
if (isset($error))
{
echo "<tr><td></td><td><div class=\"error\">", $this->Format($error), "</div></td></tr>\n";
}
?>
<tr>
<td align="right">Votre NomWiki&nbsp;:</td>
<td><input name="name" size="40" value="<?php if (isset($name)) echo $name ?>" /></td>
</tr>
<tr>
<td align="right">Mot de passe (5 caract&egrave;res minimum)&nbsp;:</td>
<td>
<input type="password" name="password" size="40" />
<input type="hidden" name="remember" value="0" />
<input type="checkbox" name="remember" value="1" />&nbsp;Se souvenir de moi.
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Identification" size="40" /></td>
</tr>
<tr>
<td></td>
<td width="500"><?php echo $this->Format("Les champs suivants sont &agrave; remplir si vous vous identifiez pour la premi&egrave;re fois (vous cr&eacute;erez ainsi un compte)"); ?></td>
</tr>
<tr>
<td align="right">Confirmation du mot de passe&nbsp;:</td>
<td><input type="password" name="confpassword" size="40" /></td>
</tr>
<tr>
<td align="right">Adresse de messagerie &eacute;lectronique.&nbsp;:</td>
<td><input name="email" size="40" value="<?php if (isset($email)) echo $email ?>" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Nouveau compte" size="40" /></td>
</tr>
</table>
<?php
echo $this->FormClose();
}
?>
 
/tags/2014_06_04/wikini/actions/redirect.php
New file
0,0 → 1,48
<?php
/*
redirect.php : Permet de faire une redirection vers une autre pages Wiki du site
 
Copyright 2003 Eric FELDSTEIN
Copyright 2003 David DELON
Copyright 2004 Jean Christophe ANDRE
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
/*
Parametres : page : nom wiki de la page vers laquelle ont doit rediriger (obligatoire)
exemple : {{redirect page="BacASable"}}
*/
 
//recuperation du parametres
$redirPageName = $this->GetParameter("page");
 
if (empty($redirPageName)){
echo $this->Format("//Le param&ecirc;tre \"page\" est manquant.//");
}else{
if (eregi("^".$redirPageName."$",$this->GetPageTag())){
echo $this->Format("//Impossible &agrave; une page de se rediriger vers elle m&ecirc;me.//");
}else{
$fromPages = array();
$fromPages = explode(":",$_COOKIE['redirectfrom']);
if (in_array($this->GetPageTag(),$fromPages)){
echo $this->Format("//Redirection circulaire.//");
}else{
$fromPages[] = $this->GetPageTag();
SetCookie('redirectfrom', implode(":",$fromPages), time() + 30, $this->CookiePath);
$this->Redirect($this->Href('', $redirPageName));
}
}
}
?>
/tags/2014_06_04/wikini/actions/recentchangesrss.php
New file
0,0 → 1,60
<?php
/*
recentchangesrss.php
 
Copyright 2003 David DELON
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
if ($user = $this->GetUser())
{
$max = $user["changescount"];
}
else
{
$max = 50;
}
 
if ($pages = $this->LoadRecentlyChanged($max))
{
if (!($link = $this->GetParameter("link"))) $link=$this->config["root_page"];
$output = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
$output .= "<!-- RSS v0.91 generated by Wikini -->\n";
$output .= "<rdf:RDF\n";
$output .= "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
$output .= "xmlns=\"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n";
$output .= "<channel>\n";
$output .= "<title> Derniers changements sur ". $this->config["wakka_name"] . "</title>\n";
$output .= "<link>".str_replace('&', '&amp;', $this->config["base_url"].$link)."</link>\n";
$output .= "<description> Derniers changements sur " . $this->config["wakka_name"] . " </description>\n";
$output .= "<language>fr</language>\n";
$output .= "</channel>\n";
 
foreach ($pages as $i => $page)
{
list($day, $time) = explode(" ", $page["time"]);
$day= preg_replace("/-/", " ", $day);
list($hh,$mm,$ss) = explode(":", $time);
$output .= "<item>\n";
$output .= "<title>" . $page["tag"] . " --- par " .$page["user"] . " le " . $day ." - ". $hh .":". $mm . "</title>\n";
$output .= "<description> Modification de " . $page["tag"] . " --- par " .$page["user"] . " le " . $day ." - ". $hh .":". $mm . "</description>\n";
$output .= "<link>".str_replace('&', '&amp;', $this->config["base_url"].$page["tag"])."&amp;time=" . rawurlencode($page["time"]) . "</link>\n";
$output .= "</item>\n";
}
$output .= "</rdf:RDF>\n";
echo $output ;
}
?>
/tags/2014_06_04/wikini/actions/backlinks.php
New file
0,0 → 1,62
<?php
 
/*
backlinks.php
 
Copyright 2002 Patrick PAUL
Copyright 2003 David DELON
Copyright 2003 Charles NEPOTE
 
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
 
if ($this->GetParameter("page"))
{
$page = $this->GetParameter("page");
$title = "Pages ayant un lien vers ".$this->ComposeLinkToPage($page)."&nbsp;: <br />\n";
}
else
{
$page = $this->getPageTag();
$title = "Pages ayant un lien vers la page courante&nbsp;: <br />\n";
}
 
$pages = $this->LoadPagesLinkingTo($page);
 
if ($pages)
{
echo $title;
if (!$exclude = $this->GetParameter("exclude"))
{
foreach ($pages as $page)
{
echo $this->ComposeLinkToPage($page["tag"]), "<br />\n";
}
}
else
{
foreach ($pages as $page)
{
// Show link if it isn't an excluded link
if (!preg_match("/".$page["tag"]."(;|$)/", $exclude)) echo $this->ComposeLinkToPage($page["tag"]), "<br />\n";
}
}
}
else
{
echo "<i>Aucune page n'a de lien vers ", $this->ComposeLinkToPage($page), ".</i>";
}
?>
/tags/2014_06_04/wikini/actions/interwikilist.php
New file
0,0 → 1,30
<?php
/*interwikilist.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2003 David DELON
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
$file = implode("", file("interwiki.conf", 1));
echo $this->Format("%%".$file."%%") ;
?>
/tags/2014_06_04/wikini/actions/wantedpages.php
New file
0,0 → 1,43
<?php
/*
wantedpages.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002 Charles NEPOTE
Copyright 2002 Patrick PAUL
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
if ($pages = $this->LoadWantedPages())
{
foreach ($pages as $page)
{
echo $this->Link($page["tag"])," (<a
ref=\"",$this->href(),"&amp;linking_to=",$page["tag"],"\">",$page["count"],"</a>)<br />\n";
}
}
else
{
echo "<i>Aucune page &agrave; cr&eacute;er.</i>";
}
?>
/tags/2014_06_04/wikini/actions/pageindex.php
New file
0,0 → 1,54
<?php
/*
pageindex.php
Copyright (c) 2003, Hendrik Mans <hendrik@mans.de>
Copyright 2003 David DELON
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
if ($pages = $this->LoadAllPages())
{
foreach ($pages as $page)
{
if (!preg_match("/^Comment/", $page["tag"])) {
$firstChar = strtoupper($page["tag"][0]);
if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
$firstChar = "#";
}
 
if ($firstChar != $curChar) {
if ($curChar) echo "<br />\n" ;
echo "<b>$firstChar</b><br />\n" ;
$curChar = $firstChar;
}
 
echo $this->ComposeLinkToPage($page["tag"]),"<br />\n" ;
}
}
}
else
{
echo "<i>Aucune page trouv&eacute;e.</i>" ;
}
 
?>
/tags/2014_06_04/wikini/actions/attach.php
New file
0,0 → 1,121
<?php
/*
attach.php
Code original de ce fichier : Eric FELDSTEIN
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2003,2004 Eric FELDSTEIN
Copyright 2003 Jean-Pascal MILCENT
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
/******************************************************************************
* DOCUMENTATION
*******************************************************************************
RESUME
L'action {{attach}} permet de lier un fichier à une page, d'uploader ce fichier
et de downloader ce fichier. Si le fichier est une image, elle est affichée
dans la page. Lorsque le fichier est sur le serveur, il est possible de faire
une mise à jour de celui-ci.
 
PARAMETRES DE L'ACTION
L'action {{attach}} prend les paramètres suivants :
- file ou attachfile: nom du fichier tel qu'il sera sur le serveur. Les
espaces sont remplacé par des "_". (OBLIGATOIRE)
- desc ou attachdesc: description du fichier. C'est le texte qui sera affiché
comme lien vers le fichier ou dans l'attribut alt de la balise <img>. Ce
paramètre est obligatoire pour les images pour être conforme au XHTML.
- delete ou attachdelete: Si ce paramètre est non vide alors le fichier sera
effacé sur le serveur.
- link ou attachlink: URL de lien pour une image sensible. le lien peut être
un nom de page WikiNi, un lien interwiki ou une adresse http
- class: indique le nom de la ou les classes de style à utiliser pour afficher
l'image. les noms des classes sont séparés par un espace.
 
EXEMPLES
- Attacher un fichier archive:
{{attach file="archive.zip"}}
- Attacher un fichier archive avec une description
{{attach file="archive.zip" desc="Code source de l'application"}}
- Supprimer un fichier:
{{attach file="archive.zip" delete="y"}}
- Afficher une image:
{{attach file="image.png" desc="voici une image"}}
- Afficher une image sensible:
{{attach file="image.png" desc="voici une image" link="PagePrincipale"}}
{{attach file="image.png" desc="voici une image" link="WikiNi:PagePrincipale"}}
{{attach file="image.png" desc="voici une image" link="http://www.wikini.net"}}
- Afficher une image collé sur le bord droit et sans contour:
{{attach file="image.png" desc="voici une image" class="right noborder"}}
 
INSTALLATION
1) Copiez le fichier attach.php dans le répertoire des actions (/actions)
2) Copiez le fichier attach.class.php dans le répertoire des actions (/actions)
3) Copiez le fichier attachfm.php dans le repertoire des actions (/actions)
4) Copiez le fichier filamanager.php dans le répertoire des handlers (/handlers/page)
5) Copiez le fichier upload.php dans le répertoire des handlers (/handlers/page)
6) Copiez le fichier download.php dans le répertoire des handlers (/handlers/page)
7) Créez le répertoire racine des uploads sur le site du wiki. Si le SAFE_MODE
de PHP est activé, vous devez créer vous même ce répertoire et autoriser
l'écriture dans ce répertoire pour l'utilisateur et le groupe.
8) Ouvrez le fichier wakka.config.php et ajoutez la configuration de l'action.
Tous les paramètres de configuration ont une valeur par défaut.
Le configuration par défaut est:
 
$wakkaConfig["attach_config"] = array(
"upload_path" => 'files', //repertoire racine des uploads
"ext_images" => 'gif|jpeg|png|jpg', //extension des fichiers images
"ext_script" => 'php|php3|asp|asx|vb|vbs|js', //extension des script(non utilisé)
"update_symbole" => '*', //symbole pour faire un update du fichier
"max_file_size" => 1024*100, //taille maximum du fichier en octer (100Ko par défaut)
"fmDelete_symbole" => 'Supr', //symbole a afficher pour le lien "supprimer" dans le gestionnaire de fichier
"fmRestore_symbole" => 'Rest', //symbole a afficher pour le lien "restaurer" dans le gestionnaire de fichier
"fmTrash_symbole" => 'Poubelle') //symbole a afficher pour le lien "Poubelle" dans le gestionnaire de fichier
 
9) Ajoutez les classes de style au fichier wakka.css. Exemple de style :
.attach_margin05em { margin: 0.5em;}
.attach_margin1em { margin: 1em;}
.attach_left {float: left;}
.attach_right {float: right;}
.attach_noborder {border-width: 0px;}
.attach_vmiddle {vertical-align: text-bottom;}
 
10)Pour configurer l'aspect du gestionnnaire de fichier utiliser les classes de style .tableFM
tableFMCol1 et tableFMCol2
Exemple :
.tableFM {border: thin solid Black; width: 100%; }
.tableFM THEAD { background-color: Silver; font-weight: bold; text-align: center; }
.tableFM TFOOT { background-color: Silver; font-weight: bold; text-align: left; }
.tableFM TBODY TR { text-align: center; }
.tableFMCol1 { background-color: Aqua; }
.tableFMCol2 { background-color: Yellow; }
*******************************************************************************/
 
if (!class_exists('attach')){
include($this->GetConfigValue('action_path').'/attach.class.php');
}
$att = new attach($this);
$att->doAttach();
unset($att);
?>
/tags/2014_06_04/wikini/actions/resetpassword.php
New file
0,0 → 1,80
<?php
/*
resetpassword.php
 
Copyright 2003 Patrick PAUL
Copyright 2003 David DELON
Copyright 2004 David VANTYGHEM
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
 
if (($user = $this->GetUser()) && ($user["name"]==$this->GetConfigValue("admin")) && $this->GetConfigValue("admin"))
{
 
if (($_REQUEST["action"] == "resetpass"))
{
$this->Query("update ".$this->config["table_prefix"]."users set ".
"password = md5('".mysql_escape_string($_POST["password"])."') ".
"where name = '".mysql_escape_string($_POST["name"])."' limit 1");
$this->SetMessage("Mot de passe r&eacute;initialis&eacute; !");
$this->Redirect($this->href());
}
else
{
$error="";
//$error = "Il est interdit de r&eacute;initialiser le mot de passe de cet utilisateur ! Non mais !";
}
echo $this->FormOpen() ;
$name=$_GET["name"];
?>
<input type="hidden" name="action" value="resetpass">
<table>
<tr>
<td align="right"></td>
<td><?php echo $this->Format("R&eacute;initialisation du mot de passe"); ?></td>
</tr>
<?php
if ($error)
{
echo "<tr><td></td><td><div class=\"error\">".$this->Format($error)."</div></td></tr>\n" ;
}
?>
<tr>
<td align="right">Login:</td>
<td><input name="name" size="40" value="<?php echo $name ?>"></td>
</tr>
<tr>
<td align="right">Nouveau mot de passe:</td>
<td><input type="password" name="password" size="40"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Reset password" size="40"></td>
</tr>
</table>
<?php
echo $this->FormClose() ;
}
else
{
echo "<i>Vous n'avez pas les permissions n&eacute;cessaires pour ex&eacute;cuter cette action.</i>" ;
}
 
?>
/tags/2014_06_04/wikini/actions/mypages.php
New file
0,0 → 1,78
<?php
 
// actions/mypages.php
// written by Carlo Zottmann
// http://wakkawikki.com/CarloZottmann
/*
mypages.php
Copyright (c) 2003, Carlo Zottmann
Copyright 2003 David DELON
Copyright 2003 Jean Pascal MILCENT
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
 
if ($user = $this->GetUser())
{
echo "<b>Liste des pages dont vous &ecirc;tes le propri&eacute;taire.</b><br /><br />\n" ;
 
$my_pages_count = 0;
 
if ($pages = $this->LoadAllPages())
{
foreach ($pages as $page)
{
if ($this->UserName() == $page["owner"] && !preg_match("/^Comment/", $page["tag"])) {
$firstChar = strtoupper($page["tag"][0]);
if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
$firstChar = "#";
}
if ($firstChar != $curChar) {
if ($curChar) echo "<br />\n" ;
echo "<b>$firstChar</b><br />\n" ;
$curChar = $firstChar;
}
echo $this->ComposeLinkToPage($page["tag"]),"<br />\n" ;
$my_pages_count++;
}
}
if ($my_pages_count == 0)
{
echo "<i>Vous n'&ecirc;tes le propri&eacute;taire d'aucune page.</i>";
}
}
else
{
echo "<i>Aucune page trouv&eacute;e.</i>" ;
}
}
else
{
echo "<i>Vous n'&ecirc;tes pas identifi&eacute; : impossible d'afficher la liste des pages que vous avez modifi&eacute;es.</i>" ;
}
 
?>
/tags/2014_06_04/wikini/actions/changestyle.php
New file
0,0 → 1,67
<?php
 
// Action changesstyle.php version 0.2 du 16/03/2004
// pour WikiNi 0.4.1rc (=> à la version du 200403xx) et supérieurs
// Par Charles Népote (c) 2004
// Licence GPL
 
 
// Fonctionnement
//
// Cette action regroupe la fonction de changement de style ainsi que l'interface
// de modification du style.
// Une fois le style sélectionné via l'interface, la requête est envoyée sous la forme :
// http://example.org/PageTest&set="NomDeFeuilleDeStyle"
// . si ce nom n'est pas constitué uniquement de caractères alphanumériques,
// une erreur est retournée
// . si ce nom est valide et que la feuille de style existe :
// . on change le cookie utilisateur
// . on redirrige l'utilisateur vers http://example.org/PageTest où
// l'utilisateur peut alors constater le changement de style
 
 
// Usage :
//
// -- {{changestyle link="xxx.css"}}
// donne le lien suivant :
// Feuille de style xxx.css
//
// -- {{changestyle link="xxx.css" title="Ouragan"}}
// donne le lien suivant :
// Ouragan
 
 
// A compléter (peut-être un jour) :
//
// -- {{changestyle}}
// donne un formulaire :
// Entrer l'adresse de la feuille de style désirée : [ ]
//
// -- {{changestyle choice="zzz.css;ttt.css"}}
// [] Feuille de style zzz
// [] Feuille de style ttt
 
 
$set = $_GET["set"];
 
 
if ($this->GetParameter(link))
{
echo "<a href=\"".$this->href()."&set=".$this->GetParameter(link)."\">";
echo (!$this->GetParameter(title))?"Feuille de style ".$this->GetParameter(link):$this->GetParameter(title);
echo "</a>";
}
 
 
// Do it.
if (preg_match("/^[A-Za-z0-9][A-Za-z0-9]+$/", $set))
{
$this->SetPersistentCookie('sitestyle',$set,1);
header("Location: ".$this->href());
}
else if ($set)
{
$this->SetMessage("La feuille de style ".$set." est non valide !");
header("Location: ".$this->href());
}
?>
/tags/2014_06_04/wikini/actions/listuserscommon.php
New file
0,0 → 1,24
<?php
if ($last = $this->GetParameter("last"))
{
if ($last=="last") $last=150; else $last= (int) $last;
if ($last)
{
$last_users = $this->LoadAll("select name, signuptime from ".$this->config["common_table_prefix"]."users order by signuptime desc limit $last");
foreach($last_users as $user) { print($this->Format($user["name"])." . . . ".$user["signuptime"]."<br />\n"); }
}
}
 
else
{
if ($last_users = $this->LoadAll("select name, signuptime from ".$this->config["common_table_prefix"]."users order by name asc")
)
{
foreach($last_users as $user)
{
print($this->Format($user["name"])." . . . ".$user["signuptime"]."<br />\n");
}
}
}
 
?>
/tags/2014_06_04/wikini/actions/usersettingscommon.php
New file
0,0 → 1,231
<?php
if (!function_exists("LoadUser"))
{
function LoadUser($name, $password = 0)
{
global $wiki;
return $wiki->LoadSingle("select * from ".$wiki->config["common_table_prefix"]."users where name = '".mysql_escape_string($name)."' ".($password === 0 ? "" : "and password = '".mysql_escape_string($password)."'")." limit 1");
}
}
if ($_REQUEST["action"] == "logout")
{
$this->LogoutUser();
$this->SetMessage("Vous êtes maintenant déconnecté !");
$this->Redirect($this->href());
}
else if ($user = $this->GetUser())
{
// is user trying to update?
if ($_REQUEST["action"] == "update")
{
$this->Query("update ".$this->config["common_table_prefix"]."users set ".
"email = '".mysql_escape_string($_POST["email"])."', ".
"doubleclickedit = '".mysql_escape_string($_POST["doubleclickedit"])."', ".
"show_comments = '".mysql_escape_string($_POST["show_comments"])."', ".
"revisioncount = '".mysql_escape_string($_POST["revisioncount"])."', ".
"changescount = '".mysql_escape_string($_POST["changescount"])."', ".
"motto = '".mysql_escape_string($_POST["motto"])."' ".
"where name = '".$user["name"]."' limit 1");
$this->SetUser(LoadUser($user["name"]));
// forward
$this->SetMessage("Paramètres sauvegardés !");
$this->Redirect($this->href());
}
if ($_REQUEST["action"] == "changepass")
{
// check password
$password = $_POST["password"];
if (preg_match("/ /", $password)) $error = "Les espaces ne sont pas permis dans les mots de passe.";
else if (strlen($password) < 5) $error = "Password too short.";
else if ($user["password"] != md5($_POST["oldpass"])) $error = "Mauvais mot de passe.";
else
{
$this->Query("update ".$this->config["common_table_prefix"]."users set "."password = md5('".mysql_escape_string($password)."') "."where name = '".$user["name"]."'");
$this->SetMessage("Mot de passe changé !");
$user["password"]=md5($password);
$this->SetUser($user);
$this->Redirect($this->href());
}
}
// user is logged in; display config form
print($this->FormOpen());
?>
<input type="hidden" name="action" value="update" />
<table>
<tr>
<td align="right"></td>
<td>Hello, <?php echo $this->Link($user["name"]) ?>!</td>
</tr>
<tr>
<td align="right">Votre adresse e-mail :</td>
<td><input name="email" value="<?php echo htmlentities($user["email"]) ?>" size="40" /></td>
</tr>
<tr>
<td align="right">Edition en Doublecliquant :</td>
<td><input type="hidden" name="doubleclickedit" value="N" /><input type="checkbox" name="doubleclickedit" value="Y" <?php echo $user["doubleclickedit"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">Montrer les commentaires par default :</td>
<td><input type="hidden" name="show_comments" value="N" /><input type="checkbox" name="show_comments" value="Y" <?php echo $user["show_comments"] == "Y" ? "checked\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">Nombre maximum de derniers commentaires :</td>
<td><input name="changescount" value="<?php echo htmlentities($user["changescount"]) ?>" size="40" /></td>
</tr>
<tr>
<td align="right">Nombre maximum de versions :</td>
<td><input name="revisioncount" value="<?php echo htmlentities($user["revisioncount"]) ?>" size="40" /></td>
</tr>
<tr>
<td align="right">Votre devise :</td>
<td><input name="motto" value="<?php echo htmlentities($user["motto"]) ?>" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Mise à jour" /> <input type="button" value="Déconnection" onClick="document.location='<?php echo $this->href("", "", "action=logout"); ?>'" /></td>
</tr>
 
<?php
print($this->FormClose());
 
print($this->FormOpen());
?>
<input type="hidden" name="action" value="changepass" />
 
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right"></td>
<td><?php echo $this->Format("Changement de mot de passe"); ?></td>
</tr>
<?php
if ($error)
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($error)."</div></td></tr>\n");
}
?>
<tr>
<td align="right">Votre ancien mot de passe :</td>
<td><input type="password" name="oldpass" size="40" /></td>
</tr>
<tr>
<td align="right">Nouveau mot de passe :</td>
<td><input type="password" name="password" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Changer" size="40" /></td>
</tr>
</table>
<?php
print($this->FormClose());
 
}
else
{
// user is not logged in
// is user trying to log in or register?
if ($_REQUEST["action"] == "login")
{
// if user name already exists, check password
if ($existingUser = LoadUser($_POST["name"]))
{
// check password
if ($existingUser["password"] == md5($_POST["password"]))
{
$this->SetUser($existingUser, $_POST["remember"]);
$this->Redirect($this->href());
}
else
{
$error = "Mauvais mot de passe !";
}
}
// otherwise, create new account
else
{
$name = trim($_POST["name"]);
$email = trim($_POST["email"]);
$password = $_POST["password"];
$confpassword = $_POST["confpassword"];
 
// check if name is WikkiName style
if (!$this->IsWikiName($name)) $error = "Votre nom d'utilisateur dois être formaté en NomWiki.";
else if (!$email) $error = "Vous devez spécifier une adresse e-mail.";
else if (!preg_match("/^.+?\@.+?\..+$/", $email)) $error = "Ceci ne ressemble pas à une adresse e-mail.";
else if ($confpassword != $password) $error = "Les mots de passe n'étaient pas identiques";
else if (preg_match("/ /", $password)) $error = "Les espaces ne sont pas permis dans un mot de passe.";
else if (strlen($password) < 5) $error = "Mot de passe trop court. Un mot de passe doit contenir au minimum 5 caractères alphanumériques.";
else
{
$this->Query("insert into ".$this->config["common_table_prefix"]."users set ".
"signuptime = now(), ".
"name = '".mysql_escape_string($name)."', ".
"email = '".mysql_escape_string($email)."', ".
"password = md5('".mysql_escape_string($_POST["password"])."')");
 
// log in
$this->SetUser(LoadUser($name));
 
// forward
$this->Redirect($this->href());
}
}
}
print($this->FormOpen());
?>
<input type="hidden" name="action" value="login" />
<table>
<tr>
<td align="right"></td>
<td><?php echo $this->Format("Si vous êtes déjà enregistré, identifiez-vous ici"); ?></td>
</tr>
<?php
if ($error)
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($error)."</div></td></tr>\n");
}
?>
<tr>
<td align="right">Votre NomWiki :</td>
<td><input name="name" size="40" value="<?php echo $name ?>" /></td>
</tr>
<tr>
<td align="right">Mot de passe (5 caractères minimum) :</td>
<td><input type="password" name="password" size="40" />
<input type="hidden" name="remember" value="0" /><input type="checkbox" name="remember" value="1" /> <?php echo $this->Format("Se souvenir de moi.") ?> </td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Identification" size="40" /></td>
</tr>
<tr>
<td align="right"></td>
<td width="500"><?php echo $this->Format("Les champs suivants sont à remplir si vous vous identifiez pour la première fois (vous créérez ainsi un compte)"); ?></td>
</tr>
<tr>
<td align="right">Confirmation du mot de passe :</td>
<td><input type="password" name="confpassword" size="40" /></td>
</tr>
<tr>
<td align="right">Adresse e-mail :</td>
<td><input name="email" size="40" value="<?php echo $email ?>" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Nouveau compte" size="40" /></td>
</tr>
</table>
<?php
print($this->FormClose());
}
?>
 
/tags/2014_06_04/wikini/actions/attach.class.php
New file
0,0 → 1,625
<?php
/*
attach.class.php
Code original de ce fichier : Eric FELDSTEIN
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2003,2004 Eric FELDSTEIN
Copyright 2003 Jean-Pascal MILCENT
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
# Classe de gestion de l'action {{attach}}
# voir actions/attach.php ppour la documentation
# copyrigth Eric Feldstein 2003-2004
 
class attach {
var $wiki = ''; //objet wiki courant
var $attachConfig = array(); //configuration de l'action
var $file = ''; //nom du fichier
var $desc = ''; //description du fichier
var $link = ''; //url de lien (image sensible)
var $isPicture = 0; //indique si c'est une image
var $classes = ''; //classe pour afficher une image
var $attachErr = ''; //message d'erreur
var $pageId = 0; //identifiant de la page
var $isSafeMode = false; //indicateur du safe mode de PHP
/**
* Constructeur. Met les valeurs par defaut aux paramètres de configuration
*/
function attach(&$wiki){
$this->wiki = $wiki;
$this->attachConfig = $this->wiki->GetConfigValue("attach_config");
if (empty($this->attachConfig["ext_images"])) $this->attachConfig["ext_images"] = "gif|jpeg|png|jpg";
if (empty($this->attachConfig["ext_script"])) $this->attachConfig["ext_script"] = "php|php3|asp|asx|vb|vbs|js";
if (empty($this->attachConfig['upload_path'])) $this->attachConfig['upload_path'] = 'files';
if (empty($this->attachConfig['update_symbole'])) $this->attachConfig['update_symbole'] = '*';
if (empty($this->attachConfig['max_file_size'])) $this->attachConfig['max_file_size'] = 1024*100; //100ko max
if (empty($this->attachConfig['fmDelete_symbole'])) $this->attachConfig['fmDelete_symbole'] = 'Supr';
if (empty($this->attachConfig['fmRestore_symbole'])) $this->attachConfig['fmRestore_symbole'] = 'Rest';
if (empty($this->attachConfig['fmTrash_symbole'])) $this->attachConfig['fmTrash_symbole'] = 'Poubelle';
$this->isSafeMode = ini_get("safe_mode");
}
/******************************************************************************
* FONCTIONS UTILES
*******************************************************************************/
/**
* Création d'une suite de répertoires récursivement
*/
function mkdir_recursif ($dir) {
if (strlen($dir) == 0) return 0;
if (is_dir($dir)) return 1;
elseif (dirname($dir) == $dir) return 1;
return ($this->mkdir_recursif(dirname($dir)) and mkdir($dir,0755));
}
/**
* Renvois le chemin du script
*/
function GetScriptPath () {
if (preg_match("/.(php)$/i",$_SERVER["PHP_SELF"])){
$a = explode('/',$_SERVER["PHP_SELF"]);
$a[count($a)-1] = '';
$path = implode('/',$a);
}else{
$path = $_SERVER["PHP_SELF"];
}
return !empty($_SERVER["HTTP_HOST"])? 'http://'.$_SERVER["HTTP_HOST"].$path : 'http://'.$_SERVER["SERVER_NAME"].$path ;
}
/**
* Calcul le repertoire d'upload en fonction du safe_mode
*/
function GetUploadPath(){
if ($this->isSafeMode) {
$path = $this->attachConfig['upload_path'];
}else{
$path = $this->attachConfig['upload_path'].'/'.$this->wiki->GetPageTag();
if (! is_dir($path)) $this->mkdir_recursif($path);
}
return $path;
}
/**
* Calcule le nom complet du fichier attaché en fonction du safe_mode, du nom et de la date de
* revision la page courante.
* Le nom du fichier "mon fichier.ext" attache à la page "LaPageWiki"sera :
* mon_fichier_datepage_update.ext
* update : date de derniere mise a jour du fichier
* datepage : date de revision de la page à laquelle le fichier a ete lié/mis a jour
* Si le fichier n'est pas une image un '_' est ajoute : mon_fichier_datepage_update.ext_
* Selon la valeur de safe_mode :
* safe_mode = on : LaPageWiki_mon_fichier_datepage_update.ext_
* safe_mode = off: LaPageWiki/mon_fichier_datepage_update.ext_ avec "LaPageWiki" un sous-repertoire du répertoire upload
*/
function GetFullFilename($newName = false){
$pagedate = $this->convertDate($this->wiki->page['time']);
//decompose le nom du fichier en nom+extension
if (preg_match('`^(.*)\.(.*)$`', str_replace(' ','_',$this->file), $match)){
list(,$file['name'],$file['ext'])=$match;
if(!$this->isPicture()) $file['ext'] .= '_';
}else{
return false;
}
//recuperation du chemin d'upload
$path = $this->GetUploadPath($this->isSafeMode);
//generation du nom ou recherche de fichier ?
if ($newName){
$full_file_name = $file['name'].'_'.$pagedate.'_'.$this->getDate().'.'.$file['ext'];
if($this->isSafeMode){
$full_file_name = $path.'/'.$this->wiki->GetPageTag().'_'.$full_file_name;
}else{
$full_file_name = $path.'/'.$full_file_name;
}
}else{
//recherche du fichier
if($this->isSafeMode){
//TODO Recherche dans le cas ou safe_mode=on
$searchPattern = '`^'.$this->wiki->GetPageTag().'_'.$file['name'].'_\d{14}_\d{14}\.'.$file['ext'].'$`';
}else{
$searchPattern = '`^'.$file['name'].'_\d{14}_\d{14}\.'.$file['ext'].'$`';
}
$files = $this->searchFiles($searchPattern,$path);
 
$unedate = 0;
foreach ($files as $file){
//recherche du fichier qui une datepage <= a la date de la page
if($file['datepage']<=$pagedate){
//puis qui a une dateupload la plus grande
if ($file['dateupload']>$unedate){
$theFile = $file;
$unedate = $file['dateupload'];
}
}
}
if (is_array($theFile)){
$full_file_name = $path.'/'.$theFile['realname'];
}
}
return $full_file_name;
}
/**
* Test si le fichier est une image
*/
function isPicture(){
return preg_match("/.(".$this->attachConfig["ext_images"].")$/i",$this->file)==1;
}
/**
* Renvoie la date courante au format utilise par les fichiers
*/
function getDate(){
return date('YmdHis');
}
/**
* convertie une date yyyy-mm-dd hh:mm:ss au format yyyymmddhhmmss
*/
function convertDate($date){
$date = str_replace(' ','', $date);
$date = str_replace(':','', $date);
return str_replace('-','', $date);
}
/**
* Parse une date au format yyyymmddhhmmss et renvoie un tableau assiatif
*/
function parseDate($sDate){
$pattern = '`^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$`';
$res = '';
if (preg_match($pattern, $sDate, $m)){
//list(,$res['year'],$res['month'],$res['day'],$res['hour'],$res['min'],$res['sec'])=$m;
$res = $m[1].'-'.$m[2].'-'.$m[3].' '.$m[4].':'.$m[5].':'.$m[6];
}
return ($res?$res:false);
}
/**
* Decode un nom long de fichier
*/
function decodeLongFilename($filename){
$afile = array();
$afile['realname'] = basename($filename);
$afile['size'] = filesize($filename);
$afile['path'] = dirname($filename);
if(preg_match('`^(.*)_(\d{14})_(\d{14})\.(.*)(trash\d{14})?$`', $afile['realname'], $m)){
$afile['name'] = $m[1];
//suppression du nom de la page si safe_mode=on
if ($this->isSafeMode){
$afile['name'] = preg_replace('`^('.$this->wiki->tag.')_(.*)$`i', '$2', $afile['name']);
}
$afile['datepage'] = $m[2];
$afile['dateupload'] = $m[3];
$afile['trashdate'] = preg_replace('`(.*)trash(\d{14})`', '$2', $m[4]);
//suppression de trashxxxxxxxxxxxxxx eventuel
$afile['ext'] = preg_replace('`^(.*)(trash\d{14})$`', '$1', $m[4]);
$afile['ext'] = rtrim($afile['ext'],'_');
//$afile['ext'] = rtrim($m[4],'_');
}
return $afile;
}
/**
* Renvois un tableau des fichiers correspondant au pattern. Chaque element du tableau est un
* tableau associatif contenant les informations sur le fichier
*/
function searchFiles($filepattern,$start_dir){
$files_matched = array();
$start_dir = rtrim($start_dir,'\/');
$fh = opendir($start_dir);
while (($file = readdir($fh)) !== false) {
if (strcmp($file, '.')==0 || strcmp($file, '..')==0 || is_dir($file)) continue;
if (preg_match($filepattern, $file)){
$files_matched[] = $this->decodeLongFilename($start_dir.'/'.$file);
}
}
return $files_matched;
}
/******************************************************************************
* FONCTIONS D'ATTACHEMENTS
*******************************************************************************/
/**
* Test les paramètres passé à l'action
*/
function CheckParams(){
//recuperation des parametres necessaire
$this->file = $this->wiki->GetParameter("attachfile");
if (empty($this->file)) $this->file = $this->wiki->GetParameter("file");
$this->desc = $this->wiki->GetParameter("attachdesc");
if (empty($this->desc)) $this->desc = $this->wiki->GetParameter("desc");
$this->link = $this->wiki->GetParameter("attachlink");//url de lien - uniquement si c'est une image
if (empty($this->link)) $this->link = $this->wiki->GetParameter("link");
//test de validité des parametres
if (empty($this->file)){
$this->attachErr = $this->wiki->Format("//action attach : paramètre **file** manquant//---");
}
if ($this->isPicture() && empty($this->desc)){
$this->attachErr .= $this->wiki->Format("//action attach : paramètre **desc** obligatoire pour une image//---");
}
if ($this->wiki->GetParameter("class")) {
$array_classes = explode(" ", $this->wiki->GetParameter("class"));
foreach ($array_classes as $c) { $this->classes = $this->classes . "attach_" . $c . " "; }
$this->classes = trim($this->classes);
}
}
/**
* Affiche le fichier lié comme une image
*/
function showAsImage($fullFilename){
//c'est une image : balise <IMG..../>
$img = "<img src=\"".$this->GetScriptPath().$fullFilename."\" ".
"alt=\"".$this->desc.($this->link?"\nLien vers: $this->link":"")."\" />";
//test si c'est une image sensible
if(!empty($this->link)){
//c'est une image sensible
//test si le lien est un lien interwiki
if (preg_match("/^([A-Z][A-Z,a-z]+)[:]([A-Z,a-z,0-9]*)$/s", $this->link, $matches))
{ //modifie $link pour être un lien vers un autre wiki
$this->link = $this->wiki->GetInterWikiUrl($matches[1], $matches[2]);
}
//calcule du lien
$output = $this->wiki->Format('[['.$this->link." $this->file]]");
$output = eregi_replace(">$this->file<",">$img<",$output);//insertion du tag <img...> dans le lien
}else{
//ce n'est pas une image sensible
$output = $img;
}
$output = ($this->classes?"<span class=\"$this->classes\">$output</span>":$output);
echo $output;
$this->showUpdateLink();
}
/**
* Affiche le fichier lié comme un lien
*/
function showAsLink($fullFilename){
$url = $this->wiki->href("download",$this->wiki->GetPageTag(),"file=$this->file");
echo '<a href="'.$url.'">'.($this->desc?$this->desc:$this->file)."</a>";
$this->showUpdateLink();
}
/**
* Affiche le lien de mise à jour
*/
function showUpdateLink(){
echo " <a href=\"".
$this->wiki->href("upload",$this->wiki->GetPageTag(),"file=$this->file").
"\" title='Mise à jour'>".$this->attachConfig['update_symbole']."</a>";
}
/**
* Affiche un liens comme un fichier inexistant
*/
function showFileNotExits(){
echo $this->file."<a href=\"".$this->wiki->href("upload",$this->wiki->GetPageTag(),"file=$this->file")."\">?</a>";
}
/**
* Affiche l'attachement
*/
function doAttach(){
$this->CheckParams();
if ($this->attachErr) {
echo $this->attachErr;
return;
}
$fullFilename = $this->GetFullFilename();
//test d'existance du fichier
if((!file_exists($fullFilename))||($fullFilename=='')){
$this->showFileNotExits();
return;
}
//le fichier existe : affichage en fonction du type
if($this->isPicture()){
$this->showAsImage($fullFilename);
}else{
$this->showAsLink($fullFilename);
}
}
/******************************************************************************
* FONTIONS D'UPLOAD DE FICHIERS
*******************************************************************************/
/**
* Traitement des uploads
*/
function doUpload(){
$HasAccessWrite=$this->wiki->HasAccess("write");
if ($HasAccessWrite){
switch ($_SERVER["REQUEST_METHOD"]) {
case 'GET' : $this->showUploadForm(); break;
case 'POST': $this->performUpload(); break;
default : echo $this->wiki->Format("//Methode de requete invalide//---");
}
}else{
echo $this->wiki->Format("//Vous n'avez pas l'accès en écriture à cette page//---");
echo $this->wiki->Format("Retour à la page ".$this->wiki->GetPageTag());
}
}
/**
* Formulaire d'upload
*/
function showUploadForm(){
echo $this->wiki->Format("====Formulaire d'envois de fichier====\n---");
$this->file = $_GET['file'];
echo $this->wiki->Format("**Envois du fichier $this->file :**\n")
."<form enctype=\"multipart/form-data\" name=\"frmUpload\" method=\"POST\" action=\"".$_SERVER["PHP_SELF"]."\">\n"
." <input type=\"hidden\" name=\"wiki\" value=\"".$this->wiki->GetPageTag()."/upload\" />\n"
." <input TYPE=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"".$this->attachConfig['max_file_size']."\" />\n"
." <input type=\"hidden\" name=\"file\" value=\"$this->file\" />\n"
." <input type=\"file\" name=\"upFile\" size=\"50\" /><br />\n"
." <input type=\"submit\" value=\"Envoyer\" />\n"
."</form>\n";
}
/**
* Execute l'upload
*/
function performUpload(){
$this->file = $_POST['file'];
 
$destFile = $this->GetFullFilename(true); //nom du fichier destination
//test de la taille du fichier recu
if($_FILES['upFile']['error']==0){
$size = filesize($_FILES['upFile']['tmp_name']);
if ($size > $this->attachConfig['max_file_size']){
$_FILES['upFile']['error']=2;
}
}
switch ($_FILES['upFile']['error']){
case 0:
$srcFile = $_FILES['upFile']['tmp_name'];
if (move_uploaded_file($srcFile,$destFile)){
chmod($destFile,0644);
header("Location: ".$this->wiki->href("",$this->wiki->GetPageTag(),""));
}else{
echo $this->wiki->Format("//Erreur lors du déplacement du fichier temporaire//---");
}
break;
case 1:
echo $this->wiki->Format("//Le fichier téléchargé excède la taille de upload_max_filesize, configuré dans le php.ini.//---");
break;
case 2:
echo $this->wiki->Format("//Le fichier téléchargé excède la taille de MAX_FILE_SIZE, qui a été spécifiée dans le formulaire HTML.//---");
break;
case 3:
echo $this->wiki->Format("//Le fichier n'a été que partiellement téléchargé.//---");
break;
case 4:
echo $this->wiki->Format("//Aucun fichier n'a été téléchargé.//---");
break;
}
echo $this->wiki->Format("Retour à la page ".$this->wiki->GetPageTag());
}
/******************************************************************************
* FUNCTIONS DE DOWNLOAD DE FICHIERS
*******************************************************************************/
function doDownload(){
$this->file = $_GET['file'];
$fullFilename = $this->GetUploadPath().'/'.$this->file;
if(!file_exists($fullFilename)){
$fullFilename = $this->GetFullFilename();
$dlFilename = $this->file;
$size = filesize($fullFilename);
}else{
$file = $this->decodeLongFilename($fullFilename);
$size = $file['size'];
$dlFilename =$file['name'].'.'.$file['ext'];
}
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Content-type: application/force-download");
header('Pragma: public');
header("Pragma: no-cache");// HTTP/1.0
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Content-Transfer-Encoding: none');
header('Content-Type: application/octet-stream; name="' . $dlFilename . '"'); //This should work for the rest
header('Content-Type: application/octetstream; name="' . $dlFilename . '"'); //This should work for IE & Opera
header('Content-Type: application/download; name="' . $dlFilename . '"'); //This should work for IE & Opera
header('Content-Disposition: attachment; filename="'.$dlFilename.'"');
header("Content-Description: File Transfer");
header("Content-length: $size".'bytes');
readfile($fullFilename);
}
/******************************************************************************
* FONTIONS DU FILEMANAGER
*******************************************************************************/
function doFileManager(){
$do = $_GET['do']?$_GET['do']:'';
switch ($do){
case 'restore' :
$this->fmRestore();
$this->fmShow(true);
break;
case 'erase' :
$this->fmErase();
$this->fmShow(true);
break;
case 'del' :
$this->fmDelete();
$this->fmShow();
break;
case 'trash' :
$this->fmShow(true); break;
case 'emptytrash' :
$this->fmEmptyTrash(); //pas de break car apres un emptytrash => retour au gestionnaire
default :
$this->fmShow();
}
}
/**
* Affiche la liste des fichiers
*/
function fmShow($trash=false){
$fmTitlePage = $this->wiki->Format("====Gestion des fichiers attachés à la page ".$this->wiki->tag."====\n---");
if($trash){
//Avertissement
$fmTitlePage .= '<div class="prev_alert">Les fichiers effacés sur cette page le sont définitivement</div>';
//Pied du tableau
$url = $this->wiki->Link($this->wiki->tag,'filemanager','Gestion des fichiers');
$fmFootTable = ' <tfoot>'."\n".
' <tr>'."\n".
' <td colspan="6">'.$url.'</td>'."\n";
$url = $this->wiki->Link($this->wiki->tag,'filemanager&do=emptytrash','Vider la poubelle');
$fmFootTable.= ' <td>'.$url.'</td>'."\n".
' </tr>'."\n".
' </tfoot>'."\n";
}else{
//pied du tableau
$url = '<a href="'.$this->wiki->href('filemanager',$this->wiki->GetPageTag(),'do=trash').'" title="Poubelle">'.$this->attachConfig['fmTrash_symbole']."</a>";
$fmFootTable = ' <tfoot>'."\n".
' <tr>'."\n".
' <td colspan="6">'.$url.'</td>'."\n".
' </tr>'."\n".
' </tfoot>'."\n";
}
//entete du tableau
$fmHeadTable = ' <thead>'."\n".
' <tr>'."\n".
' <td>&nbsp;</td>'."\n".
' <td>Nom du fichier</td>'."\n".
' <td>Nom réel du fichier</td>'."\n".
' <td>Taille</td>'."\n".
' <td>Révision de la page</td>'."\n".
' <td>Révison du fichier</td>'."\n";
if($trash){
$fmHeadTable.= ' <td>Suppression</td>'."\n";
}
$fmHeadTable.= ' </tr>'."\n".
' </thead>'."\n";
//corps du tableau
$files = $this->fmGetFiles($trash);
$files = $this->sortByNameRevFile($files);
 
$fmBodyTable = ' <tbody>'."\n";
$i = 0;
foreach ($files as $file){
$i++;
$color= ($i%2?"tableFMCol1":"tableFMCol2");
//lien de suppression
if ($trash){
$url = $this->wiki->href('filemanager',$this->wiki->GetPageTag(),'do=erase&file='.$file['realname']);
}else{
$url = $this->wiki->href('filemanager',$this->wiki->GetPageTag(),'do=del&file='.$file['realname']);
}
$dellink = '<a href="'.$url.'" title="Supprimer">'.$this->attachConfig['fmDelete_symbole']."</a>";
//lien de restauration
$restlink = '';
if ($trash){
$url = $this->wiki->href('filemanager',$this->wiki->GetPageTag(),'do=restore&file='.$file['realname']);
$restlink = '<a href="'.$url.'" title="Restaurer">'.$this->attachConfig['fmRestore_symbole']."</a>";
}
 
//lien pour downloader le fichier
$url = $this->wiki->href("download",$this->wiki->GetPageTag(),"file=".$file['realname']);
$dlLink = '<a href="'.$url.'">'.$file['name'].'.'.$file['ext']."</a>";
$fmBodyTable .= ' <tr class="'.$color.'">'."\n".
' <td>'.$dellink.' '.$restlink.'</td>'."\n".
' <td>'.$dlLink.'</td>'."\n".
' <td>'.$file['realname'].'</td>'."\n".
' <td>'.$file['size'].'</td>'."\n".
' <td>'.$this->parseDate($file['datepage']).'</td>'."\n".
' <td>'.$this->parseDate($file['dateupload']).'</td>'."\n";
if($trash){
$fmBodyTable.= ' <td>'.$this->parseDate($file['trashdate']).'</td>'."\n";
}
$fmBodyTable .= ' </tr>'."\n";
}
$fmBodyTable .= ' </tbody>'."\n";
//pied de la page
$fmFooterPage = "---\n-----\n[[".$this->wiki->tag." Retour à la page ".$this->wiki->tag."]]\n";
//affichage
echo $fmTitlePage."\n";
echo '<table class="tableFM" border="0" cellspacing="0">'."\n".$fmHeadTable.$fmFootTable.$fmBodyTable.'</table>'."\n";
echo $this->wiki->Format($fmFooterPage);
}
/**
* Renvoie la liste des fichiers
*/
function fmGetFiles($trash=false){
$path = $this->GetUploadPath();
if($this->isSafeMode){
$filePattern = '^'.$this->wiki->GetPageTag().'_.*_\d{14}_\d{14}\..*';
}else{
$filePattern = '^.*_\d{14}_\d{14}\..*';
}
if($trash){
$filePattern .= 'trash\d{14}';
}else{
$filePattern .= '[^(trash\d{14})]';
}
return $this->searchFiles('`'.$filePattern.'$`', $path);
}
/**
* Vide la poubelle
*/
function fmEmptyTrash(){
$files = $this->fmGetFiles(true);
foreach ($files as $file){
$filename = $file['path'].'/'.$file['realname'];
if(file_exists($filename)){
unlink($filename);
}
}
}
/**
* Effacement d'un fichier dans la poubelle
*/
function fmErase(){
$path = $this->GetUploadPath();
$filename = $path.'/'.($_GET['file']?$_GET['file']:'');
if (file_exists($filename)){
unlink($filename);
}
}
/**
* Met le fichier a la poubelle
*/
function fmDelete(){
$path = $this->GetUploadPath();
$filename = $path.'/'.($_GET['file']?$_GET['file']:'');
if (file_exists($filename)){
$trash = $filename.'trash'.$this->getDate();
rename($filename, $trash);
}
}
/**
* Restauration d'un fichier mis a la poubelle
*/
function fmRestore(){
$path = $this->GetUploadPath();
$filename = $path.'/'.($_GET['file']?$_GET['file']:'');
if (file_exists($filename)){
$restFile = preg_replace('`^(.*\..*)trash\d{14}$`', '$1', $filename);
rename($filename, $restFile);
}
}
/**
* Tri tu tableau liste des fichiers par nom puis par date de revision(upload) du fichier, ordre croissant
*/
function sortByNameRevFile($files){
if (!function_exists('ByNameByRevFile')){
function ByNameByRevFile($f1,$f2){
$f1Name = $f1['name'].'.'.$f1['ext'];
$f2Name = $f2['name'].'.'.$f2['ext'];
$res = strcasecmp($f1Name, $f2Name);
if($res==0){
//si meme nom => compare la revision du fichier
$res = strcasecmp($f1['dateupload'], $f2['dateupload']);
}
return $res;
}
}
usort($files,'ByNameByRevFile');
return $files;
}
}
?>
/tags/2014_06_04/wikini/actions/recentchanges.php
New file
0,0 → 1,76
<?php
 
/*
recentchanges.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2002 Patrick PAUL
Copyright 2003 Eric DELORD
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
// Which is the max number of pages to be shown ?
if ($max = $this->GetParameter("max"))
{
if ($max=="last") $max=50; else $last = (int) $max;
}
elseif ($user = $this->GetUser())
{
$max = $user["changescount"];
}
else
{
$max = 50;
}
 
// Show recently changed pages
if ($pages = $this->LoadRecentlyChanged($max))
{
if ($this->GetParameter("max"))
{
foreach ($pages as $i => $page)
{
// echo entry
echo "(",$page["time"],") (",$this->ComposeLinkToPage($page["tag"], "revisions", "historique", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0)," . . . . ",$this->Format($page["user"]),"<br />\n" ;
}
}
else
{
$curday='';
foreach ($pages as $i => $page)
{
// day header
list($day, $time) = explode(" ", $page["time"]);
if ($day != $curday)
{
if ($curday) echo "<br />\n" ;
echo "<b>$day&nbsp;:</b><br />\n" ;
$curday = $day;
}
// echo entry
echo "&nbsp;&nbsp;&nbsp;(",$time,") (",$this->ComposeLinkToPage($page["tag"], "revisions", "historique", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0)," . . . . ",$this->Format($page["user"]),"<br />\n" ;
}
}
}
?>
/tags/2014_06_04/wikini/actions/textsearch.php
New file
0,0 → 1,106
<?php
/*
textsearch.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002 Patrick PAUL
Copyright 2004 Jean Christophe ANDRÉ
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
 
// label à afficher devant la zone de saisie
$label = $this->GetParameter('label', 'Ce que vous souhaitez chercher&nbsp;: ');
// largeur de la zone de saisie
$size = $this->GetParameter('size', '40');
// texte du bouton
$button = $this->GetParameter('button', 'Chercher');
// texte à chercher
$phrase = $this->GetParameter('phrase', false);
// séparateur entre les éléments trouvés
$separator = $this->GetParameter('separator', false);
 
// se souvenir si c'était un paramètre de l'action ou du CGI
$paramPhrase = $phrase;
// récupérer le paramètre du CGI le cas échéant
if (!isset($_REQUEST['phrase'])) $_REQUEST['phrase'] = '';
if (!$phrase) $phrase = $_REQUEST['phrase'];
 
// s'il y a un paramètre d'action "phrase", on affiche uniquement le résultat
// dans le cas contraire, présenter une zone de saisie
if (!$paramPhrase)
{
echo $this->FormOpen('', '', 'get');
if ($label)
{
echo $this->Format($label), ' ';
}
echo '<input name="phrase" size="', htmlspecialchars($size), '" value="', htmlentities($phrase), '" />';
if ($button)
{
echo '&nbsp;<input type="submit" value="', htmlspecialchars($button), '" />';
}
echo "\n", $this->FormClose();
}
 
if ($phrase)
{
if ($results = $this->FullTextSearch($phrase))
{
if ($separator)
{
$separator = htmlspecialchars($separator);
if (!$paramPhrase)
{
echo '<p>R&eacute;sultat(s) de la recherche de "', htmlspecialchars($phrase), '"&nbsp;: ';
}
foreach ($results as $i => $page)
{
if ($i > 0) echo $separator;
echo $this->ComposeLinkToPage($page['tag']);
}
if (!$paramPhrase)
{
echo '</p>', "\n";
}
}
else
{
echo '<p><strong>R&eacute;sultat(s) de la recherche de "', htmlspecialchars($phrase), '"&nbsp;:</strong></p>', "\n",
'<ol>', "\n";
foreach ($results as $i => $page)
{
echo "<li>", $this->ComposeLinkToPage($page["tag"]), "</li>\n";
}
echo "</ol>\n";
}
}
else
{
if (!$paramPhrase)
{
echo "<p>Aucun r&eacute;sultat pour \"", htmlspecialchars($phrase), "\". :-(</p>";
}
}
}
?>
/tags/2014_06_04/wikini/actions/trail.php
New file
0,0 → 1,102
<?php
 
/*
trail.php : Permet d'afficher des liens "Page Suivante" "Sommaire" "Page Precedente" dans une page
 
Copyright 2003 Eric FELDSTEIN
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
/*
* Cette action permet de lier des pages entre elle via une page contenant la liste
* ordonnées de ces pages. L'action affiche des liens de navigation permettant de
* passer à la page suivante ou précédente ou de revenir au sommaire.
*
* @param toc string nom de la page contenant la liste ordonnée des pages à liées entre elles
*/
 
/* La page sommaire doit contenir une liste de pages. Le premier mot de chaque élément
de la liste doit être le nom d'une page du wiki, donc un mot wiki ou un lien force
exemple de page sommaire:
 
===Sommaire===
 
IntroductionAuProjet : présentation du projet.
[[AnalyseProjet Analyse]] : analyse des besoins
-BesoinDesUtilisateurs
-ContraintesTechniques
OutilsEtNormes
 
Texte texte texte texte texte texte texte texte texte texte
texte texte texte texte texte texte texte texte texte texte texte
texte texte texte texte texte texte texte texte texte texte texte texte
 
*/
 
//echo $this->Format("===Action Trail===");
$sommaire = $this->GetParameter("toc");
if (!$sommaire) {
echo $this->Format("//Indiquez le nom de la page sommaire, paramètre 'toc'//.");
}else{
//chargement de la page sommaire
$tocPage = $this->LoadPage($sommaire);
//analyse de la page sommaire pour récupérer la liste des pages
//recuperation de la liste
if (preg_match_all("/\n[\t ]+(.*)/",$tocPage["body"],$tocListe)){
//analyse de chaque ligne de la liste pour recupérer la page cible
$currentPageIndex = NULL;
foreach ($tocListe[1] as $line){
//suppression d'un signe de liste eventuel
$line = trim(preg_replace("/^([A-Za-z0-9]+\)|-)/","",$line));
//recuperation du 1er mot
$line = preg_replace("/^(\[\[.*\]\]|[A-Za-z0-9]+)\s*(.*)$/","$1",$line);
//ajout a la liste des pages si le 1er mot est un lien force ou un mot wiki
if (preg_match("/\[\[.*\]\]/",$line,$match)|$this->IsWikiName($line)){
$pages[] = $line;
//regarde si la page ajoute a la liste est la page courante
if (strcasecmp($this->GetPageTag(),$line)==0){
$currentPageIndex = count($pages)-1;
}else { //traite le cas des lien force
if (preg_match("/\[\[(.*:)?".$this->GetPageTag()."(\s.*)?\]\]$/",$line)) {
$currentPageIndex = count($pages)-1;
}
}
 
}
}//foreach
}
//ecriture des liens Page Précedente/sommaire/page suivante
if ($currentPageIndex>0) {
$PrevPage = $pages[$currentPageIndex-1];
$btnPrev = "<span class=\"trail_button\">".$this->Format("&lt;&lt; $PrevPage")."</span>";
}else{
$btnPrev = "&nbsp;";
}
$btnTOC = "<span class=\"trail_button\">".$this->Format($sommaire)."</span>";
if ($currentPageIndex < (count($pages)-1)){
$NextPage = $pages[$currentPageIndex+1];
$btnNext = "<span class=\"trail_button\">".$this->Format("$NextPage &gt;&gt;")."</span>";
}else{
$btnNext = "&nbsp;";
}
echo "<table class=\"trail_table\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
echo " <tr>\n";
echo " <td align=\"left\" width=\"35%\">$btnPrev</td>\n";
echo " <td align=\"center\">$btnTOC</td>\n";
echo " <td align=\"right\" width=\"35%\">$btnNext</td>\n";
echo " </tr>\n";
echo "</table>\n";
}
?>
/tags/2014_06_04/wikini/actions/findpage.php
New file
0,0 → 1,0
The unfinished FindPage action.
/tags/2014_06_04/wikini/actions/mychanges.php
New file
0,0 → 1,118
<?php
/*
mychanges.php
Copyright (c) 2003, Carlo Zottmann
Copyright 2003 David DELON
Copyright 2003 Charles NEPOTE
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
if ($user = $this->GetUser())
{
$my_edits_count = 0;
 
if (($bydate = $this->GetParameter("bydate")))
{
echo "<b>Liste des pages que vous avez modifi&eacute;es, tri&eacute;e par date de modification.</b><br /><br />\n";
 
if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user = '".mysql_escape_string($this->UserName())."' AND tag NOT LIKE 'Comment%' ORDER BY time ASC, tag ASC"))
{
foreach ($pages as $page)
{
$edited_pages[$page["tag"]] = $page["time"];
}
 
arsort($edited_pages);
 
foreach ($edited_pages as $page["tag"] => $page["time"])
{
// day header
list($day, $time) = explode(" ", $page["time"]);
if ($day != $curday)
{
if ($curday) echo "<br />\n";
echo "<b>$day:</b><br />\n";
$curday = $day;
}
 
// echo entry
echo "&nbsp;&nbsp;&nbsp;($time) (",$this->ComposeLinkToPage($page["tag"], "revisions", "history", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0),"<br />\n";
 
$my_edits_count++;
}
if ($my_edits_count == 0)
{
echo "<i>Vous n'avez pas modifi&eacute; de page.</i>";
}
}
else
{
echo "<i>Aucune page trouv&eacute;e.</i>";
}
}
else
{
echo "<b>Liste des pages que vous avez modifi&eacute;es, tri&eacute;e par ordre alphab&eacute;tique.</b><br /><br />\n";
 
if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user = '".mysql_escape_string($this->UserName())."' AND tag NOT LIKE 'Comment%' ORDER BY tag ASC, time DESC"))
{
foreach ($pages as $page)
{
if ($last_tag != $page["tag"]) {
$last_tag = $page["tag"];
$firstChar = strtoupper($page["tag"][0]);
if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
$firstChar = "#";
}
if ($firstChar != $curChar) {
if ($curChar) echo "<br />\n";
echo "<b>$firstChar</b><br />\n";
$curChar = $firstChar;
}
// echo entry
echo "&nbsp;&nbsp;&nbsp;(",$page["time"],") (",$this->ComposeLinkToPage($page["tag"], "revisions", "history", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0),"<br />\n";
$my_edits_count++;
}
}
if ($my_edits_count == 0)
{
echo "<i>Vous n'avez pas modifi&eacute; de page.</i>";
}
}
else
{
echo "<i>Aucune page trouv&eacute;e.</i>";
}
}
}
else
{
echo "<i>Vous n'&ecirc;tes pas identifi&eacute; : impossible d'afficher la liste des pages que vous avez modifi&eacute;es.</i>";
}
 
?>
/tags/2014_06_04/wikini/actions/test.php
New file
0,0 → 1,0
I'm a test!
/tags/2014_06_04/wikini/handlers/page/raw.php
New file
0,0 → 1,45
<?php
/*
raw.php
 
Copyright 2002 David DELON
Copyright 2003 Eric FELDSTEIN
Copyright 2003 Charles NEPOTE
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
 
if ($this->HasAccess("read"))
{
if (!$this->page)
{
return;
}
else
{
header("Content-type: text/plain");
// display raw page
echo $this->page["body"];
}
}
else
{
return;
}
?>
/tags/2014_06_04/wikini/handlers/page/deletepage.php
New file
0,0 → 1,53
<?php
/*
deletepage.php
 
Copyright 2002 David DELON
Copyright 2003 Eric FELDSTEIN
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
?>
<div class="page">
<?php
 
if ($this->UserIsOwner())
{
if ($pages = $this->IsOrphanedPage($this->GetPageTag()))
{
foreach ($pages as $page)
{
$this->DeleteOrphanedPage($this->GetPageTag());
}
}
else
{
echo"<i>Cette page n'est pas orpheline.</i>";
}
 
}
else
{
echo"<i>Vous n'&ecirc;tes pas le propri&eacute;taire de cette page.</i>";
}
 
?>
</div>
<?php echo $this->Footer(); ?>
/tags/2014_06_04/wikini/handlers/page/referrers.php
New file
0,0 → 1,86
<?php
/*
referrers.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2003 Eric FELDSTEIN
Copyright 2003 Jean-Pascal MILCENT
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
?>
<div class="page">
<?php
if ($global = $_REQUEST["global"])
{
$title = "Sites faisant r&eacute;f&eacute;rence &agrave; ce wiki (<a href=\"".$this->href("referrers_sites", "", "global=1")."\">voir la liste des domaines</a>)&nbsp;:";
$referrers = $this->LoadReferrers();
}
else
{
$title = "Pages externes faisant r&eacute;f&eacute;rence &agrave; ".$this->ComposeLinkToPage($this->GetPageTag()).
($this->GetConfigValue("referrers_purge_time") ? " (depuis ".($this->GetConfigValue("referrers_purge_time") == 1 ? "24 heures" : $this->GetConfigValue("referrers_purge_time")." jours").")" : "")." (<a href=\"".$this->href("referrers_sites")."\">voir la liste des domaines</a>)&nbsp;:";
$referrers = $this->LoadReferrers($this->GetPageTag());
}
 
echo "<b>$title</b><br /><br />\n" ;
if ($referrers)
{
{
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n" ;
foreach ($referrers as $referrer)
{
echo "<tr>" ;
echo "<td width=\"30\" align=\"right\" valign=\"top\" style=\"padding-right: 10px\">",$referrer["num"],"</td>" ;
echo "<td valign=\"top\"><a href=\"",$referrer["referrer"],"\">",$referrer["referrer"],"</a></td>" ;
echo "</tr>\n" ;
}
echo "</table>\n" ;
}
}
else
{
echo "<i>Aucune <acronym tilte=\"Uniform Resource Locator (adresse web)\">URL</acronym> ne fait r&eacute;f&eacute;rence &agrave; cette page.</i><br />\n" ;
}
 
if ($global)
{
echo "<br />[<a href=\"",$this->href("referrers_sites"),"\">Voir les domaines faisant r&eacute;f&eacute;rence &agrave; ",$this->GetPageTag()," seulement</a> | <a href=\"",$this->href("referrers"),"\">Voir les r&eacute;f&eacute;rences &agrave; ",$this->GetPageTag()," seulement</a>]" ;
}
else
{
 
echo "<br />[<a href=\"",$this->href("referrers_sites", "", "global=1"),"\">Voir tous les domaines faisant r&eacute;f&eacute;rence </a> | <a href=\"",$this->href("referrers", "", "global=1"),"\">Voir toutes les r&eacute;f&eacute;rences </a>]" ;
}
 
 
?>
</div>
<?php echo $this->Footer(); ?>
/tags/2014_06_04/wikini/handlers/page/xml.php
New file
0,0 → 1,39
<?php
/*
xml.php
 
Copyright 2003 David DELON
Copyright 2003 Eric FELDSTEIN
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
 
header("Content-type: text/xml");
 
if ($HasAccessRead=$this->HasAccess("read"))
{
// TODO : Return an empty xml ?
// TODO : Return an error read (noaccess) xml ?
if ($this->page)
{
// display page
echo $this->Format($this->page["body"], "action") ;
}
}
?>
/tags/2014_06_04/wikini/handlers/page/slide_show.php
New file
0,0 → 1,233
<?php
/*
Handler "slide_show" pour WikiNi version WikiNi 0.4.1rc et supérieurs.
Développé par Charles Népote.
Version 0.08 du 26/04/2004.
Licence GPL.
 
Par défaut il utilise les classes de style suivantes :
.slide { font-size: 160%; margin: 5%; background-color: #FFFFFF; padding: 30px; border: 1px inset; line-height: 1.5; }
.slide UL, LI { font-size: 100%; }
.slide LI LI { font-size: 90% }
.sl_nav p { text-decoration: none; text-align: right; font-size: 80%; line-height: 0.4; }
.sl_nav A { text-decoration: none; }
.sl_nav a:hover { color: #CF8888 }
.sum { font-size: 8px; }
 
Pour modifier ces styles il faut créer un fichier "slideshow.css" contenant les styles modifiés.
Le fichier "slideshow.css" sera reconnu automatiquement.
 
*/
 
// On teste si le script n'est pas appelé en direct
if (!eregi("wakka.php", $_SERVER['PHP_SELF']))
{
die ("acc&egrave;s direct interdit");
}
 
// On teste si l'utilisateur peut lire la page
if (!$this->HasAccess("read"))
{
return;
}
else
{
// On teste si la page existe
if (!$this->page)
{
return;
}
else
{
/*
Exemple de page :
(1) Présentation xxxxxxxxxxxxxx
===== (2) Titre =====
Diapo 2.
===== (3) Titre =====
Diapo 3.
===== (4) Titre =====
Diapo 4.
===== (5) Titre =====
Diapo 5.
===== (6) Titre =====
Diapo 6.
===== (7) Titre =====
Diapo 7.
Autre exemple :
===== (1) Titre =====
Diapo 1.
===== (2) Titre =====
Diapo 2.
===== (3) Titre =====
Diapo 3.
===== (4) Titre =====
Diapo 4.
===== (5) Titre =====
Diapo 5.
===== (6) Titre =====
Diapo 6.
===== (7) Titre =====
Diapo 7.
*/
 
//
// découpe la page
$body_f = $this->format($this->page["body"]);
$body = preg_split('/(.*<h2>.*<\/h2>)/',$body_f,-1,PREG_SPLIT_DELIM_CAPTURE);
if ($_REQUEST["debug"] == "1") print_r("<div style=\"display: none\">".$body."</div>");
 
// Si la première diapositive commence par un titre de niveau 1
if (preg_match('/^<h2>.*<\/h2>/', $body_f)) $major = "0";
else $major = "1";
$user = $this->GetUser(); // echo $this->GetUser();
 
// On teste toutes les paramètres du handler "slide_show" ; s'il n'y en a pas, c'est le paramètre "slide=1" qui est invoqué par défaut
 
/*
switch ($_REQUEST["method"])
{
case "export":
export();
break;
case "show":
showSlide();
break;
default:
showSlide();
break;
}
*/
 
//if ($_REQUEST["export"]) { return; }
 
if (!$body)
{
return;
}
else
{
// Si on ne précise pas de paramètre, on affiche par défaut la première diapo
if (!$_REQUEST["slide"] or $_REQUEST["slide"] == "1") $slide = "1";
else $slide = $_REQUEST["slide"];
 
// Affiche l'en-tête
echo
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo
"<html>\n\n\n",
"<head>\n",
"<title>", $this->GetWakkaName(), ":", $this->GetPageTag(), "</title>\n",
"<meta name=\"robots\" content=\"noindex, nofollow\" />\n",
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n";
echo
"<style type=\"text/css\" media=\"all\"> @import \"wakka.css\";</style>\n";
// Teste s'il existe une feuille de style externe, sinon utilise des styles par défaut
if (!file_exists("slideshow.css"))
{
echo "<style type=\"text/css\">\n",
".slide { font-size: 160%; margin: 5%; background-color: #FFFFFF; padding: 30px; border: 1px inset; line-height: 1.5; }\n",
".slide UL, LI { font-size: 100%; }\n",
".slide LI LI { font-size: 90% }\n",
".sl_nav p { text-decoration: none; text-align: right; font-size: 80%; line-height: 0.4; }\n",
".sl_nav A { text-decoration: none; }\n",
".sl_nav a:hover { color: #CF8888 }\n",
".sum { font-size: 8px; }\n",
"</style>\n";
}
else
{
echo "<style type=\"text/css\" media=\"all\"> @import \"slideshow.css\";</style>\n";
}
 
echo
"</head>\n\n\n";
// Affiche le corps de la page
echo
"<body ";
echo (!$user || ($user["doubleclickedit"] == 'Y')) ? "ondblclick=\"document.location='".$this->href("edit")."';\" " : "", ">\n";
 
// Affichage du sommaire [à compléter]
/*
if ($_REQUEST["sum"] == "on")
{
echo "<ul class=\"sum\">\n";
if ($major = "1") echo "<li>", $this->format($body[0]), "</li>\n";
foreach ($body as $title_sum)
{
$i = $i + 1;
$type = gettype($i/2);
// Ne retourne que les 50 premiers caractères du titre
$title_sum = substr($title_sum, 0, 50);
if ($type == "integer")
{
echo "<li>",$this->format($title_sum),"</li>\n";
}
}
echo "</ul>\n\n";
}
*/
 
// Affichage du menu de navigation
echo
"<div class=\"sl_nav\">\n",
"<p>";
if ($slide !== "1")
echo
"<a href=\"",$this->href(),"/slide_show&slide=",$_REQUEST['slide']-1,"\"><< précédent</a>",
" :: <a href=\"",$this->href(),"/slide_show&slide=1\">[début]</a>\n";
echo " :: ";
if ($body[($slide)*2-($nb*2)+2] or $slide == "1")
echo "<a href=\"",$this->href(),"/slide_show&slide=",$slide+1,"\">suivant >></a>\n";
echo
"</p>\n";
echo "<p><a href=\"",$this->href(),"/edit\">Éditer </a> :: <a href=\"",$this->href(),"\">[]-></a></p>\n";
echo
"</div>\n\n";
 
echo
"<div class=\"slide\">\n";
// Si c'est la première diapositive
if ($slide == "1" and $major == "1")
{
echo $body[0], "<br /><br />";
}
 
// A partir de la deuxième diapositive
else
{
echo
$body[($slide*2)-($major*2)-1].$body[($slide*2)-($major*2)],"\n";
echo "\n";
}
echo
"</div>\n\n";
 
echo
"</body>\n",
"</html>";
}
}
}
?>
/tags/2014_06_04/wikini/handlers/page/resetstyle.php
New file
0,0 → 1,27
<?php
 
// Handler resetstyle.php version 0.2 du 16/03/2004
// pour WikiNi 0.4.1rc (=> à la version du 200403xx) et supérieurs
// Par Charles Népote (c) 2004
// Licence GPL
 
 
// Fonctionnement
//
// Cet handler permet à l'utilisateur de revenir à la feuille de style par défaut du site.
// Techniquement :
 
 
// Usage :
// http://example.org/PageTest/resetstyle
 
 
// A compléter (peut-être un jour) :
//
// -- détecter le fichier par défaut via une variable de configuration
//
 
$this->SetPersistentCookie('sitestyle','wakka',1);
header("Location: ".$this->href());
 
?>
/tags/2014_06_04/wikini/handlers/page/referrers_sites.php
New file
0,0 → 1,98
<?php
/*
wakka.php
Copyright (c) 2003, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2003 Eric FELDSTEIN
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
?>
<div class="page">
<?php
if ($global = $_REQUEST["global"])
{
$title = "Domaines faisant r&eacute;f&eacute;rence &agrave; ce wiki (<a href=\"".$this->href("referrers", "", "global=1")."\">voir la liste des pages externes</a>):";
$referrers = $this->LoadReferrers();
}
else
{
$title = "Domaines faisant r&eacute;f&eacute;rence &agrave; ".$this->Link($this->GetPageTag()).
($this->GetConfigValue("referrers_purge_time") ? " (depuis ".($this->GetConfigValue("referrers_purge_time") == 1 ? "24 heures" : $this->GetConfigValue("referrers_purge_time")." jours").")" : "")." (<a href=\"".$this->href("referrers")."\">voir la liste des pages externes</a>):";
$referrers = $this->LoadReferrers($this->GetPageTag());
}
 
echo "<b>$title</b><br /><br />\n" ;
if ($referrers)
{
for ($a = 0; $a < count($referrers); $a++)
{
$temp_parse_url = parse_url($referrers[$a]["referrer"]);
$temp_parse_url = ($temp_parse_url["host"] != "") ? strtolower(preg_replace("/^www\./Ui", "", $temp_parse_url["host"])) : "inconnu";
 
if (isset($referrer_sites["$temp_parse_url"]))
{
$referrer_sites["$temp_parse_url"] += $referrers[$a]["num"];
}
else
{
$referrer_sites["$temp_parse_url"] = $referrers[$a]["num"];
}
}
 
array_multisort($referrer_sites, SORT_DESC, SORT_NUMERIC);
reset($referrer_sites);
 
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n" ;
foreach ($referrer_sites as $site => $site_count)
{
echo "<tr>" ;
echo "<td width=\"30\" align=\"right\" valign=\"top\" style=\"padding-right: 10px\">" , $site_count, "</td>" ;
echo "<td valign=\"top\">" , (($site != "unknown") ? "<a href=\"http://$site\">$site</a>" : $site) , "</td>" ;
echo "</tr>\n" ;
}
echo "</table>\n" ;
}
else
{
echo "<i>None</i><br />\n" ;
}
 
if ($global)
{
echo "<br />[<a href=\"",$this->href("referrers_sites"),"\">Voir les domaines faisant r&eacute;f&eacute;rence &agrave; ",$this->GetPageTag()," seulement</a> | <a href=\"",$this->href("referrers"),"\">Voir les r&eacute;f&eacute;rences ",$this->GetPageTag()," seulement</a>]";
}
else
{
echo "<br />[<a href=\"",$this->href("referrers_sites", "", "global=1"),"\">Voir tous les domaines faisant r&eacute;f&eacute;rence </a> | <a href=\"",$this->href("referrers", "", "global=1"),"\">Voir toutes les r&eacute;f&eacute;rences </a>]" ;
}
 
 
?>
</div>
<?php echo $this->Footer(); ?>
/tags/2014_06_04/wikini/handlers/page/diff.orig.php
New file
0,0 → 1,39
<div class="page">
<?php
 
/* NOTE: This is a really cheap way to do it. I think it may be more intelligent to write the two
pages to temporary files and run /usr/bin/diff over them. Then again, maybe not. */
 
// load pages
$pageA = $this->LoadPageById($_REQUEST["a"]);
$pageB = $this->LoadPageById($_REQUEST["b"]);
 
// prepare bodies
$bodyA = explode("\n", $pageA["body"]);
$bodyB = explode("\n", $pageB["body"]);
 
$added = array_diff($bodyA, $bodyB);
$deleted = array_diff($bodyB, $bodyA);
 
$output .= "<b>Comparing <a href=\"".$this->href("", "", "time=".urlencode($pageA["time"]))."\">".$pageA["time"]."</a> to <a href=\"".$this->href("", "", "time=".urlencode($pageB["time"]))."\">".$pageB["time"]."</a></b><br />\n";
 
if ($added)
{
// remove blank lines
$output .= "<br />\n<b>Additions:</b><br />\n";
$output .= "<div class=\"additions\">".$this->Format(implode("\n", $added))."</div>";
}
 
if ($deleted)
{
$output .= "<br />\n<b>Deletions:</b><br />\n";
$output .= "<div class=\"deletions\">".$this->Format(implode("\n", $deleted))."</div>";
}
 
if (!$added && !$deleted)
{
$output .= "<br />\nNo differences.";
}
print($output);
?>
</div>
/tags/2014_06_04/wikini/handlers/page/download.php
New file
0,0 → 1,48
<?php
/*
download.php
Code original de ce fichier : Eric FELDSTEIN
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2003,2004 Eric FELDSTEIN
Copyright 2003 Jean-Pascal MILCENT
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
# Execute le download des fichiers lier par l'action {{attach}}
# Necessite le fichier actions/attach.php pour fonctionner
# voir actions/attach.php ppour la documentation
# copyrigth Eric Feldstein 2003-2004
 
//vérification de sécurité
if (!WIKINI_VERSION) {
die ("acc&egrave;s direct interdit");
}
if (!class_exists('attach')){
include($this->GetConfigValue('action_path').'/attach.class.php');
}
$att = new attach($this);
$att->doDownload();
unset($att);
?>
/tags/2014_06_04/wikini/handlers/page/diff.php
New file
0,0 → 1,1003
<?php
/*
diff.php
 
Copyright (C) 1992 Free Software Foundation, Inc. Francois Pinard <pinard@iro.umontreal.ca>.
Copyright (C) 2000, 2001 Geoffrey T. Dairiki <dairiki@dairiki.org>
Copyright 2002,2003,2004 David DELON
Copyright 2002 Patrick PAUL
Copyright 2003 Eric FELDSTEIN
 
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
original diff.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
 
 
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
?>
<div class="page">
<?php
 
if ($this->HasAccess("read"))
{
 
// If asked, call original diff
 
if ($_REQUEST["fastdiff"]) {
/* NOTE: This is a really cheap way to do it. I think it may be more intelligent to write the two pages to temporary files and run /usr/bin/diff over them. Then again, maybe not. */
// load pages
$pageA = $this->LoadPageById($_REQUEST["a"]);
$pageB = $this->LoadPageById($_REQUEST["b"]);
// prepare bodies
$bodyA = explode("\n", $pageA["body"]);
$bodyB = explode("\n", $pageB["body"]);
$added = array_diff($bodyA, $bodyB);
$deleted = array_diff($bodyB, $bodyA);
$output .= "<b>Comparaison de <a href=\"".$this->href("", "", "time=".urlencode($pageA["time"]))."\">".$pageA["time"]."</a> &agrave; <a href=\"".$this->href("", "", "time=".urlencode($pageB["time"]))."\">".$pageB["time"]."</a></b><br />\n";
if ($added)
{
// remove blank lines
$output .= "<br />\n<b>Ajouts:</b><br />\n";
$output .= "<div class=\"additions\">".$this->Format(implode("\n", $added))."</div>";
}
if ($deleted)
{
$output .= "<br />\n<b>Suppressions:</b><br />\n";
$output .= "<div class=\"deletions\">".$this->Format(implode("\n", $deleted))."</div>";
}
if (!$added && !$deleted)
{
$output .= "<br />\nPas de diff&eacute;rences.";
}
echo $output;
}
else {
// load pages
$pageA = $this->LoadPageById($_REQUEST["b"]);
$pageB = $this->LoadPageById($_REQUEST["a"]);
// extract text from bodies
$textA = $pageA["body"];
$textB = $pageB["body"];
$sideA = new Side($textA);
$sideB = new Side($textB);
$bodyA='';
$sideA->split_file_into_words($bodyA);
$bodyB='';
$sideB->split_file_into_words($bodyB);
// diff on these two file
$diff = new Diff(split("\n",$bodyA),split("\n",$bodyB));
// format output
$fmt = new DiffFormatter();
$sideO = new Side($fmt->format($diff));
$resync_left=0;
$resync_right=0;
$count_total_right=$sideB->getposition() ;
$sideA->init();
$sideB->init();
$output='';
while (1) {
$sideO->skip_line();
if ($sideO->isend()) {
break;
}
if ($sideO->decode_directive_line()) {
$argument=$sideO->getargument();
$letter=$sideO->getdirective();
switch ($letter) {
case 'a':
$resync_left = $argument[0];
$resync_right = $argument[2] - 1;
break;
case 'd':
$resync_left = $argument[0] - 1;
$resync_right = $argument[2];
break;
case 'c':
$resync_left = $argument[0] - 1;
$resync_right = $argument[2] - 1;
break;
}
$sideA->skip_until_ordinal($resync_left);
$sideB->copy_until_ordinal($resync_right,$output);
// deleted word
if (($letter=='d') || ($letter=='c')) {
$sideA->copy_whitespace($output);
$output .="@@";
$sideA->copy_word($output);
$sideA->copy_until_ordinal($argument[1],$output);
$output .="@@";
}
// inserted word
if ($letter == 'a' || $letter == 'c') {
$sideB->copy_whitespace($output);
$output .="££";
$sideB->copy_word($output);
$sideB->copy_until_ordinal($argument[3],$output);
$output .="££";
}
}
}
$sideB->copy_until_ordinal($count_total_right,$output);
$sideB->copy_whitespace($output);
$out=$this->Format($output);
echo $out;
}
 
}
else{
echo "<i>Vous n'&ecirc;tes pas autoris&eacute; &agrave; lire cette page.</i>" ;
}
// Side : a string for wdiff
class Side {
var $position;
var $cursor;
var $content;
var $character;
var $directive;
var $argument;
var $length;
 
function Side($content) {
$this->content=$content;
$this->position=0;
$this->cursor=0;
$this->directive='';
$this->argument=array();
$this->length=strlen($this->content);
$this->character=substr($this->content,0,1);
}
 
function getposition() {
return $this->position;
}
 
function getcharacter() {
return $this->character;
}
 
function getdirective() {
return $this->directive;
}
 
function getargument() {
return $this->argument;
}
 
function nextchar() {
$this->cursor++;
$this->character=substr($this->content,$this->cursor,1);
}
 
function copy_until_ordinal($ordinal,&$out) {
while ($this->position < $ordinal) {
$this->copy_whitespace($out);
$this->copy_word($out);
}
}
 
function skip_until_ordinal($ordinal) {
while ($this->position < $ordinal) {
$this->skip_whitespace();
$this->skip_word();
}
}
 
function split_file_into_words (&$out) {
while (!$this->isend()) {
$this->skip_whitespace();
if ($this->isend()) {
break;
}
$this->copy_word($out);
$out .="\n";
}
}
function init() {
$this->position=0;
$this->cursor=0;
$this->directive='';
$this->argument=array();
$this->character=substr($this->content,0,1);
}
 
function isspace($char) {
if (ereg('[[:space:]]',$char)) {
return true;
}
else {
return false;
}
}
 
function isdigit($char) {
if (ereg('[[:digit:]]',$char)) {
return true;
}
else {
return false;
}
}
 
function isend() {
if (($this->cursor)>=($this->length)) {
return true;
}
else {
return false;
}
}
 
 
 
function copy_whitespace(&$out) {
while (!$this->isend() && $this->isspace($this->character)) {
$out .=$this->character;
$this->nextchar();
}
}
 
function skip_whitespace() {
while (!$this->isend() && $this->isspace($this->character)) {
$this->nextchar();
}
}
 
function skip_line() {
while (!$this->isend() && !$this->isdigit($this->character)) {
while (!$this->isend() && $this->character!="\n")
$this->nextchar();
if($this->character=="\n")
$this->nextchar();
}
}
 
 
 
function copy_word(&$out) {
while (!$this->isend() && !($this->isspace($this->character))) {
$out.=$this->character;
$this->nextchar();
}
$this->position++;
}
 
function skip_word() {
 
while (!$this->isend() && !($this->isspace($this->character))) {
$this->nextchar();
}
$this->position++;
}
 
 
function decode_directive_line() {
 
$value=0;
$state=0;
$error=0;
 
while (!$error && $state < 4) {
if ($this->isdigit($this->character)) {
$value = 0;
while($this->isdigit($this->character)) {
$value = 10 * $value + $this->character - '0';
$this->nextchar();
}
}
else if ($state != 1 && $state != 3)
$error = 1;
 
/* Assign the proper value. */
 
$this->argument[$state] = $value;
 
/* Skip the following character. */
 
switch ($state) {
case 0:
case 2:
if ($this->character == ',')
$this->nextchar();
break;
 
case 1:
if ($this->character == 'a' || $this->character == 'd' || $this->character == 'c') {
$this->directive = $this->character;
$this->nextchar();
}
else
$error = 1;
break;
 
case 3:
if ($this->character != "\n")
$error = 1;
break;
}
$state++;
}
 
/* Complete reading of the line and return success value. */
 
while ((!$this->isend()) && ($this->character != "\n")) {
$this->nextchar();
}
if ($this->character == "\n")
$this->nextchar();
 
return !$error;
}
 
 
 
}
 
// difflib
//
// A PHP diff engine for phpwiki.
//
// Copyright (C) 2000, 2001 Geoffrey T. Dairiki <dairiki@dairiki.org>
// You may copy this code freely under the conditions of the GPL.
//
 
 
// PHP3 does not have assert()
define('USE_ASSERTS', function_exists('assert'));
 
class _DiffOp {
var $type;
var $orig;
var $final;
 
function norig() {
return $this->orig ? sizeof($this->orig) : 0;
}
 
function nfinal() {
return $this->final ? sizeof($this->final) : 0;
}
}
 
class _DiffOp_Copy extends _DiffOp {
var $type = 'copy';
function _DiffOp_Copy ($orig, $final = false) {
if (!is_array($final))
$final = $orig;
$this->orig = $orig;
$this->final = $final;
}
 
}
 
class _DiffOp_Delete extends _DiffOp {
var $type = 'delete';
function _DiffOp_Delete ($lines) {
$this->orig = $lines;
$this->final = false;
}
 
}
 
class _DiffOp_Add extends _DiffOp {
var $type = 'add';
function _DiffOp_Add ($lines) {
$this->final = $lines;
$this->orig = false;
}
 
}
 
class _DiffOp_Change extends _DiffOp {
var $type = 'change';
function _DiffOp_Change ($orig, $final) {
$this->orig = $orig;
$this->final = $final;
}
 
}
/**
* Class used internally by Diff to actually compute the diffs.
*
* The algorithm used here is mostly lifted from the perl module
* Algorithm::Diff (version 1.06) by Ned Konz, which is available at:
* http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip
*
* More ideas are taken from:
* http://www.ics.uci.edu/~eppstein/161/960229.html
*
* Some ideas are (and a bit of code) are from from analyze.c, from GNU
* diffutils-2.7, which can be found at:
* ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz
*
* Finally, some ideas (subdivision by NCHUNKS > 2, and some optimizations)
* are my own.
*
* @author Geoffrey T. Dairiki
* @access private
*/
class _DiffEngine
{
function diff ($from_lines, $to_lines) {
$n_from = sizeof($from_lines);
$n_to = sizeof($to_lines);
 
$this->xchanged = $this->ychanged = array();
$this->xv = $this->yv = array();
$this->xind = $this->yind = array();
unset($this->seq);
unset($this->in_seq);
unset($this->lcs);
// Skip leading common lines.
for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) {
if ($from_lines[$skip] != $to_lines[$skip])
break;
$this->xchanged[$skip] = $this->ychanged[$skip] = false;
}
// Skip trailing common lines.
$xi = $n_from; $yi = $n_to;
for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++) {
if ($from_lines[$xi] != $to_lines[$yi])
break;
$this->xchanged[$xi] = $this->ychanged[$yi] = false;
}
// Ignore lines which do not exist in both files.
for ($xi = $skip; $xi < $n_from - $endskip; $xi++)
$xhash[$from_lines[$xi]] = 1;
for ($yi = $skip; $yi < $n_to - $endskip; $yi++) {
$line = $to_lines[$yi];
if ( ($this->ychanged[$yi] = empty($xhash[$line])) )
continue;
$yhash[$line] = 1;
$this->yv[] = $line;
$this->yind[] = $yi;
}
for ($xi = $skip; $xi < $n_from - $endskip; $xi++) {
$line = $from_lines[$xi];
if ( ($this->xchanged[$xi] = empty($yhash[$line])) )
continue;
$this->xv[] = $line;
$this->xind[] = $xi;
}
 
// Find the LCS.
$this->_compareseq(0, sizeof($this->xv), 0, sizeof($this->yv));
 
// Merge edits when possible
$this->_shift_boundaries($from_lines, $this->xchanged, $this->ychanged);
$this->_shift_boundaries($to_lines, $this->ychanged, $this->xchanged);
 
// Compute the edit operations.
$edits = array();
$xi = $yi = 0;
while ($xi < $n_from || $yi < $n_to) {
USE_ASSERTS && assert($yi < $n_to || $this->xchanged[$xi]);
USE_ASSERTS && assert($xi < $n_from || $this->ychanged[$yi]);
 
// Skip matching "snake".
$copy = array();
while ( $xi < $n_from && $yi < $n_to
&& !$this->xchanged[$xi] && !$this->ychanged[$yi]) {
$copy[] = $from_lines[$xi++];
++$yi;
}
if ($copy)
$edits[] = new _DiffOp_Copy($copy);
 
// Find deletes & adds.
$delete = array();
while ($xi < $n_from && $this->xchanged[$xi])
$delete[] = $from_lines[$xi++];
 
$add = array();
while ($yi < $n_to && $this->ychanged[$yi])
$add[] = $to_lines[$yi++];
if ($delete && $add)
$edits[] = new _DiffOp_Change($delete, $add);
elseif ($delete)
$edits[] = new _DiffOp_Delete($delete);
elseif ($add)
$edits[] = new _DiffOp_Add($add);
}
return $edits;
}
 
/* Divide the Largest Common Subsequence (LCS) of the sequences
* [XOFF, XLIM) and [YOFF, YLIM) into NCHUNKS approximately equally
* sized segments.
*
* Returns (LCS, PTS). LCS is the length of the LCS. PTS is an
* array of NCHUNKS+1 (X, Y) indexes giving the diving points between
* sub sequences. The first sub-sequence is contained in [X0, X1),
* [Y0, Y1), the second in [X1, X2), [Y1, Y2) and so on. Note
* that (X0, Y0) == (XOFF, YOFF) and
* (X[NCHUNKS], Y[NCHUNKS]) == (XLIM, YLIM).
*
* This function assumes that the first lines of the specified portions
* of the two files do not match, and likewise that the last lines do not
* match. The caller must trim matching lines from the beginning and end
* of the portions it is going to specify.
*/
function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks) {
$flip = false;
if ($xlim - $xoff > $ylim - $yoff) {
// Things seems faster (I'm not sure I understand why)
// when the shortest sequence in X.
$flip = true;
list ($xoff, $xlim, $yoff, $ylim)
= array( $yoff, $ylim, $xoff, $xlim);
}
 
if ($flip)
for ($i = $ylim - 1; $i >= $yoff; $i--)
$ymatches[$this->xv[$i]][] = $i;
else
for ($i = $ylim - 1; $i >= $yoff; $i--)
$ymatches[$this->yv[$i]][] = $i;
 
$this->lcs = 0;
$this->seq[0]= $yoff - 1;
$this->in_seq = array();
$ymids[0] = array();
$numer = $xlim - $xoff + $nchunks - 1;
$x = $xoff;
for ($chunk = 0; $chunk < $nchunks; $chunk++) {
if ($chunk > 0)
for ($i = 0; $i <= $this->lcs; $i++)
$ymids[$i][$chunk-1] = $this->seq[$i];
 
$x1 = $xoff + (int)(($numer + ($xlim-$xoff)*$chunk) / $nchunks);
for ( ; $x < $x1; $x++) {
$line = $flip ? $this->yv[$x] : $this->xv[$x];
if (empty($ymatches[$line]))
continue;
$matches = $ymatches[$line];
reset($matches);
while (list ($junk, $y) = each($matches))
if (empty($this->in_seq[$y])) {
$k = $this->_lcs_pos($y);
USE_ASSERTS && assert($k > 0);
$ymids[$k] = $ymids[$k-1];
break;
}
while (list ($junk, $y) = each($matches)) {
if ($y > $this->seq[$k-1]) {
USE_ASSERTS && assert($y < $this->seq[$k]);
// Optimization: this is a common case:
// next match is just replacing previous match.
$this->in_seq[$this->seq[$k]] = false;
$this->seq[$k] = $y;
$this->in_seq[$y] = 1;
}
else if (empty($this->in_seq[$y])) {
$k = $this->_lcs_pos($y);
USE_ASSERTS && assert($k > 0);
$ymids[$k] = $ymids[$k-1];
}
}
}
}
 
$seps[] = $flip ? array($yoff, $xoff) : array($xoff, $yoff);
$ymid = $ymids[$this->lcs];
for ($n = 0; $n < $nchunks - 1; $n++) {
$x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $n) / $nchunks);
$y1 = $ymid[$n] + 1;
$seps[] = $flip ? array($y1, $x1) : array($x1, $y1);
}
$seps[] = $flip ? array($ylim, $xlim) : array($xlim, $ylim);
 
return array($this->lcs, $seps);
}
 
function _lcs_pos ($ypos) {
$end = $this->lcs;
if ($end == 0 || $ypos > $this->seq[$end]) {
$this->seq[++$this->lcs] = $ypos;
$this->in_seq[$ypos] = 1;
return $this->lcs;
}
 
$beg = 1;
while ($beg < $end) {
$mid = (int)(($beg + $end) / 2);
if ( $ypos > $this->seq[$mid] )
$beg = $mid + 1;
else
$end = $mid;
}
 
USE_ASSERTS && assert($ypos != $this->seq[$end]);
 
$this->in_seq[$this->seq[$end]] = false;
$this->seq[$end] = $ypos;
$this->in_seq[$ypos] = 1;
return $end;
}
 
/* Find LCS of two sequences.
*
* The results are recorded in the vectors $this->{x,y}changed[], by
* storing a 1 in the element for each line that is an insertion
* or deletion (ie. is not in the LCS).
*
* The subsequence of file 0 is [XOFF, XLIM) and likewise for file 1.
*
* Note that XLIM, YLIM are exclusive bounds.
* All line numbers are origin-0 and discarded lines are not counted.
*/
function _compareseq ($xoff, $xlim, $yoff, $ylim) {
// Slide down the bottom initial diagonal.
while ($xoff < $xlim && $yoff < $ylim
&& $this->xv[$xoff] == $this->yv[$yoff]) {
++$xoff;
++$yoff;
}
 
// Slide up the top initial diagonal.
while ($xlim > $xoff && $ylim > $yoff
&& $this->xv[$xlim - 1] == $this->yv[$ylim - 1]) {
--$xlim;
--$ylim;
}
 
if ($xoff == $xlim || $yoff == $ylim)
$lcs = 0;
else {
// This is ad hoc but seems to work well.
//$nchunks = sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5);
//$nchunks = max(2,min(8,(int)$nchunks));
$nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1;
list ($lcs, $seps)
= $this->_diag($xoff,$xlim,$yoff, $ylim,$nchunks);
}
 
if ($lcs == 0) {
// X and Y sequences have no common subsequence:
// mark all changed.
while ($yoff < $ylim)
$this->ychanged[$this->yind[$yoff++]] = 1;
while ($xoff < $xlim)
$this->xchanged[$this->xind[$xoff++]] = 1;
}
else {
// Use the partitions to split this problem into subproblems.
reset($seps);
$pt1 = $seps[0];
while ($pt2 = next($seps)) {
$this->_compareseq ($pt1[0], $pt2[0], $pt1[1], $pt2[1]);
$pt1 = $pt2;
}
}
}
 
/* Adjust inserts/deletes of identical lines to join changes
* as much as possible.
*
* We do something when a run of changed lines include a
* line at one end and has an excluded, identical line at the other.
* We are free to choose which identical line is included.
* `compareseq' usually chooses the one at the beginning,
* but usually it is cleaner to consider the following identical line
* to be the "change".
*
* This is extracted verbatim from analyze.c (GNU diffutils-2.7).
*/
function _shift_boundaries ($lines, &$changed, $other_changed) {
$i = 0;
$j = 0;
 
USE_ASSERTS && assert('sizeof($lines) == sizeof($changed)');
$len = sizeof($lines);
$other_len = sizeof($other_changed);
 
while (1) {
/*
* Scan forwards to find beginning of another run of changes.
* Also keep track of the corresponding point in the other file.
*
* Throughout this code, $i and $j are adjusted together so that
* the first $i elements of $changed and the first $j elements
* of $other_changed both contain the same number of zeros
* (unchanged lines).
* Furthermore, $j is always kept so that $j == $other_len or
* $other_changed[$j] == false.
*/
while ($j < $other_len && $other_changed[$j])
$j++;
while ($i < $len && ! $changed[$i]) {
USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]');
$i++; $j++;
while ($j < $other_len && $other_changed[$j])
$j++;
}
if ($i == $len)
break;
 
$start = $i;
 
// Find the end of this run of changes.
while (++$i < $len && $changed[$i])
continue;
 
do {
/*
* Record the length of this run of changes, so that
* we can later determine whether the run has grown.
*/
$runlength = $i - $start;
 
/*
* Move the changed region back, so long as the
* previous unchanged line matches the last changed one.
* This merges with previous changed regions.
*/
while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) {
$changed[--$start] = 1;
$changed[--$i] = false;
while ($start > 0 && $changed[$start - 1])
$start--;
USE_ASSERTS && assert('$j > 0');
while ($other_changed[--$j])
continue;
USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]');
}
 
/*
* Set CORRESPONDING to the end of the changed run, at the last
* point where it corresponds to a changed run in the other file.
* CORRESPONDING == LEN means no such point has been found.
*/
$corresponding = $j < $other_len ? $i : $len;
 
/*
* Move the changed region forward, so long as the
* first changed line matches the following unchanged one.
* This merges with following changed regions.
* Do this second, so that if there are no merges,
* the changed region is moved forward as far as possible.
*/
while ($i < $len && $lines[$start] == $lines[$i]) {
$changed[$start++] = false;
$changed[$i++] = 1;
while ($i < $len && $changed[$i])
$i++;
 
USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]');
$j++;
if ($j < $other_len && $other_changed[$j]) {
$corresponding = $i;
while ($j < $other_len && $other_changed[$j])
$j++;
}
}
} while ($runlength != $i - $start);
 
/*
* If possible, move the fully-merged run of changes
* back to a corresponding run in the other file.
*/
while ($corresponding < $i) {
$changed[--$start] = 1;
$changed[--$i] = 0;
USE_ASSERTS && assert('$j > 0');
while ($other_changed[--$j])
continue;
USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]');
}
}
}
}
 
/**
* Class representing a 'diff' between two sequences of strings.
*/
class Diff
{
var $edits;
 
/**
* Constructor.
* Computes diff between sequences of strings.
*
* @param $from_lines array An array of strings.
* (Typically these are lines from a file.)
* @param $to_lines array An array of strings.
*/
function Diff($from_lines, $to_lines) {
$eng = new _DiffEngine;
$this->edits = $eng->diff($from_lines, $to_lines);
}
 
}
 
 
/**
* A class to format Diffs
*
* This class formats the diff in classic diff format.
* It is intended that this class be customized via inheritance,
* to obtain fancier outputs.
*/
class DiffFormatter
{
 
/**
* Format a diff.
*
* @param $diff object A Diff object.
* @return string The formatted output.
*/
function format($diff) {
 
$xi = $yi = 1;
$block = false;
$context = array();
 
$this->_start_diff();
 
foreach ($diff->edits as $edit) {
if ($edit->type == 'copy') {
if (is_array($block)) {
if (sizeof($edit->orig) <= 0) {
$block[] = $edit;
}
else{
$this->_block($x0, + $xi - $x0,
$y0, + $yi - $y0,
$block);
$block = false;
}
}
}
else {
if (! is_array($block)) {
$x0 = $xi;
$y0 = $yi;
$block = array();
}
$block[] = $edit;
}
 
if ($edit->orig)
$xi += sizeof($edit->orig);
if ($edit->final)
$yi += sizeof($edit->final);
}
 
if (is_array($block))
$this->_block($x0, $xi - $x0,
$y0, $yi - $y0,
$block);
 
return $this->_end_diff();
}
 
function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) {
$this->_start_block($this->_block_header($xbeg, $xlen, $ybeg, $ylen));
}
 
function _start_diff() {
ob_start();
}
 
function _end_diff() {
$val = ob_get_contents();
ob_end_clean();
return $val;
}
 
function _block_header($xbeg, $xlen, $ybeg, $ylen) {
if ($xlen > 1)
$xbeg .= "," . ($xbeg + $xlen - 1);
if ($ylen > 1)
$ybeg .= "," . ($ybeg + $ylen - 1);
 
return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
}
function _start_block($header) {
echo $header."\n";
}
 
}
 
?>
</div>
<?php echo $this->Footer(); ?>
/tags/2014_06_04/wikini/handlers/page/filemanager.php
New file
0,0 → 1,58
<?php
/*
filemanager.php
Code original de ce fichier : Eric FELDSTEIN
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2003,2004 Eric FELDSTEIN
Copyright 2003 Jean-Pascal MILCENT
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
# Execute le gestion des fichiers lier par l'action {{attach}}
# Necessite le fichier actions/attach.php pour fonctionner
# voir actions/attach.php ppour la documentation
# copyrigth Eric Feldstein 2003-2004
 
//vérification de sécurité
if (!WIKINI_VERSION) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
?>
<div class="page">
<?php
if($this->UserIsOwner()){
if (!class_exists('attach')){
include($this->GetConfigValue('action_path').'/attach.class.php');
}
$att = new attach($this);
$att->doFilemanager();
unset($att);
}else{
echo $this->Format("//Seul le propriétaire de cette page peut accéder au gestionnaire des fichiers attaché//");
}
?>
</div>
<?php echo $this->Footer(); ?>
/tags/2014_06_04/wikini/handlers/page/addcomment.php
New file
0,0 → 1,71
<?php
/*
addcomment.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2003 Eric FELDSTEIN
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
 
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
 
if ($this->HasAccess("comment"))
{
// find number
if ($latestComment = $this->LoadSingle("select tag, id from ".$this->config["table_prefix"]."pages where comment_on != '' order by id desc limit 1"))
{
preg_match("/^Comment([0-9]+)$/", $latestComment["tag"], $matches);
$num = $matches[1] + 1;
}
else
{
$num = "1";
}
 
$body = trim($_POST["body"]);
if (!$body)
{
$this->SetMessage("Commentaire vide -- pas de sauvegarde !");
}
else
{
// store new comment
$this->SavePage("Comment".$num, $body, $this->tag);
}
 
// redirect to page
$this->redirect($this->href());
}
else
{
echo"<div class=\"page\"><i>Vous n'&ecirc;tes pas autoris&eacute; &agrave; commenter cette page.</i></div>\n";
}
echo $this->Footer();
 
?>
/tags/2014_06_04/wikini/handlers/page/show.php
New file
0,0 → 1,170
<?php
/*
show.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2003 Eric DELORD
Copyright 2003 Eric FELDSTEIN
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
?>
<div class="page">
<?php
if ($HasAccessRead=$this->HasAccess("read"))
{
if (!$this->page)
{
echo "Cette page n'existe pas encore, voulez vous la <a href=\"".$this->href("edit")."\">cr&eacute;er</a> ?" ;
}
else
{
// comment header?
if ($this->page["comment_on"])
{
echo "<div class=\"commentinfo\">Ceci est un commentaire sur ",$this->ComposeLinkToPage($this->page["comment_on"], "", "", 0),", post&eacute; par ",$this->Format($this->page["user"])," &agrave; ",$this->page["time"],"</div>";
}
 
if ($this->page["latest"] == "N")
{
echo "<div class=\"revisioninfo\">Ceci est une version archiv&eacute;e de <a href=\"",$this->href(),"\">",$this->GetPageTag(),"</a> &agrave; ",$this->page["time"],".</div>";
}
 
 
// display page
echo $this->Format($this->page["body"], "wakka");
 
// if this is an old revision, display some buttons
if (($this->page["latest"] == "N") && $this->HasAccess("write"))
{
$latest = $this->LoadPage($this->tag);
?>
<br />
<?php echo $this->FormOpen("edit") ?>
<input type="hidden" name="previous" value="<?php echo $latest["id"] ?>">
<input type="hidden" name="body" value="<?php echo htmlentities($this->page["body"]) ?>">
<input type="submit" value="R&eacute;&eacute;diter cette version archiv&eacute;e">
<?php echo $this->FormClose(); ?>
<?php
}
}
}
else
{
echo "<i>Vous n'&ecirc;tes pas autoris&eacute; &agrave; lire cette page</i>" ;
}
?>
<hr class="hr_clear" />
</div>
 
 
<?php
if ($HasAccessRead)
{
// load comments for this page
$comments = $this->LoadComments($this->tag);
// store comments display in session
$tag = $this->GetPageTag();
if (!isset($_SESSION["show_comments"][$tag]))
$_SESSION["show_comments"][$tag] = ($this->UserWantsComments() ? "1" : "0");
if (isset($_REQUEST["show_comments"])){
switch($_REQUEST["show_comments"])
{
case "0":
$_SESSION["show_comments"][$tag] = 0;
break;
case "1":
$_SESSION["show_comments"][$tag] = 1;
break;
}
}
// display comments!
if ($this->page && $_SESSION["show_comments"][$tag])
{
// display comments header
?>
<div class="commentsheader">
Commentaires [<a href="<?php echo $this->href("", "", "show_comments=0") ?>">Cacher commentaires/formulaire</a>]
</div>
<?php
// display comments themselves
if ($comments)
{
foreach ($comments as $comment)
{
echo "<a name=\"",$comment["tag"],"\"></a>\n" ;
echo "<div class=\"comment\">\n" ;
echo $this->Format($comment["body"]),"\n" ;
echo "<div class=\"commentinfo\">\n-- ",$this->Format($comment["user"])," (".$comment["time"],")\n</div>\n" ;
echo "</div>\n" ;
}
}
// display comment form
echo "<div class=\"commentform\">\n" ;
if ($this->HasAccess("comment"))
{
?>
Ajouter un commentaire &agrave; cette page:<br />
<?php echo $this->FormOpen("addcomment"); ?>
<textarea name="body" rows="6" style="width: 100%"></textarea><br />
<input type="submit" value="Ajouter Commentaire" accesskey="s">
<?php echo $this->FormClose(); ?>
<?php
}
echo "</div>\n" ;
}
else
{
?>
<div class="commentsheader">
<?php
switch (count($comments))
{
case 0:
echo "Il n'y a pas de commentaire sur cette page." ;
break;
case 1:
echo "Il y a un commentaire sur cette page." ;
break;
default:
echo "Il y a ",count($comments)," commentaires sur cette page." ;
}
?>
[<a href="<?php echo $this->href("", "", "show_comments=1") ?>">Afficher commentaires/formulaire</a>]
 
</div>
<?php
}
}
echo $this->Footer();
?>
/tags/2014_06_04/wikini/handlers/page/revisions.php
New file
0,0 → 1,86
<?php
/*
revisions.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2003 Eric FELDSTEIN
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
?>
<div class="page">
<?php
// load revisions for this pageif
if ($this->HasAccess("read")) {
 
$output='';
if ($pages = $this->LoadRevisions($this->tag))
{
$output .= $this->FormOpen("diff", "", "post");
$output .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n";
$output .= "<tr>\n";
$output .= "<td><input type=\"submit\" value=\"Voir Diff&eacute;rences\" /></td>";
$output .= "<td><input type=\"checkbox\" name=\"fastdiff\"/>\n".$this->Format("Affichage simplifi&eacute;")."</td>";
$output .= "</tr>\n";
$output .= "</table>\n";
$output .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n";
if ($user = $this->GetUser())
{
$max = $user["revisioncount"];
}
else
{
$max = 20;
}
$c = 0;
foreach ($pages as $page)
{
$c++;
if (($c <= $max) || !$max)
{
$output .= "<tr>";
$output .= "<td><input type=\"radio\" name=\"a\" value=\"".$page["id"]."\" ".($c == 1 ? "checked=\"checked\"" : "")." /></td>";
$output .= "<td><input type=\"radio\" name=\"b\" value=\"".$page["id"]."\" ".($c == 2 ? "checked=\"checked\"" : "")." /></td>";
$output .= "<td>&nbsp;<a href=\"".$this->href("show")."&amp;time=".urlencode($page["time"])."\">".$page["time"]."</a></td>";
$output .= "<td>&nbsp;by ".$this->Format($page["user"])."</td>";
$output .= "</tr>\n";
}
}
$output .= "</table>\n".$this->FormClose()."\n";
}
echo $output ;
}
else
{
echo "<i>Vous n'avez pas acc&egrave;s &agrave; cette page.</i>" ;
}
?>
</div>
<?php echo $this->Footer(); ?>
/tags/2014_06_04/wikini/handlers/page/acls.php
New file
0,0 → 1,128
<?php
/*
acls.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2003 Eric FELDSTEIN
Copyright 2003 Jean-Pascal MILCENT
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
?>
<div class="page">
<?php
 
if ($this->UserIsOwner())
{
if ($_POST)
{
// store lists
$this->SaveAcl($this->GetPageTag(), "read", $_POST["read_acl"]);
$this->SaveAcl($this->GetPageTag(), "write", $_POST["write_acl"]);
$this->SaveAcl($this->GetPageTag(), "comment", $_POST["comment_acl"]);
$message = "Droits d\'acc&egrave;s mis &agrave; jour ";//$message = "Access control lists updated";
// change owner?
if ($newowner = $_POST["newowner"])
{
$this->SetPageOwner($this->GetPageTag(), $newowner);
$message .= " et changement du propri&eacute;taire. Nouveau propri&eacute;taire : ".$newowner;//$message .= " and gave ownership to ".$newowner;
}
 
// redirect back to page
$this->SetMessage($message."!");
$this->Redirect($this->Href());
}
else
{
// load acls
$readACL = $this->LoadAcl($this->GetPageTag(), "read");
$writeACL = $this->LoadAcl($this->GetPageTag(), "write");
$commentACL = $this->LoadAcl($this->GetPageTag(), "comment");
 
// show form
?>
<h3>Liste des droits d'acc&egrave;s de la page <?php echo $this->ComposeLinkToPage($this->GetPageTag()) ?></h3><!-- Access Control Lists for-->
<br />
<?php echo $this->FormOpen("acls") ?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" style="padding-right: 20px">
<b>Droits de lecture :</b><br /><!-- Read ACL:-->
<textarea name="read_acl" rows="4" cols="20"><?php echo $readACL["list"] ?></textarea>
</td>
<td valign="top" style="padding-right: 20px">
<b>Droits d'&eacute;criture :</b><br /><!-- Write ACL:-->
<textarea name="write_acl" rows="4" cols="20"><?php echo $writeACL["list"] ?></textarea>
</td>
<td valign="top" style="padding-right: 20px">
<b>Droits des commentaires :</b><br /><!-- Comments ACL:-->
<textarea name="comment_acl" rows="4" cols="20"><?php echo $commentACL["list"] ?></textarea>
</td>
</tr>
<tr>
<td colspan="3">
<b>Changer le propri&eacute;taire :</b><br /><!-- Set Owner:-->
<select name="newowner">
<option value="">Ne rien modifier</option><!-- Don't change-->
<option value=""></option>
<?php
if ($users = $this->LoadUsers())
{
foreach($users as $user)
{
echo "<option value=\"",htmlentities($user["name"]),"\">",$user["name"],"</option>\n";
}
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="3">
<br />
<input type="submit" value="Enregistrer" style="width: 120px" accesskey="s" /><!-- Store ACLs-->
<input type="button" value="Annuler" onclick="history.back();" style="width: 120px" /><!-- Cancel -->
</td>
</tr>
</table>
<?php
echo$this->FormClose();
}
}
else
{
echo"<i>Vous n'&ecirc;tes pas le propri&eacute;taire de cette page.</i>";
//echo"<i>You're not the owner of this page.</i>";
}
 
?>
</div>
<?php echo $this->Footer(); ?>
/tags/2014_06_04/wikini/handlers/page/upload.php
New file
0,0 → 1,55
<?php
/*
upload.php
Code original de ce fichier : Eric FELDSTEIN
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2003,2004 Eric FELDSTEIN
Copyright 2003 Jean-Pascal MILCENT
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
# Execute l'upload des fichiers lier par l'action {{attach}}
# Necessite le fichier actions/attach.php pour fonctionner
# voir actions/attach.php ppour la documentation
# copyrigth Eric Feldstein 2003-2004
 
//vérification de sécurité
if (!WIKINI_VERSION) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
?>
<div class="page">
<?php
 
if (!class_exists('attach')){
include($this->GetConfigValue('action_path').'/attach.class.php');
}
$att = new attach($this);
$att->doUpload();
unset($att);
?>
</div>
<?php echo $this->Footer(); ?>
/tags/2014_06_04/wikini/handlers/page/claim.php
New file
0,0 → 1,46
<?php
/*
claim.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2003 Eric FELDSTEIN
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
 
// only claim ownership if this page has no owner, and if user is logged in.
if ($this->page && !$this->GetPageOwner() && $this->GetUser())
{
$this->SetPageOwner($this->GetPageTag(), $this->GetUserName());
$this->SetMessage("Vous &ecirc;tes maintenant le propri&eacute;taire de cette page");
}
 
$this->Redirect($this->href());
 
echo $this->Footer();
?>
/tags/2014_06_04/wikini/handlers/page/edit.php
New file
0,0 → 1,144
<?php
/*
edit.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Charles NEPOTE
Copyright 2002, 2003 Patrick PAUL
Copyright 2003 Eric FELDSTEIN
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
//vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("acc&egrave;s direct interdit");
}
echo $this->Header();
?>
<div class="page">
<?php
if ($this->HasAccess("write") && $this->HasAccess("read"))
{
$output='';
if ($_POST)
{
// only if saving:
if ($_POST["submit"] == "Sauver")
{
// check for overwriting
if ($this->page)
{
if ($this->page["id"] != $_POST["previous"])
{
$error = "ALERTE : ".
"Cette page a &eacute;t&eacute; modifi&eacute;e par quelqu'un d'autre pendant que vous l'&eacute;ditiez.<br />\n".
"Veuillez copier vos changements et r&eacute;&eacute;diter cette page.\n";
}
}
 
 
// store
if (!$error)
{
$body = str_replace("\r", "", $_POST["body"]);
// test si la nouvelle page est differente de la précédente
if(rtrim($body)==rtrim($this->page["body"])) {
$this->SetMessage("Cette page n\'a pas &eacute;t&eacute; enregistr&eacute;e car elle n\'a subi aucune modification.");
$this->Redirect($this->href());
}
 
// add page (revisions)
$this->SavePage($this->tag, $body);
 
// now we render it internally so we can write the updated link table.
$this->ClearLinkTable();
$this->StartLinkTracking();
$dummy = $this->Header();
$dummy .= $this->Format($body);
$dummy .= $this->Footer();
$this->StopLinkTracking();
$this->WriteLinkTable();
$this->ClearLinkTable();
 
// forward
$this->Redirect($this->href());
}
}
}
 
// fetch fields
if (!$previous = $_POST["previous"]) $previous = $this->page["id"];
if (!$body = $_POST["body"]) $body = $this->page["body"];
 
// preview?
if ($_POST["submit"] == "Aperçu")
{
$output .=
"<div class=\"prev_alert\"><strong>Aper&ccedil;u</strong></div>\n".
$this->Format($body)."\n\n".
$this->FormOpen("edit").
"<input type=\"hidden\" name=\"previous\" value=\"".$previous."\" />\n".
"<input type=\"hidden\" name=\"body\" value=\"".htmlentities($body)."\" />\n".
"<br />\n".
"<input name=\"submit\" type=\"submit\" value=\"Sauver\" accesskey=\"s\" />\n".
"<input name=\"submit\" type=\"submit\" value=\"R&eacute;&eacute;diter \" accesskey=\"p\" />\n".
"<input type=\"button\" value=\"Annulation\" onclick=\"document.location='".$this->href("")."';\" />\n".
$this->FormClose()."\n";
}
else
{
// display form
if ($error)
{
$output .= "<div class=\"error\">$error</div>\n";
}
 
// append a comment?
if ($_REQUEST["appendcomment"])
{
$body = trim($body)."\n\n----\n\n--".$this->UserName()." (".strftime("%c").")";
}
require_once("ACeditor.buttonsBar.php");
$output .=
$this->FormOpen("edit").
"<input type=\"hidden\" name=\"previous\" value=\"".$previous."\" />\n".$ACbuttonsBar.
"<textarea onkeydown=\"fKeyDown()\" name=\"body\" cols=\"60\" rows=\"40\" wrap=\"soft\" class=\"edit\">\n".
htmlspecialchars($body).
"\n</textarea><br />\n".
($this->config["preview_before_save"] ? "" : "<input name=\"submit\" type=\"submit\" value=\"Sauver\" accesskey=\"s\" />\n").
"<input name=\"submit\" type=\"submit\" value=\"Aper&ccedil;u\" accesskey=\"p\" />\n".
"<input type=\"button\" value=\"Annulation\" onclick=\"document.location='".$this->href("")."';\" />\n".
$this->FormClose();
}
 
echo $output;
}
else
{
echo "<i>Vous n'avez pas acc&egrave;s en &eacute;criture &agrave; cette page !</i>\n";
}
?>
<hr class="hr_clear" />
</div>
<?php echo $this->Footer(); ?>
/tags/2014_06_04/wikini/setup/writeconfig.php
New file
0,0 → 1,77
<?php
/*
writeconfig.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Patrick PAUL
Copyright 2003 Jean-Pascal MILCENT
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
 
// fetch config
$config = $config2 = unserialize($_POST["config"]);
 
// merge existing configuration with new one
$config = array_merge($wakkaConfig, $config);
 
// set version to current version, yay!
$config["wikini_version"] = WIKINI_VERSION;
$config["wakka_version"] = WAKKA_VERSION;
 
// convert config array into PHP code
$configCode = "<?php\n// wakka.config.php cr&eacute;&eacute;e ".strftime("%c")."\n// ne changez pas la wikini_version manuellement!\n\n\$wakkaConfig = array(\n";
foreach ($config as $k => $v)
{
$entries[] = "\t\"".$k."\" => \"".$v."\"";
}
$configCode .= implode(",\n", $entries).");\n?>";
 
// try to write configuration file
echo "<b>Cr&eacute;ation du fichier de configuration en cours...</b><br>\n";
test("&Eacute;criture du fichier de configuration <tt>".$wakkaConfigLocation."</tt>...", $fp = @fopen($wakkaConfigLocation, "w"), "", 0);
 
if ($fp)
{
fwrite($fp, $configCode);
// write
fclose($fp);
echo "<p>Voila c'est termin&eacute; ! Vous pouvez <a href=\"",$config["base_url"],"\">retourner sur votre site WikiNi</a>. Il est conseill&eacute; de retirer l'acc&egrave;s en &eacute;criture au fichier <tt>wakka.config.php</tt>. Ceci peut &ecirc;tre une faille dans la s&eacute;curit&eacute;.</p>";
}
else
{
// complain
echo"<p><span class=\"failed\">AVERTISSEMENT:</span> Le
fichier de configuration <tt>",$wakkaConfigLocation,"</tt> n'a pu &ecirc;tre
cr&eacute;&eacute;. Veuillez vous assurez que votre serveur a les droits d'acc&egrave;s en &eacute;criture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas faire &ccedil;a vous devez copier les informations suivantes dans un fichier et les transf&eacute;rer au moyen d'un logiciel de transfert de fichier (ftp) sur le serveur dans un fichier <tt>wakka.config.php</tt> directement dans le r&eacute;pertoire de WikiNi. Une fois que vous aurez fait cela, votre site WikiNi devrait fonctionner correctement.</p>\n";
?>
<form action="<?php echo myLocation() ?>?installAction=writeconfig" method="POST">
<input type="hidden" name="config" value="<?php echo htmlentities(serialize($config2)) ?>">
<input type="submit" value="Essayer &agrave; nouveau">
</form>
<?php
echo"<div style=\"background-color: #EEEEEE; padding: 10px 10px;\">\n<xmp>",$configCode,"</xmp>\n</div>\n";
}
 
?>
/tags/2014_06_04/wikini/setup/default.php
New file
0,0 → 1,90
<form action="<?php echo myLocation() ?>?installAction=install" method="POST">
<table>
 
<tr><td></td><td><b>Installation de WikiNi</b></td></tr>
 
<?php
/*
default.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002 Patrick PAUL
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
if (($wakkaConfig["wakka_version"]) || ($wakkaConfig["wikini_version"]))
{
if ($wakkaConfig["wikini_version"]) {
$config=$wakkaConfig["wikini_version"];
}
else {
$config=$wakkaConfig["wakka_version"];
}
echo "<tr><td></td><td>Votre syst&egrave;me WikiNi existant a &eacute;t&eacute; reconnu comme &eacute;tant la version ",$config,". Vous &ecirc;tes sur le point de <b>mettre &agrave; jour</b> WikiNi pour la version ",WIKINI_VERSION,". Veuillez revoir vos informations de configuration ci-dessous.</td></tr>\n";
}
else
{
echo "<tr><td></td><td>Vous &ecirc;tes sur le point d'installer WikiNi ",WIKINI_VERSION,". Veuillez configurer votre WikiNi en utilisant le formulaire suivant.</td></tr>\n";
}
?>
 
<tr><td></td><td><br>NOTE: Ce programme d'installation va essayer de modifier les options de configurations dans le fichier <tt>wakka.config.php</tt>, situ&eacute; dans votre r&eacute;pertoire WikiNi. Pour que cela fonctionne, veuillez vous assurez que votre serveur a les droits d'acc&egrave;s en &eacute;criture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas faire &ccedil;a vous devrez modifier ce fichier manuellement (ce programme d'installation vous dira comment).</td></tr>
 
<tr><td></td><td><br><b>Configuration de la base de donn&eacute;es</b></td></tr>
<tr><td></td><td>La machine sur laquelle se trouve votre serveur MySQL. En g&eacute;n&eacute;ral c'est "localhost" (ie, la m&ecirc;me machine que celle o&ugrave; se trouve les pages de WikiNi.).</td></tr>
<tr><td align="right" nowrap>Machine MySQL :</td><td><input type="text" size="50" name="config[mysql_host]" value="<?php echo $wakkaConfig["mysql_host"] ?>"></td></tr>
<tr><td></td><td>La base de donn&eacute;es MySQL &agrave; utiliser pour WikiNi. Cette base de donn&eacute;es doit d&eacute;j&agrave; exister avant de pouvoir continuer.</td></tr>
<tr><td align="right" nowrap>Base de donn&eacute;es MySQL :</td><td><input type="text" size="50" name="config[mysql_database]" value="<?php echo $wakkaConfig["mysql_database"] ?>"></td></tr>
<tr><td></td><td>Nom et mot de passe de l'utilisateur MySQL qui sera utilis&eacute; pour se connecter &agrave; votre base de donn&eacute;es.</td></tr>
<tr><td align="right" nowrap>Non de l'utilisateur MySQL :</td><td><input type="text" size="50" name="config[mysql_user]" value="<?php echo $wakkaConfig["mysql_user"] ?>"></td></tr>
<tr><td align="right" nowrap>Mot de passe MySQL :</td><td><input type="password" size="50" name="config[mysql_password]" value=""></td></tr>
<tr><td></td><td>Pr&eacute;fixe &agrave; utiliser pour toutes les tables utilis&eacute;es par WikiNi. Ceci vous permet d'utiliser plusieurs WikiNi sur une m&ecirc;me base de donnn&eacute;es en donnant diff&eacute;rents pr&eacute;fixes aux tables.</td></tr>
<tr><td align="right" nowrap>Prefixe des tables :</td><td><input type="text" size="50" name="config[table_prefix]" value="<?php echo $wakkaConfig["table_prefix"] ?>"></td></tr>
 
<tr><td></td><td><br><b>Configuration de votre site WikiNi</b></td></tr>
 
<tr><td></td><td>Le nom de votre site WikiNi. Ceci est g&eacute;n&eacute;ralement un NomWiki et EstSousCetteForme.</td></tr>
<tr><td align="right" nowrap>Le nom de votre WikiNi :</td><td><input type="text" size="50" name="config[wakka_name]" value="<?php echo $wakkaConfig["wakka_name"] ?>"></td></tr>
 
<tr><td></td><td>La page d'accueil de votre WikiNi. Ceci doit &ecirc;tre un NomWiki.</td></tr>
<tr><td align="right" nowrap>Home page:</td><td><input type="text" size="50" name="config[root_page]" value="<?php echo $wakkaConfig["root_page"] ?>"></td></tr>
 
<tr><td></td><td>META Mots clefs/Description qui seront ins&eacute;r&eacute;s dans les codes HTML.</td></tr>
<tr><td align="right" nowrap>Mots clefs :</td><td><input type="text" size="50" name="config[meta_keywords]" value="<?php echo $wakkaConfig["meta_keywords"] ?>"></td></tr>
<tr><td align="right" nowrap>Description :</td><td><input type="text" size="50" name="config[meta_description]" value="<?php echo $wakkaConfig["meta_description"] ?>"></td></tr>
 
<tr><td></td><td><br><b>Configuration de l'URL de votre WikiNi</b><?php echo $wakkaConfig["wikini_version"] ? "" : "<br>Ceci est une nouvelle installation. Le programme d'installation va essayer de trouver les valeurs appropri&eacute;es. Changez-les uniquement si vous savez ce que vous faites." ?></td></tr>
 
<tr><td></td><td>L'URL de base de votre site WikiNi. Les noms des pages seront directement rajout&eacute;s &agrave; cet URL. Supprimez la partie "?wiki=" uniquement si vous utilisez la redirection (voir ci apr&egrave;s).</td></tr>
<tr><td align="right" nowrap>URL de base :</td><td><input type="text" size="50" name="config[base_url]" value="<?php echo $wakkaConfig["base_url"] ?>"></td></tr>
 
<tr><td></td><td>Le mode "redirection automatique" doit &ecirc;tre s&eacute;lectionn&eacute; uniquement si vous utilisez WikiNi avec la redirection d'URL (si vous ne savez pas ce qu'est la redirection d'URL n'activez pas cette option).</td></tr>
<tr><td align="right" nowrap>Mode "redirection" :</td><td><input type="hidden" name="config[rewrite_mode]" value="0"><input type="checkbox" name="config[rewrite_mode]" value="1" <?php echo $wakkaConfig["rewrite_mode"] ? "checked" : "" ?>> Activation</td></tr>
 
<tr><td></td><td><br><b>Options suppl&eacute;mentaires</b></td></tr>
 
<tr><td></td><td><input type="hidden" name="config[preview_before_save]" value="0"><input type="checkbox" name="config[preview_before_save]" value="1" <?php echo $wakkaConfig["preview_before_save"] ? "checked" : "" ?>> Imposer de faire un aper&ccedil;u avant de pouvoir sauver une page.</td></tr>
<tr><td></td><td><input type="submit" value="Continuer"></td></tr>
</table>
</form>
/tags/2014_06_04/wikini/setup/install.php
New file
0,0 → 1,175
<?php
/*
install.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003 Patrick PAUL
Copyright 2003 Eric FELDSTEIN
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
 
// fetch configuration
$config = $_POST["config"];
 
// test configuration
echo "<b>Test de la configuration</b><br>\n";
test("Test connexion MySQL ...", $dblink = @mysql_connect($config["mysql_host"], $config["mysql_user"], $config["mysql_password"]));
test("Recherche base de donn&eacute;es ...", @mysql_select_db($config["mysql_database"], $dblink), "La base de donn&eacute;es que vous avez choisie n'existe pas, vous devez la cr&eacute;er avant d'installer WikiNi !");
echo "<br>\n" ;
 
// do installation stuff
if (!$version = trim($wakkaConfig["wikini_version"])) $version = "0";
switch ($version)
{
// new installation
case "0":
echo "<b>Installation</b><br>\n";
test("Creation table page...",
@mysql_query(
"CREATE TABLE ".$config["table_prefix"]."pages (".
"id int(10) unsigned NOT NULL auto_increment,".
"tag varchar(50) NOT NULL default '',".
"time datetime NOT NULL default '0000-00-00 00:00:00',".
"body text NOT NULL,".
"body_r text NOT NULL,".
"owner varchar(50) NOT NULL default '',".
"user varchar(50) NOT NULL default '',".
"latest enum('Y','N') NOT NULL default 'N',".
"handler varchar(30) NOT NULL default 'page',".
"comment_on varchar(50) NOT NULL default '',".
"PRIMARY KEY (id),".
"FULLTEXT KEY tag (tag,body),".
"KEY idx_tag (tag),".
"KEY idx_time (time),".
"KEY idx_latest (latest),".
"KEY idx_comment_on (comment_on)".
") TYPE=MyISAM;", $dblink), "D&eacute;j&agrave; cr&eacute;&eacute;e ?", 0);
test("Creation table ACL ...",
@mysql_query(
"CREATE TABLE ".$config["table_prefix"]."acls (".
"page_tag varchar(50) NOT NULL default '',".
"privilege varchar(20) NOT NULL default '',".
"list text NOT NULL,".
"PRIMARY KEY (page_tag,privilege)".
") TYPE=MyISAM", $dblink), "D&eacute;j&agrave; cr&eacute;&eacute;e ?", 0);
test("Creation table link ...",
@mysql_query(
"CREATE TABLE ".$config["table_prefix"]."links (".
"from_tag char(50) NOT NULL default '',".
"to_tag char(50) NOT NULL default '',".
"UNIQUE KEY from_tag (from_tag,to_tag),".
"KEY idx_from (from_tag),".
"KEY idx_to (to_tag)".
") TYPE=MyISAM", $dblink), "D&eacute;j&agrave; cr&eacute;&eacute;e ?", 0);
test("Creation table referrer ...",
@mysql_query(
"CREATE TABLE ".$config["table_prefix"]."referrers (".
"page_tag char(50) NOT NULL default '',".
"referrer char(150) NOT NULL default '',".
"time datetime NOT NULL default '0000-00-00 00:00:00',".
"KEY idx_page_tag (page_tag),".
"KEY idx_time (time)".
") TYPE=MyISAM", $dblink), "D&eacute;j&agrave; cr&eacute;&eacute;e ?", 0);
test("Creation table user ...",
@mysql_query(
"CREATE TABLE ".$config["table_prefix"]."users (".
"name varchar(80) NOT NULL default '',".
"password varchar(32) NOT NULL default '',".
"email varchar(50) NOT NULL default '',".
"motto text NOT NULL,".
"revisioncount int(10) unsigned NOT NULL default '20',".
"changescount int(10) unsigned NOT NULL default '50',".
"doubleclickedit enum('Y','N') NOT NULL default 'Y',".
"signuptime datetime NOT NULL default '0000-00-00 00:00:00',".
"show_comments enum('Y','N') NOT NULL default 'N',".
"PRIMARY KEY (name),".
"KEY idx_name (name),".
"KEY idx_signuptime (signuptime)".
") TYPE=MyISAM", $dblink), "D&eacute;j&agrave; cr&eacute;&eacute;e ?", 0);
//insertion des pages de documentation et des pages standards
$d = dir("setup/doc/");
while ($doc = $d->read()){
if ($doc != "." && $doc != ".." && !is_dir($doc)){
$pagecontent = implode ('', file("setup/doc/$doc"));
if ($doc=='_root_page.txt'){
$pagename = $config["root_page"];
}else{
$pagename = substr($doc,0,strpos($doc,'.txt'));
}
 
$sql = "Select tag from ".$config["table_prefix"]."pages where tag='$pagename'";
// Insert documentation page if not present (a previous failed installation ?)
if (($r=@mysql_query($sql, $dblink)) && (mysql_num_rows($r)==0)) {
$sql = "Insert into ".$config["table_prefix"]."pages ".
"set tag = '$pagename', ".
"body = '".mysql_escape_string($pagecontent)."', ".
"user = 'WikiNiInstaller', ".
"time = now(), ".
"latest = 'Y'";
 
test("Insertion de la page $pagename ...", @mysql_query($sql, $dblink),"?",0);
 
// update table_links
$wiki = new Wiki($config);
$wiki->SetPage($wiki->LoadPage($pagename,"",0));
$wiki->ClearLinkTable();
$wiki->StartLinkTracking();
$wiki->TrackLinkTo($pagename);
$dummy = $wiki->Header();
$dummy .= $wiki->Format($pagecontent);
$dummy .= $wiki->Footer();
$wiki->StopLinkTracking();
$wiki->WriteLinkTable();
$wiki->ClearLinkTable();
}
else
{
test("Insertion de la page $pagename ...", 0 ,"Existe d&eacute;j&agrave;.",0);
}
 
}
}
break;
// The funny upgrading stuff. Make sure these are in order! //
case "0.1":
echo "<b>En cours de mise &agrave; jour de WikiNi 0.1</b><br>\n";
test("Just very slightly altering the pages table...",
@mysql_query("alter table ".$config["table_prefix"]."pages add body_r text not null default '' after body", $dblink), "Already done? Hmm!", 0);
test("Claiming all your base...", 1);
}
 
?>
 
<p>
A l'&eacute;tape suivante, le programme d'installation va essayer
d'&eacute;crire le fichier de configuration <tt><?php echo $wakkaConfigLocation ?></tt>.
Assurez vous que le serveur web a bien le droit d'&eacute;crire dans ce fichier, sinon vous devrez le modifier manuellement. </p>
 
<form action="<?php echo myLocation(); ?>?installAction=writeconfig" method="POST">
<input type="hidden" name="config" value="<?php echo htmlentities(serialize($config)) ?>">
<input type="submit" value="Continuer">
</form>
/tags/2014_06_04/wikini/setup/header.php
New file
0,0 → 1,65
<?php
/*
header.php
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
Copyright 2002, 2003 David DELON
Copyright 2002 Patrick PAUL
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The 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 AUTHOR 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.
*/
// stuff
function test($text, $condition, $errorText = "", $stopOnError = 1) {
echo "$text " ;
if ($condition)
{
echo "<span class=\"ok\">OK</span><br>\n" ;
}
else
{
echo "<span class=\"failed\">ECHEC</span>" ;
if ($errorText) echo ": ",$errorText ;
echo "<br>\n" ;
if ($stopOnError) exit;
}
}
 
function myLocation()
{
list($url, ) = explode("?", $_SERVER["REQUEST_URI"]);
return $url;
}
 
?>
<html>
<head>
<title>Installation de WikiNi</title>
<style>
P, BODY, TD, LI, INPUT, SELECT, TEXTAREA { font-family: Verdana; font-size: 13px; }
INPUT { color: #880000; }
.ok { color: #008800; font-weight: bold; }
.failed { color: #880000; font-weight: bold; }
A { color: #0000FF; }
</style>
</head>
 
<body>
/tags/2014_06_04/wikini/setup/footer.php
New file
0,0 → 1,2
</body>
</html>
/tags/2014_06_04/wikini/setup/doc/BacASable.txt
New file
0,0 → 1,0
Faites vos test sur [[http://www.wikini.net WikiNi]] sur cette page
/tags/2014_06_04/wikini/setup/doc/ActionUserSettings.txt
New file
0,0 → 1,10
L'action ""{{UserSettings}}"" permet aux utilisateurs d'effectuer les actions suivantes :
- création d'un nouveau compte
- authentification
- réglage des paramètres utilisateur
- changement de mot-de-passe
 
On peut la voir en action dans les ParametresUtilisateur.
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/ParametresUtilisateur.txt
New file
0,0 → 1,0
{{UserSettings}}
/tags/2014_06_04/wikini/setup/doc/ActionRedirect.txt
New file
0,0 → 1,23
L'action ##""{{redirect page="PagePrincipale"}}""## permet d'être redirigé vers une autre page lorsqu'une page est demandée (ici vers la PagePrincipale). Cela permet de faire des "alias" de page, plusieurs noms différents pour une même page.
 
**Synthèse des cas** où cette action peut être utile :
- dans le cas où certains termes sont d'orthographe variable, comme par exemple Persistance of Vision - qui devient ""PoV"", ""POV"", ""PovRay"", ""POV-Ray""... et certains Wiki voient donc deux pages apparaitre pour la même chose, avec du contenu trop élaboré pour être facilement reconciliable en une seule page.
- en cas de renommage d'une page (en fait le déplacement d'une page vers une autre page), l'ancien nom peut rediriger vers le nouveau nom ; ceci peut être particulièrement utile dans le cas où de très nombreuses pages pointe sur la page originelle, évitant ainsi de changer les liens dans chaque page
- redirection d'une page au nom wiki disgracieux vers une page au nom wiki plus lisible ; exemples : ""SpIp"" => Spip, ""DelPhine"" => Delphine, etc.
 
Une différence notable entre une inclusion et une redirection : lors d'une inclusion, le contenu de la page incluant une autre page peut être modifé, donc utiliser l'inclusion pour faire des alias de page ne me parait pas très sûr car il risque d'apparaitre des divergences de contenu si c'est la page incluant une autre page qui est modifée. Par contre, une redirection __impose__ qu'une seule page est éditable et la cohérence de contenu est donc correcte.
 
===== Paramètres =====
 
Cette action accepte un seul paramètre :
- page : paramètre obligatoire pour désigner la page vers laquelle la page est redirigée.
 
===== Modification d'une page contenant l'action ##redirect## =====
Il faut entrer manuellement dans la barre d'adresse du navigateur l'adresse de la page + le "handler" désiré ; par exemple :
Pour la modifier :
- http://domaine/wakka.php?wiki=NomDeLaPage/edit
Pour la supprimer :
- http://domaine/wakka.php?wiki=NomDeLaPage/deletepage
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/ActionBacklinks.txt
New file
0,0 → 1,24
Action permettant d'insérer la liste de toutes les pages faisant référence à la page courante. Dans cette présente page, ""{{backlinks}}"" donne ceci :
 
{{BackLinks}}
 
Sur la page personnelle d'un utilisateur, cette action affichera aussi les pages dont il est le propriétaire ou le dernier modificateur.
 
===== Paramètres =====
 
==== Paramètre "page" ====
Le paramètre "page" ([[http://www.wikini.net WikiNi]] >= 0.4.1) permet de spécifier une page différente de la page courante.
Par exemple ##""{{backlinks page="PagePrincipale"}}""##
Ce paramètre peut être utile, par exemple :
- pour améliorer le TableauDeBordDeCeWiki : il suffit d'ajouter la liste des pages liées à la page ""AFaire"" pour connaître les pages qui doivent faire l'objet d'un travail
- pour consolider des données sur une seule page : par exemple la liste des pages liées aux pages ""EstUnHomme"" et ""EstUneFemme""
- autres ?
 
==== Paramètre "exclude" ====
Le paramètre "exclude" ([[http://www.wikini.net WikiNi]] >= 0.4.1) permet de spécifier des pages à exclure de la liste des pages qui ont pourtant un lien vers la page de référence.
Il est en effet parfois génant d'afficher la totalité des pages faisant référence à une page. Par exemple, la page ""AFaire"" liste la page ""CharlesNepoteVeilleSurInternet"" alors que, non seulement cette information n'a pas d'intérêt mais elle pollue en outre la lecture de cette page. Autre exemple, une page ""MamiFeres"" a intérêt par exemple à lister ""CheVal"" et ""ElePhant"" mais pas nécessairement ""AniMaux"" qui est une catégorie supérieure. Je suggère donc la création d'un paramètre exclude destiné à exclure certaines pages : par exemple :
##""{{backlinks exclude="AniMaux"}}""##
Le paramètre "exclude" peut contenir plusieurs noms de page séparés par des ";", par exemple : ##""{{backlinks exclude="AniMaux; PagePrincipale"}}""##
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/ActionWantedPages.txt
New file
0,0 → 1,5
L'action ""{{WantedPages}}"" liste tous les MotWiki du site qui n'ont pas vu la création d'une page.
Cette page est visible en action sur les PagesACreer.
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/ActionPageIndex.txt
New file
0,0 → 1,7
L'action ""{{PageIndex}}"" liste toutes les pages classées par ordre alphabétique et regroupées par lettre. On peut la voir en action sur l'IndexDesPagesBis.
Pour obtenir la liste des pages du site on pourra voir également l'action [[ActionListPages ListPages]].
 
Cette action ne prend aucun paramètre.
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/RechercheTexte.txt
New file
0,0 → 1,0
{{TextSearch}}
/tags/2014_06_04/wikini/setup/doc/TableauDeBordDeCeWiki.txt
New file
0,0 → 1,14
Ce tableau de bord regroupe toutes les pages utiles à l'analyse et à l'animation de ce site.
- DerniersChangements et DerniersCommentaires
- PlanDuSite à partir de la racine
- IndexDesPages, IndexDesPagesBis
- PagesOrphelines
- PagesACreer
 
----
==== 8 derniers comptes utilisateurs ====
{{Listusers last="8"}}
==== 8 dernières pages modifiées ====
{{recentchanges max="8"}}
==== 5 dernières pages commentées ====
{{RecentlyCommented max="5"}}
/tags/2014_06_04/wikini/setup/doc/ActionRecentChanges.txt
New file
0,0 → 1,10
L'action ""{{RecentChanges}}"" affiche la liste des pages récement modifiées. Elle est illustrée dans la page DerniersChangements.
 
==== Paramètres ====
Cette action prend en compte le paramètre "max", permettant à un utilisateur de spécifier le nombre de pages affichées.
Par exemple ""{{recentchanges max="3"}}"" donne :
 
{{recentchanges max="3"}}
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/ActionTextSearch.txt
New file
0,0 → 1,12
L'action ##""{{TextSearch}}""## permet de lister les pages contenant un ou plusieurs mots entré(s) par l'utilisateur.
On peut la voir en action sur la page RechercheTexte.
 
Cette action utilise la fonction d'indexation en texte intégral de ""MySQL"" et hérite de ses qualités et défauts :
- la recherche est quasi instantanée
- la recherche est limitée à des mots de 4 lettres au minimim
- la recherche n'accepte pas de caractères génériques (ou caractères joker : ".*?", etc.)
- la recherche n'est pas lématisée : la recherche de "protocole" ne trouvera pas "protocoles" ; la recherche de "lascif" ne trouvera pas "lascive"
- la recherche n'est pas effectuée sur une partie de MotWiki : la recherche de "text" ne donnera pas ActionTextSearch pour résultat
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/ListeDesActionsWikini.txt
New file
0,0 → 1,22
Wikini propose par défaut les "actions" suivantes.
 
- ActionBacklinks
- ActionFindpage
- ActionInclude : inclusion d'une page au sein d'une autre
- ActionListPages
- ActionListUsers
- ActionMyChanges
- ActionMyPages
- ActionOrphanedPages : recherche les pages qui n'ont pas de liens vers elle (par orpheline )
- ActionPageIndex
- ActionRecentChanges
- ActionRecentChangesRSS
- ActionRecentComments
- ActionRecentlyCommented
- ActionRedirect : redirection d'une page vers une autre
- ActionTextSearch : recherche d'une chaine de caractères dans l'ensemble des page de [[http://www.wikini.net WikiNi]]
- ActionTrail : permet de lier des pages entres elles et de passer de l'une à l'autre avec un petit navigateur style "précédente/suivante"
- ActionUserSettings
- ActionWantedPages : liste les pages devant être écrites.
 
 
/tags/2014_06_04/wikini/setup/doc/PlanDuSite.txt
New file
0,0 → 1,0
{{listpages/tree}}
/tags/2014_06_04/wikini/setup/doc/ActionTrail.txt
New file
0,0 → 1,38
L'action ##""{{trail toc="NomDePage"}}""## permet de lier des pages entres elles grace à une page de sommaire. Cette action affiche un navigateur du type "précedente/suivante" en indiquant le nom des pages précende et suivante.
 
====Paramètre====
Le paramètre ##toc## permet d'indiquer le nom de la page contenant le liste des pages liées.
 
====Configuration====
L'aspet des liens du navigateur est définis par deux classe CSS présente dans wakka.css :
##
.trail_table { line-height: 30px;}
.trail_button { color: #993333; }
##
 
====Ecriture d'une page "toc"====
Cette page peut contenir n'importe quel texte. Les règles qui permettent de définir la liste des pages liées sont :
- Le nom de la page appartient à une liste (numéroté, à bulle ou sans signe)
- Le nom de la page est le **1er** mot de chaque élément de la liste
- Les liens ##""[[NomPageWikiNi Nom d'une page WikiNi]]""## sont acceptés et doivent être le **1er mot** de chaque éléments de la liste.
 
Un exemple de page sommaire :
-----
 
====Sommaire====
 
Texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte.
 
- Page1 : texte texte texte texte texte texte texte texte texte texte texte
- Page2 : texte texte texte texte texte texte texte texte texte texte texte texte texte
- [[Page3 Vers la page 3]] : texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte
- Page31 : texte texte texte texte texte texte texte texte texte texte texte
- Page32 : texte texte texte texte texte texte texte texte texte texte texte
- Page4 : texte texte texte texte texte texte texte texte texte texte texte
 
texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte.
- Page5 : texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte
- Page6 : texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte
-----
{{trail toc="ListeDesActionsWikiNi"}}
/tags/2014_06_04/wikini/setup/doc/NomWiki.txt
New file
0,0 → 1,3
Un NomWiki est un nom qui est écrit ""CommeCela"".
 
Un NomWiki est transformé automatiquement en lien. Si la page correspondante n'existe pas, un '?' est affiché à côté du mot.
/tags/2014_06_04/wikini/setup/doc/AideWikiNi.txt
New file
0,0 → 1,5
=====Les pages d'aide sur [[http://www.wikini.net WikiNi]]=====
 
- ReglesDeFormatage : résumé des syntaxes ""WikNi"" permettant la mise en forme du texte.
- ListeDesActionsWikini : liste des actions disponible dans [[http://www.wikini.net WikiNi]].
- ControlerLAccesAuxPages : explique comment gérer les droits d'accès aux page de [[http://www.wikini.net WikiNi]].
/tags/2014_06_04/wikini/setup/doc/_root_page.txt
New file
0,0 → 1,3
Bienvenue ! Cliquez sur le lien "Editer cette page" au bas de la page pour démarrer.
 
Pages utiles: PagesOrphelines, PagesACreer, RechercheTexte, ReglesDeFormatage, AideWikiNi, TableauDeBordDeCeWiki.
/tags/2014_06_04/wikini/setup/doc/ActionOrphanedPages.txt
New file
0,0 → 1,11
L'action ""{{OrphanedPages}}"" liste toutes les pages orphelines, c'est-à-dire toutes les pages n'étant reliées à aucune autre page.
Cette action est utilisée ici dans la page : PagesOrphelines.
 
Elle peut servir :
- à localiser les pages qui ont besoin d'être reliées à d'autres pages
- à localiser les pages rendues inutiles et que l'on peut alors effacer
 
Cette page ne comporte aucun paramètre.
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/ActionRecentlyCommented.txt
New file
0,0 → 1,10
L'action ""{{RecentlyCommented}}"" permet d'afficher la liste des pages ayant été récement commentées. Cette action est visible sur la page DerniersCommentaires.
 
==== Paramètres ====
Cette action accepte un seul paramètre, le paramètre "max" permettant de spécifier le nombre maximum de pages récemment commentées à afficher.
Par exemple ""{{RecentlyCommented max="3"}}"" va donner le résultat suivant :
 
{{RecentlyCommented max="3"}}
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/ReglesDeFormatage.txt
New file
0,0 → 1,61
==== Guide des règles de formatage ====
 
Les règles de formatage avec Wakka diffèrent légèrement des autres Wikis. (Voir par exemple [[http://c2.com/cgi/wiki?TextFormattingRules les règles de formatage de WikiWikiWeb]], le premier Wiki connu.)
Tout texte placé entre deux guillemets doubles - " - est présenté tel que.
 
Vous pouvez effectuer vos propres test dans le BacASable : c'est un endroit fait pour ça.
 
Règles de base :
""**Texte en gras !** ---""> **Texte en gras !**
""//Texte en italique.// ---""> //Texte en italique.//
""Texte __souligné__ ! ---""> Texte __souligné__ !
""Texte @@barré@@ ! ---""> Texte @@barré@@ !
""##texte à espacement fixe## ---""> ##texte à espacement fixe##
""%%code%%""
""%%(php) PHP code%%""
""%%(delphi) code delphi/pascal%%""
 
Empêcher le formatage du texte :
Pour empêcher que Wikini n'interprète les balises de formatage de texte qu'il reconnait, encadrer le texte par une paire de guillemets doubles. ""Par __exemple__, ce **texte** @@contient@@ des %%balises%% reconnue par Wikini qui ne sont //pas// interprétée car il est encadré par une paire de **guillemets double** comme __vous__ pouvez vous en apercevoir :)""
Deux autres utilisations :
- écrire directement du HTML dans le wikini - par exemple pour les tableaux... ;-) - vu que ce qui est renvoyé est tout de même interprété par le moteur de rendu de Mozilla
- afficher des logs / des scripts shell en ajoutant les tag <pre> et </pre> qui seront interprétés pour afficher le texte tel quel par le navigateur (sous réserve qu'il n'y ait pas de double guillemet dedans). Cela permet d'avoir le contenu in extenso plutôt que dans une boîte de code qui est de taille fixe (contrairement à la fonctionnalité de phpBB2 avec les tags [code] et [/code])
 
Liens forcés :
""[[http://www.mon-site.org]]""
""[[http://www.mon-site.org Mon-site]]""
""[[P2P]]""
""[[P2P Page sur le P2P]]""
 
En-têtes :
""====== En-tête énorme ======"" ====== En-tête énorme ======
""===== En-tête très gros ====="" ===== En-tête très gros =====
""==== En-tête gros ===="" ==== En-tête gros ====
""=== En-tête normal ==="" === En-tête normal ===
""== Petit en-tête =="" == Petit en-tête ==
 
Séparateur horizontal : il suffit de taper au moins 4 "-", au dela de 4 tirets c'est le meme effet
Exemple : ""----""
-------
 
 
Retour de ligne forcé :
""---""
 
L'indentation de textes se fait avec la touche "TAB". Vous pouvez aussi créer des listes à puces ou numérotées :
""- liste à puce""
""1) liste numérotée (chiffres arabes)""
""A) liste numérotée (capitales alphabétiques)""
""a) liste numérotée (minuscules alphabétiques)""
""i) liste numérotée (chiffres romains)""
 
Vous pouvez également indenter du texte en utilisant des caractères espace au lieu de la touche "TAB", les exemples ci dessus restent valables mais attention à ne pas mélanger des "TAB" et des espaces dans la même énumération.
 
""- liste à puce""
""1) liste numérotée (chiffres arabes)""
""A) liste numérotée (capitales alphabétiques)""
""a) liste numérotée (minuscules alphabétiques)""
""i) liste numérotée (chiffres romains)""
 
Note : à cause d'un [[http://bugzilla.mozilla.org/show_bug.cgi?id=10547 bogue dans son moteur de rendu]], les listes, utilisant la touche TAB, ne fonctionnent pas (encore) sous Mozilla.
 
/tags/2014_06_04/wikini/setup/doc/ControlerLAccesAuxPages.txt
New file
0,0 → 1,29
Chaque page possède trois niveaux de contrôle d'accès :
- lecture de la page
- écriture/modification de la page
- commentaire de la page
 
Les contrôles d'accès ne peuvent être modifiés que par le propriétaire de la page -- l'administrateur technique peut aussi manuellement modifier ces contrôles en travaillant directement sur la base de données.
Le propriétaire d'une page voit apparaître, dans la page dont il est propriétaire, l'option "Éditer permissions" : cette option lui permet de modifier les contrôles d'accès.
Ces contrôles sont matérialisés par des colonnes où le propriétaire va ajouter ou supprimer des informations.
Le propriétaire peut compléter ces colonnes par les informations suivantes, séparées par des espaces :
- le nom d'un ou plusieurs utilisateurs : par exemple ""CharlesNepote"" ou ""DavidDelon""
- le caractère ***** désignant tous les utilisateurs
- le caractère **+** désignant les utilisateurs enregistrés
- le caractère **!** signifiant la négation : par exemple !""CharlesNepote"" signifie que ""CharlesNepote"" **ne doit pas** avoir accès à cette page
 
===== Droits d'accès par défaut =====
Pour toute nouvelle page créée, [[http://www.wikini.net WikiNi]] applique des droits d'accès par défaut. Ces droits d'accès sont configurables via le fichier /wakka.config.php.
Il faut renseigner les trois variables de configuration suivantes :
##
"default_write_acl" => "*",
"default_read_acl" => "*",
"default_comment_acl" => "*",
##
 
Par exemple, vous pouvez souhaiter que, par défaut, seuls les utilisateurs enregistrés puisse modifier des pages. Vous utiliserez alors :
##
"default_write_acl" => "+",
"default_read_acl" => "*",
"default_comment_acl" => "*",
##
/tags/2014_06_04/wikini/setup/doc/PagesACreer.txt
New file
0,0 → 1,0
{{WantedPages}}
/tags/2014_06_04/wikini/setup/doc/IndexDesPagesBis.txt
New file
0,0 → 1,0
{{pageindex}}
/tags/2014_06_04/wikini/setup/doc/ActionInclude.txt
New file
0,0 → 1,40
L'action ##""{{include page="PagePrincipale"}}""## ([[http://www.wikini.net WikiNi]] >= 0.4.1) permet d'inclure dans une page une autre page du wiki (ici la page PagePrincipale). Cette action possède plusieurs applications :
- elle permet de regrouper plusieurs pages en une seule et donc, par exemple, créer un document à partir de différentes "sections" disséminées dans plusieurs pages
- elle permet de commenter/critiquer une page en lecture seule en l'incluant dans le corps d'une autre page
- elle peut permettre, par exemple, de constituer des blocs d'informations redondantes qui seront répétés (inclus) dans plusieurs autres pages (il peut s'agir d'un menu, d'une signature, d'une mention légale, ou autre)
- encore plus fort ! il semble possible configurer ainsi le menu de navigation de [[http://www.wikini.net WikiNi]] de cette manière ! dans le fichier wakka.config.php, il suffit d'indiquer :
##"navigation_links" => """{{include page=\"MenuDuHaut\"}}""",##
et de créer dans la page ""MenuDuHaut"" ce que l'on souhaite voir apparaître. Cette page peut être protégée en lecture seule pour tout le monde et en écriture pour les administrateurs fonctionnels.
- elle permet une sorte de syndication en incluant des pages d'un autre __""WikiNi""__.
 
==== Paramètres ====
Cette action accepte deux paramètres :
- page : paramètre obligatoire pour désigner la page à inclure (sans lequel l'action ne fonctionne pas). Ce paramètre peut être une page local au [[http://www.wikini.net WikiNi]] ou une page d'un autre [[http://www.wikini.net WikiNi]].
- class : désignant une ou plusieurs classes de style, séparées par des espaces, agissant sur la mise en forme de l'inclusion ; ce paramètre est optionnel.
 
Actuellement, [[http://www.wikini.net WikiNi]] intègre plusieurs classes prédéfinies pour gérer la mise en forme de l'inclusion :
%%
.include_right { float: right; width: 17%; } /* bloc flotant à droite */
.include_left { float: left; width: 17%; } /* bloc flotant à gauche */
.include_solid_border { border: solid; padding: 2px; } /* encadré noir */
.include_gray_background { background-color: #DDDDDD; } /* fond gris */
.include_small_fonts { font-size: 0.8em; } /* petites polices */
.include_big_fonts { font-size: 1.2em; } /* grandes polces */
.include_height10em { height: 10em; overflow: scroll; } /* boite de 10em de hauteur, avec ascenseur */
.include_height15em { height: 15em; overflow: scroll; }
.include_height30em { height: 30em; overflow: scroll; }
.include_height60em { height: 60em; overflow: scroll; }
%%
 
{{include page="ListeDesActionsWikini" class="right height15em small_fonts solid_border gray_background"}}
Ces classes de style peuvent être employées cumulativement. Ainsi, si l'on souhaite obtenir, par exemple, une boite grise avec une bordure et de petits caractères, on employera :
##""{{include page="ListeDesActionsWikini" class="gray_background solid_border small_fonts"}}""##
L'inclusion par défaut, pour le moment, produit une présentation non différenciée par rapport au reste de la page ; il faut **spécifier** un style (comme en HTML classique), pour le voir appliqué. L'utilisation des classes de style doit faire l'objet d'une attention particulière, certains navigateurs ne supportant que peu ou pas les styles CSS.
La boite ci à droite correspond à l'inclusion suivante : ##""{{include page="ListeDesActionsWikini" class="right height15em small_fonts solid_border gray_background"}}""##
 
Une page ne peut-être inclue dans elle-même : cela provoquerait une boucle récursive infinie : un page affichant une page, affichant une page, affichant une page, etc.
De même, les boucles d'inclusion portant sur plus d'une page, sont impossibles. Prenons par exemple : un page ""Page1"" inclus une page ""Page2"" qui inclus une page ""Page3"" qui inclus la page ""Page1"". Lorsque ont demande à afficher la page ""Page1"", on voit le contenu des pages ""Page1"", ""Page2"" et ""Page3"" et le message d'erreur indiquant qu'il est impossible d'inclure une page dans elle même. En effet, la page "active" est ""Page1"" et le test dans l'action ##""{{include}}""## regarde si le nom de la page inclus est le même que celui de la page active ce qui provoque une erreur car l'inclusion d'autres pages ne change pas la page active.
On verra cet exemple concrètement développé dans WikiNi:ActionIncludeExempleDeBouclePage1 et suivantes.
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/DerniersCommentaires.txt
New file
0,0 → 1,0
{{RecentlyCommented}}
/tags/2014_06_04/wikini/setup/doc/MotWiki.txt
New file
0,0 → 1,0
{{redirect page="NomWiki"}}
/tags/2014_06_04/wikini/setup/doc/IndexDesPages.txt
New file
0,0 → 1,0
{{listpages}}
/tags/2014_06_04/wikini/setup/doc/PagesOrphelines.txt
New file
0,0 → 1,0
{{OrphanedPages}}
/tags/2014_06_04/wikini/setup/doc/DerniersChangements.txt
New file
0,0 → 1,0
{{RecentChanges}}
/tags/2014_06_04/wikini/setup/doc/ActionListPages.txt
New file
0,0 → 1,16
L'action ""{{ListPages}}"" liste la totalité des pages du site.
Pour obtenir la liste des pages du site on pourra voir également l'action [[ActionPageIndex PageIndex]].
 
L'action ""ListPages"" s'utilise avec différents paramètres :
 
- ""{{ListPages}}"" : établi un IndexDesPages, liste de toutes les pages du site dans l'ordre alphabétique de leur nom, avec leur propriétaire (identique à ""{{ListPages/sort}}"" et ""{{ListPages/sort="tag"}}"")
- ""{{ListPages/tree}}"" : établi un PlanDuSite, c'est-à-dire une liste hiérarchique des pages sur trois niveaux à partir de la page d'accueil (cette action ne liste donc pas toutes les pages du site)
- ""{{ListPages/tree="MotWiki"}}"" : établi une liste hiérarchique des pages sur trois niveaux à partir de la page passée en paramètre, ici ""MotWiki"".
- ""{{ListPages/sort}}"" : liste de toutes les pages du site classées par ordre alphabétique (identique à ""{{ListPages}}"" et ""{{ListPages/sort="tag"}}"")
- ""{{ListPages/sort="time"}}"" : liste toutes les pages du site classées par ordre de dernière date de modification
- ""{{ListPages/sort="owner"}}"" : liste de toute les pages du site classées par ordre du nom du propriétaire de la page
- ""{{ListPages/sort="user"}}"" : liste de toutes les pages du site classées par ordre du nom du dernier utilisateur à l'avoir modifiée
- ""{{ListPages/sort="tag"}}"" : liste de toutes les pages du site classées par ordre alphabétique (identique à ""{{ListPages}}"" et ""{{ListPages/sort}}"")
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/setup/doc/ActionListUsers.txt
New file
0,0 → 1,20
==== Liste des comptes utilisateurs ====
 
Cette fonction permet de lister les comptes utilisateurs créés.
La fonction est loin d'être indispensable, mais elle permet, par exemple, de connaître les nouveaux utilisateurs qui se sont inscrits pour des raisons pratiques (paramétrage) mais qui n'ont pas encore renseigné leur page personnelle. Autre exemple, on peut observer le nombre de nouveaux inscrits suite à une promotion du site, etc.
Par défaut, cette fonction donne la liste des comptes par ordre alphabétique. Cette fonction accepte en outre le paramètre "last" permettant le tri des comptes par odre inverse de date de création. Ce dernier paramètre accepte lui-même, de surcroit, un chiffre en paramètre permettant de réduire le nombre comptes affichés. La syntaxe d'utilisation de cette "action" est donnée ci-dessous.
 
""{{Listusers/last}}"" : donne la liste des derniers comptes utilisateurs
{{listusers/last}}
 
""{{Listusers/last="3"}}""
{{listusers/last="3"}}
 
""{{Listusers/last="50"}}""
{{listusers/last="50"}}
 
""{{Listusers}}"" : donne la liste des comptes utilisateurs par ordre alphabétique
{{listusers}}
 
----
{{trail toc="ListeDesActionsWikini"}}
/tags/2014_06_04/wikini/ACeditor.buttonsBar.php
New file
0,0 → 1,43
<?php
$ACbuttonsBar = "
<div id=\"toolbar\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'**','**');\" src=\"ACEdImages/bold.gif\" title=\"Passe le texte sélectionné en gras ( Ctrl-Maj-b )\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'//','//');\" src=\"ACEdImages/italic.gif\" title=\"Passe le texte sélectionné en italique ( Ctrl-Maj-t )\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'__','__');\" src=\"ACEdImages/underline.gif\" title=\"Souligne le texte sélectionné ( Ctrl-Maj-u )\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'@@','@@');\" src=\"ACEdImages/strike.gif\" title=\"Barre le texte sélectionné\">
<img class=\"buttons\" src=\"ACEdImages/separator.gif\" >
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'======','======\\n');\" src=\"ACEdImages/t1.gif\" title=\" En-tête énorme\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'=====','=====\\n');\" src=\"ACEdImages/t2.gif\" title=\" En-tête très gros\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'====','====\\n');\" src=\"ACEdImages/t3.gif\" title=\" En-tête gros\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'===','===\\n');\" src=\"ACEdImages/t4.gif\" title=\" En-tête normal\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'==','==');\" src=\"ACEdImages/t5.gif\" title=\" Petit en-tête\">
<img class=\"buttons\" src=\"ACEdImages/separator.gif\" >
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelectionWithLink(thisForm.body);\" src=\"ACEdImages/link.gif\" title=\"Ajoute un lien au texte sélectionné\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'\\t-&nbsp;','');\" src=\"ACEdImages/listepuce.gif\" title=\"Liste\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'\\t1)&nbsp;','');\" src=\"ACEdImages/listenum.gif\" title=\"Liste numérique\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'\\ta)&nbsp;','');\" src=\"ACEdImages/listealpha.gif\" title=\"Liste alphabéthique\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelectionBis(thisForm.body,'\\n---','');\" src=\"ACEdImages/crlf.gif\" title=\"Insère un retour chariot\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelectionBis(thisForm.body,'\\n------','');\" src=\"ACEdImages/hr.gif\" title=\"Insère une ligne horizontale\">
 
 
<img class=\"buttons\" src=\"ACEdImages/separator.gif\" >
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'%%','%%');\" src=\"ACEdImages/code.gif\" title=\"Code\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelection(thisForm.body,'%%(php)','%%');\" src=\"ACEdImages/php.gif\" title=\"Code PHP\">
</div>
<div id=\"toolbar\">
<img class=\"buttons\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onmousedown=\"mousedown(this);\" onmouseup=\"mouseup(this);\" onclick=\"wrapSelectionWithImage(thisForm.body);\" src=\"ACEdImages/image.gif\" title=\"insère un tag image \">
 
<span class=\"texteChampsImage\">
&nbsp;&nbsp;Fichier&nbsp;<input type=\"text\" name=\"filename\" class=\"ACsearchbox\" size=\"10\">&nbsp;&nbsp;Description&nbsp;<input type=\"text\" name=\"description\" class=\"ACsearchbox\" size=\"10\">
&nbsp;&nbsp;Alignement&nbsp;<select id=\"alignment\" class=\"ACsearchbox\">
<option value=\"left\">Gauche</option>
<option value=\"center\">Centré</option>
<option value=\"right\">Droite</option>
</select>
</span>
</div>";
?>
/tags/2014_06_04/wikini/files/vide.txt
--- tags/2014_06_04/wikini/ACeditor.js (revision 0)
+++ tags/2014_06_04/wikini/ACeditor.js (revision 430)
@@ -0,0 +1,124 @@
+
+ /*
+ written by chris wetherell
+ http://www.massless.org
+ chris [THE AT SIGN] massless.org
+ warning: it only works for IE4+/Win and Moz1.1+
+ feel free to take it for your site
+ if there are any problems, let chris know.
+ */
+
+
+ var ACEditor; /* make sure to change the onload handler of the
+ <body> tag to the form you're using!... */
+
+ function mozWrap(txtarea, lft, rgt) {
+ var selLength = txtarea.textLength;
+ var selStart = txtarea.selectionStart;
+ var selEnd = txtarea.selectionEnd;
+ if (selEnd==1 || selEnd==2) selEnd=selLength;
+ var s1 = (txtarea.value).substring(0,selStart);
+ var s2 = (txtarea.value).substring(selStart, selEnd)
+ var s3 = (txtarea.value).substring(selEnd, selLength);
+ txtarea.value = s1 + lft + s2 + rgt + s3;
+ }
+
+ function IEWrap(lft, rgt) {
+ strSelection = document.selection.createRange().text;
+ if (strSelection!="") {
+ document.selection.createRange().text = lft + strSelection + rgt;
+ }
+ }
+ // Cette fonction permet de faire fonctionner l'insertion de tag image dans un textarea de IE sans sélection initiale,
+ // à la position du curseur
+
+ function IEWrap2(txtarea,lft, rgt) {
+ txtarea.focus();
+ if (document.selection) {
+ txtarea.focus();
+ sel = document.selection.createRange();
+ sel.text = lft+rgt;
+ }
+ }
+
+ function wrapSelection(txtarea, lft, rgt) {
+ if (document.all) {IEWrap(lft, rgt);}
+ else if (document.getElementById) {mozWrap(txtarea, lft, rgt);}
+ }
+
+ function wrapSelectionBis(txtarea, lft, rgt) {
+ // pareil que la wrapSelection, avec une différence dans IE
+ // qui permet à wrapSelectionBis de pouvoir insérer à l'endroit du curseur même sans avoir sélectionné des caractères !!!
+ // Pour mozilla, c'est bien la fonction Wrap standard qui est appelée, aucun changement
+
+ if (document.all) { // document.all est une infamie de IE, on détecte cette horreur !
+ IEWrap2(txtarea,lft, rgt); // Attention, un parametre de plus que IEWrap
+ } else if (document.getElementById) {
+ mozWrap(txtarea, lft, rgt); // là on est chez les gentils
+ }
+ }
+
+ function wrapSelectionWithLink(txtarea) {
+ var my_link = prompt("Entrez l'URL: ","http://");
+ if (my_link != null) {
+ lft="[[" + my_link + " ";
+ rgt="]]";
+ wrapSelection(txtarea, lft, rgt);
+ }
+ return;
+ }
+ /* Aaaxl modif for ACeditor */
+ function wrapSelectionWithImage(txtarea) {
+ nom = document.ACEditor.filename.value;
+ descript = document.ACEditor.description.value;
+ align = document.ACEditor.alignment.value;
+
+ lft= " {{attach file=\"" + nom + "\" desc=\"" + descript + "\" class=\"" + align + "\" }} ";
+ rgt = "";
+ wrapSelectionBis(txtarea, lft, rgt);
+ return;
+ }
+
+ document.onkeypress = function (e) {
+ if (document.all) {
+ key=event.keyCode; txtarea=thisForm.body;
+ if (key == 1) wrapSelectionWithLink(txtarea);
+ if (key == 2) wrapSelection(txtarea,'**','**');
+ if (key == 20) wrapSelection(txtarea,'//','//');
+ }
+ else if (document.getElementById) {
+ ctrl=e.ctrlKey; shft=e.shiftKey; chr=e.charCode;
+ if (ctrl) if (shft) if (chr==65) wrapSelectionWithLink(thisForm.body);
+ if (ctrl) if (shft) if (chr==66) wrapSelection(thisForm.body,'**','**');
+ if (ctrl) if (shft) if (chr==84) wrapSelection(thisForm.body,'//','//');
+ //if (ctrl) if (shft) if (chr==85) wrapSelection(thisForm.body,'__','__');
+ }
+ return true;
+ }
+ /* end chris w. script */
+
+
+
+ /*
+ written by meg hourihan
+ http://www.megnut.com
+ meg@megnut.com
+
+ warning: it only works for IE4+/Win and Moz1.1+
+ feel free to take it for your site
+ but leave this text in place.
+ any problems, let meg know.
+ */
+ function mouseover(el) {
+ el.className = "raise";
+ }
+ function mouseout(el) {
+ el.className = "buttons";
+ }
+ function mousedown(el) {
+ el.className = "press";
+ }
+ function mouseup(el) {
+ el.className = "raise";
+ }
+ /* end meg script */
/tags/2014_06_04/wikini/wakka.basic.css
New file
0,0 → 1,56
body { background-color: #F5F5F5; color: black; font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; }
 
a { color: #993333; }
 
body, p, td, li, input, select, textarea { font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; font-size: 13px; }
h1, h2, h3, h4, h5 { margin: 0px; padding: 0px; }
ul { margin-top: 0px; padding-top: 0px; padding-bottom: 0px; }
ol { margin-top: 0px; padding-top: 0px; padding-bottom: 0px; }
form { margin: 0px; padding: 0px; }
tt { color: Navy; }
 
 
.error { color: #CC3333; font-weight: bold; }
.indent { margin-left: 40px; }
.additions { color: #008800; }
.deletions { color: #880000; }
.add { font-weight: bold; color:#c00; text-decoration: underline; }
.del { font-style: italic; color:#c00; text-decoration: line-through; }
.header { padding: 10px; padding-top: 0px; }
.page { background-color: #FFFFFF; padding: 10px; border: 1px inset; }
.prev_alert { background-color: red; color: white; font-size: 1.7em; font-weight: bold; margin-bottom: 5px; }
.edit { width: 100%; height: 400px; }
.footer { background-color: #DDDDDD;padding: 5px; border: 1px inset }
.code { background: #FFFFFF; border: solid #888888 2px; font-family: 'Courier New', Courier; color: black; font-size: 10pt; width: 100%; overflow: scroll; padding: 3px; }
.revisioninfo { color: #AAAAAA; padding-bottom: 20px; }
 
.commentsheader { background-color: #DDDDDD; padding: 2px 10px; }
.comment { background-color: #EEEEEE; padding: 10px; }
.commentinfo { color: #AAAAAA; }
.commentform { background-color: #EEEEEE; padding: 10px; }
 
.copyright { font-size: 11px; color: #AAAAAA; text-align: right; }
.copyright A { color: #AAAAAA; }
.searchbox { background: #FFFFF8; border: 0px; padding: 0px; margin: 0px; }
.debug { font-size: 11px; color: #888888; }
 
/* CONTRIBUTION MENU GAUCHE */
.page_table {margin: 0px; padding: 0px ; border: none; height: 100%;width: 100%;}
.menu_column {background-color: #FFFFCC; vertical-align: top; width: 150px; border: 1px solid #000000;padding:5px;}
.body_column {vertical-align: top; border: none;padding:5px;}
 
/* CONTRIBUTION ACTION ATTACH */
/* - les images */
.attach_margin05em { margin: 0.5em;} /* marge de 0.5 em autour de l'image*/
.attach_margin1em { margin: 1em;} /* marge de 1em autour de l'image*/
.attach_left {float: left;} /* bloc flotant à gauche */
.attach_right {float: right;} /* bloc flotant à droite */
.attach_noborder {border-width: 0px;} /* pas de bordure */
.attach_vmiddle {vertical-align: text-bottom;} /* aligenement vertical au milieu */
/* - le gestionnaire des uploads */
.tableFM {border: thin solid Black; width: 100%; }
.tableFM THEAD { background-color: Silver; font-weight: bold; text-align: center; }
.tableFM TFOOT { background-color: Silver; font-weight: bold; text-align: left; }
.tableFM TBODY TR { text-align: center; }
.tableFMCol1 { background-color: Aqua; }
.tableFMCol2 { background-color: Yellow; }
/tags/2014_06_04/wikini/INSTALL
New file
0,0 → 1,25
Wakka / Wikini Installation
 
 
Not much to it (as long as it works, ahem). Unpack/upload the distribution files
into a directory that can be accessed via the web. Then go to the corresponding URL.
A web-based installer will walk you through the rest.
 
Example:
 
If your website, say, http://www.mysite.com, is mapped to the directory /home/jdoe/www/,
and you place the Wakka distribution files into /home/jdoe/www/wakka/, you should go to
http://www.mysite.com/wakka/.
 
Note that Wakka distributions normally unpack into directories that include the version
in their name; you'll probably want to rename those to just "wakka" -- or, if you're
on a unixoid system, set up a symbolic link.
 
IMPORTANT: for installing or upgrading Wakka, do NOT access any of the files contained
in the setup/ subdirectory. They're used by the web-based installer/updater, but you
should really just access the Wakka directory itself, and it will (or at least should)
work perfectly.
 
Detailed instructions are available at <http://www.wakkawiki.com/WakkaInstallation>.
 
- Hendrik Mans <hendrik@mans.de>
/tags/2014_06_04/wikini/COPYING
New file
0,0 → 1,340
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
 
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
 
Preamble
 
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
 
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
 
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
 
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
 
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
 
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
 
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
 
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
 
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
 
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
 
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
 
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
 
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
 
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
 
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
 
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
 
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
 
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
 
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
 
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
 
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
 
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
 
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
 
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
 
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
 
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
 
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
 
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
 
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
 
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
 
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
 
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
 
NO WARRANTY
 
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
 
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
 
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
 
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
 
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
 
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
 
This program 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.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 
Also add information on how to contact you by electronic and paper mail.
 
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
 
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
 
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
 
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
 
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
 
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
 
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
/tags/2014_06_04/wikini/bibliotheque/documents/vide.txt
/tags/2014_06_04/wikini/wakka.print.css
New file
0,0 → 1,75
* {margin: 0; padding: 0;}
p, td, li, input, select, textarea{ font-family:Georgia, Helvetica, Verdana, sans-serif;font-size:12px;color:#000;}
body {font-family:Georgia, Helvetica, Verdana, sans-serif;font-size:12px;color:#000;background: transparent;}
h1 {font-size:16px;font-weight:bold;padding:5px;}
h2 {font-size:14px;color:black;font-weight:bold;}
h3 {font-size:12px;color:black;font-weight:bold;}
h4 {font-size:12px;color:black;}
h5 {font-size:12px;color:black;}
hr {border: 1px solid;color:black;margin-top:5px;}
img {display:block;border:0;}
img a {display:block;}
a {color:#669;text-decoration:none;}
.wiki_name { display:none; float: left; padding-left: 60px; margin: 0px 15px 0px 10px; font-size: 150%; font-weight: bold; background-color: transparent; color: black;}
.page_name { display:none; font-size: 150%; background-color: transparent;}
.header { display:none; padding: 10px; padding-top: 5px; padding-left: 75px;}
ul { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 10px;}
ol { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; }
form { margin: 0px; padding: 0px; }
tt {color: black; }
.error { display:none;color: #CC3333; font-weight: bold; }
.indent { margin-left: 40px; }
.additions { display:none;color: #008800; }
.deletions { display:none;color: #880000; }
.add { display:none;font-weight: bold; color: #c00; text-decoration: underline; }
.del { display:none;font-style: italic; color: #c00; text-decoration: line-through; }
.page { padding: 10px; margin:10px;border: 0px inset;}
.prev_alert { display:none;background-color: red; color: white; font-size: 1.7em; font-weight: bold; margin-bottom: 5px; }
.edit { width: 100%; height: 400px; }
.footer { display:none;background-color: #DDDDDD; padding: 5px 10px; border: 1px inset; border-top: none; border-top: 1px solid #CCCCCC }
.code { background: #FFFFFF; border: solid #888888 2px; font-family: 'Courier New', Courier; color: black; font-size: 10pt; width: 100%; height: 400px; overflow: scroll; padding: 3px; }
.revisioninfo { color: #AAAAAA; padding-bottom: 20px; }
.commentsheader { display:none;background-color: #DDDDDD; padding: 2px 10px; border-left: 1px inset; border-right: 1px inset; border-top: 1px solid #CCCCCC }
.comment { display:none;background-color: #EEEEEE; padding: 10px; border-left: 1px inset; border-right: 1px inset; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #EEEEEE; }
.commentinfo { display:none;color: #AAAAAA; }
.commentform { background-color: #EEEEEE; padding: 10px; border-left: 1px inset; border-right: 1px inset; border-top: 1px solid #CCCCCC }
.copyright { display:none;font-size: 11px; color: #AAAAAA; text-align: right; }
.copyright A { display:none;color: #AAAAAA; }
.searchbox { display:none;background: #FFFFF8; border: 0px; border-bottom: 1px solid #CCCCAA; padding: 0px; margin: 0px; }
.debug { display:none;font-size: 11px; color: #888888; }
.hr_clear { clear: both; visibility: hidden; }
.include_right { float: right; width: 17%; } /* bloc flotant à droite */
.include_left { float: left; width: 17%; } /* bloc flotant à gauche */
.include_solid_border { border: solid; padding: 2px; } /* encadré noir */
.include_gray_background { background-color: #DDDDDD; } /* fond gris */
.include_small_fonts { font-size: 0.8em; } /* petites polices */
.include_big_fonts { font-size: 1.2em; } /* grandes polces */
.include_height10em { height: 10em; overflow: scroll; } /* boite de 10em de hauteur, avec ascenseur */
.include_height15em { height: 15em; overflow: scroll; }
.include_height30em { height: 30em; overflow: scroll; }
.include_height60em { height: 60em; overflow: scroll; }
.trail_table { line-height: 30px;}
.trail_button { color: #993333; }
 
/* CONTRIBUTION MENU GAUCHE */
.page_table {margin: 20px; padding: 0px ; border: none; height: 100%;width: 100%;}
.menu_column { display:none;vertical-align: top; width: 210px; border: 0px; padding:5px; margin-top: 50px; }
.body_column {vertical-align: top; border: none;padding:5px;}
 
/* CONTRIBUTION ACTION ATTACH */
/* - les images */
.attach_margin05em { margin: 0.5em;} /* marge de 0.5 em autour de l'image*/
.attach_margin1em { margin: 1em;} /* marge de 1em autour de l'image*/
.attach_left {float: left;} /* bloc flotant à gauche */
.attach_right {float: right;} /* bloc flotant à droite */
.attach_noborder {border-width: 0px;} /* pas de bordure */
.attach_vmiddle {vertical-align: text-bottom;} /* aligenement vertical au milieu */
 
 
 
/* CONTRIBUTION ACeditor */
.image_left {float: left;} /* bloc flotant à  gauche */
.image_right {float: right;} /* bloc flotant à  droite */
.image_center {text-align:center;} /* bloc centré */
 
 
/tags/2014_06_04/projet.css
New file
0,0 → 1,440
/*
+----------------------------------------------------------------------------+
| projets.css |
+----------------------------------------------------------------------------+
| Copyright (c) 2008 Tela Botanica |
+----------------------------------------------------------------------------+
| Feuille de style specifique a l'application projet de Tela Botanica |
+----------------------------------------------------------------------------+
| Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
+----------------------------------------------------------------------------+
*/
 
.table_cadre {
line-height : 18px;
}
 
.information_projet {
float:right;
width:250px;
text-align:left;
max-width: 800px;
position : relative;
left : -3px;
}
 
 
.information_projet ul {
margin-top : 10px;
}
 
.information_projet li {
margin-left: 20px;
}
 
#texte {
max-width:850px;
}
.liste_projet li {
padding:8px;
list-style-type:none;
 
}
 
.liste_projet h3 {
margin: 10px 0 0;
}
#precedent, #suivant {
border:1px solid black;
padding: 3px 4px 3px 4px;
margin: 3px;
background-image: none;
}
 
#precedent a, #suivant a {
text-decoration:none;
background-image:none;
}
#precedent:before {content: "<< ";}
#suivant:after {content: " >>";}
.nombre_message {
font-size:14px;
color: #ad5a40;
}
 
#precedent:hover, #suivant:hover {background-color:#eddbd6;}
#bouton_repondre {float:none;display:inline;}
.mois {background-color:#DFDFDF;padding:3px;
text-align:center;}
#petit_calendrier table {border:1px solid black;}
#petit_calendrier th {background-color:#C2C0AD;color:white;padding:2px;}
.col_annee {font-weight:bold;}
.liste_projet li:hover {
background-color:#F5F5F5;
}
.liste_projet a, .liste_projet h1 {
background-color:transparent;
}
 
.liste_projet li {
list-style-image: none !important;
}
 
ul.liste_projet {max-width:700px;margin-left:0px;padding-left:0px;}
.liste_projet h1{font-size:15px;padding-top:0px;margin-top:0px}
.projet_activite_elevee {color:red;}
.projet_activite_moyenne {color:green;}
.projet_activite_faible {color:blue;}
 
#projet_theme {
margin-left: 20px;
}
 
#projet_theme h1{
background:none;
color:black;
}
.pager {
width:100%;max-width:600px;
text-align:center;
margin:10px 0 10px 0;
}
 
.pager .page_courante, .pager a {
border:1px solid black;
padding:3px 4px 3px 4px;
margin:3px;
background-image:none;
}
.pager .page_courante {
background-color:#eddbd6;
background-image:none;
}
.pager a:hover {
background-color:#eddbd6;
background-image:none;
}
 
.projet_recherche {
margin-bottom:5px;
}
.projet_recherche fieldset {border:0px;}
.notes input {
border:1px solid #ad5a40;
background-color:#eddbd6;
}
#projet_recherche_submit {
text-align:center;
margin:5px;
}
 
#projet_range {display:inline;}
#projet_choix_mode {display:inline;width:100%;text-align:right;}
#projet_range .nombre {font-weight:bold;}
#cartouche_liste_projet {width:100;margin-left:40px;padding:8px;}
 
table.table_cadre {display:block;max-width:800px;}
.table_cadre a.tri_bas {
background: url("/client/projet/images/icon_sort_dwn.gif") no-repeat left;
padding: 0 0 0 10px;
color:white;
}
.table_cadre a.tri_haut {
background: url("/client/projet/images/icon_sort_up.gif") no-repeat left;
padding: 0 0 0 10px;
color:white;
}
.table_cadre a.tri_sans {
background: url("/client/projet/images/icon_sort.gif") no-repeat left;
padding: 0 0 0 10px;
color:white;
}
 
#table_projet {max-width:100%;width:100%}
 
#projet_bloc_action {
border:0px solid black;
margin:0 0 10px 0px;
width:100%;
max-width:680px;
}
#projet_bloc_action img {
float:left;
}
 
#projet_bloc_action h2 {
clear:none;
}
#projet_lien_inscription {
height:45px;
width:280px;
padding:0 5px 0 0;margin:0;
border:1px solid black;
text-decoration:none;
display:block;
float:left;
background-color:#ede7d8;
overflow:hidden;
}
#projet_lien_inscription a {
padding:0;
width:100%;
display:block;
float:left;
text-decoration:none;
color:black;
background-image:none;
}
 
 
#projet_ou {
text-align:center;
float:left;
width:80px;
font:bold 17px arial;
color:#ad5a40;
margin:20px 50px 10px 50px;
}
 
 
#projet_lien_inscription:hover, #projet_lien_login:hover {background-color:darkgrey;}
 
#projet_lien_login {
background-color:#ede7d8;
width:220px;
height:45px;
margin:0;
overflow:hidden;
border:1px solid black;
float:right;
}
 
#projet_lien_login a {
cursor:pointer;
padding:0;
width:250px;
display:block;
text-decoration:none;
background-image: none;
float:left;
}
#projet_bloc_inscription {
width:265px;
margin-top:10px;
background-color:#ede7d8;
border:1px solid black;
padding:10px;
}
#projet_bloc_inscription span, #projet_lien_inscription span {
margin:12px 0 0 10px;
font:bold 15px Arial, sans-serif;
display:block;
float:left;
color:black;
}
 
#projet_bloc_inscription p {
margin:0;
font:normal 13px/15px Arial;
}
 
#projet_bloc_inscription form {
margin:25px 0 0 0;
font-weight:bold;
}
#projet_bloc_inscription label {
font-weight:normal;
}
#projet_bloc_inscription input {
display:block;
margin-bottom:6px;
width:85%;
}
#projet_bloc_inscription input[type="submit"] {
width:35px;margin:auto;
text-align:center;
}
#projet_bloc_inscription input[type="checkbox"] {
width:15px;
float:left;
}
 
#projet_bloc_inscription:hover {
}
 
 
#laius_inscription {
color:#005500;
font-weight:bold;
line-height:5px;
}
 
#form_connexion2 fieldset {border:0;margin:0;padding:0;}
#form_connexion2 legend {display:none;}
#persistant2 {width:10px;}
/** Les petits bouton */
.projet_bouton_action {
}
.projet_bouton_action:hover {
background-color:#c38673;
}
.projet_bouton_action a {
display:block;
float:left;
margin:0 7px 0 0;
background-color:#f5f5f5;
border:1px solid #dedede;
border-top:1px solid #eee;
border-left:1px solid #eee;
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
font-size:100%;
line-height:130%;
text-decoration:none;
font-weight:bold;
color:#565656;
cursor:pointer;
padding:5px 10px 6px 7px; /* Links */
background-image:none;
margin-bottom:10px;
}
 
 
.projet_bouton_inline {display:inline;}
 
.projet_bouton_inline a {
display:inline;
 
margin:0 7px 0 0;
background-color:#f5f5f5;
border:1px solid #dedede;
border-top:1px solid #eee;
border-left:1px solid #eee;
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
font-size:100%;
line-height:130%;
text-decoration:none;
font-weight:bold;
color:#565656;
cursor:pointer;
padding:5px 10px 6px 7px; /* Links */
background-image:none;
 
}
#lien_inscription2 {display:none !important;}
 
.projet_bouton_action a img, .projet_bouton_inline a img {
margin:0 3px -3px 0 !important;
padding:0;
border:none;
width:16px;
height:16px;
}
.projet_bouton_action a:hover, .projet_bouton_inline a:hover{
background-color:#dff4ff;
border:1px solid #c2e1ef;
color:#336699;
}
 
.projet_bouton_action a:active{
background-color:#6299c5;
border:1px solid #6299c5;
color:#fff;
}
 
/** Menus de projets **/
.menu_projet li {
background: none;
margin-left:15px;
}
 
.menu_projet > li {
list-style-image: none !important;
}
 
/* Onglets */
 
.onglets {
}
 
.onglets li {
list-style-image : none;
}
 
.onglets li:hover {
color:#AD5A40
}
 
.onglets li:hover a {
color:#AD5A40;
}
.onglets .menu_inactif {
border-bottom:#62210F;
}
.onglets .menu_actif {
background-color: #C2C0AD;
}
 
.onglets .menu_actif a {
color:#C2C0AD;
}
 
/*Tableau*/
 
.table_cadre {
border: 1px solid #C2C0AD;
}
 
.table_cadre th{
background-color:#A89D80;
padding:0 5px;
color:white;}
.table_cadre a {
color:black !important;}
.table_cadre tr {
height: 30px;
}
 
.table_cadre td {
padding-left:5px;
padding-right:5px;
}
.ligne_paire {
padding-top: 2px;
background-color:#C2C0AD;
}
 
.page li {
list-style-image: none !important;
margin-left: 30px;
}
 
/** Wikini **/
 
#wikini_page {
border-color: #A89D80;
}
 
#toolbar, .buttons {
background: #A89D80 !important;
}
 
.edit {
border-color: #A89D80 !important;
}
 
/** Message **/
.message pre {
white-space: pre-wrap;
}
 
/tags/2014_06_04/fichiers/vide.txt
--- tags/2014_06_04/classes/gestion_wikini05.class.php (revision 0)
+++ tags/2014_06_04/classes/gestion_wikini05.class.php (revision 430)
@@ -0,0 +1,207 @@
+<?php
+/*vim: set expandtab tabstop=4 shiftwidth=4: */
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 4.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This library is free software; you can redistribute it and/or |
+// | modify it under the terms of the GNU General Public |
+// | License as published by the Free Software Foundation; either |
+// | version 2.1 of the License, or (at your option) any later version. |
+// | |
+// | This library is distributed in the hope that it will be useful, |
+// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public |
+// | License along with this library; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id: gestion_wikini.class.php,v 1.2 2005-09-27 16:38:54 alexandre_tb Exp $
+/**
+* Application projet
+*
+* La classe gestion_wikini
+*
+*@package projet
+//Auteur original :
+*@author Alexandre Granier <alexandre@tela-botanica.org>
+//Autres auteurs :
+*@author Aucun
+*@copyright Tela-Botanica 2000-2004
+*@version $Revision: 1.2 $
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+
+// +------------------------------------------------------------------------------------------------------+
+// | ENTETE du PROGRAMME |
+// +------------------------------------------------------------------------------------------------------+
+
+
+/**
+ * class gestion_wikini
+ *
+ */
+class gestion_wikini
+{
+
+ /*** Attributes: ***/
+
+ /**
+ * Un objet PEAR::DB
+ * @access private
+ */
+ var $_db;
+
+ /**
+ * Constructeur
+ *
+ * @param DB objetDB Une référence vers un objet PEAR:DB
+ * @return void
+ * @access public
+ */
+ function gestion_wikini( &$objetDB )
+ {
+ $this->_db = $objetDB ;
+ } // end of member function gestion_wikini
+
+ /**
+ *
+ *
+ * @param string prefixe Le préfixe des tables.
+ * @return void
+ * @access public
+ */
+ function creation_tables( $prefixe )
+ {
+
+ $prefixe .= '_' ;
+
+ $this->_db->query(
+ "CREATE TABLE ".$prefixe."pages (".
+ "id int(10) unsigned NOT NULL auto_increment,".
+ "tag varchar(50) NOT NULL default '',".
+ "time datetime NOT NULL default '0000-00-00 00:00:00',".
+ "body text NOT NULL,".
+ "body_r text NOT NULL,".
+ "owner varchar(50) NOT NULL default '',".
+ "user varchar(50) NOT NULL default '',".
+ "latest enum('Y','N') NOT NULL default 'N',".
+ "handler varchar(30) NOT NULL default 'page',".
+ "comment_on varchar(50) NOT NULL default '',".
+ "PRIMARY KEY (id),".
+ "FULLTEXT KEY tag (tag,body),".
+ "KEY idx_tag (tag),".
+ "KEY idx_time (time),".
+ "KEY idx_latest (latest),".
+ "KEY idx_comment_on (comment_on)".
+ ") TYPE=MyISAM;");
+ $this->_db->query(
+ "CREATE TABLE ".$prefixe."acls (".
+ "page_tag varchar(50) NOT NULL default '',".
+ "privilege varchar(20) NOT NULL default '',".
+ "list text NOT NULL,".
+ "PRIMARY KEY (page_tag,privilege)".
+ ") TYPE=MyISAM");
+
+ $this->_db->query(
+ "CREATE TABLE ".$prefixe."links (".
+ "from_tag char(50) NOT NULL default '',".
+ "to_tag char(50) NOT NULL default '',".
+ "UNIQUE KEY from_tag (from_tag,to_tag),".
+ "KEY idx_from (from_tag),".
+ "KEY idx_to (to_tag)".
+ ") TYPE=MyISAM");
+
+ $this->_db->query(
+ "CREATE TABLE ".$prefixe."referrers (".
+ "page_tag char(50) NOT NULL default '',".
+ "referrer char(150) NOT NULL default '',".
+ "time datetime NOT NULL default '0000-00-00 00:00:00',".
+ "KEY idx_page_tag (page_tag),".
+ "KEY idx_time (time)".
+ ") TYPE=MyISAM");
+
+ $this->_db->query(
+ "CREATE TABLE ".$prefixe."users (".
+ "name varchar(80) NOT NULL default '',".
+ "password varchar(32) NOT NULL default '',".
+ "email varchar(50) NOT NULL default '',".
+ "motto text NOT NULL,".
+ "revisioncount int(10) unsigned NOT NULL default '20',".
+ "changescount int(10) unsigned NOT NULL default '50',".
+ "doubleclickedit enum('Y','N') NOT NULL default 'Y',".
+ "signuptime datetime NOT NULL default '0000-00-00 00:00:00',".
+ "show_comments enum('Y','N') NOT NULL default 'N',".
+ "PRIMARY KEY (name),".
+ "KEY idx_name (name),".
+ "KEY idx_signuptime (signuptime)".
+ ") TYPE=MyISAM");
+
+ $this->_db->query(
+ 'CREATE TABLE `' .$prefixe. 'triples` (' .
+ ' `id` int(10) unsigned NOT NULL auto_increment,' .
+ ' `resource` varchar(255) NOT NULL default \'\',' .
+ ' `property` varchar(255) NOT NULL default \'\',' .
+ ' `value` text NOT NULL default \'\',' .
+ ' PRIMARY KEY (`id`),' .
+ ' KEY `resource` (`resource`),' .
+ ' KEY `property` (`property`)' .
+ ') TYPE=MyISAM');
+
+ // que fait on pour le compte admin ?
+ // c'est moche alors on l'externalisera dans une variable de conf
+ $this->_db->query(
+ "insert into ".$prefixe."users set ".
+ "signuptime = now(), ".
+ "name = '".mysql_escape_string('AdminWiki')."', ".
+ "email = '".mysql_escape_string('accueil@tela-botanica.org')."', ".
+ "password = md5('".mysql_escape_string('wqa&WQA1')."')");
+
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'PagePrincipale', body = '".mysql_escape_string("====== Bienvenue ! sur le Wikini de ce groupe de travail ======\nEnfin, vous pourrez cliquer sur le lien \"Editer cette page\" au bas de la page pour rédiger.\n\n----\n\n\n\n\n\n\n----\n===== Pages utiles =====\n -[[TableauDeBord Tableau de bord de ce Wikini]]\n -[[ReglesDeFormatage Règles de formatage]]\n -[[BacASable Bac à sable]]")."', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'DerniersChangementsPages', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n{{RecentChanges}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'DernierChangementCommentaires', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n{{RecentlyCommented}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'ParametresUtilisateur', body = '** Retour : ** [[PagePrincipale page principale]]\n----\n** Note : ** L\'idéal pour la création d\'un nom Wiki est d\'accoler son prénom et son nom de cette façon : \"PrenomNom\". \n----\n==== Mes paramètres ====\n\n{{UserSettingsCommon}}\n\n----\n==== Voir ma participation à ce Wikini ====\n\n [[MesPagesModifier Voir les pages que j\'ai modifiées ]]\n\n [[MesPagesCreer Voir les pages que j\'ai créées ]]', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'PagesACreer', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des pages à créer : ===\n\n{{WantedPages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'PagesOrphelines', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des pages orphelines ===\n\n{{OrphanedPages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'RechercheTexte', body = '** Retour : ** [[PagePrincipale Page principale]] > [[TableauDeBord Tableau de bord]]\n----\n{{TextSearch}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'ReglesDeFormatage', body = '** Retour : ** [[PagePrincipale Page principale]]\n----\n====== Guide des règles de formatage ======\n\nLes règles de formatage avec Wakka diffèrent légèrement des autres Wikis. (Voir par exemple [[http://c2.com/cgi/wiki?TextFormattingRules les règles de formatage de WikiWikiWeb]], le premier Wiki connu.)\nTout texte placé entre deux guillemets doubles - \" - est présenté tel que.\n\nVous pouvez effectuer vos propres tests dans le BacASable : c\'est un endroit fait pour ça.\n\n=== Règles de base : ===\n \"\"**Texte en gras !** -----\"\"> **Texte en gras !**\n \"\"//Texte en italique.// -----\"\"> //Texte en italique.//\n \"\"Texte __souligné__ ! -----\"\"> Texte __souligné__ !\n \"\"##texte à espacement fixe## -----\"\"> ##texte à espacement fixe##\n \"\"%%code%%\"\"\n \"\"%%(php) PHP code%%\"\"\n\n=== Liens forcés : ===\n \"\"[[http://www.mon-site.org]]\"\"\n \"\"[[http://www.mon-site.org Mon-site]]\"\"\n \"\"[[P2P]]\"\"\n \"\"[[P2P Page sur le P2P]]\"\"\n\n=== Liens dans Wikini ===\n Pour réaliser un lien dans wikini qui apparaisse avec un style normal utilisez cette écriture :\n \"\"[[ReglesDeFormatage Règles de Formatage]]\"\"\n Le lien apparaîtra de cette manière [[ReglesDeFormatage Règles de Formatage]].\n\n=== En-têtes : ===\n \"\"====== En-tête énorme ======\"\" ====== En-tête énorme ======\n \"\"===== En-tête très gros =====\"\" ===== En-tête très gros =====\n \"\"==== En-tête gros ====\"\" ==== En-tête gros ====\n \"\"=== En-tête normal ===\"\" === En-tête normal ===\n \"\"== Petit en-tête ==\"\" == Petit en-tête ==\n\n=== Séparateur horizontal : ===\n \"\"----\"\"\n\n=== Retour de ligne forcé : ===\n \"\"---\"\"\n=== Indentation : ===\nL\'indentation de textes se fait avec la touche \"TAB\". Vous pouvez aussi créer des listes à puces ou numérotées :\n \"\"- liste à puce\"\"\n \"\"1) liste numérotée (chiffres arabes)\"\"\n \"\"A) liste numérotée (capitales alphabétiques)\"\"\n \"\"a) liste numérotée (minuscules alphabétiques)\"\"\n \"\"i) liste numérotée (chiffres romains)\"\"\n\n=== Inclure une image ===\n\n - Pour inclure un lien sur une image (sans l\'inclure à la page):\n \"\"[[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\"\"(ne pas indiquer de texte alternatif).\n Ce qui donne : [[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\n\n - Pour inclure une image sans indiquer de texte alternatif :\n \"\"[[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\"\"(laisser 3 espaces blancs avant la fermeture des crochets).\n Ce qui donne quand l\'image est trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\n Quand l\'image n\'est pas trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/table.gif]]\n\n - Pour inclure une image en indiquant un texte alternatif :\n \"\"[[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif une puce ]]\"\"\n Ce qui donne quand l\'image est trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif une puce ]]\n Quand l\'image n\'est pas trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/table.gif une puce ]]\n\n//Note :// le texte alternatif est affiché à la place de l\'image s\'il y a une erreur lors de l\'affichage de celle-ci.\n\n=== Outils avancés : ===\n\n \"\"{{Backlinks}}\"\" permet de créer un lien vers la page précédente. \n \"\"{{Listusers}}\"\" affiche la liste des utilisateurs du site wikini.\n \"\"{{OrphanedPages}}\"\" affiche les pages orphelines du site wikini.\n \"\"{{ListPages/tree}}\"\" affiche le plan du site wikini.\n \"\"{{pageindex}}\"\" affiche un index des pages du site classées par lettres alphabétiques.\n \"\"{{ListPages}}\"\" affiche un index des pages du site avec le nom de leur propriétaire.\n \"\"{{WantedPages}}\"\" affiche la liste des pages restant à créer. Elles apparaissent dans le site avec un ? à la suite de leur nom.\n \"\"{{RecentChanges}}\"\" affiche la liste des sites faisant référence au site wikini.\n \"\"{{RecentlyCommented}}\"\" affichage de la liste des derniers commentaires.\n \"\"{{TextSearch}}\"\" recherche de texte dans les pages du site.\n\n**Note :** à cause d\'un [[http://bugzilla.mozilla.org/show_bug.cgi?id=10547 bogue dans son moteur de rendu]], les listes, utilisant la touche TAB, ne fonctionnent pas (encore) sous Mozilla.\nUne astuce consiste à réaliser une tabulation dans un éditeur de texte puis de la copier. On peut ensuite coller la tabulation dans la zone de saisie de Wikini.\nVous pouvez également indenter du texte en utilisant des caractères espace au lieu de la touche \"TAB\", les exemples ci-dessus restent valables mais attention à ne pas mélanger des \"TAB\" et des espaces dans la même énumération.\n\n---', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'ListeUtilisateurs', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des utilisateurs ===\n\n... du premier au dernier.\n\n{{Listuserscommon}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'ListeUtilisateursInverse', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des utilisateurs ===\n\n... du dernier au premier.\n\n{{Listuserscommon/last}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'PlanDuSite', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Plan du site : ===\n\n{{ListPages/tree}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'IndexDesPages', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Liste des pages : ===\n\n{{ListPages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'IndexDesPagesAlphabet', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Liste des pages par ordre alphabétique : ===\n\n{{pageindex}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'DerniersChangementsRSS', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\nCette page renvoie au fils RSS des derniers changement. Pour savoir comment l\'utiliser voir la page \"\"<a href=\"http://www.wikini.net/wakka.php?wiki=WikiniEtLesFluxRSS\" target=\"_blank\" title=\"Wikini et les flux RSS\">Wikini et les flux RSS</a>\"\".\n\n\"\"<!--\n\n{{recentchangesrss/link=\"DerniersChangements\"}}\n\n-->\"\"', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'ListeInterWiki', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Liste des distributions wiki : ===\n\n{{interwikilist}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'BacASable', body = '** Retour : ** [[PagePrincipale Page pincipale]]\n----\nUtilisez cette page pour faire vos tests !', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'MesPagesModifier', body = '**Retour : ** [[ParametresUtilisateur mes paramètres ]]\n----\n{{mychanges}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'TableauDeBord', body = '** Retour : ** [[PagePrincipale Page Principale]]\n----\n===== Tableau de bord =====\n\n - Listes des utilisateurs : [[ListeUtilisateurs par ordre de création ]] ou [[ListeUtilisateursInverse par ordre inverse de création ]].\n\n - [[DerniersChangementsPages Dernières modifications sur les pages]]\n - [[DernierChangementCommentaires Dernières modifications sur les commentaires]]\n\n\n - [[PagesOrphelines Pages orphelines]]\n - [[PagesACreer Pages à créer]]\n\n - [[RechercheTexte Recherche texte]]\n\n - [[PlanDuSite Plan du site]]\n - [[IndexDesPages Index des pages avec noms des propriétaires]]\n - [[IndexDesPagesAlphabet Index des pages par classement alphabétique]]\n\n - [[DerniersChangementsRSS La page permettant le flux RSS]]\n\n - [[ListeInterWiki Liste des wiki existants ]]\n----\n==== 5 derniers comptes utilisateurs ====\n{{Listuserscommon last=\"5\"}}\n\n==== 5 dernières pages modifiées ====\n{{recentchanges max=\"5\"}}\n----', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'MesPagesCreer', body = '**Retour : ** [[ParametresUtilisateur mes paramètres ]]\n----\n{{mypages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ $this->_db->query("insert into ".$prefixe."pages set tag = 'NomWiki', body = '** Retour : ** [[PagePrincipale Page Principale]]\n----\nUn NomWiki est un nom qui est écrit \"\"CommeCela\"\".\n\nUn NomWiki est transformé automatiquement en lien. Si la page correspondante n\'existe pas, un \'?\' est affiché à côté du mot.', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
+ } // end of member function creation_tables
+
+ /**
+ *
+ *
+ * @param string prefixe Le préfixe des tables à supprimer
+ * @return void
+ * @access public
+ */
+ function suppression_tables( $prefixe )
+ {
+ $resultat = $this->_db->query("DROP TABLE ".$prefixe."_acls ,".$prefixe."_links ,".$prefixe."_pages ,".
+ $prefixe."_referrers ,".$prefixe."_users") ;
+ if (DB::isError ($resultat)) {
+ echo ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
+ }
+ } // end of member function suppression_tables
+
+
+
+
+
+} // end of gestion_wikini
+?>
/tags/2014_06_04/classes/HTML_formulaireListe.class.php
New file
0,0 → 1,123
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_formulaireListe.class.php,v 1.2 2005-09-27 16:40:39 alexandre_tb Exp $
/**
* Application projet
*
* La classe HTML_formulaireListe
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
 
require_once 'HTML/QuickForm.php' ;
require_once 'HTML/QuickForm/checkbox.php' ;
require_once 'HTML/QuickForm/select.php' ;
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE des constantes |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class HTML_formulaireListe
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
*/
class HTML_formulaireListe extends HTML_QuickForm
{
 
 
/**
* Constructeur
*
* @param string formName Le nom du formulaire.
* @param string method Soit get soit post, voir le protocole HTTP
* @param string action L'action du formulaire.
* @param string target La cible du formulaire.
* @param Array attributes Des attributs supplémentaires pour la balise <form>
* @param bool trackSubmit Pour repérer si la formulaire a été soumis.
* @return void
* @access public
*/
function HTML_formulaireListe( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
} // end of member function HTML_formulaireListe
 
/**
* Renvoie le code HTML du formulaire.
*
* @return string
* @access public
*/
function toHTML( )
{
$res = HTML_QuickForm::toHTML() ;
return $res ;
} // end of member function toHTML
 
/**
* Ajoute les champs nécessaire au formulaire.
*
* @return void
* @access public
*/
function construitFormulaire()
{
$this->addElement ('text', 'nom_liste', PROJET_NOM_DE_LA_LISTE, array('size' => '20')) ;
$this->addRule ('nom_liste', PROJET_NOM_DE_LA_LISTE_REQUIRED, 'required', '', 'client') ;
$this->applyFilter('nom_liste', 'strtolower') ;
$this->addElement ('text', 'domaine_liste', PROJET_DOMAINE_DE_LA_LISTE, array('size' => '20')) ;
$this->addRule ('domaine_liste', PROJET_DOMAINE_LISTE_REQUIRED, 'required', '', 'client') ;
$radio[] = &HTML_QuickForm::createElement('radio', 'liste_visibilite', 1, PROJET_OUI, 1) ;
$radio[] = &HTML_QuickForm::createElement('radio', 'liste_visibilite', 0, PROJET_NON, 0);
$this->addGroup($radio, null, PROJET_FORUMS_VISIBILITE, '&nbsp;');
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.PROJET_CHAMPS_REQUIS) ;
$url_annuler = new Net_URL($this->getAttribute('action')) ;
$url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
// qui remplacent deux fois les & par des &amp;
// ce qui fait échouer le lien
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', PROJET_FICHIER_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
} // end of member function _construitFormulaire
 
} // end of HTML_formulaireListe
?>
/tags/2014_06_04/classes/ezmlmAccessObject.class.php
New file
0,0 → 1,354
<?php
//vim: set expandtab tabstop=4 shiftwidth=4:
 
// Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org)
//
// Ce logiciel est un programme informatique servant � g�rer du contenu et des
// applications web.
// Ce logiciel est regi par la licence CeCILL soumise au droit francais et
// respectant les principes de diffusion des logiciels libres. Vous pouvez
// utiliser, modifier et/ou redistribuer ce programme sous les conditions
// de la licence CeCILL telle que diffusee par le CEA, le CNRS et l'INRIA
// sur le site "http://www.cecill.info".
 
// En contrepartie de l'accessibilite au code source et des droits de copie,
// de modification et de redistribution accordes par cette licence, il n'est
// offert aux utilisateurs qu'une garantie limitee. Pour les memes raisons,
// seule une responsabilite restreinte pese sur l'auteur du programme, le
// titulaire des droits patrimoniaux et les concedants successifs.
 
// A cet egard l'attention de l'utilisateur est attiree sur les risques
// associes au chargement, a l'utilisation, a la modification et/ou au
// developpement et a la reproduction du logiciel par l'utilisateur etant
// donne sa specificite de logiciel libre, qui peut le rendre complexe a
// manipuler et qui le reserve donc a des developpeurs et des professionnels
// avertis possedant des connaissances informatiques approfondies. Les
// utilisateurs sont donc invites a charger et tester l'adequation du
// logiciel a leurs besoins dans des conditions permettant d'assurer la
// securite de leurs systemes et ou de leurs donnees et, plus generalement,
// a l'utiliser et l'exploiter dans les memes conditions de securite.
 
// Le fait que vous puissiez acceder a cet en-tete signifie que vous avez
// pris connaissance de la licence CeCILL, et que vous en avez accepte les
// termes.
// ----
// CVS : $Id: ezmlmAccessObject.class.php,v 1.6 2008-08-25 15:16:59 alexandre_tb Exp $
 
/**
* Application projet
*
* La classe ezmlmAccessObject
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2006
*@version $Revision: 1.6 $
// +------------------------------------------------------------------------------------------------------+
*/
 
/** Etend XML_Parser_Simple */
require_once 'XML/Parser/Simple.php' ;
 
/**
* Les codes erreurs
*/
define ('EZMLM_ACCESS_OBJECT_ACTION_NON_SUPPORTEE', 206) ;
/**
* classe ezmlmAccessObject parse les fichiers XML
* issue de ezmlm
*
* @category XML
* @package projet
* @author alex
*/
class ezmlmAccessObject extends XML_Parser_Simple {
/**
* Le domaine de la liste
*/
var $domaine ;
/**
* Le nom de la liste
*/
var $liste ;
/**
* Les actions valides
*/
var $actions_supportees = array ('calendrier_messages',
'message',
'derniers_messages',
'messages_auteur',
'messages_mois',
'messages_thread',
'supprimer',
'liste_abonnes',
'nombre_messages');
/**
* l'action selectionnee
*/
var $action ;
/**
* La langue 'fr-FR'
*/
var $langue ;
/**
* L'url de base
*/
var $url ;
/**
* L'identifiant du repertoire
*/
var $identifiant_repertoire ;
/**
* Identifiant message
*/
var $identifiant_message;
 
/**
* L'identifiant du repertoire
*/
var $_numeroRepertoireSuivant ;
/**
* L'identifiant du repertoire
*/
var $hash_auteur ;
/**
* Le mois a afficher
*/
var $mois ;
var $_numeraRepertoirePrecedent;
/**
* Identifiant message
*/
var $_numeroFichierSuivant;
var $_numeroFichierPrecedent;
var $chemin_fichier_xml;
/**
* Creation de l'objet d'acces
*
*/
function ezmlmAccessObject ($action, $domaine, $liste, $langue = 'fr', $url = '') {
$this->XML_Parser_Simple(null, 'func') ;
$this->action = $action ;
$this->domaine = $domaine ;
$this->liste = $liste ;
$this->langue = $langue ;
$this->url = $url ;
}
/**
* Gestion des balises
*
* Cette methode specifie les balises reconnus par ezmlmAccessObject
* Elle remplace la methode handleElement de XML_Parser_Simple
*
* @access public
* @param string nom de l'element (Voir la doc de PHP)
* @param array attributes
* @param
* @link http://fr.php.net/manual/fr/ref.xml.php manuel
*/
function handleElement_ezmlm_message ($name, $attribs, $data) {
echo $data ;
}
function handleElement_message_suivant ($name, $attribs, $data) {
$this->_numeroRepertoireSuivant = $attribs['NUMERO_REPERTOIRE'] ;
$this->_numeroFichierSuivant = $attribs['NUMERO'] ;
}
function handleElement_message_precedent ($name, $attribs, $data) {
$this->_numeroRepertoirePrecedent = $attribs['NUMERO_REPERTOIRE'] ;
$this->_numeroFichierPrecedent = $attribs['NUMERO'] ;
}
function handleElement_ezmlm_calendrier_messages ($name, $attribs, $data) { echo $data ; }
function handleElement_ezmlm_derniers_messages ($name, $attribs, $data) { echo $data ; }
function handleElement_ezmlm_messages_auteur ($name, $attribs, $data) { echo $data ; }
function handleElement_ezmlm_messages_mois ($name, $attribs, $data) { echo $data ; }
function handleElement_ezmlm_messages_thread ($name, $attribs, $data) { echo $data ; }
function handleElement_ezmlm_liste_abonnes ($name, $attribs, $data) { echo $data ; }
function handleElement_ezmlm_nombre_messages ($name, $attribs, $data) { echo $data ; }
/**
* Choix de l'action
*
* Liste des actions :
* 'calendrier_messages'
*
* @access public
* @param string une action qui doit etre support�
*/
function setAction($action) {
// verification de l'action
if (!in_array($action, $this->actions_supportees)) {
return raiseError(EZMLM_ACCESS_OBJECT_ACTION_NON_SUPPORTEE) ;
}
$this->action = $action ;
// Libere les ressources (XML_Parser::free)
$this->free();
// On vide l url
//$this->url = '';
$this->chemin_fichier_xml = '';
// Charge la nouvelle action
$this->load() ;
}
/**
* Charge une action
*
* cad affecte un fichier xml au parser
*
* @access public
*/
function load() {
$this->chemin_fichier_xml = PROJET_SERVEUR_VPOPMAIL.'/'.$this->action.'.php?domaine='.
$this->domaine.'&liste='.$this->liste.'&langue='.
$this->langue ;
if ($this->url != '') $this->chemin_fichier_xml.= '&url='.urlencode($this->url) ;
if (isset ($this->identifiant_repertoire))
$this->chemin_fichier_xml .= '&actionargs[]='.$this->identifiant_repertoire ;
if (isset ($this->identifiant_message))
$this->chemin_fichier_xml .= '&actionargs[]='.$this->identifiant_message ;
if (isset ($this->hash_auteur))
$this->chemin_fichier_xml .= '&actionargs[]='.$this->hash_auteur ;
if (isset ($this->mois))
$this->chemin_fichier_xml .= '&actionargs[]='.$this->mois ;
$this->setInputFile($this->chemin_fichier_xml) ;
}
/**
* Precise un message a extraire
*
* On indique le numero de repertoire ezmlm et le numero du message
* @param integer le numero du repertoire
* @param integer le numero du message
*
*/
function setIdMessage ($identifiant_repertoire, $identifiant_message) {
$this->identifiant_repertoire = $identifiant_repertoire ;
$this->identifiant_message = $identifiant_message ;
}
/**
* Precise un auteur
*
* On indique le numero de repertoire ezmlm et le numero du message
* @param string le hash d'un auteur
*
*/
function setHashAuteur ($hash_auteur) {
$this->hash_auteur = $hash_auteur;
}
/**
* Precise un mois
*
* On indique le numero de repertoire ezmlm et le num�ro du message
* @param string le hash d'un auteur
*
*/
function setMois ($mois) {
$this->mois = $mois;
}
/**
* Renvoi le numero du repertoire suivant
*
*
*/
function getNumeroRepertoireSuivant() { return $this->_numeroRepertoireSuivant; }
function getNumeroFichierSuivant () { return $this->_numeroFichierSuivant ; }
function getNumeroRepertoirePrecedent() { return $this->_numeroRepertoirePrecedent; }
function getNumeroFichierPrecedent () { return $this->_numeroFichierPrecedent ; }
function getNumeroMessage () { return $this->_numeroMessage ; }
function getNombreTotalMessage () { return $this->_nombreTotalMessage ; }
function parse()
{
if (substr(phpversion(), 0, 1) == '5') {
try {
$xml = new SimpleXMLElement($this->chemin_fichier_xml, null, true);
switch ($this->action) {
case 'calendrier_messages' :echo $xml;
echo $xml->ezmlm_calendrier_messages;
break;
case 'message':
echo $xml;
$this->_numeroRepertoirePrecedent = $xml->message_precedent['numero_repertoire'];
$this->_numeroRepertoireSuivant = $xml->message_suivant['numero_repertoire'];
$this->_numeroFichierSuivant = $xml->message_suivant['numero'];
$this->_numeroFichierPrecedent = $xml->message_precedent['numero'];
$this->_numeroMessage = $xml->numero;
$this->_nombreTotalMessage = $xml->numero['total_message'];
break;
case 'nombre_messages':
echo $xml[0];
break;
case 'liste_abonnes':
return $xml;
break;
default :
echo $xml;
}
$error = 'Erreur dans l\'acc&egrave;s au fichier:<br />'.$this->chemin_fichier_xml.'<br />';
$error = '';
throw new Exception($error);
}
catch (Exception $e) {
echo $e->getMessage().'<br />';
//echo $this->chemin_fichier_xml;
}
} else {
return parent::parse();
}
}
}
 
?>
/tags/2014_06_04/classes/commande_serveur.class.php
New file
0,0 → 1,107
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: commande_serveur.class.php,v 1.2 2005-09-27 16:37:40 alexandre_tb Exp $
/**
* Application projet
*
* La classe commande_serveur
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class commande_serveur
* Cette classe permet d'accéder au fichier ezmlm.sh afin de lui ajouter des
* commandes qui seront effectués périodiquement par le serveur.
*/
class commande_serveur
{
 
/*** Attributes: ***/
 
/**
* Pointeur vers le fichier des commandes
* @access private
*/
var $_fichier;
 
/**
*
*
* @return void
* @access public
*/
function commande_serveur($fichier)
{
$this->_fichier = fopen ($fichier,'a+') ;
if (!$this->_fichier) {
return 'Impossible d\'ouvrir le fichier de commande' ;
}
} // end of member function commande_serveur
 
/**
*
*
* @param string commande La commande, une chaine à ajouter à la fin du fichier ezmlm.sh
* @return bool
* @access public
*/
function ajouterCommande( $commande )
{
fwrite ($this->_fichier, "\n".$commande) ;
} // end of member function ajouterCommande
/**
* Destructeur
*
* @return void
* @access public
*/
function _commande_serveur($fichier)
{
fclose ($this->_fichier) ;
} // end of member function commande_serveur
 
/**
*
*
* @return
*/
function enleverToutesCommandes () {
ftruncate ($this->_fichier, 12) ;
}
} // end of commande_serveur
?>
/tags/2014_06_04/classes/HTML_formulaireInscriptionProjet.class.php
New file
0,0 → 1,115
<?php
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_formulaireInscriptionProjet.class.php,v 1.3 2007-11-21 09:42:50 alexandre_tb Exp $
/**
* Application projet
*
* La classe HTML_formulaireInscriptionProjet
* Elle se base sur la table projet_statut_utilisateur
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/radio.php';
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php';
 
/**
* class HTML_formulaireInscriptionProjet
*
*/
class HTML_formulaireInscriptionProjet extends HTML_QuickForm
{
/*** Attributes: ***/
 
/**
*
*
* @return void
* @access public
*/
function HTML_formulaireInscriptionProjet( $formName = '', $method = 'post', $action = '', $target = '_self', $attributes = '', $trackSubmit = false )
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
} // end of member function HTML_formulaireInscriptionProjet
 
/**
*
*
* @return void
* @access public
*/
function construitFormulaire(& $projet )
{
$squelette =& $this->defaultRenderer();
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
$modele_element_debut = '<li class="groupe_formulaire">'."\n".'<span class="inscription_label1">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
"\n".'{element}'."\n".''."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
''."\n" ;
$modele_element_fin = "\n".'<span class="inscription_label2">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
"\n".'{element}'."\n".''."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n" ;
$squelette->setElementTemplate( '<li class="liste_inscription">'."\n".'<span class="inscription_label">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
"\n".'{element}'."\n".''."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
$squelette->setElementTemplate( '<ul><li class="groupe_bouton">{element}', 'annuler');
$squelette->setElementTemplate( '{element}</li></ul>', 'valider');
$squelette->setRequiredNoteTemplate("\n".'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'."\n");
if ($projet->avoirListe()) {
$this->addElement ('radio', 'radio_inscription_liste', '&nbsp;', PROJET_INSCRIPTION_LISTE_NORMAL, 2) ;
$this->addElement ('radio', 'radio_inscription_liste', '&nbsp;', PROJET_INSCRIPTION_PAS_DE_MAIL, 1) ;
// Indisponible pour le moment
//$this->addElement ('radio', 'radio_inscription_liste', '&nbsp;', PROJET_INSCRIPTION_LISTE_RESUME, 2) ;
}
$this->addElement ('hidden', 'id_projet', $projet->getId()) ;
$url_annuler = new Net_URL($this->getAttribute('action')) ;
$url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
$url_annuler->removeQueryString(PROJET_VARIABLE_ID_PROJET) ;
// on fait un groupe avec les boutons pour les mettres sur la même ligne
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
// qui remplacent deux fois les & par des &amp;
// ce qui fait échouer le lien
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider_inscription_projet', PROJET_S_INSCRIRE_AU_PROJET);
$this->addGroup($buttons, null, null, '&nbsp;');
} // end of member function construitFormulaire
 
 
} // end of HTML_formulaireInscriptionProjet
?>
/tags/2014_06_04/classes/projetTemplate.class.php
New file
0,0 → 1,89
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
 
// CVS : $Id: projetTemplate.class.php,v 1.4 2008-09-16 14:10:41 alexandre_tb Exp $
 
/**
* Application projet
*
* La classe controleur projet
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once 'PEAR.php' ;
 
/** Constante des templates */
// Pour le coordinateur dans la cas de projets moderes
define ('PROJET_TEMPLATE_DEMANDE_INSCRIPTION_SUJET', 1);
define ('PROJET_TEMPLATE_DEMANDE_INSCRIPTION_CORPS', 2);
 
// Pour le coordinateur lors d une nouvelle inscription (projets non moderes)
define ('PROJET_TEMPLATE_INSCRIPTION_NOUVELLE_SUJET', 3);
define ('PROJET_TEMPLATE_INSCRIPTION_NOUVELLE_CORPS', 4);
 
// pour le coodinateur lors des desinscription
define ('PROJET_TEMPLATE_DESINSCRIPTION_SUJET', 5);
define ('PROJET_TEMPLATE_DESINSCRIPTION_CORPS', 6);
 
// Pour le coordinateur lors du depot d un nouveau document
define ('PROJET_TEMPLATE_NOUVEAU_DOC_SUJET', 7);
define ('PROJET_TEMPLATE_NOUVEAU_DOC_CORPS', 8);
 
// Pour les administrateur lorsque le dernier coordinateur
// d un projet se desinscrit
define ('PROJET_TEMPLATE_DESINSCRIPTION_DERNIER_COORD_SUJET', 9);
define ('PROJET_TEMPLATE_DESINSCRIPTION_DERNIER_COORD_CORPS', 10);
 
class projetTemplate extends PEAR {
 
 
var $_db ;
function projetTemplate(&$objetDB) {
$this->_db = $objetDB ;
}
function getTemplate ($id_template, $lang='fr-FR', $argument = 0) {
$requete = 'select pt_template from projet_template where pt_id_template='.$this->_db->escapeSimple($id_template).
' and pt_i18n like "'.$lang.'%"' ;
if ($argument != 0) $requete .= ' and pt_argument='.$this->_db->escapeSimple($argument) ;
$resultat = $GLOBALS['projet_db']->query($requete) ;
if (DB::isError($resultat)) return $this->raiseError ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
if ($resultat->numRows() == 0) return $this->raiseError ('Aucun template avec l\'identifiant: '.$id_template.
', la langue: '.$lang. ' et l argument '.$argument) ;
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
return $ligne->pt_template ;
}
}
?>
/tags/2014_06_04/classes/HTML_Liste.class.php
New file
0,0 → 1,77
<?php
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_Liste.class.php,v 1.2 2005-09-27 16:42:00 alexandre_tb Exp $
/**
* Application projet
*
* La classe HTML_Liste, classe de base pour toutes les listes du module projet
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once 'HTML/Table.php' ;
 
/**
* class HTML_Liste
*
*/
class HTML_Liste extends HTML_Table
{
/*** Attributes: ***/
 
/**
*
* @access protected
*/
var $pager;
/**
*
* @access private
*/
var $_utilise_pager;
 
 
/**
*
*
* @param bool utilise_pager Si l'on souhaite que les résultats soient divisés en page, on passe true.
* @return HTML_Liste
* @access public
*/
function HTML_Liste( $utilise_pager = false, $attributes = '')
{
HTML_Table::HTML_Table($attributes) ;
$this->_utilise_pager = $utilise_pager ;
} // end of member function HTML_Liste
 
} // end of HTML_Liste
?>
/tags/2014_06_04/classes/projet_type.class.php
New file
0,0 → 1,107
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projet_type.class.php,v 1.2 2005-10-14 08:55:50 alexandre_tb Exp $
/**
* Application projet
*
* La classe projet_type
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class projet_type
*
*/
class projet_type
{
 
/*** Attributes: ***/
 
/**
* Une connection vers une base de donnée
* @access private
*/
var $_db;
 
/**
* Renvoie tous types de projets (de la table projet_type) ans un tableau avec pour
* clé l'identifiant et pour valeur le label.
*
* @return Array
* @static
* @access public
*/
function getTousLesTypes(& $objetDB )
{
$requete = 'select * from projet_type' ;
return $objetDB->getAssoc ($requete) ;
} // end of member function getTousLesTypes
 
/**
*
*
* @param DB objetDB Une instance de la classe PEAR::DB
* @return void
* @access public
*/
function projet_type( & $objetDB )
{
$this->_db = $objetDB ;
} // end of member function projet_type
 
 
/**
*
*
* @param DB objetDB Une instance de la classe PEAR::DB
* @return void
* @access public
*/
function getLabelType( $id_type)
{
$requete = 'select pt_label_type from projet_type where pt_id_type='.$this->_db->escapeSimple($id_type) ;
$resultat = $this->_db->getOne($requete) ;
if (DB::isError($resultat)) {
echo $resultat->getMessage() ;
}
return $resultat ;
} // end of member function projet_type
 
 
 
 
} // end of projet_type
?>
/tags/2014_06_04/classes/HTML_formulaireCouperColler.class.php
New file
0,0 → 1,134
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_formulaireCouperColler.class.php,v 1.3 2007-06-25 12:15:06 alexandre_tb Exp $
/**
* Application projet
*
* La classe HTML_formulaireCouperColler
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
require_once 'HTML/QuickForm.php' ;
 
/**
* class HTML_formulaireCouperColler
*
*/
class HTML_formulaireCouperColler extends HTML_QuickForm
{
/**
*
*
* @return void
* @access public
*/
function construitFormulaire($tableau_repertoire)
{
$squelette =& $this->defaultRenderer();
$squelette->setFormTemplate("\n".'<form{attributes}><ul>'."\n".'{content}'."\n".'</ul></form>'."\n");
$squelette->setElementTemplate( '<li style="list-style-type: none;">'."\n".'{element}'."\n".'</li>'."\n");
$this->addElement('radio', 'projet_repertoire', '', PROJET_RACINE, 0) ;
if (count ($tableau_repertoire)) {
$this->addElement('html', '<ul>') ;
foreach ($tableau_repertoire as $valeur) {
if ($valeur['id_pere'] ==0) {
$this->addElement ('radio', 'projet_repertoire', '', $valeur['label'], $valeur['id']) ;
if (count ($valeur['fils'])) $this->construireArbreRadio ($valeur['fils']);
}
}
$this->addElement('html', '</ul>') ;
}
$url_annuler = new Net_URL($this->getAttribute('action')) ;
$url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
// on fait un groupe avec les boutons pour les mettres sur la même ligne
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', '',
preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER
); // Le preg_replace contourne un pb de QuickForm et Net_URL
// qui remplacent deux fois les & par des &amp;
// ce qui fait échouer le lien
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider_inscription_projet', PROJET_FICHIER_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
} // end of member function construitFormulaire
 
function construireArbreRadio(&$noeud) {
foreach ($noeud as $val) {
$this->addElement('html', '<ul>') ;
$this->construitLigneRepertoire($val) ;
if (count($val['fils'])) $this->construireArbreRadio ($val['fils']) ;
$this->addElement('html', '</ul>') ;
}
}
/**
*
*
*
*
*/
function construitLigneRepertoire($noeud) {
$this->addElement('html', '<ul>') ;
$this->addElement('radio', 'projet_repertoire', '', $noeud['label'], $noeud['id']) ;
$this->addElement('html', '</ul>') ;
}
/**
*
*
* @return void
* @access public
*/
function HTML_formulaireCouperColler($formName = '', $method = 'post', $action = '', $target = '_self', $attributes = '', $trackSubmit = false )
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
} // end of member function HTML_formulaireCouperColler
 
/**
*
*
* @return string
* @access public
*/
function toHTML($nom_de_fichier)
{
$res = '<h2>'.PROJET_CHANGER_REPERTOIRE.'</h2>'."\n" ;
$res .= PROJET_FICHIER_A_DEPLACER . $nom_de_fichier;
$res .= '<h2>'.PROJET_CHOISISSEZ_REPERTOIRE.'</h2>' ;
$res .= HTML_QuickForm::toHTML() ;
return $res ;
}
}
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/ezmlm-author.php
New file
0,0 → 1,72
<?php
// $Id: ezmlm-author.php,v 1.4 2008-11-19 09:28:46 aperonnet Exp $
//
// ezmlm-author.php - ezmlm-php v2.0
// --------------------------------------------------------------
// Displays all messages by a given author
// --------------------------------------------------------------
 
require_once("ezmlm.php");
 
class ezmlm_author extends ezmlm_php {
function display($authorhash) {
$file = "/archive/authors/" . substr($authorhash,0,2) . "/" . substr($authorhash,2,18);
//echo $file ;
if (!is_file($this->listdir . $file)) { $this->error(EZMLM_INVALID_AUTHOR); return; }
// Le fichier author comprend
// première ligne hash_auteur nom_auteur
// num_mess:annéemois:hash_sujet sujet
$fd = @fopen($this->listdir . $file, "r");
$i = 0 ;
$class = array ('ligne_impaire', 'ligne_paire') ;
while (!feof($fd)) {
$buf = fgets($fd,4096);
if (preg_match('/^' . $authorhash . '/', $buf)) {
// this should ALWAYS be the first line in the file
$author = preg_replace('/^' . $authorhash . ' /', '', $buf);
print '<h3>'.$author.'</h3>' ;
print '<table class="table_cadre">'."\n";
print '<tr><th class="col1">De</th><th>Sujet</th><th>Date</th></tr>'."\n";
$tableopened = TRUE;
} else if (preg_match('/^[0-9]*:[0-9]/',$buf)) {
// si la ligne est valide
// on récupère le numéro du message pour en extraire le nom du fichier
$msgfile = preg_replace('/^([0-9]*):.*/', '\1', $buf);
$msgdir = (int)((int)$msgfile / 100);
$msgfile = (int)$msgfile % 100;
 
if ($msgfile < 10) { $msgfile = "0" . $msgfile; }
 
if (!is_file($this->listdir . "/archive/" . $msgdir . "/" . $msgfile)) {
print "<!-- " . $this->listdir . "/archive/" . $msgdir . "/" . $msgfile . " -->\n";
$this->error(EZMLM_INCONSISTANCY);
fclose($fd);
return;
}
 
//$msg = new ezmlm_parser();
//$msg->parse_file_headers($this->listdir . "/archive/" . $msgdir . "/" . $msgfile);
$message = file_get_contents($this->listdir . "/archive/" . $msgdir . "/" . $msgfile) ;
$mimeDecode = new Mail_mimeDecode($message) ;
$mailDecode = $mimeDecode->decode() ;
$subject = $mailDecode->headers['subject'];
$subject = preg_replace("/\[" . $this->listname . "\]/", "", $subject);
$date = preg_replace ('/CEST/', '', $mailDecode->headers['date']);
print '<tr class="'.$class[$i].'">'."\n";
if ($mailDecode->headers['from'] == '') $from = $mailDecode->headers['return-path'] ; else $from = $mailDecode->headers['from'];
$hash = $this->makehash($from);
print '<td>'.$this->makelink("action=show_author_msgs&actionargs[]=" . $hash,$this->decode_iso($this->protect_email($from,false)));
print '</td>';
print "<td><b>" . $this->makelink("action=show_msg&actionargs[]=" . $msgdir . "&actionargs[]=" . $msgfile, $this->decode_iso($subject)) . "</b></td>";
print "<td>" . $this->date_francaise($mailDecode->headers['date']) . "</td>\n";
print "</tr>\n";
$i++;
if ($i == 2) $i = 0 ;
unset ($mailDecode) ;
}
}
if ($tableopened) { print "</table>\n"; }
}
}
/tags/2014_06_04/classes/ezmlm-php-2.0/ezmlm.php
New file
0,0 → 1,346
<?php
// $Id: ezmlm.php,v 1.3.2.2 2007/03/13 11:04:46 alexandre_tb Exp $
//
// ezmlm.php - ezmlm-php v2.0
// --------------------------------------------------------------
// As the site that ezmlm-php was developed for grew, and grew
// the old system used had to be bandaid fixed more, and more
// because the site started moving to an object oriented design
// for all the backend systems and ezmlm wasn't playing nice
// with the new design. So, ezmlm was redesigned too, and here
// it is.
//
// It may look a little more confusing if you're not used to
// working with objects but it actually is much more effiecient
// and organized in it's new incarnation.
// Simply edit the variables in the ezmlm-php constructor below
// just like you would with the old ezmlm-php-config.php file,
// if you're unsure howto do this check out the file CONFIG,
// then check the USAGE file for how you should include and use
// the new classes if you are integrating ezmlm-php into your
// site.
// (SEARCH FOR: USER-CONFIG to find where to edit.)
// --------------------------------------------------------------
 
require_once("ezmlm-errors.def");
require_once("ezmlm-parser.php");
require_once("ezmlm-threads.php");
require_once("ezmlm-listinfo.php");
require_once("ezmlm-msgdisplay.php");
require_once("ezmlm-repondre.php");
require_once("ezmlm-author.php");
 
$GLOBALS['mois'] = array ('Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre') ;
 
// CLASS: ezmlm_php
// the base class, contains common functions and the config
class ezmlm_php {
var $listdir; // the root directory of the list
var $listname; // the list address upto the @
var $listdomain; // the domain for the list
 
var $tempdir; // a directory in which the webserver can write cache files
 
var $sendheaders; // send generic page headers
var $sendbody; // send generic body definitions
var $sendfooters; // send generic page footers
var $includebefore; // a file to include before the content
var $includeafter; // a file to include after the content
 
var $href; // what to add before the '?param=value' in links
 
var $prefertype; // what mime type do you prefer?
var $showheaders; // what headers should we show?
 
var $msgtemplate; // the template for displaying messages (see the file TEMPLATE)
 
var $tablecolours; // what are the colours for the table rows?
 
var $thread_subjlen; // the maximum length of subjects in the thread view (0 = no limit)
 
var $forcehref; // force the base of makelink();
 
// --------- END USER CONFIGURATION ---------
 
// Internal variables
var $action = '';
var $actionargs;
 
function ezmlm_php() {
 
// USER-CONFIG section
// these variables act the same way ezmlm-php-config.php did in the first release
// simply edit these variables to match your setup
 
$this->listdir = "";
$this->listname = "";
$this->listdomain = "";
 
$this->tempdir = "";
 
$this->sendheaders = TRUE;
$this->sendbody = TRUE;
$this->sendfooters = TRUE;
$this->includebefore = "";
$this->includeafter = "";
 
$this->href = "";
 
$this->prefertype = "text/html";
$this->showheaders = array(
"to",
"from",
"subject",
"date"
);
$this->header_en_francais = array ('to' => 'A',
'from' => 'De',
'subject' => 'Sujet',
'date' => 'Date') ;
 
$this->msgtemplate = "<pre><ezmlm-body></pre>"; // if blank it will use the internal one
 
$this->tablecolours = array(
// delete the next line if you don't want alternating colours
"#eeeeee",
"#ffffff"
);
 
$this->thread_subjlen = 55;
 
// --- STOP EDITING HERE ---
// some sanity checking
if ((!is_dir($this->listdir . "/archive")) or
(!is_dir($this->listdir . "/archive/authors")) or
(!is_dir($this->listdir . "/archive/threads")) or
(!is_dir($this->listdir . "/archive/subjects"))) {
return false ;
/*$this->error(EZMLM_INVALID_DIR,TRUE);*/
}
}
/*
* Renvoi le nombre de message dans une archive
* Le nombre contenu dans liste/num
*/
function getNumArchive() {
if ($this->listdir != '') {
$num = split(':', file_get_contents($this->listdir.'/num'));
return $num[0];
}
}
 
function set_action($action) {
if (is_array($action)) { $this->error(EZMLM_INVALID_SYNTAX,TRUE); }
$this->action = $action;
}
function set_actionargs($actionargs) {
if ($this->action == '') { $this->error(EZMLM_INVALID_SYNTAX,TRUE); }
$this->actionargs = $actionargs;
}
 
function run() {
if ($this->action == '') { $this->error(EZMLM_INVALID_SYNTAX,TRUE); }
 
if ($this->sendheaders) { $this->sendheaders(); }
if ($this->sendbody) { $this->sendbody(); }
if ($this->includebefore != '') { @include_once($this->includebefore); }
 
switch ($this->action) {
case "list_info":
$info = new ezmlm_listinfo();
$info->display();
break;
case "show_msg":
if (count($this->actionargs) < 2) {
$this->error(EZMLM_INVALID_SYNTAX,TRUE);
}
$show_msg = new ezmlm_msgdisplay();
$show_msg->display($this->actionargs[0] . "/" . $this->actionargs[1]);
break;
case "show_threads":
$threads = new ezmlm_threads();
$threads->load($this->actionargs[0]);
break;
case "show_author_msgs":
$author = new ezmlm_author();
$author->display($this->actionargs[0]);
break;
}
 
if ($this->includeafter != '') { @include_once($this->includeafter); }
if ($this->sendfooters) { $this->sendfooters(); }
}
 
function sendheaders() {
print "<html><head>\n";
print "<style type=\"text/css\">\n";
print "<!--\n";
print ".heading { font-family: helvetica; font-size: 16px; line-height: 18px; font-weight: bold; }\n";
print "//-->\n";
print "</style>\n";
print "</head>\n";
}
 
function sendbody() {
print "<body>\n";
}
 
function sendfooters() {
print "</body>\n";
print "</html>\n";
}
 
 
// begin common functions
 
// makehash - generates an author hash using the included makehash program
function makehash($str) {
$str = preg_replace ('/>/', '', $str) ;
$handle = popen ('/usr/local/lib/safe_mode/makehash \''.$str.'\'', 'r') ;
$hash = fread ($handle, 256) ;
pclose ($handle) ;
return $hash;
}
 
// makelink - writes the <a href=".."> tag
function makelink($params,$text) {
if ($this->forcehref != "") {
$basehref = $this->forcehref;
} else {
$basehref = preg_replace('/^(.*)\?.*/', '\\1', $_SERVER['REQUEST_URI']);
}
$link = '<a href="'. $basehref . '&amp;' . $params . '">' . $text . '</a>';
return $link;
}
 
// md5_of_file - provides wrapper function that emulates md5_file for PHP < 4.2.0
function md5_of_file($file) {
if (function_exists("md5_file")) { // php >= 4.2.0
return md5_file($file);
} else {
if (is_file($file)) {
$fd = fopen($file, "rb");
$filecontents = fread($fd, filesize($file));
fclose ($fd);
return md5($filecontents);
} else {
return FALSE;
}
}
}
 
// protect_email - protects email address turns user@domain.com into user@d...
function protect_email($str,$short = FALSE) {
if (preg_match("/[a-zA-Z0-9\-\.]\@[a-zA-Z0-9\-\.]*\./", $str)) {
$outstr = preg_replace("/([a-zA-Z0-9\-\.]*\@)([a-zA-Z0-9\-\.])[a-zA-Z0-9\-\.]*\.[a-zA-Z0-9\-\.]*/","\\1\\2...",$str);
$outstr = preg_replace("/\</", '&lt;', $outstr);
$outstr = preg_replace("/\>/", '&gt;', $outstr);
} else {
$outstr = $str;
}
 
if ($short) {
$outstr = preg_replace("/&lt;.*&gt;/", '', $outstr);
$outstr = preg_replace("/[\"']/", '', $outstr);
}
 
$at_split = explode('@',$outstr);
$outstr = $at_split[0];
 
$points_sep = explode('.',$outstr);
if(count($points_sep) > 2) {
$outstr = implode('.', array_slice($points_sep,0,count($points_sep) - 2));
$outstr = rtrim($outstr, '.').'...';
}
return trim($outstr);
}
 
// cleanup_body: sortta like protect_email, just for message bodies
function cleanup_body($str) {
$outstr = preg_replace("/([a-zA-Z0-9\-\.]*\@)([a-zA-Z0-9\-\.])[a-zA-Z0-9\-\.]*\.[a-zA-Z0-9\-\.]*/","\\1\\2...",$str);
return $outstr;
}
 
function error($def, $critical = FALSE) {
global $ezmlm_error;
 
print "\n\n";
print "<table width=600 border=1 cellpadding=3 cellspacing=0>\n";
print "<tr bgcolor=\"#cccccc\"><td><b>EZMLM-PHP Error: " . $ezmlm_error[$def]['title'] . "</td></tr>\n";
print "<tr bgcolor=\"#aaaaaa\"><td>" . $ezmlm_error[$def]['body'] . "</td></tr>\n";
print "</table>\n\n";
 
if ($critical) { die; }
}
/**
* Parse une chaine et supprime les probleme d'encodage de type ISO-4 ...
*
* @return string
*/
 
function decode_iso ($chaine) {
 
if (preg_match ('/windows-[0-9][0-9][0-9][0-9]/i', $chaine, $nombre)) {
$reg_exp = $nombre[0] ;
$chaine = str_replace(' ', '', $chaine);
} else {
$reg_exp = 'ISO-8859-15?' ;
}
if (preg_match ('/UTF/i', $chaine)) $reg_exp = 'UTF-8' ;
preg_match_all ("/=\?$reg_exp\?(Q|B)\?(.*?)\?=/i", $chaine, $match, PREG_PATTERN_ORDER) ;
for ($i = 0; $i < count ($match[0]); $i++ ) {
 
if (strtoupper($match[1][$i]) == 'Q') {
$decode = quoted_printable_decode ($match[2][$i]) ;
} elseif ($match[1][$i] == 'B') {
$decode = base64_decode ($match[2][$i]) ;
}
$decode = preg_replace ("/_/", " ", $decode) ;
if ($reg_exp == 'UTF-8') {
$decode = utf8_decode ($decode) ;
}
$chaine = str_replace ($match[0][$i], $decode, $chaine) ;
}
return $chaine ;
}
 
/**
*
*
* @return
*/
 
function date_francaise ($date_mail) {
$date_mail = preg_replace ('/CEST/', '', $date_mail) ;
$numero_mois = date('m ', strtotime($date_mail)) - 1 ;
$date = date ('d ', strtotime($date_mail)).$GLOBALS['mois'][$numero_mois] ; // Le jour et le mois
$date .= date(' Y ', strtotime($date_mail)) ; // l'annee
if (date('a', strtotime($date_mail)) == 'pm') {
$date .= (int) date('g', strtotime($date_mail)) + 12 ; // Les heures
} else {
$date .= date('g', strtotime($date_mail)) ;
}
$date .= date(':i', strtotime($date_mail)) ; // Les minutes
return $date ;
}
 
/**
* Cette fonction renvoie le prefixe, cad 0 ou rien
* d un nom de message, ex : pour 09, on renvoie 0
* pour 12 on renvoie rien
*/
function prefixe_nom_message($nom) {
if (preg_match ('/0([1-9][0-9]*)/', $nom, $match)) {
$nom_fichier = $match[1];
return '0' ;
} else {
return '' ;
}
}
}
 
//
// --- END OF CLASS DEFINITION ---
//
 
// FIN
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/suppression_liste.php
New file
0,0 → 1,20
<?php
 
if (!isset ($domaine) || $domaine == '' || !isset($liste) || $liste == '') {
die ('manque paramètre domaine ou liste') ;
}
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
$fichier_qmail = '/home/vpopmail/domains/'.$domaine.'/.qmail-'.$liste ;
 
 
echo exec ('rm '.$fichier_qmail, $output2, $ret2) ;
echo exec ('rm '.$fichier_qmail.'-default', $output2, $ret2) ;
echo exec ('rm '.$fichier_qmail.'-digest-owner', $output2, $ret2) ;
echo exec ('rm '.$fichier_qmail.'-digest-return-default', $output2, $ret2) ;
echo exec ('rm '.$fichier_qmail.'-owner', $output2, $ret2) ;
echo exec ('rm '.$fichier_qmail.'-return-default', $output2, $ret2) ;
echo 'rm '.$fichier_qmail ;
echo exec ('rm -rf '.$repertoire, $output, $ret) ;
echo 'rm -rf '.$repertoire ;
 
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/messages_auteur.php
New file
0,0 → 1,32
<?php
 
include_once 'ezmlm-php-2.0/ezmlm.php' ;
 
 
// Parametrage de la liste
$info = new ezmlm_author();
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
$info->forcehref = $url;
$info->listdir = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
$info->listname = $liste;
$info->listdomain = $domaine ;
 
ob_start() ;
if (!$info->display($actionargs[0])) {
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
}
$html = ob_get_contents() ;
ob_end_clean() ;
 
include_once 'XML/Util.php' ;
 
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
 
$xml .= XML_Util::createStartElement ('ezmlm_messages_auteur', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue )) ;
 
$xml .= '<![CDATA[ '.$html.']]>';
 
$xml .= XML_Util::createEndElement('ezmlm_messages_auteur') ;
header ('Content-type: text/xml');
echo $xml ;
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/messages_mois.php
New file
0,0 → 1,101
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: messages_mois.php,v 1.4 2008-11-04 17:11:10 aperonnet Exp $
/**
* Application projet
*
* Action forums
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2008
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
include_once 'ezmlm-php-2.0/ezmlm.php' ;
 
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
date_default_timezone_set("Europe/Paris");
// extract($_GET); // PHP-5.4, sans register_globals
 
// Parametrage de la liste
$info = new ezmlm_listinfo();
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
$info->forcehref = $url;
$info->listdir = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
$info->listname = $liste;
$info->listdomain = $domaine ;
 
 
 
/** Calcul du cache */
 
require_once('Cache/Lite.php');
 
// Set a id for this cache
$id = 'cachemonth_'.$domaine.'_'.$liste.'_'.$actionargs[0];
 
// Set a few options
$options = array(
'cacheDir' => 'tmp/',
'lifeTime' => 360000
);
 
// Create a Cache_Lite object
$Cache_Lite = new Cache_Lite($options);
 
if ($xml = $Cache_Lite->get($id)) {
} else {
include_once 'XML/Util.php' ;
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
$html = $info->show_month($actionargs[0]);
if (!$html) {
$xml .= XML_Util::createStartElement ('ezmlm_erreur', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
$xml .= '<![CDATA[ \'Les fichiers de la liste ne sont pas visibles sur le serveur\']]>';
$xml .= XML_Util::createEndElement('ezmlm_erreur') ;
} else {
$xml .= XML_Util::createStartElement ('ezmlm_messages_mois', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
$xml .= '<![CDATA[ '.$html.']]>';
$xml .= XML_Util::createEndElement('ezmlm_messages_mois') ;
$Cache_Lite->save($xml);
}
}
header ('Content-type: text/xml');
echo $xml ;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2008-08-25 15:24:09 alexandre_tb
* ajout de la gestion du cache
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/messages_thread.php
New file
0,0 → 1,76
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: messages_thread.php,v 1.5 2008-11-19 09:28:45 aperonnet Exp $
/**
* Application projet
*
* Renvoie les messages d un thread
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2008
*@version $Revision: 1.5 $
// +------------------------------------------------------------------------------------------------------+
*/
include_once 'ezmlm-php-2.0/ezmlm.php' ;
 
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
// extract($_GET); // PHP-5.4, sans register_globals
 
// Parametrage de la liste
$info = new ezmlm_threads();
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
$info->forcehref = $url;
$info->listdir = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
$info->listname = $liste;
$info->listdomain = $domaine ;
$info->tempdir = '/home/vpopmail/www/tmp' ;
$html = $info->load($actionargs[0]) ;
if (!$html) {
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
}
 
include_once 'XML/Util.php' ;
 
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
 
$xml .= XML_Util::createStartElement ('ezmlm_messages_thread', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
 
$xml .= '<![CDATA[ '.$html.']]>';
 
$xml .= XML_Util::createEndElement('ezmlm_messages_thread') ;
header ('Content-type: text/xml');
echo $xml ;
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2008-11-04 17:11:10 aperonnet
* correction de bugs dans la liste des derniers messages
*
* Revision 1.3 2008-08-26 09:26:41 alexandre_tb
* ajout commentaire
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/calendrier_messages.php
New file
0,0 → 1,132
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: calendrier_messages.php,v 1.4 2008-08-25 15:25:47 alexandre_tb Exp $
/**
* Application projet
*
* Action forums
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2008
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
include_once 'ezmlm-php-2.0/ezmlm.php' ;
 
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
date_default_timezone_set("Europe/Paris");
// extract($_GET); // PHP-5.4, sans register_globals
 
// Parametrage de la liste
$info = new ezmlm_threads();
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
$info->forcehref = $url;
$info->listdir = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
$info->listname = $liste;
$info->listdomain = $domaine ;
 
/** Calcul du cache */
/*
require_once('Cache/Lite.php');
 
// Set a id for this cache
$id = 'cache_'.$domaine.'_'.$liste;
 
// Set a few options
 
$options = array(
'cacheDir' => 'tmp/',
'lifeTime' => null
);
*/
 
include_once 'XML/Util.php' ;
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
 
if (!file_exists($info->listdir.'/num')) {
$xml .= XML_Util::createStartElement ('ezmlm_calendrier_messages', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
$xml .= '<![CDATA[il n\'y a pas de messages dans cette liste pour le moment.]]>';
$xml .= XML_Util::createEndElement('ezmlm_calendrier_messages') ;
header ('Content-type: text/xml');
echo $xml;
exit();
}
/*
// Create a Cache_Lite object
$Cache_Lite = new Cache_Lite($options);
$recalcule = false ;
$Cache_Lite->get($id);
 
 
if (@fileatime($info->listdir.'/num') > (int)$Cache_Lite->lastModified()) {
$recalcule = true;
}
 
// Test if thereis a valide cache for this id
if (!$recalcule) {
$xml = $Cache_Lite->get($id);
} else { // pas de cache, on construit le calendrier
*/
$html = $info->listmessages();
 
if (!$html) {
$xml .= XML_Util::createStartElement ('ezmlm_erreur', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
$xml .= '<![CDATA[Les fichiers de la liste ne sont pas visibles sur le serveur]]>';
$xml .= XML_Util::createEndElement('ezmlm_erreur') ;
} else {
$xml .= XML_Util::createStartElement ('ezmlm_calendrier_messages', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
$xml .= '<![CDATA[ '.$html.']]>';
$xml .= XML_Util::createEndElement('ezmlm_calendrier_messages') ;
/*
$xml .= XML_Util::createStartElement('cache_time') ;
$xml .= (int)$Cache_Lite->lastmodified().'#'.fileatime($info->listdir.'/num');
$xml .= XML_Util::createEndElement('cache_time') ;*/
//$Cache_Lite->save($xml, $id);
}
//}
 
header ('Content-type: text/xml');
echo $xml ;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: calendrier_messages.php,v $
* Revision 1.4 2008-08-25 15:25:47 alexandre_tb
* optimisation et gestion du cache
*
* Revision 1.3 2008-06-09 10:05:28 alexandre_tb
* Ajout de la gestion du cache
* dependance avec Cache_Lite
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/derniers_messages.php
New file
0,0 → 1,93
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id $
/**
* Application projet
*
* Action forums
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2008
*@version $Revision: 1.6 $
// +------------------------------------------------------------------------------------------------------+
*/
include_once 'ezmlm-php-2.0/ezmlm.php' ;
 
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
date_default_timezone_set("Europe/Paris");
// extract($_GET); // PHP-5.4, sans register_globals
 
// Parametrage de la liste
$info = new ezmlm_listinfo();
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
$info->forcehref = $url;
$info->listdir = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
$info->listname = $liste;
$info->listdomain = $domaine ;
 
include_once 'XML/Util.php' ;
 
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
 
if (!file_exists($info->listdir.'/num')) {
$xml .= XML_Util::createStartElement ('ezmlm_derniers_messages', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
$xml .= '<![CDATA[il n\'y a pas de messages dans cette liste pour le moment.]]>';
$xml .= XML_Util::createEndElement('ezmlm_derniers_messages') ;
header ('Content-type: text/xml');
echo $xml;
exit();
}
 
$html = $info->show_recentmsgs() ;
 
if (!$html) {
if (!$info) {
echo 'Les fichiers de la liste ne sont pas visibles sur le serveur' ;
exit();
}
}
 
$xml .= XML_Util::createStartElement ('ezmlm_derniers_messages', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
 
$xml .= '<![CDATA[ '.$html.']]>';
 
$xml .= XML_Util::createEndElement('ezmlm_derniers_messages') ;
header ('Content-type: text/xml');
echo $xml ;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2008-11-04 17:11:10 aperonnet
* correction de bugs dans la liste des derniers messages
*
* Revision 1.4 2008-08-25 15:25:09 alexandre_tb
* optimisation et gestion des erreurs
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/ajout_abonne.php
New file
0,0 → 1,6
<?php
 
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
 
echo exec ('/usr/local/bin/ezmlm-sub '.$repertoire.' '.$mail, $output, $ret) ;
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/creation_liste.php
New file
0,0 → 1,20
<?php
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
$fichier_qmail = '/home/vpopmail/domains/'.$domaine.'/.qmail-'.$liste ;
 
 
// Transformation de ma chaine $parametres ((de aBud en -a -B -u -D)
$para = '' ;
for ($i = 0; $i < count ($parametres); $i++) {
$para .= '-'.$parametres.' ' ;
}
 
 
echo exec ('ezmlm-make '.$para.' '.$repertoire.' '.$fichier_qmail.' '.$liste.' '.$domaine, $output, $ret) ;
echo "\n" ;
 
echo exec ('ezmlm-reply-to '.$domaine.' '.$liste) ;
echo "\n" ;
 
 
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/ajout_moderateur.php
New file
0,0 → 1,7
<?php
 
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste.'/mod' ;
 
echo exec ('ezmlm-sub '.$repertoire.' '.$mail, $output, $ret) ;
echo 'ezmlm-sub '.$repertoire.' '.$mail ;
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/suppression_abonne.php
New file
0,0 → 1,7
<?php
 
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
 
echo exec ('ezmlm-unsub '.$repertoire.' '.$mail, $output, $ret) ;
echo 'ezmlm-unsub '.$repertoire.' '.$mail;
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/est_abonne.php
New file
0,0 → 1,65
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: est_abonne.php,v 1.1 2008-10-27 16:45:25 aperonnet Exp $
/**
* Application projet
*
* Renvoie une balise xml contenant 1 si l'utilisateur est abonné à une liste de discussion donnée, 0 sinon
*
*@package projet
//Auteur original :
*@author Aurelien Peronnet <aurelien@tela-botanica.org>
*@copyright Tela-Botanica 2000-2008
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
include_once 'XML/Util.php' ;
 
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
 
// Les 2 parametres doivent etres present
 
if (!isset($_GET['domaine']) || !isset($_GET['liste'])) {
$xml .= XML_Util::createTag('erreur', 'Vous devez sp&eacute;cifier un domaine et une liste');
} else {
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
exec ('ezmlm-list '.$repertoire, $output, $ret) ;
$xml .= XML_Util::createStartElement ('ezmlm_est_abonne') ;
if(in_array($mail,$output) >= 1) {
$xml .= '1' ;
}
else {
$xml .= '0' ;
}
$xml .= XML_Util::createEndElement('ezmlm_est_abonne') ;
header ('Content-type: text/xml');
echo $xml ;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
 
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/forumRSS.php
New file
0,0 → 1,54
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: forumRSS.php,v 1.2 2008-08-26 09:23:33 alexandre_tb Exp $
/**
* Générateur de flux RSS à partir d'une liste
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
*
*@copyright Tela-Botanica 2000-2004
*@version $$
// +------------------------------------------------------------------------------------------------------+
*/
 
include_once 'ezmlm-php-2.0/ezmlm-xml.php' ;
 
// test des variables
 
if (!isset($domaine) || !isset($liste)) {
exit() ;
}
 
$list = new ezmlm_xml() ;
$list->listdir = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
header('Content-type: text/xml') ;
$list->show_rss() ;
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/message.php
New file
0,0 → 1,50
<?php
 
include_once 'ezmlm-php-2.0/ezmlm.php' ;
 
 
// Parametrage de la liste
$message = new ezmlm_msgdisplay();
if (!$message) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
$message->forcehref = $url;
$message->listdir = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
$message->listname = $liste;
$message->listdomain = $domaine ;
$id_rep = $actionargs[0] ;
$num_message = $actionargs[1] ;
if ($id_rep =='' || $num_message == '') exit();
 
 
$html = $message->display ($id_rep.'/'.$num_message) ;
 
include_once 'XML/Util.php' ;
 
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
 
if (!$html) {
$xml .= XML_Util::createStartElement ('ezmlm_erreur') ;
$xml .= 'Le message n\'existe pas';
$xml .= XML_Util::createEndElement('ezmlm_erreur') ;
header ('Content-type: text/xml');
echo $xml;
exit();
}
 
 
 
$xml .= XML_Util::createStartElement ('ezmlm_message', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
 
$xml .= "\n".'<![CDATA[ '.$html.']]>';
$info_suivant = $message->getInfoSuivant() ;
$xml .= XML_Util::createStartElement ('message_suivant', array ('numero' => $info_suivant['fichier_suivant'],
'numero_repertoire' => $info_suivant['repertoire_suivant'])) ;
$xml .= XML_Util::createEndElement('message_suivant') ;
 
$xml .= XML_Util::createStartElement ('message_precedent', array ('numero' => $info_suivant['fichier_precedent'],
'numero_repertoire' => $info_suivant['repertoire_precedent'])) ;
$xml .= XML_Util::createEndElement('message_precedent') ;
$xml .= XML_Util::createEndElement('ezmlm_message') ;
header ('Content-type: text/xml');
echo $xml ;
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/.htaccess
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/.htaccess
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/liste_abonnes.php
New file
0,0 → 1,17
<?php
 
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
exec ('ezmlm-list '.$repertoire, $output, $ret) ;
 
include_once 'XML/Util.php' ;
 
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
 
$xml .= XML_Util::createStartElement ('ezmlm_liste_abonnes', array('domaine' => $domaine, 'liste' => $liste)) ;
 
foreach ($output as $mail) $xml .= XML_Util::createTag('email', '', $mail) ;
 
$xml .= XML_Util::createEndElement('ezmlm_liste_abonnes') ;
header ('Content-type: text/xml');
echo $xml ;
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/supprimer.php
New file
0,0 → 1,15
<?php
/**
* Supprime un message d'une liste
* Entrée domaine, liste, numero_repertoire, numero_message
*/
 
$repertoire_liste = '/home/vpopmail/domains/'.$domaine.'/'.$liste;
$message_a_supprimer = $repertoire_liste.'/archive/'.$actionargs[0].'/'.$actionargs[1] ;
 
if (file_exists ($message_a_supprimer)) {
echo $message_a_supprimer;
exec ('rm '.$message_a_supprimer) ;
exec ('ezmlm-archive -c '.$repertoire_liste);
exec ('ezmlm-idx '.$repertoire_liste);
}
/tags/2014_06_04/classes/ezmlm-php-2.0/services_vpopmail/clical.php
New file
0,0 → 1,68
<?php
/**
* @author Raphaël Droz <raphael@tela-botanica.org>
* @copyright 2013, Tela-Botanica
* @license GPL v3
* @license CECILL v2
*/
 
// eg: php clical.php amorphophallus_et_araceae|html2text
if (PHP_SAPI !== 'cli') die;
 
// for standalone use
// WARNING: this uses cache !
// php-cli user could have != permission than a webserver
// then cache file created could become inaccessible to webserver
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE ^ E_DEPRECATED);
date_default_timezone_set('Europe/Paris');
 
$path = '/home/vpopmail/domains';
$domaine = 'tela-botanica.org';
 
/*
List (ezmlm_threads::listmessages()), /calendrier_messages.php,
Recent (ezmlm_listinfo::show_recentmsgs()), /derniers_messages.php?domaine=&liste=
Month (ezmlm_listinfo::show_month(X)), /messages_mois.php?domaine=&liste=&actionargs[]=201306
month/Thread (ezmlm_listinfo::show_month(X)), /messages_thread.php?domaine=&liste=&actionargs[]=201306
XXX: Show (ezmlm_msgdisplay::display(X)), /message.php?domaine=&liste=&action=show_msg&actionargs[]=18&actionargs[]=09
 
-p: path
-d: domaine
*/
$options = getopt("LRMTp:d:");
if(isset($options['p'])) $path = $options['p'];
if(isset($options['d'])) $domaine = $options['d'];
$liste = array_slice($argv, -1)[0];
 
if(!$liste || !$domaine || !$path) die;
 
include_once 'ezmlm-php-2.0/ezmlm.php' ;
 
// Parametrage de la liste
if(array_key_exists('R', $options) || array_key_exists('M', $options)) {
$info = new ezmlm_listinfo();
} else { // cal & show threads
$info = new ezmlm_threads();
}
 
 
if (!$info) die('Les fichiers de la liste ne sont pas visible sur le serveur');
 
$info->forcehref = $url;
$info->listdir = $path . '/' . $domaine . '/' . $liste ;
$info->listname = $liste;
$info->listdomain = $domaine ;
 
if(array_key_exists('R', $options)) {
echo $info->show_recentmsgs();
}
elseif(array_key_exists('M', $options)) {
echo $info->show_month("201307");
}
elseif(array_key_exists('T', $options)) {
$info->tempdir = '/tmp' ; echo $info->load("201306");
}
else {
echo $info->listmessages(); // ezmlm_threads
}
/tags/2014_06_04/classes/ezmlm-php-2.0/ezmlm-errors.def
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/classes/ezmlm-php-2.0/ezmlm-errors.def
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/classes/ezmlm-php-2.0/README
New file
0,0 → 1,131
ezmlm-php 2.0
Nov 13, 2002
http://www.unixpimps.org/software/ezmlm-php
 
ezmlm-php is a group of files written in php that allow you to fetch messages
from a ezmlm mailing list archive via a web page. It is fully customizable so
it can fit into an existing layout design very well, it is also self contained
so that you can run it with no existing site setup.
 
The new version has been rewritten from the ground up to exclude all external
dependancies (except one which comes with the source, see makehash later on)
and now implements RFC2045 MIME parsing in pure PHP.
The system is now also object based to allow greater flexibility within the
code itself, it also makes the code much more managable and readable.
 
 
INSTALLATION
~~~~~~~~~~~~
*NOTE*
The installation of ezmlm-php now requires access to a compiler to build the
included makehash program. See the MAKEHASH section at the end.
 
1. Unpack the tarball and copy the files to your webroot in the directory you
want the list to be accessed from. For example using /home/www/mailinglist
 
gzip -d ezmlm-php-2.0.tar.gz
tar xvf ezmlm-php.2.0.tar
cd /home/www/mailinglist
cp ~/ezmlm-php-2.0/*.php .
cp ~/ezmlm-php-2.0/*.def .
 
2. Build the included makehash program.
 
cd ~/ezmlm-php-2.0
gzip -d makehash.tar.gz
tar xvf makehash.tar
cd makehash
make
 
If you do not have compiler access check the binaries directory in the
makehash.tar file as there are some common binaries there. If you build
makehash on a new platform please feel free to submit the binary for
inclusion.
 
3. Move the resulting binary to your webroot.
 
4. Edit ezmlm.php and change the user configurable options. Search for
USER-CONFIG to find where to edit. See CONFIGURATION below.
 
5. Access www.yoursite.com/mailinglist to test the installation.
 
 
CONFIGURATION
~~~~~~~~~~~~~
This section will explain each variable. If you used the last version most
of these are the exact same.
 
Name Meaning
~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
listdir This variable should be pointed at the root of the ezmlm
archive. For instance /usr/home/lists/ragga-jungle
 
listname The name of the list (everything before the @)
 
listdomain The domain name of the list
 
tempdir Where to store the cache files. /var/tmp should be fine
for most installations. /tmp is another choice.
 
sendheaders If set to TRUE then ezmlm will generate the nessesary
page headers. If set to FALSE your header file needs to
generate them. See 'includebefore'
 
sendbody If set to TRUE then ezmlm will generate the <body></body>
tags.
 
sendfooters If set to TRUE then ezmlm will generate the tage needed
to finish the document. If set to FALSE your footer file
needs to generate them. See 'includeafter'
 
includebefore This is a file that will be included before ezmlm-php
generates any output. You can have ezmlm-php generate
the nessesary headers (sendheaders = TRUE) and still
include a file of your own. The file is included by the
include_once function.
 
includeafter This is the exact same as includebefore except the file
is included after ezmlm-php has sent all of it's data.
 
href This is a string to prepend to the path whenever an
<a href= tag is generated. This option was added to fix
the problem of using a <base href= tag.
 
prefertype This is the mime type that you wish to send if the
current message is a multipart message. If this type isn't
found it defaults to the first part.
Some examples are: text/html, text/plain, etc...
 
showheaders This is an array of the headers to show. You can add or
remove any valid RFC822 header you wish to this array.
Some examples: X-Mailer, Message-ID
(This is case-insensitive)
 
msgtemplate This is a file to use as the message template, if blank
the internal one is used. See the file MSGTEMPLATE for
more information as it is to much to describe here.
 
tablescolours This is an array of colour hex triplets for use when a
table is generated. For each row that is generated the
next colour is used, just use a single element if you
don't want alternating colours.
(Yes there is a U in colours, the software was written
in Canada ;)
 
thread_subjlen This is an integer that tells the software how many
characters to allow the subjects when displayed in
threads or on the info page. This is useful if you
want to limit subjects to a certain length so that no
line wrapping occurs.
 
 
MAKEHASH
~~~~~~~~
So what is this little binary you need to build? Simply put it is a small
little C program to generate the nessesary ezmlm-idx hashes for cross
referencing authors. In the last version this was done by recursivley doing
a grep on the /authors directory which isn't very efficient when the list
subscriber base grows above 1000 or so. This program computes the hash by
using the same algorithim the software does and speeds things up a lot.
 
-FIN-
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/2014_06_04/classes/ezmlm-php-2.0/index.php
New file
0,0 → 1,19
<?php
// An even simpler version of the index page than version 1. All the actual work of
// determining what needs to be included and what needs to be run is now in the main class.
// Also, 'register_globals' doesn't need to be 'on' anymore.
 
require_once("ezmlm.php");
 
$ezmlm = new ezmlm_php();
 
$action = ($_POST['action'] ? $_POST['action'] : ($_GET['action'] ? $_GET['action'] : "list_info"));
$actionargs = ($_POST['actionargs'] ? $_POST['actionargs'] : ($_GET['actionargs'] ? $_GET['actionargs'] : ""));
 
$ezmlm->set_action($action);
$ezmlm->set_actionargs($actionargs);
$ezmlm->run();
 
unset($ezmlm);
 
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/ezmlm-listinfo.php
New file
0,0 → 1,235
<?php
// $Id: ezmlm-listinfo.php,v 1.3 2007/04/19 15:34:35 neiluj Exp $
//
// ezmlm-listinfo.php - ezmlm-php v2.0
// --------------------------------------------------------------
// Displays general list info in the format of a welcome page.
// --------------------------------------------------------------
 
require_once("ezmlm.php");
 
class ezmlm_listinfo extends ezmlm_php {
 
function ezmlm_listinfo () {
//return is_dir($this->listdir.'/archive/0') ;
}
function display() {
if (!is_dir($this->listdir.'/archive/0')) { // On teste si il y a au moins un message, cad le répertoire 0
echo $this->listdir.'/archive/0' ;
return false ;
}
$parser = new ezmlm_parser();
$parser->listdir = $this->listdir ;
//$this->show_info_file();
$threads = new ezmlm_threads();
$threads->listdir = $this->listdir ;
$threads->listname = $this->listname ;
$threads->forcehref = $this->forcehref ; /// ajout alex
$threads->listmessages() ;
$this->show_recentmsgs();
return true ;
}
 
function show_info_file() {
if (@is_file($this->listdir . "/text/info")) {
$infofile = @file($this->listdir . "/text/info");
while (list($line_num, $line) = each($infofile)) {
print nl2br($line);
}
}
}
 
 
function show_recentmsgs($title = "Messages récents") {
if (!is_dir($this->listdir.'/archive/0')) return false;
$html = '' ;
$parser = new ezmlm_parser();
$parser->listdir = $this->listdir ;
$html .= '<table class="table_cadre">'."\n";
$html .= '<tr><th class="col1">Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
$ctc = 0;
$recent = $parser->recent_msgs();
// le tableau recent est de la forme
// $recent[numero_message][1] sujet
// $recent[numero_message][2] date en anglais => (22 May 2006)
// $recent[numero_message][3] le hash de l auteur
// $recent[numero_message][4] auteur
$class = array ('ligne_paire', 'ligne_impaire') ;
while (list($key,$val) = each($recent)) {
$html .= '<tr class="'.$class[$ctc].'">'."\n";
//print '<td>'.$val->nummessage.'</td>' ;
// $key contient le numero du message tel que dans les fichiers d index par ex 216
// on retrouve le nom du repertoire et le nom du fichier
$decimal = (string) $key;
if ($key >= 100) {
$fichier_message = substr($decimal, -2) ;
$repertoire_message = substr ($decimal, 0, -2) ;
} else {
if ($key < 10) {
$fichier_message = '0'.$key;
} else {
$fichier_message = $decimal;
}
$repertoire_message = '0';
}
$html .= '<td>'.$key.'</td>' ;
$html .= '<td>';
 
$from = $val[4];
 
$html .= $this->makelink("action=show_author_msgs&actionargs[]=".$val[3],$this->decode_iso($this->protect_email($from,false)));
$html .= "</td>\n";
$html .= '<td><b>';
$actionargs = preg_split("/\//", $val->msgfile);
$html .= $this->makelink("action=show_msg&actionargs[]=".$repertoire_message.
"&actionargs[]=".$fichier_message ,$this->decode_iso($val[1]));
 
$html .= "</b></td>\n";
//print '<td>'.$this->date_francaise($val[2]).'</td>'."\n";
$html .= '<td>'.$val[2].'</td>'."\n";
$html .= "</tr>\n";
 
$ctc++;
if ($ctc == 2) { $ctc = 0; }
}
$html .= '</table>'."\n";
return $html;
}
// month = yyyymm
function show_month ($month) {
$html = '' ;
// on ouvre chaque fichier en lecture
if(!file_exists($this->listdir . '/archive/threads/' . $month)) {
return false ;
}
$numeros_mails_mois = $this->calculerNumMessagesDansMois($month);
 
$html .= '<table class="table_cadre">'."\n";
$html .= '<tr><th class="col1">Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
$ctc = 0;
$class = array ('ligne_paire', 'ligne_impaire') ;
 
if(count($numeros_mails_mois) > 0) {
$repertoire_premier_mail = (int) (reset($numeros_mails_mois) / 100) ;
}
foreach ($numeros_mails_mois as $num_message) {
 
$i = $num_message;
 
if ($i > 99) {
$multiplicateur = (int) ($i / 100) ;
// pour les mails > 99, on retranche n fois 100, ex 256 => 56 cad 256 - 2 * 100
$i = $i - $multiplicateur * 100 ;
}
 
if ($i < 10) $num_message = '0'.$i ; else $num_message = $i ;
if (file_exists($this->listdir.'/archive/'.$repertoire_premier_mail.'/'.$num_message)) {
$mimeDecode = new Mail_mimeDecode(file_get_contents ($this->listdir.'/archive/'.$repertoire_premier_mail.'/'.$num_message)) ;
$mailDecode = $mimeDecode->decode() ;
 
if ($i == 99) {
$repertoire_premier_mail++;
$i = -1;
}
$html .= '<tr class="'.$class[$ctc].'">'."\n";
$html .= '<td>'.($repertoire_premier_mail != 0 ? $repertoire_premier_mail : '').$num_message.'</td><td>';
$hash = $this->makehash($mailDecode->headers['from']);
$html .= $this->makelink("action=show_author_msgs&actionargs[]=".
$hash,$this->decode_iso($this->protect_email($mailDecode->headers['from'],TRUE)));
$html .= "</td>\n";
$html .= '<td><b>';
$actionargs[0] = $repertoire_premier_mail ;
$actionargs[1] = $num_message ;
if (count ($actionargs) > 1) {
$html .= $this->makelink("action=show_msg&actionargs[]=".
$actionargs[(count($actionargs) - 2)] .
"&actionargs[]=".
$actionargs[(count($actionargs) - 1)] ,$this->decode_iso($mailDecode->headers['subject']));
}
$html .= "</b></td>\n";
$html .= '<td>'.$this->date_francaise($mailDecode->headers['date']).'</td>'."\n";
$html .= "</tr>\n";
$ctc++;
if ($ctc == 2) { $ctc = 0; }
}
}
 
$html .= '</table>'."\n";
 
return $html;
}
 
private function calculerNumMessagesDansMois($mois) {
 
$fd = file_get_contents($this->listdir . '/archive/threads/'.$mois, 'r');
$fichier = explode ("\n", $fd) ;
 
$premiere_ligne = $fichier[0] ;
 
$nb_lignes_fichier = count($fichier);
 
$lignes_messages = array();
preg_match ('/[0-9]+/', $premiere_ligne, $match) ;
$numero_premier_mail = $match[0] ;
 
$lignes_messages[$numero_premier_mail] = $numero_premier_mail;
 
foreach($fichier as $ligne) {
 
if(trim($ligne == '')) { continue ;}
 
$ligne_tableau = explode(' ', $ligne);
$num_mail_sujet = explode(':',$ligne_tableau[0]);
$num_sujet = $num_mail_sujet[1];
 
$fd_sujet = file_get_contents($this->listdir.'/archive/subjects/'.substr($num_sujet,0,2).'/'.substr($num_sujet,2,strlen($num_sujet) - 1), 'r');
$premiere_ligne = true;
 
$fichier_sujet = explode ("\n", $fd_sujet) ;
foreach($fichier_sujet as $ligne_sujet) {
 
if($premiere_ligne || trim($ligne_sujet) == '') {$premiere_ligne = false; continue; }
$ligne_tableau_sujet = explode(':', $ligne_sujet);
$num_mail = $ligne_tableau_sujet[0];
$mois_ligne = $ligne_tableau_sujet[1];
if($mois_ligne == $mois) {
if(is_numeric($num_mail)) {
$lignes_messages[$num_mail] = $num_mail;
} else {
$num_mail = preg_replace('/[^0-9]+/','', $num_mail) ;
$lignes_messages[$num_mail] = $num_mail;
}
}
}
}
 
asort($lignes_messages);
return $lignes_messages;
}
}
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/makehash
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/classes/ezmlm-php-2.0/makehash
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/classes/ezmlm-php-2.0/MSGTEMPLATE
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/classes/ezmlm-php-2.0/MSGTEMPLATE
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/classes/ezmlm-php-2.0/ezmlm-threads.php
New file
0,0 → 1,492
<?php
// $Id: ezmlm-threads.php,v 1.7 2008-11-19 09:28:46 aperonnet Exp $
//
// ezmlm-threads.php - ezmlm-php v2.0
// --------------------------------------------------------------
// Builds, maintains & displays thread caches
// These cache files live in $ezmlm->tmpdir and are serialized
// php objects that can be unserialized and displayed easily
// --------------------------------------------------------------
 
require_once("ezmlm.php");
require_once("ezmlm-parser.php");
require_once ('ezmlm-langue-fr.php');
 
// CLASS: ezmlm_threads will build, maintain & display thread files (even if a thread is only 1 msg)
class ezmlm_threads extends ezmlm_php {
 
// load: this is the main function that should be called.
// it first checks to see if the cache files are stale, if they are it calls build
// other wise it loads them and calls display
function load($month) {
if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
$checksum = $this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month . "-" . "checksum";
} else {
$checksum = $this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month . "-" . "checksum";
}
$md5 = '' ;
if (!is_file($checksum)) {
$this->build($month);
} else {
$fd = fopen($checksum,"r");
while (!preg_match('/^md5:/', $md5)) { $md5 = fgets($fd,4096); }
fclose($fd);
$md5 = rtrim(preg_replace('/^md5:/', '', $md5), "\n");
if ($md5 != $this->md5_of_file($this->listdir . "/archive/threads/" . $month)) {
print "<!-- $md5 ne " . $this->md5_of_file($this->listdir . "/archive/threads/" . $month) . " -->\n";
$this->build($month);
}
}
$html = $this->display($month);
return $html ;
}
 
// display: this loads each cache file sequentially and displays the messages in them
// there is no checking of checksum's done here so load() is the preferred method to
// view the threads
function display($month) {
$html = '' ;
$seq = 0;
if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
$cache = $this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month;
} else {
$cache = $this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month;
}
// Le lien par date et par thread
$html .= '[ '.$this->makelink('action=show_month&amp;actionargs[]='.$month, 'par date').' ]' ;
$months = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August',
9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December');
// remplacé par le tableau globals $mois dans ezmlm.php
$html .= '<h2>'.FIL_DE_DISCUSSION.' pour '.$GLOBALS['mois'][((int)substr($month,4,2) / 1) -1] .', ' . substr($month,0,4) . '</h2>'."\n";
 
$html .= '<table class="table_cadre">'."\n";
$html .= '<tr><th>Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
$html .= '<tr><td colspan="3"><hr /></td></tr>'."\n";
$ctc .= 0;
 
if (is_file($cache)) {
$html .= file_get_contents($cache);
}
$html .= '<tr><td colspan="3"></td></tr>'."\n";
$html .= '</table>'."\n";
 
return $html ;
}
 
 
function thread_to_html($thread) {
$html = '';
$lastdepth = -1;
$ctc = 0 ;
$thread_curr = $thread;
$class = array ('ligne_paire', 'ligne_impaire') ;
while ($thread_curr != NULL) {
preg_match ('!/archive/([0-9]*)/([0-9]*)!', $thread_curr->file, $match) ;
if (!isset($GLOBALS['fichiers_analyses'][$match[1]][$match[2]])) {
$message = file_get_contents($this->listdir . "/archive/" . $msgdir . "/" . $msgfile) ;
$mimeDecode = new Mail_mimeDecode($message) ;
$mailDecode = $mimeDecode->decode() ;
//$msg = new ezmlm_parser();
//$msg->parse_file($this->listdir . $thread_curr->file, TRUE);
 
} else {
$mailDecode = $GLOBALS['fichiers_analyses'][$match[1]][$match[2]] ;
}
$actionargs = preg_split("/\//", $thread_curr->file);
$html .= '<tr class="'.$class[$ctc].'">'."\n";
$html .= '<td>'.$actionargs[2].$actionargs[3].'</td><td>';
$html .= $this->makelink('action=show_author_msgs&amp;actionargs[]='.
$this->makehash($this->decode_iso($mailDecode->headers['from'])),$this->decode_iso($this->protect_email($mailDecode->headers['from'],TRUE)));
$html .= '</td>'."\n";
$html .= '<td><b>';
//$html .= " <a name=\"" . urlencode($thread_curr->file) . "\">"; A quoi ça sert ?
for ($i = 0; $i < $thread_curr->depth; $i++) {
$html .= "&nbsp;&nbsp;";
}
if (($this->thread_subjlen > 0) and (strlen($this->decode_iso($mailDecode->headers['subject'])) > $this->thread_subjlen)) {
$subject = substr($this->decode_iso($mailDecode->headers['subject']), 0, ($this->thread_subjlen - 3 - ($thread_curr->depth * 2)));
$subject = $subject . "...";
} else {
$subject = $this->decode_iso($mailDecode->headers['subject']);
}
 
 
$subject = preg_replace("/\[" . $this->listname . "\]/", "", $subject);
$html .= $this->makelink("action=show_msg&amp;actionargs[]=" . $actionargs[2] . "&amp;actionargs[]=" . $actionargs[3], $subject);
$html .= "</b></td>\n";
$html .= '<td>' .$this->date_francaise($mailDecode->headers['date']).'</td>'."\n";
$html .= "</tr>\n";
 
$ctc++;
if ($ctc == count($this->tablecolours)) { $ctc = 0; }
 
$lastdepth = $thread_curr->depth;
$thread_curr = $thread_curr->next;
}
 
$html .= '<tr><td colspan="3"><hr noshade size="1" /></td></tr>'."\n";
return $html;
}
 
// TODO: Fonction à tester et compléter
// Construit un index de tous les messages envoyés dans une liste donnée pour un mois
// au format YYYYMM
/* // commenté sur le serveur
function build_month_list($date)
{
$months = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug',
9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec');
 
$month = $months[((int)substr($month,4,2) / 1) -1] ;
$year = substr($month,0,4) ;
$numArchive = $this->getNumArchive();
$dernierRepertoire = floor($numArchive / 100);
 
$threads = array();
 
for ($rep_courant = $dernierRepertoire; $rep_courant >= 0; $rep_courant--) {
$fichier_index = file ($this->listdir.'/archive/'.$rep_courant.'/index', FILE_IGNORE_NEW_LINES);
 
// On parcourt le fichier a l envers
for ($j = count($fichier_index)-1; $j >= 0; $j-=2) {
$match = strpos($fichier_index[$j],$month.' '.$year) ;
if ($match) {
 
$threads[] = $fichier_index[$j-1] ;
 
}
}
}
}
*/
 
// build: takes one argument in the format YYYYMM and builds the thread cache file
// for that month if the ezmlm thread file exists. The resulting cache file is then
// stored in $this->tmpdir;
function build($month) {
if (!is_file($this->listdir . "/archive/threads/" . $month)) { return FALSE; }
 
if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month,"w+");
} else {
$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month,"w+");
}
fclose($fd2);
$i=0;
// ouverture du fichier thread de ezmlm
// Ils sont classés mois par mois
$fd1 = fopen($this->listdir . "/archive/threads/" . $month, "r");
while (!feof($fd1)) {
$line = fgets($fd1,4096);
if (preg_match('/^[0-9]*\:[a-z]* \[.*/', $line)) {
// valid ezmlm thread file entry
 
// On place dans $subjectfile le chemin vers le fichier sujet
$subjectfile = preg_replace("/^[0-9]*\:([a-z]*) \[.*/", "\\1", $line);
$subjectfile = substr($subjectfile,0,2) . '/' . substr($subjectfile,2,18);
 
$thread_head = NULL;
$thread_curr = NULL;
$thread_temp = NULL;
$thread_depth = 1;
 
if (!is_file($this->listdir . "/archive/subjects/" . $subjectfile)) { continue; }
// on ouvre le fichier sujet
// Celui-ci contient sur la première ligne le hash du sujet puis le sujet
// sur les autres lignes :
// num_message:annéemois:hash_auteur nom_auteur
$fd2 = fopen($this->listdir . "/archive/subjects/" . $subjectfile, "r");
while (!feof($fd2)) {
$line2 = fgets($fd2,4096);
if (preg_match('/^[0-9]/',$line2)) {
$msgnum = preg_replace('/^([0-9]*):.*/', '\\1', $line2);
$msgfile = $msgnum % 100;
$msgdir = (int)($msgnum / 100);
if ($msgfile < 10) { $msgfile = "0" . $msgfile; }
//$msg = new ezmlm_parser();
//$msg->parse_file_headers($this->listdir . "/archive/" . $msgdir . "/" . $msgfile, TRUE);
 
$message = file_get_contents($this->listdir . "/archive/" . $msgdir . "/" . $msgfile) ;
$mimeDecode = new Mail_mimeDecode($message) ;
$mailDecode = $mimeDecode->decode() ;
 
 
 
// On stocke le fichier analysée pour réutilisation ultàrieure
$GLOBALS['fichiers_analyses'][$msgdir][$msgfile] = $mailDecode ;
$msgid = (isset ($mailDecode->headers['message-id']) ? $mailDecode->headers['message-id'] : '');
$inreply = (isset($mailDecode->headers['in-reply-to']) ? $mailDecode->headers['in-reply-to'] : '');
$references = (isset ($mailDecode->headers['references']) ? $mailDecode->headers['references'] : '') ;
$thread_depth = 1;
 
if ($thread_head == NULL) {
$thread_head = new ezmlm_thread(0,'/archive/' . $msgdir . '/' . $msgfile,$msgid);
} else {
$thread_curr = new ezmlm_thread($depth,'/archive/' . $msgdir . '/' . $msgfile,$msgid);
if ($inreply != '') { $thread_curr->inreply = $inreply; }
if ($references != '') { $thread_curr->references = $references; }
$thread_head->append($thread_curr);
}
}
}
fclose($fd2);
 
// so now after all that mess $thread_head contains a full thread tree
// first build the depth of each message based on 'in-reply-to' and 'references'
unset($thread_temp);
$thread_temp = NULL;
$thread_curr =& $thread_head->next;
while (get_class($thread_curr) == 'ezmlm_thread') {
unset($thread_temp);
$thread_temp = NULL;
 
if ($thread_curr->inreply != '') { $thread_temp =& $thread_head->find_msgid($thread_curr->inreply); }
if ($thread_temp == NULL) {
if ($thread_curr->references != '') {
$refs = preg_split('/ /', $thread_curr->references);
$refs = array_pop($refs);
$thread_temp =& $thread_head->find_msgid($refs);
}
}
if ($thread_temp == NULL) {
// we couldn't find anything... set depth to 1, the default
$thread_curr->depth = 1;
} else {
// we found a reference, set it to it's depth + 1
$thread_curr->depth = $thread_temp->depth + 1;
}
$thread_curr =& $thread_curr->next;
}
 
// now write it to a temp file named MONTH-SEQ where seq is cronologic sequence order of the thread.
if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
@mkdir($this->tempdir . "/ezmlm-php-" . $this->listname, 0755);
if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month, "a");
} else {
$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month, "a");
}
} else {
$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month, "a");
}
fputs($fd2,$this->thread_to_html($thread_head));
fclose($fd2);
}
}
 
// finally store our checksum
if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month . "-" . "checksum","w+");
} else {
$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month . "-" . "checksum","w+");
}
fputs($fd2,"md5:" . $this->md5_of_file($this->listdir . "/archive/threads/" . $month) . "\n");
fclose($fd2);
fclose($fd1);
 
return TRUE;
}
 
// listmessages: prints out a nice little calendar and displays the message
// totals for each month. The link jumps to the thread listing.
// On lit le repertoire archive/threads/ qui contient un fichier par mois avec tous les thread, par sujet
// Presentes comme suit
// num_thread:hash [taille_du_thread] Sujet du thread (le dernier)
// les messages sont ranges par leur numero
function listmessages() {
if (!is_dir($this->listdir . "/archive/threads/")) {
return false ;
}
 
$res = '<table id="petit_calendrier">'."\n";
$res .= " <tr>\n";
$res .= " <td></td>" ;
foreach ($GLOBALS['mois'] as $valeur) $res .= '<th>'.$valeur.'</th>' ;
$res .=" </tr>\n";
$res .= $this->calendrierMessage();
$res .= "</table>\n";
 
return $res;
/*
$threadcount = array();
 
$repertoire_archive = opendir($this->listdir . "/archive/");
$tableau_annee = array();
while (false !== ($item = readdir($repertoire_archive))) {
// $item contient les noms des repertoires
// on ne garde que ceux qui sont des chiffres
 
if (preg_match('/[0-9]+/', $item)) {
// on ouvre le fichier d index de chaque repertoire
$fichier_index = fopen($this->listdir.'/archive/'.$item.'/index', 'r');
$compteur = 0 ;
 
while (!feof($fichier_index)) {
// On ignore la premiere ligne
$temp = fgets($fichier_index, 4096);
// dans la seconde on recupere la date
$temp = fgets($fichier_index, 4096);
preg_match('/\t([0-9]+) ([a-zA-Z][a-zA-Z][a-zA-Z]) ([0-9][0-9][0-9][0-9])/', $temp, $match) ;
if ($match[0] != '') {
 
$threadmonth = date('n', strtotime($match[0])) ;
$threadyear = date('Y', strtotime($match[0])) ;
$threadcount[$threadyear][$threadmonth]++;
if (!in_array($threadyear, $tableau_annee)) array_push ($tableau_annee, $threadyear);
}
}
fclose ($fichier_index);
}
}
if (count($threadcount) == 0) return 'Il n\y a pas de messages dans les archives';
// La partie qui suit, simple, cree la table avec le nombre de message echange chaque mois
$res = '<table id="petit_calendrier">'."\n";
$res .= " <tr>\n";
$res .= " <td></td>" ;
foreach ($GLOBALS['mois'] as $valeur) $res .= '<th>'.$valeur.'</th>' ;
$res .=" </tr>\n";
arsort($tableau_annee);
foreach ($tableau_annee as $annee) {
$res .= " <tr>\n";
$res .= ' <td class="col_annee">'.$annee.'</td>';
for ($i = 1; $i <= 12; $i++) {
$res .= '<td class="mois">';
if (isset($threadcount[$annee][$i]) && $threadcount[$annee][$i] > 0) {
$res .= $this->makelink('action=show_month&amp;actionargs[]='.$annee.($i < 10 ? '0'.$i:$i),$threadcount[$annee][$i]);
}
$res .= '</td>';
}
$res .= '</tr>'."\n";
}
$res .= "</table>\n";
return $res ;
*/
}
/*
* Cree un fichier liste.calendrierPermanent qui contient
* le nombre de message par mois pour toutes les annees
* depuis le debut de la liste sauf la derniere
*
*/
function calculeCalendrierPermanent($Annnee = '') {
$numArchive = $this->getNumArchive();
$dernierRepertoire = floor($numArchive / 100);
 
$threadcount = array();
$tableau_annee = array();
 
for ($rep_courant = $dernierRepertoire; $rep_courant >= 0; $rep_courant--) {
$fichier_index = file ($this->listdir.'/archive/'.$rep_courant.'/index', FILE_IGNORE_NEW_LINES);
 
// On parcours le fichier a l envers
for ($j = count($fichier_index)-1; $j >= 0; $j-=2) {
preg_match('/\t([0-9]+) ([a-zA-Z]{3}) ([0-9]{4})/', $fichier_index[$j], $match) ;
if ($match[0] != '') {
$threadmonth = date('n', strtotime($match[0]));
$threadyear = date('Y', strtotime($match[0]));
if ($Annnee != '') {
if ($threadyear < date('Y')) {
$sortir = true;
break;
}
} else {
if ($threadyear == date('Y')) continue;
}
$threadcount[$threadyear][$threadmonth]++;
if (!in_array($threadyear, $tableau_annee)) array_push ($tableau_annee, $threadyear);
}
}
if ($sortir) break;
}
$res = '';
arsort($tableau_annee);
foreach ($tableau_annee as $annee) {
$res .= " <tr>\n";
$res .= ' <td class="col_annee">'.$annee.'</td>';
for ($i = 1; $i <= 12; $i++) {
$res .= '<td class="mois">';
if (isset($threadcount[$annee][$i]) && $threadcount[$annee][$i] > 0) {
$res .= $this->makelink('action=show_month&amp;actionargs[]='.$annee.($i < 10 ? '0'.$i:$i),$threadcount[$annee][$i]);
}
$res .= '</td>';
}
$res .= '</tr>'."\n";
}
return $res;
}
function ecrireFichierCalendrier() {
$html = $this->calculeCalendrierPermanent();
$f = fopen ('tmp/'.$this->listname.'.calendrier', 'w') ;
fwrite ($f, $html);
fclose($f);
return $html;
}
 
function calendrierMessage() {
$html = '';
// On ajoute la derniere annee
$html .= $this->calculeCalendrierPermanent(date ('Y'));
 
if (! $this->isFichierCalendrierExiste()) return $html . $this->ecrireFichierCalendrier();
// S'il existe mais qu il est trop vieux, il faut le recalculer et le réécrire
if ($this->isDoitRecalculerCalendrier()) return $html . $this->ecrireFichierCalendrier();
// précédemment, dans ce cas ci-dessus
// était effectuée un recalcul partiel, mais sans réécriture du fichier:
/* $annees = $this->getAnneesARecalculer();
$html .= $this->calculeCalendrierPermanent($annees); */
 
return $html . file_get_contents('tmp/'.$this->listname.'.calendrier');
}
 
function isFichierCalendrierExiste() {
if (file_exists('tmp/'.$this->listname.'.calendrier')) {
return true;
}
return false;
}
function isDoitRecalculerCalendrier() {
return (date ('Y', filemtime('tmp/'.$this->listname.'.calendrier')) <= date('Y') - 1);
}
 
function getAnneesARecalculer() {
// On suppose que l index de ezmlm est correct
$anneeFichierCalendrier = date ('Y', filemtime('tmp/'.$this->listname.'.calendrier'));
return $anneeFichierCalendrier + 1;
}
 
}
 
// CLASS: ezmlm-thread is a quick little class to allow us to define
// a structure of the current thread in a single-linked list.
// it's a little messy since php doesn't support pointers like C does
// so we have to use references and a head object to append to the list.
class ezmlm_thread {
var $next;
var $depth;
var $file;
var $msgid;
var $inreply;
var $references;
function append($thread) {
$thread_curr =& $this;
while ($thread_curr->next != NULL) {
$thread_curr =& $thread_curr->next;
}
$thread_curr->next = $thread;
}
function &find_msgid($msgid) {
$thread_curr =& $this;
while ($thread_curr->next != NULL) {
if (trim($thread_curr->msgid) == trim($msgid)) { return $thread_curr; }
$thread_curr =& $thread_curr->next;
}
return NULL;
}
function ezmlm_thread($depth,$file,$msgid) {
$this->depth = $depth;
$this->file = $file;
$this->msgid = $msgid;
$this->next = NULL;
}
}
?>
/tags/2014_06_04/classes/ezmlm-php-2.0/ezmlm-msgdisplay.php
New file
0,0 → 1,396
<?php
// $Id: ezmlm-msgdisplay.php,v 1.11 2008-11-19 09:28:46 aperonnet Exp $
//
// ezmlm-msgdisplay.php - ezmlm-php v2.0
// --------------------------------------------------------------
// Will parse a template (if specified) and display a message.
// Includes a default template.
// --------------------------------------------------------------
 
require_once("ezmlm.php");
require_once("Mail/mimeDecode.php") ;
 
class ezmlm_msgdisplay extends ezmlm_php {
// our template
var $msgtmpl;
var $message_rendu ;
var $_auth ;
// display: parses a message (using ezmlm_parser) and displays it
// using a template
var $msgfile;
function display($msgfile) {
if (!is_file($msgfile)) {
if (is_file($this->listdir . "/" . $msgfile)) { $msgfile = $this->listdir . "/" . $msgfile; }
else if (is_file($this->listdir . "/archive/" . $msgfile)) { $msgfile = $this->listdir . "/archive/" . $msgfile; }
else { return FALSE; }
}
$this->msgfile = $msgfile ;
$message = file_get_contents($msgfile) ;
// En cours de codage
// La fonction display retourne tout simplement le source du mail
// Il n'y a plus d'analyse a ce niveau
return $message;
$mimeDecode = new Mail_mimeDecode($message) ;
$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
// $msg->msgfile contient le chemin du fichier du mail en partant de la racine
// Le point d'exclamation est le delimiteur de l'expression reguliere
$relfile = preg_replace('!' . $this->listdir . '!', '', $msgfile);
$a1 = preg_replace('!/archive/(.*)/.*$!', '\1', $relfile); // $a1 contient le nom du repertoire
$a2 = preg_replace('!/archive/.*/(.*)$!', '\1', $relfile); // $a2 contient le nom du fichier
if (isset($mailDecode->headers['date'])) $msgtime = strtotime(preg_replace ('/CEST/', '', $mailDecode->headers['date']));
$threadidx = date("Ym", $msgtime);
if ($a2 <= 10) $numero_precedent = '0'.($a2 - 1) ; else $numero_precedent = ($a2 - 1) ;
if ($a2 < 9) $numero_suivant = '0'.($a2 + 1) ; else $numero_suivant = ($a2 + 1);
// On teste si le message suivant existe
$decoupe = explode ('/', $msgfile) ;
// Les nom de fichiers sont du format :
// archive/0/01
// archive/0/02 ... 0/99 archive/1/01 ...
$nom_fichier = $decoupe[count($decoupe)-1] ;
$nom_repertoire = $decoupe[count($decoupe)-2] ;
$repertoire_suivant = $nom_repertoire ; $repertoire_precedent = $nom_repertoire ;
if ($nom_fichier > 8) {
$fichier_suivant = $nom_fichier + 1 ;
if ($nom_fichier == 99) {
$fichier_suivant = '01' ;
$repertoire_suivant = $nom_repertoire + 1 ;
}
} else {
$fichier_suivant = '0'.($nom_fichier + 1) ;
}
if ($nom_fichier > 10) {
$fichier_precedent = $nom_fichier - 1 ;
} else {
if ($nom_fichier == '01') {
$fichier_precedent = '99' ;
$repertoire_precedent = $nom_repertoire - 1 ;
} else {
$fichier_precedent = '0'.($nom_fichier - 1) ;
}
}
print $this->parse_entete_mail($mailDecode) ;
$this->parse_template($mailDecode, $a2, $a1);
print $this->message_rendu;
//print '</div>' ;
}
/**
* Renvoie les infos des messages suivants
*
*
*/
function getInfoSuivant() {
$relfile = preg_replace('!' . $this->listdir . '!', '', $this->msgfile);
$nom_repertoire = preg_replace('!/archive/(.*)/.*$!', '\1', $relfile);
$nom_fichier = preg_replace('!/archive/.*/(.*)$!', '\1', $relfile);
$repertoire_suivant = $nom_repertoire;
// On recupere le numero du dernier message
if (file_exists($this->listdir.'/archnum')) {
$numero_dernier_message = file_get_contents($this->listdir.'/archnum');
}
// a partir du nom du fichier
// et du nom du repertoire, on reconstitue
// le numero du message stocke dans le fichier d index
// le message 12 du repertoire 2 a le numero 212
if ($nom_repertoire == '0') {
$numero_message = $nom_fichier;
} else {
$numero_message = $nom_repertoire.$nom_fichier ;
}
// On ouvre le fichier d index
$fichier_index = fopen ($this->listdir.'/archive/'.$nom_repertoire.'/index', 'r');
$compteur_ligne = 1;
if (preg_match ('/0([1-9][0-9]*)/', $nom_fichier, $match)) {
$nom_fichier = $match[1];
$prefixe = '0' ;
} else {
$prefixe = '' ;
}
$prefixe = $this->prefixe_nom_message($nom_fichier);
//echo $numero_message;
// on cherche la ligne avec le numero du message
while (!feof($fichier_index)) {
$temp = fgets($fichier_index,4096);
$x = preg_match('/(\d+): (\w+) (.*)/', $temp, $matches);
array_shift($matches);
list($num, $hash, $sujet) = $matches;
 
if ($num == $numero_message) {
$ligne_message_precedent = $compteur_ligne -2;
$temp = fgets($fichier_index, 4096);
$temp = fgets($fichier_index, 4096);
list ($fichier_suivant,$hash, $sujet) = split(':', $temp);
// Au cas ou est au dernier message du fichier d index
// il faut ouvrir le suivant
if (feof($fichier_index)) {
$repertoire_suivant++;
if (file_exists($this->listdir.'/archive/'.$repertoire_suivant.'/index')) {
$fichier_index_suivant = fopen($this->listdir.'/archive/'.$repertoire_suivant.'/index', 'r');
// on recupere le numero du premier message
list($fichier_suivant, $hash, $sujet) = split (':', fgets($fichier_index_suivant), 4096);
fclose ($fichier_index_suivant);
}
}
// Si le numero est > 100, il faut decouper et ne retenir
// que les dizaines et unites
if ($fichier_suivant >= 100) {
$decimal = (string) $fichier_suivant;
$numero = substr($decimal, -2) ;
$fichier_suivant = $numero ;
} else {
if ($fichier_suivant <= 9)$fichier_suivant = '0'.$fichier_suivant;
}
break;
}
// On avance d une ligne, la 2e ligne contient date hash auteur
$temp2 = fgets($fichier_index, 4096);
$compteur_ligne += 2;
}
// On utilise $ligne_message_precedent pour recupere le num du message precedent
// Si $ligne_precedent est negatif soit c le premier message de la liste
// soit il faut ouvrir le repertoire precedent
if ($ligne_message_precedent > 0) {
$compteur = 1;
rewind($fichier_index);
while (!feof($fichier_index)) {
$temp = fgets($fichier_index, 4096);
if ($ligne_message_precedent == $compteur) {
list ($fichier_precedent, $hash, $sujet) = split (':', $temp) ;
}
$compteur++;
}
// Le nom du repertoire precedent est le meme que le repertoire courant
$repertoire_precedent = $nom_repertoire ;
// Si $ligne_message_precedent est negatif, alors il faut ouvrir
// le fichier index du repertoire precedent
// si le nom du repertoire est 0, alors il n y a pas de repertoire precedent
// et donc pas de message precedent
} else {
if ($nom_repertoire != '0') {
$repertoire_precedent = $nom_repertoire -1 ;
// on ouvre le fichier d index et on extraie le numero
// du dernier message
$fichier_index_precedent = fopen ($this->listdir.'/archive/'.$repertoire_precedent.'/index', 'r') ;
while (!feof($fichier_index_precedent)) {
$temp = fgets($fichier_index_precedent,4096);
$ligne = split (':', $temp) ;
if ($ligne[0] != '') $fichier_precedent = $ligne[0];
$temp = fgets($fichier_index_precedent,4096);
}
fclose ($fichier_index_precedent);
// on se situe dans le repertoire 0 donc pas de message precedent
} else {
$fichier_precedent = null;
$repertoire_precedent = null;
}
}
if ($fichier_precedent > 100) {
$decimal = (string) $fichier_precedent;
$numero = substr($decimal, -2) ;
$fichier_precedent = $numero ;
} else {
if ($fichier_precedent < 10 )$fichier_precedent = '0'.$fichier_precedent;
}
fclose ($fichier_index);
//if ($fichier_precedent != null && $fichier_precedent < 10) $fichier_precedent = '0'.$fichier_precedent;
return array ('fichier_suivant' => $fichier_suivant,
'repertoire_suivant' => $repertoire_suivant,
'fichier_precedent' => $fichier_precedent,
'repertoire_precedent' => $repertoire_precedent);
}
/**
* analyse l'entete d'un mail pour en extraire les entête
* to, from, subject, date
* met à jour la variable $this->msgtmpl
*
*/
function parse_entete_mail (&$mailDecode) {
$startpos = strpos(strtolower($this->msgtmpl_entete), '<ezmlm-headers>');
$endpos = strpos(strtolower($this->msgtmpl_entete), '</ezmlm-headers>');
$headers = substr($this->msgtmpl_entete,$startpos + 15,($endpos - $startpos - 15));
$headers_replace = '' ;
for ($i = 0; $i < count($this->showheaders); $i++) {
$val = $this->showheaders[$i];
$headers_replace .= $headers;
$hnpos = strpos(strtolower($headers_replace), '<ezmlm-header-name>');
$headers_replace = substr_replace($headers_replace, $this->header_en_francais[$val], $hnpos, 19);
$hvpos = strpos(strtolower($headers_replace), '<ezmlm-header-value');
$headers_replace = $this->decode_iso ($headers_replace) ;
switch ($val) {
case 'date':
$headers_replace = substr_replace($headers_replace, $this->date_francaise($mailDecode->headers[strtolower($val)]), $hvpos, 20);
break;
case 'from':
if ($mailDecode->headers[strtolower($val)] == '') $from = $mailDecode->headers['return-path'] ;
else $from = $mailDecode->headers['from'];
$headers_replace = substr_replace($headers_replace, $this->protect_email($this->decode_iso($from)), $hvpos, 20);
//$headers_replace = htmlspecialchars($headers_replace);
break;
default:
$headers_replace = substr_replace($headers_replace, $this->protect_email($this->decode_iso($mailDecode->headers[strtolower($val)])), $hvpos, 20);
}
}
return substr_replace($this->msgtmpl_entete, $headers_replace, $startpos, (($endpos + 16) - $startpos));
}
function parse_template(&$mailDecode, $numero_mail, $numero_mois, $num_part = '') {
static $profondeur = array();
if ($num_part != '') array_push ($profondeur, $num_part) ;
$corps = '' ;
if ($mailDecode->ctype_primary == 'multipart') {
include_once PROJET_CHEMIN_CLASSES.'type_fichier_mime.class.php' ;
for ($i = 0; $i < count($mailDecode->parts); $i++) {
switch ($mailDecode->parts[$i]->ctype_secondary) {
case 'plain' :
if ($mailDecode->parts[$i]->headers['content-transfer-encoding'] == '8bit') {
$corps .= $this->_cte_8bit($mailDecode->parts[$i]->body);
} else if ($mailDecode->parts[$i]->headers['content-transfer-encoding'] == 'quoted-printable') {
if ($mailDecode->parts[$i]->ctype_parameters['charset'] == 'UTF-8') {
$corps .= utf8_decode($mailDecode->parts[$i]->body);
}
}
break;
case 'html' : $corps .= trim(strip_tags ($mailDecode->parts[$i]->body, '<br><p><a><style>'));
break ;
case 'mixed' :
case 'rfc822' :
case 'alternative' :
case 'appledouble' :
$this->parse_template($mailDecode->parts[$i], $numero_mail, $numero_mois, $i) ;
break ;
case 'applefile' : continue ;
break ;
default :
if ($mailDecode->parts[$i]->ctype_secondary == 'octet-stream') {
$nom_piece_jointe = $mailDecode->parts[$i]->ctype_parameters['name'] ;
$tab = explode ('.', $nom_piece_jointe) ;
$extension = $tab[count ($tab) - 1] ;
$mimeType = type_fichier_mime::factory($extension);
$mimeType->setCheminIcone(PROJET_CHEMIN_ICONES) ;
} else {
$nom_piece_jointe = isset ($mailDecode->parts[$i]->d_parameters['filename']) ?
$mailDecode->parts[$i]->d_parameters['filename'] : $mailDecode->parts[$i]->ctype_parameters['name'] ;
$mimeType = new type_fichier_mime( $mailDecode->parts[$i]->ctype_primary.'/'.
$mailDecode->parts[$i]->ctype_secondary, PROJET_CHEMIN_ICONES) ;
}
$lien = PROJET_CHEMIN_APPLI.'fichier_attache.php?nom_liste='.$this->listname.
'&actionargs[]='.$numero_mois.
'&actionargs[]='.$numero_mail;
if (count ($profondeur) > 0) {
array_shift($profondeur) ;
for ($j= 0; $j < count ($profondeur); $j++) $lien .= '&actionargs[]='.$profondeur[$j];
}
$lien .= '&actionargs[]='.$i ;
$corps .= '<a href="'.$lien.'">';
$corps .= '<img src="'.$mimeType->getCheminIcone().'" alt="'.$nom_piece_jointe.'" />&nbsp;' ;
if ($mailDecode->parts[$i]->ctype_secondary == 'jpg' || $mailDecode->parts[$i]->ctype_secondary == 'jpeg')
$corps .= '<img src="'.$lien.'" alt="'.$nom_piece_jointe.'" />&nbsp;' ;
$corps .= $nom_piece_jointe;
$corps .= '</a><br />' ;
break ;
}
}
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($corps,TRUE), $this->msgtmpl);
} else if ($mailDecode->ctype_primary == 'message') {
$this->message_rendu .= "\n".'<div class="message">'.$this->parse_entete_mail($mailDecode->parts[0]);
$corps .= $this->parse_template($mailDecode->parts[0], $numero_mail, $numero_mois, 0) ;
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($corps,true), $this->msgtmpl).'</div>';
} else if ($mailDecode->ctype_primary == 'application' || $mailDecode->ctype_primary == 'image'){
if ($mailDecode->ctype_secondary == 'applefile') return ;
$mimeType = new type_fichier_mime( $mailDecode->ctype_primary.'/'.$mailDecode->ctype_secondary,PROJET_CHEMIN_ICONES) ;
if ($mimeType->getIdType() != 12) {
$corps .= '<a href="'.PROJET_CHEMIN_APPLI.'fichier_attache.php?nom_liste='.$this->listname.'&actionargs[]='.
$numero_mois.'&actionargs[]='.
$numero_mail.'&actionargs[]='.$i.'">'.
'<img src="'.$mimeType->getCheminIcone().'" alt="'.$mailDecode->ctype_parameters['name'].'" />&nbsp;' ;
$corps .= $mailDecode->ctype_parameters['name'].'</a><br />' ;
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($corps,true), $this->msgtmpl);
}
} else {
if (preg_match('/html/i', $mailDecode->ctype_secondary)) {
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($mailDecode->body,TRUE), $this->msgtmpl);
} else {
if (isset ($mailDecode->ctype_parameters['charset']) && $mailDecode->ctype_parameters['charset'] == 'UTF-8') {
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', '<pre>' . utf8_decode($this->cleanup_body($mailDecode->body,TRUE)) . '</pre>', $this->msgtmpl);
} else {
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', '<pre>' . $this->cleanup_body($mailDecode->body,TRUE) . '</pre>', $this->msgtmpl);
}
}
}
array_pop ($profondeur);
}
 
function ezmlm_msgdisplay() {
$this->ezmlm_php();
if (($this->msgtemplate != "") and (is_file($this->msgtemplate))) {
$fd = fopen($this->msgtemplate, "r");
while (!feof($fd)) { $this->msgtmpl .= fgets($fd,4096); }
fclose($fd);
} else {
$this->msgtmpl = '<pre>
<ezmlm-body>
</pre>
';
}
$this->msgtmpl_entete = '<dl><ezmlm-headers>
<dt><ezmlm-header-name> :</dt>
<dd><ezmlm-header-value></dd>
</ezmlm-headers>
</dl>' ;
}
// _cte_8bit: decode a content transfer encoding of 8bit
// NOTE: this function is a little bit special. Since the end result will be displayed in
// a web browser _cte_8bit decodes ASCII characters > 127 (the US-ASCII table) into the
// html ordinal equivilant, it also ensures that the messages content-type is changed
// to include text/html if it changes anything...
function _cte_8bit($data,$simple = FALSE) {
if ($simple) { return $data; }
$changed = FALSE;
$out = '';
$chars = preg_split('//',$data);
while (list($key,$val) = each($chars)) {
if (ord($val) > 127) { $out .= '&#' . ord($val) . ';'; $changed = TRUE; }
else { $out .= $val; }
}
if ($changed) { $this->headers['content-type'][1] = 'text/html'; }
return $out;
}
 
}
/tags/2014_06_04/classes/ezmlm-php-2.0/ezmlm-parser.php
New file
0,0 → 1,402
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: ezmlm-parser.php,v 1.5 2008-11-19 09:28:46 aperonnet Exp $
/**
* Application projet
*
* classe ezmlm_parser pour lire les fichiers d index de ezmlm-idx
*
*@package projet
//Auteur original : ?? recupere dans ezmlm-php
*@author Alexandre Granier <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.5 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// $Id: ezmlm-parser.php,v 1.5 2008-11-19 09:28:46 aperonnet Exp $
//
 
require_once("ezmlm.php");
require_once("Mail/mimeDecode.php") ;
// CLASS: ezmlm-parser
class ezmlm_parser extends ezmlm_php {
var $headers; // the full untouched headers of the message
var $body; // the full untouched (but decoded) body (this is not $this->parts[0]->body)
var $parts; // all the parts, if it is a multipart message. each part is an ezmlm_parser object...
 
// Here's the most accessed headers, everything else can be
// accessed from the $this->headers array.
var $to; // To:
var $from; // From:
var $date; // Date:
var $subject; // Subject:
var $replyto; // Reply-To:
var $contenttype; // Content-Type:
 
var $multipart; // TRUE if the message is a multipart message
 
var $msgfile; // if parsed from a file, this is the filename...
 
// functions
 
/**
* recent_msgs renvoie les derniers messages de la liste de discussion
* ezmlm
*
* (
* [0] => Array
* (
* [1] => sujet
* [2] => date en anglais
* [3] => le hash de l auteur
* [4] => l auteur
* )
* [1] => ...
* )
* @param int le nombre de message a renvoye
* @return array un tableau contenant les messages
* @access public
*/
function recent_msgs($show = 20, $month = "") {
$repertoire_archive = opendir($this->listdir . "/archive/");
 
$repertoire_message = array() ;
 
$numArchive = $this->getNumArchive();
$dernier_repertoire = floor($numArchive / 100);
 
$tableau_message = array() ;
$compteur_message = 0 ;
$fichier_index = fopen ($this->listdir.'/archive/'.$dernier_repertoire.'/index', 'r') ;
while (!feof($fichier_index)) {
// Recuperation du numero de message, du hash du sujet et du sujet
$temp = fgets($fichier_index, 4096);
preg_match('/([0-9]+): ([a-z]+) (.*)/', $temp, $match) ;
// dans la seconde on recupere la date, hash auteur et auteur
$temp = fgets($fichier_index, 4096);
preg_match('/\t([0-9]+) ([a-zA-Z][a-zA-Z][a-zA-Z]) ([0-9][0-9][0-9][0-9]) ([^;]+);([^ ]*) (.*)/', $temp, $match_deuxieme_ligne) ;
if ($match[1] != '') {
$tableau_message[$match[1]] = array ($match[2], $match[3],
$match_deuxieme_ligne[1].' '.$match_deuxieme_ligne[2].' '.$match_deuxieme_ligne[3],
$match_deuxieme_ligne[5],
$match_deuxieme_ligne[6]);
}
}
fclose ($fichier_index);
// on renverse le tableau pour afficher les derniers messages en premier
$tableau_message = array_reverse($tableau_message, true);
// On compte le nombre de message, s il est inferieur $show et que l on est
// pas dans le premier index, on ouvre le fichier precedent et recupere
// le n dernier message
if (count ($tableau_message) < $show && $dernier_repertoire != '0') {
$avant_dernier_repertoire = $dernier_repertoire - 1 ;
// On utilise file_get_contents pour renverser le fichier
$fichier_index = array_reverse(
explode ("\n",
preg_replace ('/\n$/', '',
file_get_contents ($this->listdir.'/archive/'.$avant_dernier_repertoire.'/index')) ), true) ;
reset ($fichier_index);
//var_dump ($fichier_index);
for ($i = count ($tableau_message); $i <= $show; $i++) {
// Recuperation du numero de message, du hash du sujet et du sujet
// dans la seconde on recupere la date, hash auteur et auteur
 
preg_match('/\t([0-9]+) ([a-zA-Z][a-zA-Z][a-zA-Z]) ([0-9][0-9][0-9][0-9]) ([^;]+);([^ ]*) (.*)/',
current ($fichier_index), $match_deuxieme_ligne) ;
preg_match('/([0-9]+): ([a-z]+) (.*)/', next($fichier_index), $match) ;
next ($fichier_index);
if ($match[1] != '') {
$tableau_message[$match[1]] = array ($match[2], $match[3],
$match_deuxieme_ligne[1].' '.$match_deuxieme_ligne[2].' '.$match_deuxieme_ligne[3],
$match_deuxieme_ligne[5],
$match_deuxieme_ligne[6]);
}
}
} else {
// Si le nombre de message est > $show on limite le tableau de retour
$tableau_message = array_slice($tableau_message, 0, $show, true);
}
return $tableau_message ;
}
 
 
// parse_file - opens a file and feeds the data to parse, file can be relative to the listdir
function parse_file($file,$simple = FALSE) {
if (!is_file($file)) {
if (is_file($this->listdir . "/" . $file)) { $file = $this->listdir . "/" . $file; }
else if (is_file($this->listdir . "/archive/" . $file)) { $file = $this->listdir . "/archive/" . $file; }
else { return FALSE; }
}
 
$this->msgfile = $file;
$data = '' ;
$fd = fopen($file, "r");
while (!feof($fd)) { $data .= fgets($fd,4096); }
fclose($fd);
return $this->parse($data,$simple);
}
 
// parse_file_headers - ouvre un fichier et analyse les entête
function parse_file_headers($file,$simple = FALSE) {
if (!is_file($file)) {
if (is_file($this->listdir . "/" . $file)) { $file = $this->listdir . "/" . $file; }
else if (is_file($this->listdir . "/archive/" . $file)) { $file = $this->listdir . "/archive/" . $file; }
else { return FALSE; }
}
 
$this->msgfile = $file;
$data = file_get_contents ($file) ;
$message = file_get_contents($file) ;
$mimeDecode = new Mail_mimeDecode($message) ;
$mailDecode = $mimeDecode->decode() ;
return $mailDecode ;
}
 
// this does all of the work (well it calls two functions that do all the work :)
// all the decoding a part breaking follows RFC2045 (http://www.faqs.org/rfcs/rfc2045.html)
function parse($data,$simple = FALSE) {
if (($this->_get_headers($data,$simple)) && $this->_get_body($data,$simple)) { return TRUE; }
return FALSE;
}
 
// all of these are internal functions, you shouldn't call them directly...
 
// _ct_parse: parse Content-Type headers -> $ct[0] = Full header, $ct[1] = Content-Type, $ct[2] ... $ct[n] = AP's
function _ct_parse() {
$instr = $this->headers['content-type'];
preg_replace('/\(.*\)/','',$instr); // strip rfc822 comments
if (preg_match('/: /', $instr)) {
$ct = preg_split('/:/',trim($instr),2);
$ct = preg_split('/;/',trim($ct[1]));
} else {
$ct = preg_split('/;/',trim($instr));
}
if (isset($ct[1])) $attrs = preg_split('/[\s\n]/',$ct[1]);
$i = 2;
$ct[1] = $ct[0];
$ct[0] = $this->headers['content-type'];
if (isset($attrs) && is_array($attrs)) {
while (list($key, $val) = each($attrs)) {
if ($val == '') continue;
$ap = preg_split('/=/',$val,2);
if (preg_match('/^"/',$ap[1])) { $ap[1] = substr($ap[1],1,strlen($ap[1])-2); }
$ct[$i] = $ap;
$i++;
}
}
// are we a multipart message?
if (preg_match('/^multipart/i', $ct[1])) { $this->multipart = TRUE; }
 
return $ct;
}
 
// _get_headers: pulls the headers out of the data and builds the $this->headers array
function _get_headers($data,$simple = FALSE) {
$lines = preg_split('/\n/', $data);
while (list($key, $val) = each($lines)) {
$val = trim($val);
if ($val == "") break;
if (preg_match('/^From[^:].*$/', $val)) continue; /* strips out any From lines added by the MTA */
 
$hdr = preg_split('/: /', $val, 2);
if (count($hdr) == 1) {
// this is a continuation of the last header (like a recieved from line)
$this->headers[$last] .= $val;
} else {
$this->headers[strtolower($hdr[0])] = $hdr[1];
//echo htmlspecialchars($this->headers['from'])."<br />" ;
$last = strtolower($hdr[0]);
}
}
// ajout alex
// pour supprimer le problème des ISO...
// a déplacer ailleur, et appelé avant affichage
if (preg_match ('/windows-[0-9][0-9][0-9][0-9]/', $this->headers['subject'], $nombre)) {
$reg_exp = $nombre[0] ;
} else {
$reg_exp = 'ISO-8859-15?' ;
}
if (preg_match ('/UTF/i', $this->headers['subject'])) $reg_exp = 'UTF-8' ;
preg_match_all ("/=\?$reg_exp\?(Q|B)\?(.*?)\?=/i", $this->headers['subject'], $match, PREG_PATTERN_ORDER) ;
for ($i = 0; $i < count ($match[0]); $i++ ) {
if ($match[1][$i] == 'Q') {
$decode = quoted_printable_decode ($match[2][$i]) ;
} elseif ($match[1][$i] == 'B') {
$decode = base64_decode ($match[2][$i]) ;
}
$decode = preg_replace ("/_/", " ", $decode) ;
if ($reg_exp == 'UTF-8') {
$decode = utf8_decode ($decode) ;
}
$this->headers['subject'] = str_replace ($match[0][$i], $decode, $this->headers['subject']) ;
}
// sanity anyone?
if (!$this->headers['content-type']) { $this->headers['content-type'] = "text/plain; charset=us-ascii"; }
if (!$simple) { $this->headers['content-type'] = $this->_ct_parse(); }
 
return TRUE;
}
 
// _get_body: pulls the body out of the data and fills $this->body, decoding the data if nessesary.
function _get_body($data,$simple = FALSE) {
$lines = preg_split('/\n/', $data);
$doneheaders = FALSE;
$data = "";
while (list($key,$val) = each($lines)) {
//echo htmlspecialchars($val)."<br>";
if (($val == '') and (!$doneheaders)) {
$doneheaders = TRUE;
continue;
} else if ($doneheaders) {
$data .= $val . "\n";
}
}
 
// now here comes the fun part... decoding.
switch($this->headers['content-transfer-encoding']) {
case 'binary':
$this->body = $this->_cte_8bit($this->_cte_qp($this->_cte_binary($data)),$simple);
break;
 
case 'base64':
$this->body = $this->_cte_8bit($this->_cte_qp($this->_cte_base64($data)),$simple);
break;
 
case 'quoted-printable':
$this->body = $this->_cte_8bit($this->_cte_qp($data),$simple);
break;
 
case '8bit':
$this->body = $this->_cte_8bit($data,$simple);
break;
 
case '7bit': // 7bit doesn't need to be decoded
default: // And the fall through as well...
$this->body = $data;
break;
}
//echo $this->headers['content-type'][2][1];
if (isset($this->headers['content-type'][2][1]) && $this->headers['content-type'][2][1] == 'UTF-8') {
//$this->body = utf8_decode ($this->body) ;
//echo quoted_printable_decode(utf8_decode ($this->body)) ;
}
if ($simple) { return TRUE; }
 
// if we are a multipart message then break up the parts and decode, set the appropriate variables.
// here comes the best part about making ezmlm-php OOP. since each part is just really a little message
// in itself each part becomes a new parser object and all the wheels turn again... :)
if ($this->multipart) {
$boundary = '';
for ($i = 2; $i <= count($this->headers['content-type']); $i++) {
if (preg_match('/boundary/i', $this->headers['content-type'][$i][0])) {
$boundary = $this->headers['content-type'][$i][1];
}
}
if ($boundary != '') {
$this->_get_parts($this->body,$boundary);
} else {
// whoopps... something's not right here. we were told that the message is supposed
// to be a multipart message, yet the boundary wasn't set in the content type.
// mark the message as non multipart and add a message to the top of the body.
$this->multipart = FALSE;
$this->body = "PARSER ERROR:\nWHILE PARSING THIS MESSAGE AS A MULTIPART MESSAGE AS DEFINED IN RFC2045 THE BOUNDARY IDENTIFIER WAS NOT FOUND!\nTHIS MESSAGE WILL NOT DISPLAY CORRECTLY!\n\n" . $this->body;
}
}
 
return TRUE;
}
 
// _get_parts: breaks up $data into parts based on $boundary following the rfc specs
// detailed in section 5 of RFC2046 (http://www.faqs.org/rfcs/rfc2046.html)
// After the parts are broken up they are then turned into parser objects and the
// resulting array of parts is set to $this->parts;
function _get_parts($data,$boundary) {
$inpart = -1;
$lines = preg_split('/\n/', $data);
// La première partie contient l'avertissement pour les client mail ne supportant pas
// multipart, elle est stocké dans parts[-1]
while(list($key,$val) = each($lines)) {
if ($val == "--" . $boundary) { $inpart++; continue; } // start of a part
else if ($val == "--" . $boundary . "--") { break; } // the end of the last part
else { $parts[$inpart] .= $val . "\n"; }
}
for ($i = 0; $i < count($parts) - 1; $i++) { // On saute la première partie
$part[$i] = new ezmlm_parser();
$part[$i]->parse($parts[$i]);
$this->parts[$i] = $part[$i];
//echo $this->parts[$i]."<br>" ;
}
}
 
// _cte_8bit: decode a content transfer encoding of 8bit
// NOTE: this function is a little bit special. Since the end result will be displayed in
// a web browser _cte_8bit decodes ASCII characters > 127 (the US-ASCII table) into the
// html ordinal equivilant, it also ensures that the messages content-type is changed
// to include text/html if it changes anything...
function _cte_8bit($data,$simple = FALSE) {
if ($simple) { return $data; }
$changed = FALSE;
$chars = preg_split('//',$data);
while (list($key,$val) = each($chars)) {
if (ord($val) > 127) { $out .= '&#' . ord($val) . ';'; $changed = TRUE; }
else { $out .= $val; }
}
if ($changed) { $this->headers['content-type'][1] = 'text/html'; }
return $out;
}
 
// _cte_binary: decode a content transfer encoding of binary
function _cte_binary($data) { return $data; }
 
// _cte_base64: decode a content transfer encoding of base64
function _cte_base64($data) { return base64_decode($data); }
 
// _cte_qp: decode a content transfer encoding of quoted_printable
function _cte_qp($data) {
// For the time being we'll use PHP's function, it seems to work well enough.
return quoted_printable_decode($data);
}
}
/tags/2014_06_04/classes/ezmlm-php-2.0/TODO
New file
0,0 → 1,5
Things left TODO...
 
- Implement unique titles for each page
- Better default header/footer
- Fix bugs as they appear
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/2014_06_04/classes/ezmlm-php-2.0/ezmlm-repondre.php
New file
0,0 → 1,187
<?php
// $Id: ezmlm-repondre.php,v 1.2 2005/09/27 16:43:08 alexandre_tb Exp $
//
// ezmlm-msgdisplay.php - ezmlm-php v2.0
// --------------------------------------------------------------
// Will parse a template (if specified) and display a message.
// Includes a default template.
// --------------------------------------------------------------
 
require_once("ezmlm.php");
require_once("Mail/mimeDecode.php") ;
 
 
class ezmlm_repondre extends ezmlm_php {
// our template
var $msgtmpl;
var $message_rendu ;
// display: parses a message (using ezmlm_parser) and displays it
// using a template
function repondre($msgfile) {
if (!is_file($msgfile)) {
if (is_file($this->listdir . "/" . $msgfile)) { $msgfile = $this->listdir . "/" . $msgfile; }
else if (is_file($this->listdir . "/archive/" . $msgfile)) { $msgfile = $this->listdir . "/archive/" . $msgfile; }
else { return FALSE; }
}
$message = file_get_contents($msgfile) ;
$mimeDecode = new Mail_mimeDecode($message) ;
$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
// $msg->msgfile contient le chemin du fichier du mail en partant de la racine
// Le point d'exclamation est le délimiteur de l'expression régulière
$relfile = preg_replace('!' . $this->listdir . '!', '', $msgfile);
$a1 = preg_replace('!/archive/(.*)/.*$!', '\1', $relfile); // $a1 contient le nom du répertoire
$a2 = preg_replace('!/archive/.*/(.*)$!', '\1', $relfile); // $a2 contient le nom du fichier
if (isset($mailDecode->headers['date'])) $msgtime = strtotime(preg_replace ('/CEST/', '', $mailDecode->headers['date']));
$threadidx = date("Ym", $msgtime);
if ($a2 <= 10) $numero_precedent = '0'.($a2 - 1) ; else $numero_precedent = ($a2 - 1) ;
if ($a2 < 9) $numero_suivant = '0'.($a2 + 1) ; else $numero_suivant = ($a2 + 1);
// On teste si le message suivant existe
$decoupe = explode ('/', $msgfile) ;
// Les nom de fichiers sont du format :
// archive/0/01
// archive/0/02 ... 0/99 archive/1/01 ...
$nom_fichier = $decoupe[count($decoupe)-1] ;
$nom_repertoire = $decoupe[count($decoupe)-2] ;
$repertoire_suivant = $nom_repertoire ; $repertoire_precedent = $nom_repertoire ;
if ($nom_fichier > 8) {
$fichier_suivant = $nom_fichier + 1 ;
if ($nom_fichier == 99) {
$fichier_suivant = '01' ;
$repertoire_suivant = $nom_repertoire + 1 ;
}
} else {
$fichier_suivant = '0'.($nom_fichier + 1) ;
}
if ($nom_fichier > 10) {
$fichier_precedent = $nom_fichier - 1 ;
} else {
if ($nom_fichier == '01') {
$fichier_precedent = '99' ;
$repertoire_precedent = $nom_repertoire - 1 ;
} else {
$fichier_precedent = '0'.($nom_fichier - 1) ;
}
}
print '<br />'."\n";
$this->parse_template($mailDecode, $a2, $a1);
$formulaireReponse = new HTML_formulaireMail('formulaire_reponse', 'post', str_replace('&amp;', '&', $this->forcehref).'&action=repondre&'.
'actionargs[]='.$a1.'&actionargs[]='.$a2.'&'.PROJET_VARIABLE_ACTION.'='.PROJET_ENVOYER_UN_MAIL_V) ;
$formulaireReponse->construitFormulaire() ;
$formulaireReponse->addElement ('hidden', 'messageid', $mailDecode->headers['message-id']) ;
// Ajout de > au début de chaque ligne du message
$tableau = explode ("\n", $this->message_rendu) ;
$this->message_rendu = "> ".implode ("\n> ", $tableau) ;
$formulaireReponse->setDefaults(array('mail_corps' => $this->message_rendu,
'mail_titre' => 'Re : '.$this->decode_iso ($mailDecode->headers['subject']))) ;
 
print $formulaireReponse->toHTML() ;
 
}
function parse_template(&$mailDecode, $numero_mail, $numero_mois, $num_part = '') {
static $profondeur = array();
array_push ($profondeur, $num_part) ;
$corps = '' ;
if ($mailDecode->ctype_primary == 'multipart') {
include_once PROJET_CHEMIN_CLASSES.'type_fichier_mime.class.php' ;
for ($i = 0; $i < count($mailDecode->parts); $i++) {
switch ($mailDecode->parts[$i]->ctype_secondary) {
case 'plain' :
case 'html' : $corps .= $mailDecode->parts[$i]->body ;
break ;
case 'mixed' :
case 'rfc822' :
case 'alternative' :
case 'appledouble' :
$this->parse_template($mailDecode->parts[$i], $numero_mail, $numero_mois, $i) ;
break ;
case 'applefile' : continue ;
break ;
default :
if ($mailDecode->parts[$i]->ctype_secondary == 'octet-stream') {
$nom_piece_jointe = $mailDecode->parts[$i]->ctype_parameters['name'] ;
$tab = explode ('.', $nom_piece_jointe) ;
$extension = $tab[count ($tab) - 1] ;
$mimeType = type_fichier_mime::factory($extension, $GLOBALS['projet_db']);
$mimeType->setCheminIcone(PROJET_CHEMIN_ICONES) ;
} else {
$nom_piece_jointe = isset ($mailDecode->parts[$i]->d_parameters['filename']) ?
$mailDecode->parts[$i]->d_parameters['filename'] : $mailDecode->parts[$i]->ctype_parameters['name'] ;
$mimeType = new type_fichier_mime($GLOBALS['projet_db'], $mailDecode->parts[$i]->ctype_primary.'/'.
$mailDecode->parts[$i]->ctype_secondary, PROJET_CHEMIN_ICONES) ;
}
$corps .= '';
if (count ($profondeur) > 0) {
array_shift($profondeur) ;
//for ($j= 0; $j < count ($profondeur); $j++) $corps .= '&actionargs[]='.$profondeur[$j];
}
/*$corps .= '&actionargs[]='.$i ;
$corps .= '">'.'<img src="'.$mimeType->getCheminIcone().'" alt="'.$nom_piece_jointe.'" />&nbsp;' ;
$corps .= $nom_piece_jointe;
$corps .= '</a><br />' ;*/
break ;
}
}
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($corps,TRUE), $this->msgtmpl);
} else if ($mailDecode->ctype_primary == 'message') {
$this->message_rendu .= "\n".'<div class="message">'.$this->parse_entete_mail($mailDecode->parts[0]);
$corps .= $this->parse_template($mailDecode->parts[0], $numero_mail, $numero_mois, 0) ;
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($corps,true), $this->msgtmpl).'</div>';
} else if ($mailDecode->ctype_primary == 'application' || $mailDecode->ctype_primary == 'image'){
if ($mailDecode->ctype_secondary == 'applefile') return ;
$mimeType = new type_fichier_mime($GLOBALS['projet_db'], $mailDecode->ctype_primary.'/'.$mailDecode->ctype_secondary,PROJET_CHEMIN_ICONES) ;
if ($mimeType->getIdType() != 12) {
$corps .= '' ;
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($corps,true), $this->msgtmpl);
}
} else {
if (preg_match('/html/i', $mailDecode->ctype_secondary)) {
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($mailDecode->body), $this->msgtmpl);
} else {
if (isset ($mailDecode->ctype_parameters['charset']) && $mailDecode->ctype_parameters['charset'] == 'UTF-8') {
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', utf8_decode($this->cleanup_body($mailDecode->body)) , $this->msgtmpl);
} else {
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($mailDecode->body), $this->msgtmpl);
}
}
}
}
 
function ezmlm_repondre() {
$this->ezmlm_php();
if (($this->msgtemplate != "") and (is_file($this->msgtemplate))) {
$fd = fopen($this->msgtemplate, "r");
while (!feof($fd)) { $this->msgtmpl .= fgets($fd,4096); }
fclose($fd);
} else {
$this->msgtmpl = '<ezmlm-body>';
}
$this->msgtmpl_entete = '<dl><ezmlm-headers>
<dt><ezmlm-header-name> :</dt>
<dd><ezmlm-header-value></dd>
</ezmlm-headers>
</dl>' ;
}
 
}
/tags/2014_06_04/classes/ezmlm-php-2.0/ezmlm-langue-fr.php
New file
0,0 → 1,5
<?php
 
define ('FIL_DE_DISCUSSION', 'Fil de discussion') ;
 
?>
/tags/2014_06_04/classes/HTML_formulaireProjet.class.php
New file
0,0 → 1,175
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_formulaireProjet.class.php,v 1.8 2008-08-25 15:15:09 alexandre_tb Exp $
/**
* Application projet
*
* La classe HTML_formulaireProjet
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.8 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
 
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/checkbox.php' ;
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php' ;
 
/**
* class HTML_formulaireProjet
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
*/
class HTML_formulaireProjet extends HTML_QuickForm
{
 
/**
* Constructeur
*
* @param string formName Le nom du formulaire.
* @param string method Soit get soit post, voir le protocole HTTP
* @param string action L'action du formulaire.
* @param string target La cible du formulaire.
* @param Array attributes Des attributs supplémentaires pour la balise <form>
* @param bool trackSubmit Pour repérer si la formulaire a été soumis.
* @return void
* @access public
*/
function HTML_formulaireProjet( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
} // end of member function HTML_formulaireProjet
 
/**
* Renvoie le code HTML du formulaire.
*
* @return string
* @access public
*/
function toHTML( )
{
$res = HTML_QuickForm::toHTML() ;
return $res ;
} // end of member function toHTML
 
 
 
/**
* Ajoute les champs nécessaire au formulaire.
*
* @return void
* @access public
*/
function construitFormulaire(&$tableau_projet, $tableau_type = '', $tableau_theme = '')
{
$this->addElement ('text', 'projet_titre', PROJET_TITRE, array ('class' => 'projet_titre', 'maxlength' => 255, 'size' => '80')) ;
$this->addRule ('projet_titre', PROJET_ALERTE_TITRE, 'required', '', 'client') ;
if ($tableau_type != '') {
$select = new HTML_QuickForm_select ('projet_type', PROJET_TYPE, $tableau_type, array ('class' => 'projet_type')) ;
$this->addElement($select) ;
unset ($select) ;
}
/* impossible de faire fonctionner dojo Editor !!!
*
GEN_stockerStyleExterne('tundra', 'api/js/dojo1.0/dijit/themes/tundra/tundra.css');
GEN_stockerStyleExterne('dojo', 'api/js/dojo1.0/dojo/resources/dojo.css');
GEN_AttributsBody('class', 'tundra');
GEN_stockerFichierScript('dojo', 'api/js/dojo1.0/dojo/dojo.js',
'text/javascript',
array ('djConfig' => 'parseOnLoad: true, isDebug: true'));
GEN_stockerFichierScript('dojo.editor', 'api/js/dojo1.0/dijit/Editor.js', 'text/javascript');
GEN_stockerCodeScript('dojo.config.allowXdRichTextSave = true;');
*/
$this->addElement ('textarea', 'projet_resume', PROJET_RESUME, array('class'=>'projet_resume', 'rows'=>"5", 'cols'=>'80',
'width'=>"200", /*'dojoType' => 'dijit.Editor',*/ 'id' => 'resume_editeur')) ;
 
$this->addElement ('textarea', 'projet_description', PROJET_DESCRIPTION,
array('class'=>"projet_resume", 'rows'=>"20", 'cols'=>'80'/*, 'dojoType' => 'dijit.Editor'*/)) ;
 
$this->addElement ('text', 'projet_espace_internet', PROJET_ESPACE_INTERNET, array ('class' => 'projet_espace_internet', 'size' => '80')) ;
// on fait un groupe avec les boutons radio pour les mettres sur la même ligne
 
$radio[] = & HTML_QuickForm::createElement('radio', 'projet_moderation', '0', PROJET_NON_MODERE, '0') ;
$radio[] = & HTML_QuickForm::createElement('radio', 'projet_moderation', '1', PROJET_MODERE, '1');
$this->addGroup($radio, null, PROJET_INSCRIPTION, '&nbsp;');
/** Theme du projet ajout 05/2008 */
//var_dump ($tableau_theme);
if ($tableau_theme != '') {
foreach ($tableau_theme as $cle => $theme) {
$checkbox[$cle] = new HTML_QuickForm_checkbox('projet_theme['.$cle.']', '', $theme);
$this->addElement($checkbox[$cle]);
}
}
$label_projet = array() ;
$id_projet = array() ;
foreach ($tableau_projet as $projet) {
$label_projet[] = $projet->getTitre() ;
$id_projet[] = $projet->getId() ;
}
if (PROJET_UTILISE_HIERARCHIE) {
$select = new HTML_QuickForm_select ('projet_asso', PROJET_PERE, $label_projet, array ('class' => 'projet_asso')) ;
$this->addElement($select) ;
unset ($select) ;
}
$this->applyFilter(array('projet_resume', 'projet_description'), 'addslashes') ;
 
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.PROJET_CHAMPS_REQUIS) ;
$url_annuler = new Net_URL($this->getAttribute('action')) ;
$url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
// on fait un groupe avec les boutons pour les mettres sur la même ligne
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER);
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', PROJET_FICHIER_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
} // end of member function _construitFormulaire
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/classes/ezmlm-php-2.0.tar.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/classes/ezmlm-php-2.0.tar.gz
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/classes/projetControleur.class.php
New file
0,0 → 1,1759
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
 
// CVS : $Id: projetControleur.class.php,v 1.50 2008-10-22 08:21:58 aperonnet Exp $
 
/**
* Application projet
*
* La classe controleur projet
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.50 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
if (isset ($GLOBALS['lang'])) {
/** le fichier de langue, par defaut PROJET_LANGUE_DEFAUT */
include_once 'client/projet/langues/pro_langue_'.$GLOBALS['lang'].'.inc.php' ;
} else {
include_once 'client/projet/langues/pro_langue_'.PROJET_LANGUE_DEFAUT.'.inc.php' ;
}
 
require_once GEN_CHEMIN_API.'sql/SQL_manipulation.fonct.php' ;
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE des constantes |
// +------------------------------------------------------------------------------------------------------+
 
define ('PROJET_ACTION_COUPER', 3) ;
define ('PROJET_ACTION_MODIFIER', 4) ;
define ('PROJET_SUPPRESSION_FICHIER', 5) ;
define ('PROJET_NOUVEAU', 6) ;
define ('PROJET_NOUVEAU_V', 7) ;
define ('PROJET_MODIFIER_DESCRIPTION', 19) ;
define ('PROJET_MODIFIER_DESCRIPTION_V', 20) ;
define ('PROJET_NOUVEAU_FICHIER', 8) ;
define ('PROJET_NOUVEAU_FICHIER_V', 9) ;
define ('PROJET_NOUVEAU_REPERTOIRE', 11) ;
define ('PROJET_NOUVEAU_REPERTOIRE_V', 12) ;
define ('PROJET_SUPPRESSION_PROJET', 10) ;
define ('PROJET_ENVOYER_UN_MAIL', 13) ;
define ('PROJET_ENVOYER_UN_MAIL_V', 14) ;
define ('PROJET_ACTION_MODIFIER_V', 15) ;
define ('PROJET_ACTION_NOUVELLE_LISTE', 16) ;
define ('PROJET_ACTION_NOUVELLE_LISTE_V', 17) ;
define ('PROJET_ACTION_S_INSCRIRE', 21) ;
define ('PROJET_ACTION_CREER_WIKI', 22) ;
define ('PROJET_ACTION_SUPPRIMER_WIKI', 23) ;
define ('PROJET_ACTION_CREER_WIKI_V', 24) ;
define ('PROJET_ACTION_SUPPRIMER_LISTE', 25) ;
define ('PROJET_ACTION_DESINSCRIPTION_PROJET', 26) ;
define ('PROJET_ACTION_INSCRIPTION_LISTE', 27) ;
define ('PROJET_ACTION_DESINSCRIPTION_LISTE', 28) ;
define ('PROJET_ACTION_REFERENCER_LISTE', 29) ;
define ('PROJET_ACTION_REFERENCER_LISTE_V', 30) ;
define ('PROJET_ACTION_COLLER', 32) ;
define ('PROJET_ACTION_ASSOCIER_WIKI', 36) ;
define ('PROJET_ACTION_ASSOCIER_WIKI_V', 37) ;
 
define ('PROJET_ACTION_VOIR_RESUME', 'resume') ;
define ('PROJET_ACTION_VOIR_DESCRIPTION', 'description') ;
define ('PROJET_ACTION_VOIR_DOCUMENT', 'documents') ;
define ('PROJET_ACTION_VOIR_FORUM', 'forums') ;
define ('PROJET_ACTION_VOIR_PARTICIPANT', 'participants') ;
define ('PROJET_ACTION_VOIR_WIKINI', 'wikini') ;
/**
* Code erreur pour l'interface projetControleur qui trouveront leur message
* correspondant via la fonction projetControleur::messageErreur()
*/
define ('PROJETCONTROLEUR_ACTION_INVALIDE', -1) ;
define ('PROJETCONTROLEUR_ERREUR_SUPPRESSION_REPERTOIRE', -2) ;
define ('PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE', -3) ;
define ('PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE', -4) ;
 
/**
* Constantes pour definir les droits
*
*/
define ('PROJET_DROIT_ADMINISTRATEUR', 1) ;
define ('PROJET_DROIT_COORDINATEUR', 2) ;
define ('PROJET_DROIT_PROPRIETAIRE', 4) ;
define ('PROJET_DROIT_CONTRIBUTEUR', 8) ;
define ('PROJET_DROIT_AUCUN', 16) ;
define ('PROJET_DROIT_EN_ATTENTE', 32);
 
/** Constante pour les notifications
* Messages envoyes par la systeme pour prevenir
* les utilisateurs de certaines action
*/
define ('PROJET_NOTIFICATION_DEMANDE_INSCRIPTION', 1);
define ('PROJET_NOTIFICATION_ACCEPTATION_INSCRIPTION', 2);
define ('PROJET_NOTIFICATION_INSCRIPTION_NOUVELLE', 3); // Pour le coordinateur quand quelqu un s inscrit au projet
define ('PROJET_NOTIFICATION_DESINSCRIPTION_PROJET', 4);
define ('PROJET_NOTIFICATION_NOUVEAU_DOC', 5);
define ('PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD', 6);
 
/**
* class projetControleur
* Cette classe sert a lancer les diverses applications du module projet, en
* fonction des parametre de l'URL GET ou POST. La methode principale est run()
*/
class projetControleur
{
/*** Attributes: ***/
 
/**
* Contient l'action du controleur, qui correspond a une action du module projet.
* @access private
*/
var $_action;
/**
* Une connexion a une base de donnee DB.
* @access private
*/
var $_db;
 
/**
* Un objet PEAR:Auth
* @access private
*/
var $_auth;
 
/**
*
* @access private
*/
var $_url;
 
/**
* L'identifiant du projet sur lequel on travaille. Dans l'action par defaut, cet
* attribut n'a pas de valeur.
* @access private
*/
var $_id_projet;
 
/**
* L'identifiant du repertoire que l'on est en train d'observer. Il sera passé en
* parametre a la classe HTML_listeDocuments.
* @access private
*/
var $_id_repertoire;
 
/**
* L'identifiant du fichier que l'on est en train de modifier / supprimer.
* @access private
*/
var $_id_document;
 
/**
* La presentation de la liste des projets, par defaut en liste.
* Valeurs possibles: arbre
* @access private
*/
var $_presentation = 'liste' ;
 
/**
* Le type du projets, par defaut 0, signifie en pas de type particumier.
* Valeurs possibles: 0, 1, 2, 3 ...
* @access private
*/
 
var $_type ;
/**
* Le tableau des projets a ne pas afficher, ni dans l'arbre, ni dans les listes
* @access private
*/
var $_projet_exclu = array();
 
/**
* parametre indiquant le type d'inscription possible
* @access private
*/
var $_prive = 0 ;
 
/**
* parametre pour gere l appel a un service en rapport avec ajax
* @access private
*/
var $_service ;
/**
* Methode principale de la classe. Elle permet d'appeler les methodes du modules
* projet en fonction de l'action.
*
* @return string
* @access public
*/
 
 
function run( )
{
// On teste en premier la presence d un appel vers un service
if ($this->_service != '') {
if (file_exists(PROJET_CHEMIN_APPLI.'services/'.$this->_service.'.php')) {
return include_once PROJET_CHEMIN_APPLI.'services/'.$this->_service.'.php' ;
}
}
if ($this->_action == '') {
return $this->messageErreur(PROJETCONTROLEUR_ACTION_INVALIDE) ;
}
 
// Si il n'y a pas d'action mais un projet, on transmet par defaut l'action PROJET_VOIR_RESUME
if ($this->_id_projet != "" && $this->_action == PROJET_DEFAUT) {
$this->_action = PROJET_ACTION_VOIR_RESUME ;
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
}
if ($this->_id_document != "") {
$this->_url->addQueryString (PROJET_VARIABLE_ID_DOCUMENT, $this->_id_document) ;
}
if ($this->_id_repertoire != '') {
$this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
}
$retour = '' ;
if (!defined('PROJET_MENU_AFFICHER_CONTENU_CORPS')) $retour = $this->menuGeneral() ;
 
switch ($this->_action) {
case PROJET_DEFAUT :
$retour .= $this->mesProjets() ;
break ;
case PROJET_NOUVEAU :
$retour .= $this->formulaireProjet(PROJET_NOUVEAU_V) ;
break ;
case PROJET_NOUVEAU_V :
$retour .= $this->nouveauProjetValidation().$this->mesProjets() ;
break ;
case PROJET_NOUVEAU_FICHIER :
$retour .= $this->formulaireFichier(PROJET_NOUVEAU_FICHIER) ;
break ;
case PROJET_ACTION_MODIFIER :
$retour .= $this->formulaireFichier (PROJET_ACTION_MODIFIER) ;
break ;
case PROJET_ACTION_MODIFIER_V :
$retour .= $this->modifierFichier () ;
$this->_action = PROJET_ACTION_VOIR_DOCUMENT ;
break ;
case PROJET_NOUVEAU_FICHIER_V :
$retour .= $this->nouveauFichierValidation() ;
$this->_action = PROJET_ACTION_VOIR_DOCUMENT ;
break ;
case PROJET_ACTION_COUPER :
$retour .= $this->fichierCouper() ;
$this->_action = PROJET_ACTION_VOIR_DOCUMENT ;
break ;
case PROJET_SUPPRESSION_PROJET :
$retour .= $this->suppressionProjet().$this->mesProjets() ;
break ;
case PROJET_NOUVEAU_REPERTOIRE :
$retour .= $this->nouveauRepertoire() ;
break ;
case PROJET_NOUVEAU_REPERTOIRE_V :
$retour .= $this->nouveauRepertoireValidation() ;
$this->_action = PROJET_ACTION_VOIR_DOCUMENT ;
break ;
case PROJET_SUPPRESSION_FICHIER :
$retour .=$this->suppressionFichier() ;
$this->_action = PROJET_ACTION_VOIR_DOCUMENT ;
break ;
case PROJET_ENVOYER_UN_MAIL :
$retour .= $this->envoyerUnMailFormulaire() ;
break ;
case PROJET_ENVOYER_UN_MAIL_V :
$retour .= $this->envoyerUnMailValidation() ;
$this->_action = PROJET_ACTION_VOIR_FORUM ;
break ;
case PROJET_ACTION_NOUVELLE_LISTE : $retour .= $this->formulaireListe(PROJET_ACTION_NOUVELLE_LISTE) ;
break ;
case PROJET_ACTION_NOUVELLE_LISTE_V : $retour .= $this->nouvelleListeValidation() ;
$this->_action = PROJET_ACTION_VOIR_FORUM ;
break ;
case PROJET_ACTION_SUPPRIMER_LISTE : $retour .= $this->supprimerListe() ;
$this->_action = PROJET_ACTION_VOIR_RESUME ;
break ;
case PROJET_MODIFIER_DESCRIPTION : $retour .= $this->formulaireProjet(PROJET_MODIFIER_DESCRIPTION_V) ;
break ;
case PROJET_MODIFIER_DESCRIPTION_V : $retour .= $this->modifierProjet() ;
$this->_action = PROJET_ACTION_VOIR_RESUME ;
break ;
case PROJET_ACTION_S_INSCRIRE : $retour .= $this->inscriptionProjet() ;
 
break ;
case PROJET_ACTION_DESINSCRIPTION_PROJET : $retour .= $this->desinscriptionProjet() ;
break ;
case PROJET_ACTION_CREER_WIKI : $retour .= $this->formulaireWiki() ;
break ;
case PROJET_ACTION_CREER_WIKI_V : $retour .= $this->creationWiki() ;
$this->_action = PROJET_ACTION_VOIR_RESUME ;
break ;
case PROJET_ACTION_ASSOCIER_WIKI : $retour .= $this->associerWiki() ;
break ;
case PROJET_ACTION_ASSOCIER_WIKI_V : $retour .= $this->associationWiki() ;
$this->_action = PROJET_ACTION_VOIR_RESUME ;
break ;
case PROJET_ACTION_SUPPRIMER_WIKI : $retour .= $this->supprimerWiki();
$this->_action = PROJET_ACTION_VOIR_RESUME ;
break ;
case PROJET_ACTION_INSCRIPTION_LISTE : $message_retour = $this->inscriptionListe() ;
$this->_action = PROJET_ACTION_VOIR_FORUM ;
break ;
case PROJET_ACTION_DESINSCRIPTION_LISTE : $message_retour = $this->desinscriptionListe() ;
$this->_action = PROJET_ACTION_VOIR_FORUM ;
break ;
case PROJET_ACTION_REFERENCER_LISTE : $retour .= $this->referencerListeExterne() ;
break ;
case PROJET_ACTION_REFERENCER_LISTE_V : $retour .= $this->referencerListeExterneValidation() ;
$this->_action = PROJET_ACTION_VOIR_RESUME ;
break ;
 
}
if (!is_int($this->_action)) {
if (file_exists(PROJET_CHEMIN_APPLI.'actions/'.$this->_action.'.php')) {
include_once PROJET_CHEMIN_APPLI.'actions/'.$this->_action.'.php' ;
}
}
return $retour ;
} // end of member function run
 
/**
* Permet de fixer la valeur de l'action pour l'objet projetControleur. Cette action
* provient generalement de $_POST['action'] ou $_GET['action']
*
* @param int action L'action à passer provient de l'URL.
* @return void
* @access public
*/
function setAction( $action )
{
$this->_action = $action ;
}
 
/**
* Permet de fixer la valeur de du service pour l'objet projetControleur. Ce service
* provient généralement de $_POST['service'] ou $_GET['service']
*
* @param int service Le service à appeler provient de l'URL.
* @return void
* @access public
*/
function setService( $service )
{
$this->_service = $service ;
}
 
 
/**
* Constructeur.
*
* @return void
* @access public
*/
function projetControleur(&$dbObjet, &$authObjet, $urlObjet = "")
{
$this->_db = $dbObjet ;
$this->_auth = $authObjet ;
$this->_id_repertoire = 0 ;
$this->_type = '' ;
if (is_object ($urlObjet)) {
$this->_url = $urlObjet ;
}
} // end of member function projetControleur
 
/**
* Renvoie la liste des projets auquel participe la personne logguee, avec son
* statut et un lien vers l'action pour gerer le projet.
*
* @return string
* @access public
*/
function mesProjets( )
{
$res = '' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$participant = new participe ($this->_db) ;
 
// Les entetes des tableaux
$tableau_label_statut_action = array (PROJET_GERER, PROJET_GERER, PROJET_GERER_FICHIER, PROJET_VOIR_FICHIER, "---") ;
 
$auth = $this->_auth->getAuth() ; // Pour raccourcir le code
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ; // --------------
return include_once PROJET_CHEMIN_APPLI.'presentation/'.$this->_presentation.'.php' ;
}
 
/**
* Renvoie le menu general de l'application projet. Avec differents liens selon le
* statut de l'utilisateur.
*
* @return string
* @access public
*/
function menuGeneral( )
{
$res = '' ;
$auth = $this->_auth->getAuth() ;
if (!$auth) return ;
$res .= '<div class="menu_projet">'."\n";
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($this->_db) ;
if ($participant->isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID))) {
$isAdm = 1; $isCoord = 1 ; $isContri = 1 ;
$label_statut = PROJET_ADMINISTRATEUR;
} else {
$isAdm = 0 ; $isCoord = 0 ; $isContri = 0 ;
}
 
// Les menus specifiques aux projets
if ($this->_id_projet != '') {
if (!$isCoord) {
$isCoord = $participant->isCoordinateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
if ($isCoord) {
$label_statut = PROJET_CHEF ;
$isContri = true ;
}
}
if (!$isContri && !$isAdm) {
$isContri = $participant->isContributeur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
if ($isContri) {
$label_statut = PROJET_VOUS_PARTICIPEZ ;
} else {
$label_statut = PROJET_VOUS_N_ETES_PAS_INSCRIT ;
}
}
if ($participant->isEnAttente($this->_auth->getAuthData(PROJET_CHAMPS_ID),$this->_id_projet,$this->_db)) {
$isEnAttente = true ;
$label_statut = PROJET_EN_ATTENTE ;
} else {
$isEnAttente = false ;
}
}
 
if ($isContri || $isAdm) {
$res .= '<h2>' ;
if ($isAdm) $res .= PROJET_VOUS_ETES.' ' ;
$res .= $label_statut.'</h2>'."\n" ;
 
} else {
if ($this->_id_projet != '') $res .= '<h2>'.$label_statut.'</h2>'."\n" ;
}
if ($this->_id_projet != '') {
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
// Participant
if (!$isEnAttente) {
$res .= '<ul id ="projet_groupe_niv1"><li class="projet_niv1">'.PROJET_CONTRIBUTEUR ;
$res .= '<ul id="projet_groupe_niv2_con">' ;
}
if ($isCoord || $isContri) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_SE_DESINSCRIRE."</a></li>\n" ;
} else {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
if (!$isEnAttente) $res .= '<li class="projet_niv2"><a href="'.
$this->_url->getURL().'">'.PROJET_S_INSCRIRE_AU_PROJET."</a></li>\n" ;
}
// L'action gerer les utilisateurs
if ($isCoord || $isAdm) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_GESTION_UTILISATEUR."</a></li>\n" ;
}
$res .= '</ul></li>' ;
//document
if ($isContri || $isCoord || $isAdm) {
// On ajoute l id d un repertoire s il existe
if (isset($this->_id_repertoire)) $this->_url->addQueryString ('id_repertoire', $this->_id_repertoire);
$res .= '<li class="projet_niv2">'.PROJET_DOCUMENT ;
// L'action "Mettre un fichier en ligne"
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER) ;
$res .= '<ul><li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_METTRE_FICHIER."</a></li>\n" ;
// L'action creer un repertoire
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_CREER_REP."</a></li>\n" ;
$res .= '</ul></li>' ;
$this->_url->removeQueryString('id_repertoire');
// Forum
$res .= '<li class="projet_niv1">'.PROJET_FORUM ;
$res .= '<ul id="projet_groupe_niv2_for">' ;
if ($projet->avoirListe()) {
// On verifie si l'utilisateur est inscrit ou non a la liste et on ajoute le lien
//$projet->getListesAssociees();
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php';
foreach ($projet->_listes_associes as $info_liste) {
$listes_ext = new liste_externe ($this->_db) ;
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
if (count ($tableau_liste) == 0) {
$inscription_liste = new inscription_liste($this->_db) ;
if ($inscription_liste->getStatutInscrit($info_liste->getId(), $this->_auth) == 0) {
$action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
$label_inscription = PROJET_RECEVOIR_MESSAGES ;
} else {
// L'action envoyer un mail
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a></li>'."\n" ;
$action_inscription = PROJET_ACTION_DESINSCRIPTION_LISTE ;
$label_inscription = PROJET_NE_PAS_RECEVOIR_MESSAGES ;
}
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">';
$res .= $label_inscription.'</a></li> ';
}
}
if ($isAdm || (PROJET_UTILISATEURS_COORD && $isCoord)) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_SUPPRIMER_LISTE) ;
$texte_liste = PROJET_SUPPRIMER_LISTE ;
$onclic = ' onclick="javascript:return confirm(\''.PROJET_SUPPRIMER_LISTE_CONFIRMATION.'\');"' ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'"'.$onclic.'>'.$texte_liste.'</a></li>'."\n" ;
}
} else {
if ($isAdm || $isCoord) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE) ;
$texte_liste = PROJET_CREER_LISTE ;
$onclic = '' ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'"'.$onclic.'>'.$texte_liste.'</a></li>'."\n" ;
}
}
if ($isAdm) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_REFERENCER_LISTE) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_REFERENCER_LISTE.'</a></li>'."\n" ;
}
$res .= '</ul></li>' ;
}
// Gestion projet
if ($isCoord || $isAdm) {
$res .= '<li class="projet_niv1">'.PROJET_GESTION_PROJET ;
$res .= '<ul id="projet_group_niv2_ges">' ;
// L'action modifier les proprietes du projet
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_MODIFIER_PROPRIETES."</a></li>\n" ;
if ($isAdm || (PROJET_UTILISATEURS_COORD && $isCoord)) {
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET) ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_NOUVEAU_PROJET.'</a></li>'."\n" ;
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
// L'action supprimer le projet
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_SUPPRESSION_PROJET) ;
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.PROJET_SUPPRIMER_PROJET_CONFIRMATION.'\');">'
.PROJET_SUPPRIMER_LE_PROJET."</a></li>\n" ;
}
$res .= '</ul></li>' ;
}
// Wikini
if ($isAdm) {
$res .= '<li class="projet_niv1">'.PROJET_WIKINI ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI) ;
$res .= '<ul><li class="projet_niv2"><a href="'.$this->_url->getURL()."\">".PROJET_CREER_WIKI."</a></li>\n" ;
// L'action choisir un wikini
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_ASSOCIER_WIKI) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL()."\">".PROJET_ASSOCIER_WIKI."</a></li>\n" ;
$res .= '</ul></li>' ;
}
} else {
if ($isAdm) {
$res .= '<li class="projet_niv1">'.PROJET_GESTION_PROJET ;
$res .= '<ul>' ;
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET) ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_NOUVEAU_PROJET.'</a></li>'."\n" ;
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
$res .= '</ul></li>' ;
}
}
$res .= '</ul>' ;
$res .= "</div>\n" ;
$this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
$vues = array (PROJET_ACTION_VOIR_RESUME, PROJET_ACTION_VOIR_DESCRIPTION, PROJET_ACTION_VOIR_WIKINI, PROJET_ACTION_VOIR_FORUM, PROJET_ACTION_VOIR_PARTICIPANT);
if (isset($_REQUEST[PROJET_VARIABLE_ACTION]) && in_array ($_REQUEST[PROJET_VARIABLE_ACTION], $vues)) $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $_REQUEST[PROJET_VARIABLE_ACTION]);
return $res ;
} // end of member function menuGeneral
 
/**
* Renvoie le formulaire de cretion d'un projet.
*
* @return string
* @access public
*/
function formulaireProjet($action)
{
if (!$this->_auth->getAuth()) {
return PROJET_TEXTE_NON_IDENTIFIE;
}
if (fileperms(PROJET_CHEMIN_FICHIER) & 0x0002) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
$formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post',str_replace ("&amp;", "&", $this->_url->getURL())) ;
$tableau_type = '' ;
if (PROJET_UTILISE_TYPE) {
include_once PROJET_CHEMIN_CLASSES.'projet_type.class.php' ;
$tableau_type = projet_type::getTousLesTypes($this->_db) ;
}
/** recuperation des themes */
include_once PROJET_CHEMIN_CLASSES.'projet_theme.class.php';
$tableau_theme = projet_theme::getTousLesThemes($this->_db);
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db), $tableau_type, $tableau_theme);
if ($action == PROJET_MODIFIER_DESCRIPTION_V) {
$projet = new projet($this->_db, $this->_id_projet) ;
$valeurs_par_defaut = array ( 'projet_titre' => $projet->getTitre(),
'projet_description' => $projet->getDescription(),
'projet_asso' => $projet->getIdPere(),
'projet_wikini' => $projet->getWikini(),
'projet_resume' => $projet->getResume(),
'projet_espace_internet' => $projet->getEspaceInternet(),
'projet_type'=> $projet->getType(),
'projet_moderation' => $projet->isModere(),
) ;
$formulaire_projet->setDefaults($valeurs_par_defaut) ;
$themes = $projet->getThemes();
foreach ($themes as $cle => $valeur) {
$element = $formulaire_projet->getElement('projet_theme['.$cle.']');
if (PEAR::isError($element)) return $element->getMessage().' projet_theme['.$cle.']';
$element->setChecked(true);
}
} else {
$formulaire_projet->setDefaults (array ('projet_moderation'=> '0')) ;
}
$res = PROJET_PROPOSER_PROJET ;
return $res . $formulaire_projet->toHTML() ;
} else {
return 'Veuillez r&eacute;gler les permissions en &eacute;criture sur '.PROJET_CHEMIN_FICHIER ;
}
} // end of member function nouveauProjet
 
/**
* Valide le formulaire et appelle la fonction d'insertion.
*
* @return string
* @access public
*/
function nouveauProjetValidation( )
{
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_V) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&amp;', '&', $this->_url->getURL())) ;
$formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
if ($formulaire_projet->validate()) {
 
$projet = new projet ($this->_db) ;
$projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
if (!$projet->enregistrerSQL($formulaire_projet->getSubmitValues())) {
return 'erreur' ;
}
// On inscrit le deposant du projet en tant que coordinateur
if (PROJET_UTILISATEURS_COORD) {
// Si le projet n'a pas de liste, on inscrit directement
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($this->_db) ;
$participant->setStatut(1, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $projet->getId()) ;
}
} else {
return $formulaire_projet->toHTML() ;
}
}
 
/**
* Valide le formulaire et appelle la fonction de mise à jour.
*
* @return void
* @access public
*/
function modifierProjet( )
{
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_V) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
$formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&amp;', '&', $this->_url->getURL())) ;
$formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
if ($formulaire_projet->validate()) {
$projet->majSQL($formulaire_projet->getSubmitValues()) ;
} else {
return $formulaire_projet->toHTML() ;
}
unset ($projet) ;
}
 
/**
* Renvoie le formulaire d'upload d'un fichier.
*
* @return void
* @access public
*/
function formulaireFichier($action)
{
$res = '<h1>'.PROJET_FICHIER_MISE_EN_LIGNE.'</h1>'."\n" ;
if (isset($_SESSION['formulaire_document'])) {
unset ($_SESSION['formulaire_document']) ;
}
$action_future = $action == PROJET_NOUVEAU_FICHIER ? PROJET_NOUVEAU_FICHIER_V : PROJET_ACTION_MODIFIER_V ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, $action_future) ;
if ($this->_id_repertoire != '') $this->_url->addQueryString (PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
$formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
$formulaire_document->construitFormulaire($action) ;
if ($action == PROJET_ACTION_MODIFIER) {
include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
$document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
// On affecte dans un tableau les valeurs de chaque champs du formulaire avec le nom de chaque element de formulaire
// voir HTML_formulaireDocument
$valeurs_par_defaut = array ('document_nom' => $document->getNomLong(),
'document_description' => $document->getDescription(),
'document_visibilite' => $document->getVisibilite()) ;
 
// On rajoute un champs cache avec l'identifiant du document
$formulaire_document->addElement ('hidden', 'id_document', $this->_id_document) ;
$formulaire_document->setDefaults($valeurs_par_defaut) ;
} else {
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$visibilite = $projet->isModere() ? "prive" : "public";
$formulaire_document->setDefaults (array ('document_visibilite'=> $visibilite)) ;
}
return $res.$formulaire_document->toHTML() ;
 
} // end of member function nouveauFichier
 
/**
* Presente un formulaire pour deplacer un fichier
*
*
*/
function fichierCouper() {
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
$res = '<h1>'.PROJET_PROJET.' : '.$projet->getTitre().'</h1>' ;
include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
$document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
// On traite le cas ou l'on vient de deplacer un fichier
 
if (isset ($_POST['projet_repertoire'])) {
if (!$document -> deplace ($_POST['projet_repertoire'], $projet->getNomRepertoire())) {
return 'echec du d&eacute;placement' ;
}
return ;
}
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireCouperColler.class.php' ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_COUPER) ;
$HTML_formulaireCouperColler = new HTML_formulaireCouperColler('formulaire_couper_coller', 'post', str_replace('&amp;', '&', $this->_url->getURL())) ;
$HTML_formulaireCouperColler -> construitFormulaire($projet->getListeRepertoireHierarchisee()) ;
$tab = $projet->getListeRepertoireHierarchisee();
//$res .= '<pre>'.print_r ($tab, true).'</pre>';
return $res .$HTML_formulaireCouperColler->toHTML('<img src="'.PROJET_CHEMIN_ICONES.$document->getCheminIcone().'" /> '.$document->getNomLong());
}
/**
* Supprime un fichier.
*
* @return void
* @access public
*/
function suppressionFichier( )
{
if ($this->_id_document == "") {
return $this->messageErreur(PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE) ;
}
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
$document->suppression() ;
$document->suppressionSQL() ;
// On verifie s il reste des documents associes au projet et si non on met
// a jour projet.p_avoir_document
if (count ($projet->getListesDocuments(PROJET_CHEMIN_FICHIER)) == 0) $projet->setAvoirDocument(false);
$this->_url->removeQueryString(PROJET_VARIABLE_ID_DOCUMENT);
return ;
 
} // end of member function nouveauFichier
 
/**
* Renvoie le formulaire de creation d'un repertoire.
*
* @return void
* @access public
*/
function nouveauRepertoire( )
{
$res = '<h1>'.PROJET_REP_CREER.'</h1>'."\n" ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE_V) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
$formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
$formulaire_repertoire->setType ('repertoire') ;
$formulaire_repertoire->construitFormulaire() ;
$formulaire_repertoire->setDefaults (array ('document_visibilite'=> 'public')) ;
return $res.$formulaire_repertoire->toHTML() ;
 
}
 
/**
* Valide le formulaire et appelle la fonction d'insertion.
*
* @return void
* @access public
*/
function nouveauFichierValidation( )
{
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
if (isset($_SESSION['formulaire_document']) && $_SESSION['formulaire_document'] == 'valide') {
return include_once PROJET_CHEMIN_APPLI.'actions/documents.php' ;
}
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
$formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
$formulaire_document->construitFormulaire() ;
if ($formulaire_document->validate()) {
// Creation d'un objet document vide
$document = new document ("", $this->_db) ;
// avant d'appeler la methode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du proprietaire
$document->setIdProjet ($this->_id_projet) ;
$document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
 
// On passe aussi le numero de repertoire s'il existe
if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
if ($this->_id_repertoire == 0) $document->setIdRepertoire(0) ;
//$GLOBALS['log'] .= '<br>this->_id_repertoire: '.$this->_id_repertoire.'<br>';
$chemin_upload = $document->calculeCheminUploaded($projet->getNomRepertoire()) ;
//$GLOBALS['log'] .= '<br>chemin_upload: '.$chemin_upload.'<br>';
//$GLOBALS['log'] .= 'projet->getRepertoire() : '.$projet->getNomRepertoire().'<br>';
$id_document = SQL_obtenirNouveauId($this->_db, 'projet_documents', 'pd_id') ;
$nouveau_nom = $document->genereNouveauNom($projet->getNomRepertoire(), $_FILES['fichier']['name'], $id_document);
if (!$document->upload (PROJET_CHEMIN_FICHIER.$chemin_upload.'/'.$nouveau_nom)) {
return 'Echec de l\'upload<br />'.
'Fichier source : '. $_FILES['fichier']['name'];
'Fichier destination : '.PROJET_CHEMIN_FICHIER.$projet->getNomRepertoire().'/'.$chemin_upload.'/'.$nouveau_nom ;
}
 
$document->enregistrerSQL($formulaire_document->getSubmitValues(), $nouveau_nom);
// On place a 1 la colonne p_avoir_document
if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
// On ajoute une information de session
$_SESSION['formulaire_document'] = 'valide';
// Pour notification coordinateur
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE,
'nom'=> PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
$utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
$this->notifierCoordinateurs(PROJET_NOTIFICATION_NOUVEAU_DOC,
$utilisateur,
 
'http://'.$this->_url->host.'/projets/'.$this->_id_projet.'/telechargement/'.$id_document.
' (' . $formulaire_document->getSubmitValue("document_nom") . ')');
} else {
return $formulaire_document->toHTML() ;
}
return $retour;
}
 
/**
* Valide le formulaire et appelle la fonction d'insertion.
*
* @return void
* @access public
*/
function modifierFichier( )
{
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_V) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
$formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
$formulaire_document->construitFormulaire(PROJET_ACTION_MODIFIER_V) ;
if ($formulaire_document->validate()) {
// Creation d'un objet document vide
$document = new document ($this->_id_document, $this->_db) ;
// On passe aussi le numero de repertoire s'il existe
if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
$document->majSQL($formulaire_document->getSubmitValues()) ;
} else {
return $formulaire_document->toHTML() ;
}
unset ($projet) ;
} // end of member function nouveauFichierValidation
 
/**
* Valide le formulaire et appelle la fonction d'insertion.
*
* @return void
* @access public
*/
function nouveauRepertoireValidation( )
{
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireDocument.class.php' ;
$formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
$formulaire_repertoire->setType ('repertoire') ;
$formulaire_repertoire->construitFormulaire() ;
if ($formulaire_repertoire->validate()) {
// Creation d'un objet
$document = new document ("", $this->_db) ;
// avant d'appeler la methode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du proprietaire
$document->setIdProjet ($this->_id_projet) ;
$document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ;
 
// On passe aussi le numero de repertoire s'il existe
if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
if ($this->_id_repertoire == 0) $document->setIdRepertoire(0) ;
$chemin_upload = $document->calculeCheminUploaded($projet->getNomRepertoire()) ;
$nom_repertoire = $document->enregistrerSQL($formulaire_repertoire->getSubmitValues(), $projet->getNomRepertoire()) ;
 
// La creation du repertoire sur le disque, chemin / nom_repertoire_projet / id_repertoire
$GLOBALS['log'] = '<br />chemin_upload:'.$chemin_upload.'<br />';
$GLOBALS['log'] .= '<br />mkdir('.PROJET_CHEMIN_FICHIER.$chemin_upload.$nom_repertoire.')<br />';
if (!mkdir (PROJET_CHEMIN_FICHIER.$chemin_upload.'/'.rtrim ($nom_repertoire, '/'))) {
 
$document->suppressionSQL() ;
return $this->messageErreur(PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE).'<br />'.
PROJET_CHEMIN_FICHIER.$chemin_upload.'/'.$nom_repertoire;
}
// On place a 1 la colonne p_avoir_document
if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
} else {
return $formulaire_repertoire->toHTML() ;
}
}
 
 
/**
* Permet de specifier au controleur sur quel projet l'on travaille.
*
* @param int id_projet L'identifiant du projet.
* @return void
* @access public
*/
function setIdProjet( $id_projet )
{
$this->_id_projet = $id_projet ;
}
 
/**
* Permet de specifier quel repertoire, dans la vue de document afficher. Il sera
* passe en parametre a la classe HTML_listeDocuments.
*
* @param int id_repertoire L'identifiant du repertoire a afficher.
* @return void
* @access public
*/
function setIdRepertoire( $id_repertoire )
{
$this->_id_repertoire = $id_repertoire ;
}
 
/**
* Supprime un projet et tout ce qui va avec.
*
* @return void
* @access public
*/
function suppressionProjet( )
{
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
$projet->getListesAssociees() ;
if ($projet->avoirListe()) $projet->supprimerListe($projet->_listes_associes[0]) ;
$msg = $projet->suppressionSQL() ;
unset ($this->_id_projet) ; unset($_GET['id_projet']);
return $msg ;
}
 
/**
* Permet d'indiquer au controleur sur quel document on travaille.
*
* @param int id_document
* @return void
* @access public
*/
function setIdDocument( $id_document )
{
$this->_id_document = $id_document ;
}
 
 
/**
* Renvoie le formulaire d'envoie de mail
*
* @return void
* @access public
*/
function envoyerUnMailFormulaire( )
{
if (!$this->_auth->getAuth()) {
return PROJET_LISTE_PROJET;
}
if (isset($_SESSION['formulaire_mail'])) {
unset ($_SESSION['formulaire_mail']) ;
}
$res = '<h1>'.PROJET_ECRIRE_LISTE.'</h1>'."\n" ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
$formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
$formulaire_mail->construitFormulaire() ;
return $res.$formulaire_mail->toHTML() ;
}
 
/**
* Envoie le mail
*
* @return void
* @access public
*/
function envoyerUnMailValidation( )
{
// Verifications
if (isset($_SESSION['formulaire_mail']) && $_SESSION['formulaire_mail'] == 'valide') {
return include_once PROJET_CHEMIN_APPLI.'actions/forums.php' ;
}
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V );
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
$formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
$formulaire_mail->construitFormulaire() ;
if ($formulaire_mail->validate()) {
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$info_liste = $projet->getListesAssociees() ;
$valeurs_mail = $formulaire_mail->getSubmitValues() ;
// Pour envoyer le mail on utilise la classe Mail de PEAR
// on a besoin du mail de l'inscrit
 
$entetes['From'] = $this->_auth->getUserName();
$entetes['To'] = $projet->_listes_associes[0]->getAdresseEnvoi() ;
$entetes['Subject'] = $valeurs_mail['mail_titre'] ;
$entetes['Date'] = date ('D, M j G:i:s \C\E\S\T Y') ;
$entetes['Message-ID'] = md5(time()).'@'.$projet->_listes_associes[0]->getNom().'.'.$projet->_listes_associes[0]->getDomaine() ;
$entetes['reply-to'] = $projet->_listes_associes[0]->getAdresseEnvoi() ;
$entetes['Content-Type'] = 'text/plain' ;
// Traitement de la reference s'il s'agit d'une reponse
if (isset ($_POST['messageid'])) {
$entetes['In-Reply-To'] = $_POST['messageid'] ;
}
$objet_mail =& Mail::factory('smtp');
$objet_mail->send($entetes['To'], $entetes, $valeurs_mail['mail_corps']);
$_SESSION['formulaire_mail'] = 'valide';
return ;
} else {
return $formulaire_mail->toHTML() ;
}
} // end of member function envoyerUnMailValidation
 
/**
* Renvoie le formulaire de creation d'une liste.
*
* @param int action Indique le type d'action, PROJET_ACTION_NOUVELLE_LISTE
* @return string
* @access public
*/
function formulaireListe( $action )
{
$res = '<h1>'.PROJET_CREATION_LISTE.'</h1>'."\n" ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListe.class.php' ;
$formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post',preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
$formulaire_liste->construitFormulaire() ;
$formulaire_liste->setDefaults(array('domaine_liste' => PROJET_DOMAINE_LISTE)) ;
$formulaire_liste->updateElementAttr('domaine_liste', array('readonly' => 'readonly')) ;
return $res.$formulaire_liste->toHTML() ;
}
 
/**
* Transmet au serveur la demande de creation d'une nouvelle liste.
*
* @return void
* @access public
*/
function nouvelleListeValidation( )
{
// Verifications
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE_V );
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListe.class.php' ;
$formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
$formulaire_liste->construitFormulaire() ;
if ($formulaire_liste->validate()) {
// creation de l'objet liste_discussion
include_once PROJET_CHEMIN_CLASSES.'liste_discussion.class.php';
$liste = new liste_discussion('', $this->_db) ;
 
// On verifie que le nom de la liste soit unique
if (liste_discussion::verifieDoubleListe($formulaire_liste->getSubmitValue('nom_liste').'@'.
$formulaire_liste->getSubmitValue('domaine_liste'), $this->_db)) {
// On rajoute la liste dans la base
$liste->enregistrerSQL($formulaire_liste->getSubmitValues()) ;
 
// On la relie au projet
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$projet->ajouterListe($liste) ;
 
// Creation de la liste
$resultat_creation = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/creation_liste.php?domaine='.
$liste->getDomaine().'&liste='.$liste->getNom().'&parametres=aBiud') ;
 
// Ajout du moderateur
$resultat_ajout_moderateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_moderateur.php?domaine='.
$liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ;
// Ajout du moderateur en tant qu'utilisateur
$resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
$liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ;
 
} else {
return PROJET_MESSAGE_LISTE_DOUBLE.$formulaire_liste->toHTML() ;
}
return $resultat_creation.$resultat_ajout_moderateur.$resultat_ajout_utilisateur;
 
} else {
return $formulaire_liste->toHTML() ;
}
} // end of member function nouvelleListeValidation
 
/**
* Supprime la liste de discussion associee au projet
*
* @return void
* @access public
*/
function supprimerListe( )
{
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet($this->_db, $this->_id_projet) ;
$projet->getListesAssociees() ;
 
$resultat_suppression = file_get_contents(PROJET_SERVEUR_VPOPMAIL.'/suppression_liste.php?domaine='.
$projet->_listes_associes[0]->getDomaine().'&liste='.$projet->_listes_associes[0]->getNom()) ;
$projet->supprimerListe($projet->_listes_associes[0]) ;
return $resultat_suppression;
} // end of member function supprimerListe
 
 
/**
*
*
* @param string presentation Pour affecter une presentation au projet
* @return void
* @access public
*/
function setPresentation( $presentation )
{
$this->_presentation = $presentation ;
} // end of member function setPresentation
 
/**
*
*
* @param string type Pour affecter un type au projet
* @return void
* @access public
*/
function setType( $type)
{
$this->_type = $type ;
} // end of member function setPresentation
 
/**
* Inscrit un utilisateur a un projet avec le statut observateur
*
* @return void
* @access public
*/
function inscriptionProjet( )
{
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireInscriptionProjet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
// Si le projet n'a pas de liste, on inscrit directement
if (isset ($this->_id_projet)) {
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($this->_db) ;
// On controle si la liste est externe (yahoo) auquel cas on ne presente pas l inscription
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$liste_ext = new liste_externe($this->_db);
$listes = $liste_ext->getListesAssociees($this->_id_projet);
if (count ($listes))$info_liste = $liste_ext->getInfoListe($listes[0]);
if (count ($listes) != 0) {
$avoir_liste_externe = true;
$msg = '';
$msg = 'Pour vous inscrire &agrave; la liste de discussion, h&eacute;berg&eacute;e par Yahoo Groupes, <a href="mailto:';
$msg .= $info_liste->AGO_A_MAILABO.'">cliquez ici</a>';
} else {
$avoir_liste_externe = false;
}
if (!$projet->avoirListe() || $avoir_liste_externe) {
if ($projet->isModere()) {
$participant->setStatut(3, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
} else {
$participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
$message_retour = '<p class="information">Votre inscription a bien &eacute;t&eacute; prise en compte'.$msg.'</p>';
}
$message_retour = '<p class="information">Votre inscription a bien &eacute;t&eacute; prise en compte. '.$msg.'</p>';
include_once PROJET_CHEMIN_APPLI.'actions/resume.php' ;
return $retour;
}
}
if (isset($_POST['valider_inscription_projet'])) {
if (isset($_POST['radio_inscription_liste'])) {
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE,
'nom'=> PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
$utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
if ($_POST['radio_inscription_liste'] == 2) {
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$projet->getListesAssociees() ;
$inscription_liste = new inscription_liste($this->_db) ;
$inscription_liste->inscrireUtilisateur( $utilisateur,
$projet->_listes_associes[0],
$_POST['radio_inscription_liste']) ;
}
if (!$projet->isModere()) {
$participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
$this->notifierCoordinateurs(PROJET_NOTIFICATION_INSCRIPTION_NOUVELLE, $utilisateur);
} else {
$participant->setStatut(3, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
$this->notifierCoordinateurs(PROJET_NOTIFICATION_DEMANDE_INSCRIPTION, $utilisateur);
}
}
 
if ($this->_presentation != 'arbre') {
if ($projet->isModere()) return '<h1>'.$projet->getTitre().'</h1>'.
str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
else {
$message_retour = '<p class="information">Votre inscription a bien &eacute;t&eacute; prise en compte'.$msg.'</p>';
include_once PROJET_CHEMIN_APPLI.'actions/resume.php' ;
return $retour;
}
} else {
$this->_action = PROJET_ACTION_VOIR_RESUME;
}
return PROJET_LAIUS_INSCRIPTION_MODERE;
}
$res = '<h1>'.PROJET_INSCRIPTION_PROJET.' : '.$projet->getTitre().'</h1>'."\n" ;
if ($projet->avoirListe()) $res .= '<h2>'.PROJET_MESSAGE_LISTE.'</h2>'."\n" ;
//$participant = new participe($this->_db) ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
$HTML_formulaireInscriptionProjet = new HTML_formulaireInscriptionProjet('inscription_projet', 'post', str_replace ('&amp;', '&', $this->_url->getURL())) ;
$HTML_formulaireInscriptionProjet->construitFormulaire($projet) ;
$HTML_formulaireInscriptionProjet->setDefaults(array('radio_inscription_liste' => 2)) ;
return $res.$HTML_formulaireInscriptionProjet->toHTML() ;
} // end of member function inscriptionProjet
 
/**
* Inscrit l'utilisateur loggue a la liste dont le parametre est en post.
*
* @return void
* @access public
*/
function inscriptionListe( )
{
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$projet->getListesAssociees() ;
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
$utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
$inscription_liste = new inscription_liste($this->_db) ;
$inscription_liste->inscrireUtilisateur( $utilisateur, $projet->_listes_associes[0], 2) ; // 2 est la statut inscription normale
return '<p class="information">Vous &ecirc;tes inscrit &agrave; la liste</p>';
} // end of member function inscriptionListe
 
/**
* Inscrit l'utilisateur loggue a la liste dont le parametre est en post.
*
* @return void
* @access public
*/
function desinscriptionListe( )
{
if (isset($_GET['inscription_liste']) || $this->_action = PROJET_ACTION_DESINSCRIPTION_LISTE) {
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$projet->getListesAssociees() ;
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
'mail' => PROJET_CHAMPS_MAIL,
'table' => PROJET_ANNUAIRE)) ;
$utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
$inscription_liste = new inscription_liste($this->_db) ;
$inscription_liste->desinscrireUtilisateur( $utilisateur, $projet->_listes_associes[0], $_GET['inscription_liste']) ;
return '<p class="information">Vous avez &eacute;t&eacute; d&eacute;sinscrit de la liste</p>';
}
} // end of member function inscriptionListe
/**
* desinscrit un utilisateur d un projet
*
* @return void
* @access public
*/
function desinscriptionProjet( )
{
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$participant = new participe($this->_db) ;
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE,
'nom'=> PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
$utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
// Le statut 4 desinscrit l'utilisateur, dans la methode setStatut
$participant->setStatut(4, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$projet->getListesAssociees() ;
if ($projet->avoirListe()) {
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$annuaire = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
$annuaire->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$desinscription= new inscription_liste($this->_db) ;
$desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
}
$this->notifierCoordinateurs(PROJET_NOTIFICATION_DESINSCRIPTION_PROJET, $utilisateur);
// On verifie si l utilisateur est le dernier coordinateur
// auquel cas on previent les administrateurs
if ($participant->isCoordinateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db)) {
$coord = $participant->getCoordinateurs($this->_id_projet);
if (count($coord) == 0) {
$this->notifierCoordinateurs(PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD, $utilisateur);
}
}
//
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php';
$liste_ext = new liste_externe($this->_db);
$listes = $liste_ext->getListesAssociees($this->_id_projet);
$msg = '';
if (count ($listes) != 0) {
$info_liste = $liste_ext->getInfoListe($listes[0]);
$msg = 'Pensez si vous le souhaitez à vous d&eacute;sinscrire de la liste de discussion, h&eacute;berg&eacute;e par Yahoo Groupes.';
$msg .= ' Vous pouvez le faire en <a href="mailto:';
$msg .= $info_liste->AGO_A_MAILDESA.'">cliquez ici</a>';
}
if ($this->_presentation != 'arbre') {
$message_retour = '<p class="information">Votre d&eacute;sinscription a bien &eacute;t&eacute; prise en compte. '.$msg.'</p>';
include_once PROJET_CHEMIN_APPLI.'actions/resume.php' ;
return $retour ;
} else {
$this->_action = PROJET_ACTION_VOIR_RESUME;
}
}
 
/**
* Renvoie le formulaire de creation d'un wiki
*
* @return void
* @access public
*/
function formulaireWiki( )
{
$GLOBALS['url']->addQueryString ('act', PROJET_ACTION_CREER_WIKI) ;
$GLOBALS['url']->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
require_once 'client/integrateur_wikini/bibliotheque/iw_admin_wikini.fonct.php';
$res =admin_afficherContenuCorps();
$res .= '<br /><a href="'.$this->_url->getURL().'">'.PROJET_RETOUR_RESUME.'</a>';
return $res;
 
}
 
 
function associerWiki( )
{
$res = '<h1>'.PROJET_ASSOCIER_WIKI.'</h1>'."\n" ;
 
$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
$res='';
 
// Comportement par defaut
// requete sur la table gen_wikini pour affichage de la liste des Wikini
$requete = "select gewi_id_wikini, gewi_code_alpha_wikini, gewi_page from gen_wikini" ;
 
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
$GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(),
__FILE__, __LINE__, 'admin_wikini') ;
return ;
}
 
include_once 'api/html/HTML_TableFragmenteur.php';
$liste = new HTML_TableFragmenteur () ;
$liste->construireEntete(array (PROJET_NOM_WIKINI,PROJET_PAGE_WIKINI, PROJET_SELECTIONNER_WIKINI)) ;
 
$tableau_wikini = array() ;
 
while ($ligne = $resultat->fetchRow()) {
$this->_url->addQueryString ('id_wikini', $ligne[0]) ;
array_push ($tableau_wikini, array ($ligne[1]."\n", // Premiere colonne, le nom de l'application
$ligne[2]."\n", // Deuxieme colonne, la page par defaut
'<a href="'.$this->_url->getURL()."&amp;".PROJET_VARIABLE_ACTION."=".PROJET_ACTION_ASSOCIER_WIKI_V."".'">'.PROJET_CHOISIR_WIKINI.'</a>'."\n",
));
}
$liste->construireListe($tableau_wikini) ;
$res .= $liste->toHTML();
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
return $res ;
 
 
 
} // end of member function formulaireWiki
 
 
/**
* Associe un wiki au projet courant
*
* @return void
* @access public
*/
 
function associationWiki( ) {
 
 
if (isset($_GET['id_wikini'])) {
$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
$requete = "select gewi_code_alpha_wikini from gen_wikini where gewi_id_wikini = ".$_GET['id_wikini'] ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
$GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(),
__FILE__, __LINE__, 'admin_wikini') ;
return ;
}
 
$ligne = $resultat->fetchRow();
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet($this->_db, $this->_id_projet) ;
$projet->majNomWikini($ligne[0]);
}
 
}
 
/**
* Supprime le wiki du projet courant
*
* @return void
* @access public
*/
function supprimerWiki( )
{
include_once PROJET_CHEMIN_CLASSES.'gestion_wikini.class.php' ;
// On crée une nouvelle connexion avec les paramètres spécifiques aux wikinis
$connexion_bd = DB::connect('mysql://'.PROJET_UTILISATEUR_WIKINI.':'.PROJET_MDP_WIKINI.'@'.PROJET_HOTE_WIKINI.'/'.PROJET_DB_WIKINI) ;
$gerantWiki = new gestion_wikini($connexion_bd) ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$gerantWiki->suppression_tables(strtolower($projet->getWikini())) ;
$projet->majNomWikini('') ;
} // end of member function supprimerWiki
 
/**
* Permet de lier une ou plusieurs listes de la table agora à un projet.
*
* @return string
* @access public
*/
function referencerListeExterne( )
{
$requete = 'show tables like \'agora\'' ;
$resultat = $this->_db->query ($requete);
if ($resultat->numRows() == 0) {
return 'Cette fonctionnalité n\'est pas active' ;
}
$res = '<h1>'.PROJET_REFERENCER_LISTE.'</h1>' ;
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$liste_externe = new liste_externe($this->_db) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListeExterne.class.php' ;
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_REFERENCER_LISTE_V) ;
$HTML_formulaireListeExterne = new HTML_formulaireListeExterne('formulaire_liste_externe', 'post', str_replace('&amp;', '&', $this->_url->getURL())) ;
$HTML_formulaireListeExterne->construitFormulaire($liste_externe->getListeNom()) ;
$liste_assoc = $liste_externe->getListesAssociees($this->_id_projet) ;
$default = array() ;
foreach ($liste_assoc as $val) $default['liste_'.$val] = 1 ;
 
$HTML_formulaireListeExterne->setDefaults($default) ;
return $res.$HTML_formulaireListeExterne->toHTML() ;
} // end of member function referencerListeExterne
 
/**
* Realise les mises a jours dans la table projet_lien_liste_externe
*
* @return void
* @access public
*/
function referencerListeExterneValidation( )
{
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$liste_externe = new liste_externe($this->_db) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListeExterne.class.php' ;
$HTML_formulaireListeExterne = new HTML_formulaireListeExterne('formulaire_liste_externe', 'post', str_replace('&amp;', '&', $this->_url->getURL())) ;
$HTML_formulaireListeExterne->construitFormulaire($liste_externe->getListeNom()) ;
 
$liste_externe->enregistrerSQL($HTML_formulaireListeExterne->getSubmitValues(), $this->_id_projet) ;
} // end of member function referencerListeExterneValidation
 
/**
* permet d'exclure un projet de l'affichage
*
* @return void
* @access public
*/
function exclure($id_projet)
{
array_push ($this->_projet_exclu, $id_projet) ;
} // end of member function exclure
 
/**
* permet d'exclure un projet de l'affichage
*
* @return void
* @access public
*/
function setPrive()
{
$this->_prive = 1 ;
} // end of member function exclure
 
/**
* retourne une variable locale si la variable $_GET existe
*
*/
function traiterVariableGet($var, $valeur_par_defaut ='') {
if (isset($_GET[$var]) && $_GET[$var] != '') {
return $_GET[$var];
} else {
return $valeur_par_defaut;
}
}
 
/**
* Renvoie un message d'erreur, en fonction du code de l'erreur.
*
* @param int valeur Le code du message d'erreur.
* @return string
* @access public
*/
function messageErreur( $valeur )
{
$messageErreur = array (
PROJETCONTROLEUR_ACTION_INVALIDE => "Action non valide",
PROJETCONTROLEUR_ERREUR_SUPPRESSION_REPERTOIRE => "Impossible de supprimer le r&eacute;pertoire",
PROJETCONTROLEUR_PAS_DE_DOCUMENT_SELECTIONNE => 'Pas de fichier s&eacute;lectionn&eacute;',
PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE => 'Impossible de cr&eacute;er le r&eacute;pertoire'
) ;
return '<p class="erreur">'.$messageErreur[$valeur].'</p>' ;
} // end of member function messageErreur
/** Envoie de mail pour prevenir les coordinateurs d une action sur le projet
* Lorsqu un projet n a plus de coordinateur, la notification est
* envoyee aux administrateurs
*
*/
 
function notifierCoordinateurs ($notification, $utilisateur, $lien = false) {
include_once PROJET_CHEMIN_CLASSES.'projetTemplate.class.php';
switch ($notification) {
case PROJET_NOTIFICATION_DEMANDE_INSCRIPTION :
$sujet = PROJET_TEMPLATE_DEMANDE_INSCRIPTION_SUJET;
$corps = PROJET_TEMPLATE_DEMANDE_INSCRIPTION_CORPS;
break;
case PROJET_NOTIFICATION_INSCRIPTION_NOUVELLE :
$sujet = PROJET_TEMPLATE_INSCRIPTION_NOUVELLE_SUJET;
$corps = PROJET_TEMPLATE_INSCRIPTION_NOUVELLE_CORPS;
break;
case PROJET_NOTIFICATION_DESINSCRIPTION_PROJET :
$sujet = PROJET_TEMPLATE_DESINSCRIPTION_SUJET;
$corps = PROJET_TEMPLATE_DESINSCRIPTION_CORPS;
break;
case PROJET_NOTIFICATION_NOUVEAU_DOC:
$sujet = PROJET_TEMPLATE_NOUVEAU_DOC_SUJET;
$corps = PROJET_TEMPLATE_NOUVEAU_DOC_CORPS;
break;
case PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD:
$sujet = PROJET_TEMPLATE_DESINSCRIPTION_DERNIER_COORD_SUJET;
$corps = PROJET_TEMPLATE_DESINSCRIPTION_DERNIER_COORD_CORPS;
break;
}
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php';
$participant = new participe($this->_db) ;
$tableau_coordinateur = $participant->getCoordinateurs($this->_id_projet) ;
$objet_mail =& Mail::factory('smtp');
$modele = new projetTemplate($GLOBALS['projet_db']);
 
$sujet_mail = $modele->getTemplate($sujet, PROJET_LANGUE_DEFAUT);
$corps_mail = $modele->getTemplate($corps, PROJET_LANGUE_DEFAUT);
if (PEAR::isError($sujet_mail)) $sujet_mail->raiseError ($sujet_mail->getMessage().'<br />'.$sujet_mail->getDebugInfo());
$corps_mail = str_replace ('{nom}', $utilisateur->getInfo( 'nom'), $corps_mail);
$corps_mail = str_replace ('{prenom}', $utilisateur->getInfo( 'prenom'), $corps_mail);
$corps_mail = str_replace ('{nom_projet}', $projet->getTitre(), $corps_mail);
if($notification == PROJET_NOTIFICATION_NOUVEAU_DOC && $lien) {
$corps_mail = str_replace ('{lien}', $lien, $corps_mail);
}
else {
$corps_mail = str_replace ('{lien}', str_replace ('&amp;', '&', $this->_url->getURL()), $corps_mail);
}
$entetes['From'] = PROJET_MAIL_ADMINISTRATEUR;
$entetes['To'] = '';
$entetes['Subject'] = trim ($sujet_mail) ; // le trim est necessaire pour enlever d eventuels retour-chariot qui foutent el l air le message
$entetes['Date'] = date ('D, M j G:i:s \C\E\S\T Y') ;
$entetes['Message-ID'] = md5(time()) ;
$entetes['reply-to'] = $this->_auth->getUserName();
$entetes['Content-Type'] = 'text/plain' ;
// 2 cas : 1. il reste des coordinateurs ou notification pour administrateur
// 2. plus de coordinateur ou notification pour administrateur
if (count ($tableau_coordinateur) != 0 && $notification != PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD) {
foreach ($tableau_coordinateur as $coordinateur) {
$entetes['To'] .= $coordinateur[3].','; // Le champs 3 est le mail
}
// On enleve la virgule finale
$entetes['To'] = substr ($entetes['To'], 0, -1);
// on envoie le mail
$objet_mail->send($entetes['To'], $entetes, html_entity_decode ($corps_mail));
} else { // Pour le cas ou il n y a plus de coordinateur, on envoie un message aux administrateurs
$tableau_administrateur = $participant->getAdministrateurs();
trigger_error(print_r($tableau_administrateur, true));
foreach ($tableau_administrateur as $administrateur) {
$entetes['To'] .= $administrateur[3].','; // Le champs 3 est le mail
}
// On enleve la virgule finale
$entetes['To'] = substr ($entetes['To'], 0, -1);
// on envoie le mail
$objet_mail->send($entetes['To'], $entetes, html_entity_decode ($corps_mail));
}
}
 
 
} // end of projetControleur
 
class bouton {
static function toHTML($lien, $label, $id, $class='projet_bouton_action') {
if ($lien != '#') {
$balise_a_debut = '<a href="'.$lien.'"'.($id == 'cross'? ' onclick="javascript:return confirm(\''.$label.' ?\');"':'').'>';
$balise_a_fin = '</a>';
} else {
$balise_a_debut = '';
$balise_a_fin = '';
}
return '<div id="bouton_'.$id.'" class="'.$class.'">' .
$balise_a_debut.'<img src="'.PROJET_CHEMIN_ICONES.$id.'.png" alt="'.$label.'" />'.$label.$balise_a_fin.'</div>';
}
}
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.49 2008-09-16 14:10:20 alexandre_tb
* verification du statut de l utilisateur lors d une desinscription.
* Si coordinateur, message aux admins
*
* Revision 1.48 2008-09-15 07:41:16 alexandre_tb
* ajout de HTML_TableFragmenteur
*
* Revision 1.47 2008-09-01 14:38:00 alexandre_tb
* correction de bug inscription projet
*
* Revision 1.46 2008-08-28 14:48:54 alexandre_tb
* encodage et suppression d une methode inutile
*
* Revision 1.45 2008-08-26 12:42:10 alexandre_tb
* nettoyage url apres suppression d un fichier
*
* Revision 1.44 2008-08-26 08:52:28 alexandre_tb
* suppression de la methode accueilProjet desormais remplacee par resume.php
*
* Revision 1.43 2008-08-25 15:06:59 alexandre_tb
* ajout:
* - des notifications
* - des messages en retour
* - correction inscription a un projet avec liste externe
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/classes/participe.class.php
New file
0,0 → 1,426
<?php
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: participe.class.php,v 1.7 2008-09-16 14:11:31 alexandre_tb Exp $
/**
* Application projet
*
* La classe partiicpe assure la jointure entre projet et Auth
* Elle se base sur la table projet_statut_utilisateur
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.7 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class participe
*
*/
class participe
{
/*** Attributes: ***/
 
/**
* Date d'inscription au projet de l'utilisateur.
* @access private
*/
var $_date_inscription;
/**
* Statut de l'utilisateur, un entier.
* @access private
*/
var $_statut;
/**
* Connexion à la base de donnée.
* @access private
*/
var $_db;
 
/**
* Constructeur. Nécessite un objet DB valide connecté à la base contenant les
* tables projets.
*
* @param DB objetDB Un objet PEAR:DB valide.
* @return void
* @access public
*/
function participe( &$objetDB )
{
$this->_db = $objetDB ;
} // end of member function participe
 
/**
* Renvoie la liste des inscrit à un projet avec leur statut.
*
* @return Array
* @access public
*/
function getInscrits($id_projet, $droits )
{
$tableau_resultat = array() ;
$requete = 'select psu_id_utilisateur,'.PROJET_CHAMPS_NOM.','.PROJET_CHAMPS_PRENOM.',' ;
$requete .= PROJET_CHAMPS_MAIL.', ' ;
$requete .= 'psu_date_inscription, ps_id_statut '.
' from projet_statut_utilisateurs, projet_statut,'.PROJET_ANNUAIRE.
' where psu_id_projet='.$this->_db->escapeSimple($id_projet).' and psu_id_utilisateur='.PROJET_CHAMPS_ID.
' and psu_id_statut=ps_id_statut order by ps_id_statut,'.PROJET_CHAMPS_NOM;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ORDERED)) {
array_push ($tableau_resultat, $ligne) ;
$id = $ligne[0];
$inscrits[$id]['nom'] = $ligne[1];
$inscrits[$id]['prenom'] = $ligne[2];
$inscrits[$id]['mail'] = $ligne[3];
$inscrits[$id]['date'] = $ligne[4];
$inscrits[$id]['id_statut'] = $ligne[5];
}
$resultat->free() ;
return $tableau_resultat ;
} // end of member function getInscrits
 
/**
* Renvoie un tableau contenant la liste des identifiants des projets et des statuts
* d'un inscrit. 0 => ['psu_id_utilisateur'] ['psu_id_statut'] 1 => ...
*
* @param int id_utilisateur Un identifiant d'utilisateur pour le champs
* projet_statut_utilisateurs:psu_id_utilisateur
* @return Array
* @access public
*/
function getIdProjetsStatuts( $id_utilisateur )
{
$tableau_resultat = array() ;
$requete = "select psu_id_utilisateur, psu_id_statut from projet_statut_utilisateurs".
" where psu_id_utilisateur=".$this->_db->escapeSimple($id_utilisateur) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
array_push ($tableau_resultat, $ligne) ;
}
$resultat->free() ;
return $tableau_resultat ;
} // end of member function getIdProjetsStatuts
 
 
/**
* Renvoie un tableau à 2 dimensions avec les informations sur l'inscription aux
* différents projets d'un utilisateur. 0 => ['p_titre'] Le titre du projet
* ['ps_label'] Le statut de l'utilisateur 1 => .... (autant que de
* projets)
*
* @param int id_utilisateur L'identifiant d'un utilisateur.
* @return Array
* @access public
*/
function getInformationsUtilisateurs( $id_utilisateur )
{
$tableau_resultat = array() ;
$requete = "select p_titre, ps_statut_nom, psu_id_statut, psu_id_projet from projet_statut_utilisateurs, projet, projet_statut".
" where psu_id_utilisateur=".$this->_db->escapeSimple($id_utilisateur).
" and psu_id_projet = p_id and psu_id_statut = ps_id_statut" ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow()) {
array_push ($tableau_resultat, $ligne) ;
}
$resultat->free() ;
return $tableau_resultat ;
} // end of member function getInformationsUtilisateurs
 
 
/**
* Renvoie le statut du projet passé en paramètre.
*
* @param int id_utilisateur
* @param int id_projet
* @param int dbObject
* @return int
* @static
* @access public
*/
function getStatutSurProjetCourant( $id_utilisateur, $id_projet, &$dbObject )
{
if (participe::isAdministrateur($id_utilisateur, $dbObject)) return PROJET_DROIT_ADMINISTRATEUR;
$requete = 'select psu_id_statut from projet_statut_utilisateurs'.
' where psu_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur).' and psu_id_projet ='.$this->_db->escapeSimple($id_projet) ;
$resultat = $dbObject->query ($requete) ;
if (DB::isError ($resultat)) {
return DB::raiseError('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
if (!$resultat->numRows()) {
return 4 ; // Le statut ne participe pas
}
return $ligne->psu_id_statut ;
} // end of member function getStatutSurProjetCourant
 
/**
* Réalise une requête dans projet_statut_utilisateurs et renvoie true si l'utilisateur
* est administrateur de l'application projet.
*
* @param int id_utilisateur L'identifiant d'un utilisateur.
* @param DB objetDB Un objet PEAR::DB
* @return bool
* @access public
*/
function isAdministrateur( $id_utilisateur, $objetDB = "" )
{
// La table projet_statut_utilisateurs possède une entré avec psu_id_projet = 0
// pour indiquer un administrateur
$requete = "select psu_id_statut from projet_statut_utilisateurs where psu_id_utilisateur=".$this->_db->escapeSimple($id_utilisateur)." ".
" and psu_id_projet=0" ;
if (is_object ($objetDB)) {
$resultat = $objetDB->query ($requete) ;
} else {
$resultat = $this->_db->query ($requete) ;
}
if ($resultat->numRows () != 0) {
return true;
}
return false ;
} // end of member function isAdministrateur
 
/**
* Met à jour le statut d'un utilisateur sur un projet
*
* @param int id_statut L'identifiant du statut à ajouter ou mettre à jour
* @param int id_utilisateur Identifiant de l'utilisateur
* @param int id_projet Identifiant du projet
* @return bool
* @access public
*/
function setStatut( $id_statut, $id_utilisateur, $id_projet )
{
$requete = 'update projet_statut_utilisateurs set psu_id_statut='.$this->_db->escapeSimple($id_statut).
' where psu_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur).' and psu_id_projet='.$this->_db->escapeSimple($id_projet);
if (participe::getStatutSurProjetCourant($id_utilisateur, $id_projet, $this->_db) == 4) {
$requete = 'insert into projet_statut_utilisateurs set psu_id_statut='.$this->_db->escapeSimple($id_statut).
', psu_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur).',psu_id_projet='.$this->_db->escapeSimple($id_projet).
', psu_date_inscription=NOW()';
}
if ($id_statut == 4) { // Si le statut est ne participe pas, on supprime l'inscrit
$requete = 'delete from projet_statut_utilisateurs where psu_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur).
' and psu_id_projet='.$this->_db->escapeSimple($id_projet) ;
}
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
return true ;
} // end of member function setStatut
 
/**
* Renvoie vrai si l'utilisateur est coordinateur, faux dans les autres cas
*
* @param int id_utilisateur L'identifiant d'un utilisateur
* @param DB objetDB Optionnel, nécessaire si on appelle cette méthode statiquement
* @return bool
* @static
* @access public
*/
function isCoordinateur( $id_utilisateur, $id_projet, &$objetDB )
{
if (!is_object($objetDB)) $objetDB = $this->_db;
$statut = $this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) ;
if ($statut == 1) {
return true;
}
return false ;
} // end of member function isCoordinateur
 
/**
* Renvoie la liste des projets auquels l'utilisateur passé en paramètre ne
* participe pas.
*
* @param int id_utilisateur L'identifiant de l'utilisateur.
* @return Array
* @access public
*/
function getProjetsNonParticipant( $id_utilisateur )
{
$tableau_resultat = array() ;
$requete = 'select p_id from projet'.
' where p_id not in (select psu_id_projet from projet_statut_utilisateurs where psu_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur).')' ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
array_push ($tableau_resultat, new projet ($this->_db, $ligne->p_id)) ;
}
$resultat->free() ;
return $tableau_resultat ;
} // end of member function getProjetsNonParticipant
 
/**
* Renvoie true si l'utilisateur passé en paramètre est observateur du projet passé
* en paramètre.
*
* @param int id_utilisateur L'identifiant de l'utilisateur
* @param int id_projet L'identifiant du projet
* @return bool
* @access public
*/
function isObservateur( $id_utilisateur, $id_projet, &$objetDB )
{
if (!is_object($objetDB)) $objetDB = $this->_db;
if ($this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) == 3) {
return true;
}
return false ;
} // end of member function isObservateur
 
/**
* Renvoie true si l'utilisateur passé en paramètre est contributeur du projet passé
* en paramètre.
*
* @param int id_utilisateur L'identifiant de l'utilisateur
* @param int id_projet L'identifiant du projet
* @return bool
* @access public
*/
function isContributeur( $id_utilisateur, $id_projet, &$objetDB )
{
if (!is_object($objetDB)) $objetDB = $this->_db;
if ($this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) == 4) return false;
if ($this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) == 2) {
return true;
}
return false ;
} // end of member function isObservateur
 
/**
* Renvoie true si l'utilisateur passé en paramètre est contributeur du projet passé
* en paramètre.
*
* @param int id_utilisateur L'identifiant de l'utilisateur
* @param int id_projet L'identifiant du projet
* @return bool
* @access public
*/
function isEnAttente( $id_utilisateur, $id_projet, &$objetDB )
{
if ($this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) == 3) {
return true;
}
return false ;
} // end of member function isObservateur
 
/**
* Renvoie les infos sur les coordinateurs d'un projet
*
* @param int id_projet L'identifiant du projet
* @return array Un tableau contenant les infos concernants les coordinateurs du projet
* @access public
*/
function getCoordinateurs($id_projet)
{
$tableau_resultat = array() ;
$requete = 'select psu_id_utilisateur,'.PROJET_CHAMPS_NOM.','.PROJET_CHAMPS_PRENOM.',' ;
$requete .= PROJET_CHAMPS_MAIL.', ' ;
$requete .= 'psu_date_inscription, ps_id_statut '.
' from projet_statut_utilisateurs, projet_statut,'.PROJET_ANNUAIRE.
' where psu_id_projet='.$this->_db->escapeSimple($id_projet).' and psu_id_utilisateur='.PROJET_CHAMPS_ID.
' and psu_id_statut=ps_id_statut and psu_id_statut=1 order by ps_id_statut,'.PROJET_CHAMPS_NOM;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ORDERED)) {
array_push ($tableau_resultat, $ligne) ;
}
$resultat->free() ;
return $tableau_resultat ;
} // end of member function getCoordinateurs
function getAdministrateurs () {
$tableau_resultat = array() ;
$requete = 'select psu_id_utilisateur,'.PROJET_CHAMPS_NOM.','.PROJET_CHAMPS_PRENOM.',' ;
$requete .= PROJET_CHAMPS_MAIL.', ' ;
$requete .= 'psu_date_inscription, ps_id_statut '.
' from projet_statut_utilisateurs, projet_statut,'.PROJET_ANNUAIRE.
' where psu_id_utilisateur='.PROJET_CHAMPS_ID.
' and psu_id_statut=ps_id_statut and psu_id_statut=0 order by ps_id_statut,'.PROJET_CHAMPS_NOM;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ORDERED)) {
array_push ($tableau_resultat, $ligne) ;
}
$resultat->free() ;
return $tableau_resultat ;
}
/**
* Renvoie la constante de statut d un utilisateur
*
* define ('PROJET_DROIT_ADMINISTRATEUR', 1) ;
* define ('PROJET_DROIT_COORDINATEUR', 2) ;
* define ('PROJET_DROIT_PROPRIETAIRE', 4) ;
* define ('PROJET_DROIT_CONTRIBUTEUR', 8) ;
* define ('PROJET_DROIT_AUCUN', 16) ;
* define ('PROJET_DROIT_EN_ATTENTE', 32);
*
* @access public
* @return int La constante de statut
*/
function getStatut($id_utilisateur, $id_projet)
{
$statut = $this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $this->_db);
switch ($statut)
{
case 0 : return PROJET_DROIT_ADMINISTRATEUR;
break;
case 1 : return PROJET_DROIT_COORDINATEUR;
break;
case 2 : return PROJET_DROIT_CONTRIBUTEUR;
break;
case 3 : return PROJET_DROIT_EN_ATTENTE;
break;
default : return PROJET_DROIT_AUCUN;
}
}
} // end of participe
?>
/tags/2014_06_04/classes/type_fichier_mime.class.php
New file
0,0 → 1,190
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: type_fichier_mime.class.php,v 1.3 2008-08-25 15:03:52 alexandre_tb Exp $
/**
* Application projet
*
* La classe type_fichier_mime
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
/**
* class type_fichier_mime
*
*/
class type_fichier_mime
{
/*** Attributes: ***/
 
/**
* Le nom du type en français (ex Image jpg)
* @access private
*/
var $_nom;
/**
* L'extension du fichier (ex: png)
* @access private
*/
var $_extension;
/**
* Le nom du fichier de l'icône représentant ce fichier.
* @access private
*/
var $_icone;
/**
* Le type mime.
* @access private
*/
var $_type_mime;
/**
*
* @access private
*/
var $_description;
/**
* Le chemin UNIX ou Windows vers le dossier des icônes. Il ne commence pas par un
* slash et termine par slash.
* @access private
*/
var $_chemin_icone = "icones/";
/**
* Un objet PEAR:DB
* @access private
*/
var $_db;
/**
* L'identifiant du type dans la table gen_type_de_fichier
* @access private
*/
var $_id_type;
 
/**
* Renvoie le chemin vers les icônes.
*
* @return string
* @access public
*/
function getCheminIcone( )
{
return $this->_chemin_icone.$this->_icone ; ;
} // end of member function getCheminIcone
 
/**
*
*
* @param string chemin Le chemin vers l'icône.
* @return void
* @access public
*/
function setCheminIcone( $chemin )
{
$this->_chemin_icone = $chemin ;
} // end of member function setCheminIcone
 
/**
*
*
* @param DB objetDB un objet PEAR:DB
* @param int id_type
* @return void
* @access public
*/
function type_fichier_mime( $id_type = '', $chemin_icones = "icones/" )
{
$requete = 'select * from gen_type_de_fichier where ' ;
if (is_numeric ($id_type)) {
$requete .= 'gtf_id_type='.$GLOBALS['projet_db']->escapeSimple($id_type) ;
} else {
$requete .= 'gtf_type_mime="'.$id_type.'"' ;
}
$resultat = $GLOBALS['projet_db']->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$this->_chemin_icone = $chemin_icones ;
$this->_icone = $ligne->gtf_type_icone ;
$this->_id_type = $ligne->gtf_id_type ;
} // end of member function type_fichier_mime
 
/**
* Tente de renvoyer un objet type_fichier_mime à partir de l'extension passé en
* paramètre. S'il elle n'y arrive pas, elle renvoie 'inconnue'.
*
* @param string extension On passe un extension en paramètre, pour déterminer le type mime.
* @param DB objetDB un objet PEAR:DB
* @return type_fichier_mime
* @static
* @access public
*/
function factory( $extension, $objetDB = '')
{
if (is_object($objetDB)) {
$GLOBALS['projet_db'] = $objetDB;
}
$requete = "select * from gen_type_de_fichier where gtf_extension=\"$extension\" or gtf_type_mime=\"$extension\"" ;
$resultat = $GLOBALS['projet_db']->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
if ($resultat->numRows() != 0) {
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
return new type_fichier_mime ( $ligne->gtf_id_type) ;
} else {
// si il n'y a pas de résultat, on renvoie inconnue
return new type_fichier_mime (12) ;
}
} // end of member function factory
 
/**
* Renvoie l'identifiant du type Mime de la table gen_type_de_fichier
*
* @return int
* @access public
*/
function getIdType( )
{
return $this->_id_type;
} // end of member function getIdType
 
 
} // end of type_fichier_mime
?>
/tags/2014_06_04/classes/gestion_wikini.class.php
New file
0,0 → 1,182
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: gestion_wikini.class.php,v 1.2 2005-09-27 16:38:54 alexandre_tb Exp $
/**
* Application projet
*
* La classe gestion_wikini
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class gestion_wikini
*
*/
class gestion_wikini
{
 
/*** Attributes: ***/
 
/**
* Un objet PEAR::DB
* @access private
*/
var $_db;
 
/**
* Constructeur
*
* @param DB objetDB Une référence vers un objet PEAR:DB
* @return void
* @access public
*/
function gestion_wikini( &$objetDB )
{
$this->_db = $objetDB ;
} // end of member function gestion_wikini
 
/**
*
*
* @param string prefixe Le préfixe des tables.
* @return void
* @access public
*/
function creation_tables( $prefixe )
{
// Connection à la base de donnée de wikini
$prefixe .= '_' ;
$this->_db->query(
"CREATE TABLE ".$prefixe."pages (".
"id int(10) unsigned NOT NULL auto_increment,".
"tag varchar(50) NOT NULL default '',".
"time datetime NOT NULL default '0000-00-00 00:00:00',".
"body text NOT NULL,".
"body_r text NOT NULL,".
"owner varchar(50) NOT NULL default '',".
"user varchar(50) NOT NULL default '',".
"latest enum('Y','N') NOT NULL default 'N',".
"handler varchar(30) NOT NULL default 'page',".
"comment_on varchar(50) NOT NULL default '',".
"PRIMARY KEY (id),".
"FULLTEXT KEY tag (tag,body),".
"KEY idx_tag (tag),".
"KEY idx_time (time),".
"KEY idx_latest (latest),".
"KEY idx_comment_on (comment_on)".
") TYPE=MyISAM;");
$this->_db->query(
"CREATE TABLE ".$prefixe."acls (".
"page_tag varchar(50) NOT NULL default '',".
"privilege varchar(20) NOT NULL default '',".
"list text NOT NULL,".
"PRIMARY KEY (page_tag,privilege)".
") TYPE=MyISAM");
$this->_db->query(
"CREATE TABLE ".$prefixe."links (".
"from_tag char(50) NOT NULL default '',".
"to_tag char(50) NOT NULL default '',".
"UNIQUE KEY from_tag (from_tag,to_tag),".
"KEY idx_from (from_tag),".
"KEY idx_to (to_tag)".
") TYPE=MyISAM");
$this->_db->query(
"CREATE TABLE ".$prefixe."referrers (".
"page_tag char(50) NOT NULL default '',".
"referrer char(150) NOT NULL default '',".
"time datetime NOT NULL default '0000-00-00 00:00:00',".
"KEY idx_page_tag (page_tag),".
"KEY idx_time (time)".
") TYPE=MyISAM");
$this->_db->query(
"CREATE TABLE ".$prefixe."users (".
"name varchar(80) NOT NULL default '',".
"password varchar(32) NOT NULL default '',".
"email varchar(50) NOT NULL default '',".
"motto text NOT NULL,".
"revisioncount int(10) unsigned NOT NULL default '20',".
"changescount int(10) unsigned NOT NULL default '50',".
"doubleclickedit enum('Y','N') NOT NULL default 'Y',".
"signuptime datetime NOT NULL default '0000-00-00 00:00:00',".
"show_comments enum('Y','N') NOT NULL default 'N',".
"PRIMARY KEY (name),".
"KEY idx_name (name),".
"KEY idx_signuptime (signuptime)".
") TYPE=MyISAM");
$this->_db->query("insert into ".$prefixe."pages set tag = 'PagePrincipale', body = '".mysql_escape_string("====== Bienvenue ! sur le Wikini de ce groupe de travail ======\nEnfin, vous pourrez cliquer sur le lien \"Editer cette page\" au bas de la page pour rédiger.\n\n----\n\n\n\n\n\n\n----\n===== Pages utiles =====\n -[[TableauDeBord Tableau de bord de ce Wikini]]\n -[[ReglesDeFormatage Règles de formatage]]\n -[[BacASable Bac à sable]]")."', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'DerniersChangementsPages', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n{{RecentChanges}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'DernierChangementCommentaires', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n{{RecentlyCommented}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'ParametresUtilisateur', body = '** Retour : ** [[PagePrincipale page principale]]\n----\n** Note : ** L\'idéal pour la création d\'un nom Wiki est d\'accoler son prénom et son nom de cette façon : \"PrenomNom\". \n----\n==== Mes paramètres ====\n\n{{UserSettingsCommon}}\n\n----\n==== Voir ma participation à ce Wikini ====\n\n [[MesPagesModifier Voir les pages que j\'ai modifiées ]]\n\n [[MesPagesCreer Voir les pages que j\'ai créées ]]', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'PagesACreer', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des pages à créer : ===\n\n{{WantedPages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'PagesOrphelines', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des pages orphelines ===\n\n{{OrphanedPages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'RechercheTexte', body = '** Retour : ** [[PagePrincipale Page principale]] > [[TableauDeBord Tableau de bord]]\n----\n{{TextSearch}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'ReglesDeFormatage', body = '** Retour : ** [[PagePrincipale Page principale]]\n----\n====== Guide des règles de formatage ======\n\nLes règles de formatage avec Wakka diffèrent légèrement des autres Wikis. (Voir par exemple [[http://c2.com/cgi/wiki?TextFormattingRules les règles de formatage de WikiWikiWeb]], le premier Wiki connu.)\nTout texte placé entre deux guillemets doubles - \" - est présenté tel que.\n\nVous pouvez effectuer vos propres tests dans le BacASable : c\'est un endroit fait pour ça.\n\n=== Règles de base : ===\n \"\"**Texte en gras !** -----\"\"> **Texte en gras !**\n \"\"//Texte en italique.// -----\"\"> //Texte en italique.//\n \"\"Texte __souligné__ ! -----\"\"> Texte __souligné__ !\n \"\"##texte à espacement fixe## -----\"\"> ##texte à espacement fixe##\n \"\"%%code%%\"\"\n \"\"%%(php) PHP code%%\"\"\n\n=== Liens forcés : ===\n \"\"[[http://www.mon-site.org]]\"\"\n \"\"[[http://www.mon-site.org Mon-site]]\"\"\n \"\"[[P2P]]\"\"\n \"\"[[P2P Page sur le P2P]]\"\"\n\n=== Liens dans Wikini ===\n Pour réaliser un lien dans wikini qui apparaisse avec un style normal utilisez cette écriture :\n \"\"[[ReglesDeFormatage Règles de Formatage]]\"\"\n Le lien apparaîtra de cette manière [[ReglesDeFormatage Règles de Formatage]].\n\n=== En-têtes : ===\n \"\"====== En-tête énorme ======\"\" ====== En-tête énorme ======\n \"\"===== En-tête très gros =====\"\" ===== En-tête très gros =====\n \"\"==== En-tête gros ====\"\" ==== En-tête gros ====\n \"\"=== En-tête normal ===\"\" === En-tête normal ===\n \"\"== Petit en-tête ==\"\" == Petit en-tête ==\n\n=== Séparateur horizontal : ===\n \"\"----\"\"\n\n=== Retour de ligne forcé : ===\n \"\"---\"\"\n=== Indentation : ===\nL\'indentation de textes se fait avec la touche \"TAB\". Vous pouvez aussi créer des listes à puces ou numérotées :\n \"\"- liste à puce\"\"\n \"\"1) liste numérotée (chiffres arabes)\"\"\n \"\"A) liste numérotée (capitales alphabétiques)\"\"\n \"\"a) liste numérotée (minuscules alphabétiques)\"\"\n \"\"i) liste numérotée (chiffres romains)\"\"\n\n=== Inclure une image ===\n\n - Pour inclure un lien sur une image (sans l\'inclure à la page):\n \"\"[[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\"\"(ne pas indiquer de texte alternatif).\n Ce qui donne : [[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\n\n - Pour inclure une image sans indiquer de texte alternatif :\n \"\"[[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\"\"(laisser 3 espaces blancs avant la fermeture des crochets).\n Ce qui donne quand l\'image est trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\n Quand l\'image n\'est pas trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/table.gif]]\n\n - Pour inclure une image en indiquant un texte alternatif :\n \"\"[[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif une puce ]]\"\"\n Ce qui donne quand l\'image est trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif une puce ]]\n Quand l\'image n\'est pas trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/table.gif une puce ]]\n\n//Note :// le texte alternatif est affiché à la place de l\'image s\'il y a une erreur lors de l\'affichage de celle-ci.\n\n=== Outils avancés : ===\n\n \"\"{{Backlinks}}\"\" permet de créer un lien vers la page précédente. \n \"\"{{Listusers}}\"\" affiche la liste des utilisateurs du site wikini.\n \"\"{{OrphanedPages}}\"\" affiche les pages orphelines du site wikini.\n \"\"{{ListPages/tree}}\"\" affiche le plan du site wikini.\n \"\"{{pageindex}}\"\" affiche un index des pages du site classées par lettres alphabétiques.\n \"\"{{ListPages}}\"\" affiche un index des pages du site avec le nom de leur propriétaire.\n \"\"{{WantedPages}}\"\" affiche la liste des pages restant à créer. Elles apparaissent dans le site avec un ? à la suite de leur nom.\n \"\"{{RecentChanges}}\"\" affiche la liste des sites faisant référence au site wikini.\n \"\"{{RecentlyCommented}}\"\" affichage de la liste des derniers commentaires.\n \"\"{{TextSearch}}\"\" recherche de texte dans les pages du site.\n\n**Note :** à cause d\'un [[http://bugzilla.mozilla.org/show_bug.cgi?id=10547 bogue dans son moteur de rendu]], les listes, utilisant la touche TAB, ne fonctionnent pas (encore) sous Mozilla.\nUne astuce consiste à réaliser une tabulation dans un éditeur de texte puis de la copier. On peut ensuite coller la tabulation dans la zone de saisie de Wikini.\nVous pouvez également indenter du texte en utilisant des caractères espace au lieu de la touche \"TAB\", les exemples ci-dessus restent valables mais attention à ne pas mélanger des \"TAB\" et des espaces dans la même énumération.\n\n---', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'ListeUtilisateurs', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des utilisateurs ===\n\n... du premier au dernier.\n\n{{Listuserscommon}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'ListeUtilisateursInverse', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des utilisateurs ===\n\n... du dernier au premier.\n\n{{Listuserscommon/last}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'PlanDuSite', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Plan du site : ===\n\n{{ListPages/tree}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'IndexDesPages', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Liste des pages : ===\n\n{{ListPages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'IndexDesPagesAlphabet', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Liste des pages par ordre alphabétique : ===\n\n{{pageindex}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'DerniersChangementsRSS', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\nCette page renvoie au fils RSS des derniers changement. Pour savoir comment l\'utiliser voir la page \"\"<a href=\"http://www.wikini.net/wakka.php?wiki=WikiniEtLesFluxRSS\" target=\"_blank\" title=\"Wikini et les flux RSS\">Wikini et les flux RSS</a>\"\".\n\n\"\"<!--\n\n{{recentchangesrss/link=\"DerniersChangements\"}}\n\n-->\"\"', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'ListeInterWiki', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Liste des distributions wiki : ===\n\n{{interwikilist}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'BacASable', body = '** Retour : ** [[PagePrincipale Page pincipale]]\n----\nUtilisez cette page pour faire vos tests !', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'MesPagesModifier', body = '**Retour : ** [[ParametresUtilisateur mes paramètres ]]\n----\n{{mychanges}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'TableauDeBord', body = '** Retour : ** [[PagePrincipale Page Principale]]\n----\n===== Tableau de bord =====\n\n - Listes des utilisateurs : [[ListeUtilisateurs par ordre de création ]] ou [[ListeUtilisateursInverse par ordre inverse de création ]].\n\n - [[DerniersChangementsPages Dernières modifications sur les pages]]\n - [[DernierChangementCommentaires Dernières modifications sur les commentaires]]\n\n\n - [[PagesOrphelines Pages orphelines]]\n - [[PagesACreer Pages à créer]]\n\n - [[RechercheTexte Recherche texte]]\n\n - [[PlanDuSite Plan du site]]\n - [[IndexDesPages Index des pages avec noms des propriétaires]]\n - [[IndexDesPagesAlphabet Index des pages par classement alphabétique]]\n\n - [[DerniersChangementsRSS La page permettant le flux RSS]]\n\n - [[ListeInterWiki Liste des wiki existants ]]\n----\n==== 5 derniers comptes utilisateurs ====\n{{Listuserscommon last=\"5\"}}\n\n==== 5 dernières pages modifiées ====\n{{recentchanges max=\"5\"}}\n----', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'MesPagesCreer', body = '**Retour : ** [[ParametresUtilisateur mes paramètres ]]\n----\n{{mypages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
$this->_db->query("insert into ".$prefixe."pages set tag = 'NomWiki', body = '** Retour : ** [[PagePrincipale Page Principale]]\n----\nUn NomWiki est un nom qui est écrit \"\"CommeCela\"\".\n\nUn NomWiki est transformé automatiquement en lien. Si la page correspondante n\'existe pas, un \'?\' est affiché à côté du mot.', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'");
} // end of member function creation_tables
 
/**
*
*
* @param string prefixe Le préfixe des tables à supprimer
* @return void
* @access public
*/
function suppression_tables( $prefixe )
{
$resultat = $this->_db->query("DROP TABLE ".$prefixe."_acls ,".$prefixe."_links ,".$prefixe."_pages ,".
$prefixe."_referrers ,".$prefixe."_users") ;
if (DB::isError ($resultat)) {
echo ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
} // end of member function suppression_tables
 
 
 
 
 
} // end of gestion_wikini
?>
/tags/2014_06_04/classes/liste_discussion.class.php
New file
0,0 → 1,294
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: liste_discussion.class.php,v 1.4 2008-08-25 15:12:24 alexandre_tb Exp $
/**
* Application projet
*
* La classe liste_discussion
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
require_once GEN_CHEMIN_API.'sql/SQL_manipulation.fonct.php' ;
/**
* class liste_discussion
*
*/
class liste_discussion
{
 
/*** Attributes: ***/
 
 
/**
* Le nom de la liste, sans le domaine.
* @access private
*/
var $_nom;
/**
*
* @access private
*/
var $_adresse;
/**
* Le domaine de la liste
* @access private
*/
var $_domaine;
/**
*
* @access private
*/
var $_adresse_inscription;
/**
*
* @access private
*/
var $_adresse_desinscription;
/**
*
* @access private
*/
var $_adresse_aide;
/**
* Une connexion PEAR::DB
* @access private
*/
var $_db;
/**
* L'identifiant de la liste.
* @access private
*/
var $_id;
/**
*
* @access private
*/
var $_adresse_inscription_resume;
/**
* Indique la portee, publique ou privee de la liste
* @access private
*/
var $_portee;
 
/**
* Le constructeur
*
* @param int id_liste L'identifiant de la liste souhaité
* @param DB objetDB Un objet PEAR:DB
* @return void
* @access public
*/
function liste_discussion( $id_liste, & $objetDB )
{
$this->_db = $objetDB ;
if ($id_liste != '') {
$this->_id = $id_liste ;
 
$requete_liste = 'select * from projet_liste where pl_id_liste='.$this->_db->escapeSimple($this->_id) ;
$resultat_liste = $this->_db->query ($requete_liste) ;
if (DB::isError ($resultat_liste)) {
die ("Echec de la requete : $requete_liste<br />".$resultat_liste->getMessage()) ;
}
$ligne_liste = $resultat_liste->fetchRow(DB_FETCHMODE_OBJECT) ;
$this->_adresse = $ligne_liste->pl_adresse_liste ;
$this->_domaine = $ligne_liste->pl_domaine ;
$this->_nom = $ligne_liste->pl_nom_liste ;
$this->_adresse_inscription = $ligne_liste->pl_adresse_inscription ;
$this->_adresse_inscription_resume = $ligne_liste->pl_nom_liste.'-digest-subscribe@'.$this->_domaine ;
$this->_portee = $ligne_liste->pl_visibilite ;
}
} // end of member function liste_discussion
 
 
/**
* Renvoie le domaine de la liste
*
* @return string
* @access public
*/
function getDomaine( )
{
return $this->_domaine ;
} // end of member function getDomaine
 
/**
* Renvoie le nom de la liste
*
* @return string
* @access public
*/
function getNom( )
{
return $this->_nom ;
} // end of member function getNom
 
/**
* Renvoie l'identifiant de la liste
*
* @return integer
* @access public
*/
function getId( )
{
return $this->_id ;
} // end of member function getNom
 
function getVisibilite( )
{
return $this->_portee ;
} // end of member function getNom
 
/**
* Enregistre une ligne dans la table projet_liste
* Le tableau de valeur doit contenir les éléments suivants 'nom_liste','','domaine_liste'
*
* @param Array tableau_de_valeur Le tableau de valeur a insérer dans la base avec pour clé les noms des éléments
* @access public
* @return void
*/
 
function enregistrerSQL ($valeur) {
 
$id = SQL_obtenirNouveauId($this->_db, 'projet_liste', 'pl_id_liste') ;
 
$requete = "insert into projet_liste set pl_id_liste=".$this->_db->escapeSimple($id) ;
$requete .= ", pl_nom_liste=\"".$valeur['nom_liste']."\", pl_domaine=\"".$valeur['domaine_liste']."\"".
", pl_adresse_liste=\"".$valeur['nom_liste'].'@'.$valeur['domaine_liste'].'", pl_adresse_inscription="'.
$valeur['nom_liste']."-subscribe@".$valeur['domaine_liste'].'",pl_adresse_desinscription="'.
$valeur['nom_liste']."-unsubscribe@".$valeur['domaine_liste'].'", pl_adresse_aide="'.
$valeur['nom_liste']."-help@".$valeur['domaine_liste'].'", pl_visibilite="'.$valeur['liste_visibilite'].'"' ;
 
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$this->_id = $id ;
$this->_domaine = $valeur['domaine_liste'] ;
$this->_nom = $valeur['nom_liste'] ;
return $id;
}
 
/**
*
*
* @param string code_sql
* @return bool
* @access public
*/
function suppressionSQL()
{
 
$requete = "delete from projet_liste where pl_id_liste=".$this->_db->escapeSimple($this->_id) ;
$resultat = $this->_db->query ($requete) ;
 
return true ;
} // end of member function suppressionSQL
 
/**
* Vérifie si une liste existe déjà dans la table projet_liste.
*
* @param string adresse_liste L'adresse de la liste à tester
* @param DB objetDB Un objet PEAR::DB
* @return bool
* @static
* @access public
*/
function verifieDoubleListe( $adresse_liste, &$objetDB )
{
$requete = 'select pl_id_liste from projet_liste where pl_adresse_liste="'.$adresse_liste.'"' ;
$resultat = $objetDB->query ($requete) ;
if (DB::isError ($resultat)) {
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
}
if ($resultat->numRows()) {
return false;
}
return true ;
} // end of member function verifieDoubleListe
 
 
/**
* Renvoie l'adresse de la liste
*
* @return string
* @access public
*/
function getAdresseEnvoi( )
{
return $this->_adresse ;
} // end of member function getAdresseEnvoi
 
/**
* Renvoie l'adresse de la liste
*
* @return string
* @access public
*/
function getAdresseInscription( )
{
return $this->_adresse_inscription ;
} // end of member function getAdresseEnvoi
 
/**
*
*
* @return string
* @access public
*/
function getAdresseResume( )
{
return $this->_adresse_inscription_resume ;
} // end of member function getAdresseResume
 
 
/**
*
*
* @return string
* @access public
*/
function isPublic( )
{
return $this->_portee ;
} // end of member function getAdresseResume
 
 
 
 
 
 
 
} // end of liste_discussion
?>
/tags/2014_06_04/classes/statut_liste.class.php
New file
0,0 → 1,100
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: statut_liste.class.php,v 1.2 2005-09-27 16:42:00 alexandre_tb Exp $
/**
* Application projet
*
* La classe statut_liste
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
 
/**
* class statut_liste
*
*/
class statut_liste
{
/*** Attributes: ***/
 
/**
* Une ressource PEAR::DB
* @access private
*/
var $_db;
/**
*
* @access private
*/
var $_id_statut;
/**
*
* @access private
*/
var $_label;
 
/**
*
*
* @param DB objetDB Une ressource PEAR::DB
* @return void
* @access public
*/
function statut_liste( &$objetDB )
{
$this->_db = $objetDB ;
} // end of member function statut_liste
 
/**
* Renvoie un tableu avec tous les status d'inscription à une liste 0 => 'Pas
* d'email' 1 => ' ...
*
* @return Array
* @access public
*/
function getTousLesStatuts( )
{
$requete = 'select * from projet_liste_statut' ;
$resultat = $this->_db->query ($requete) ;
$tableau_resultat = array();
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$tableau_resultat[$ligne->pls_id_statut] = $ligne->pls_statut_nom ;
}
return $tableau_resultat;
} // end of member function getTousLesStatuts
 
} // end of statut_liste
?>
/tags/2014_06_04/classes/statut.class.php
New file
0,0 → 1,138
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: statut.class.php,v 1.2 2005-09-27 16:42:00 alexandre_tb Exp $
/**
* Application projet
*
* La classe statut
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
define ('PROJET_STATUT_TOUS', 1) ;
define ('PROJET_STATUT_SAUF_ADM', 2) ;
define ('PROJET_STATUT_SAUF_ADM_COORD', 3) ;
 
/**
* class statut
*
*/
class statut
{
 
/** Aggregations: */
 
/** Compositions: */
 
/*** Attributes: ***/
 
/**
* L'identifiant du statut
* @access private
*/
var $_id_statut;
/**
* Le label du statut, dans la table.
* @access private
*/
var $_label;
/**
* Un objet PEAR::DB
* @access private
*/
var $_db;
 
/**
* Constructeur.
*
* @param int id_statut L'identifiant du statut créé.
* @param DB objetDB Un objet PEAR::DB
* @return void
* @access public
*/
function statut( $id_statut, &$objetDB )
{
$requete = "select * from projet_statut where ps_id_statut=".$this->_db->escapeSimple($id_statut)." " ;
$resultat = $objetDB->query ($requete) ;
if (PEAR::isError ($resultat)) {
die ($resultat->getMessage()."<br />".$requete."<br />") ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$this->_db = $objetDB ;
$this->_id_statut = $ligne->pd_id_statut ;
$this->_label = $ligne->ps_statut_nom;
} // end of member function statut
 
/**
* Renvoie le label du statut.
*
* @return string
* @access public
*/
function getLabel( )
{
return $this->_label ;
} // end of member function getLabel
/**
*
*
* @param int type_statut Indique quels statuts l'on désire voir retourner PROJET_STATUT_TOUS
* PROJET_STATUT_SAUF_ADM PROJET_STATUT_SAUF_ADM_COORD
* @return Array
* @static
* @access public
*/
function getTousLesStatuts( $type_statut = PROJET_STATUT_TOUS, &$objetDB)
{
$requete = 'select * from projet_statut' ;
if ($type_statut == PROJET_STATUT_SAUF_ADM) {
$requete .= ' where ps_id_statut <> 0' ;
}
if ($type_statut == PROJET_STATUT_SAUF_ADM_COORD) {
$requete .= ' where ps_id_statut > 1' ;
}
$resultat = $objetDB->query ($requete) ;
$tableau_resultat = array();
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$tableau_resultat[$ligne->ps_id_statut] = $ligne->ps_statut_nom ;
}
return $tableau_resultat;
} // end of member function getTousLesStatuts
 
 
 
 
 
} // end of statut
?>
/tags/2014_06_04/classes/projet_theme.class.php
New file
0,0 → 1,103
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projet_theme.class.php,v 1.1 2008-08-25 15:09:39 alexandre_tb Exp $
/**
* Application projet
*
* La classe projet_theme
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2008
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class projet_type
*
*/
class projet_theme
{
 
/*** Attributes: ***/
 
/**
* Une connection vers une base de donnée
* @access private
*/
var $_db;
 
/**
* Renvoie tous types de projets (de la table projet_type) ans un tableau avec pour
* clé l'identifiant et pour valeur le label.
*
* @return Array
* @static
* @access public
*/
function getTousLesThemes(& $objetDB )
{
$requete = 'select * from projet_theme' ;
return $objetDB->getAssoc ($requete) ;
}
 
/**
*
*
* @param DB objetDB Une instance de la classe PEAR::DB
* @return void
* @access public
*/
function projet_theme( & $objetDB )
{
$this->_db = $objetDB ;
}
 
 
/**
*
*
* @param DB objetDB Une instance de la classe PEAR::DB
* @return void
* @access public
*/
function getLabelType( $id_type)
{
$requete = 'select pt_label_theme from projet_theme where pt_id_theme='.$this->_db->escapeSimple($id_type) ;
$resultat = $this->_db->getOne($requete) ;
if (DB::isError($resultat)) {
echo $resultat->getMessage() ;
}
return $resultat ;
}
}
?>
/tags/2014_06_04/classes/HTML_formulaireListeExterne.class.php
New file
0,0 → 1,116
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_formulaireListeExterne.class.php,v 1.2 2005-09-27 16:42:00 alexandre_tb Exp $
/**
* Application projet
*
* La classe controleur projet
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
 
require_once 'HTML/QuickForm.php' ;
require_once 'HTML/QuickForm/checkbox.php' ;
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE des constantes |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class HTML_formulaireListe
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
*/
class HTML_formulaireListeExterne extends HTML_QuickForm
{
/**
* Constructeur
*
* @param string formName Le nom du formulaire.
* @param string method Soit get soit post, voir le protocole HTTP
* @param string action L'action du formulaire.
* @param string target La cible du formulaire.
* @param Array attributes Des attributs supplémentaires pour la balise <form>
* @param bool trackSubmit Pour repérer si la formulaire a été soumis.
* @return void
* @access public
*/
function HTML_formulaireListe( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
} // end of member function HTML_formulaireListe
 
/**
* Renvoie le code HTML du formulaire.
*
* @return string
* @access public
*/
function toHTML( )
{
$res = HTML_QuickForm::toHTML() ;
return $res ;
} // end of member function toHTML
 
/**
* Ajoute les champs nécessaire au formulaire.
*
* @return void
* @access public
*/
function construitFormulaire($tableau_liste_externe)
{
foreach ($tableau_liste_externe as $cle => $valeur) {
$this->addElement ('checkbox', 'liste_'.$cle, '', $valeur) ;
}
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.PROJET_CHAMPS_REQUIS) ;
$url_annuler = new Net_URL($this->getAttribute('action')) ;
$url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
// qui remplacent deux fois les & par des &amp;
// ce qui fait échouer le lien
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', PROJET_FICHIER_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
} // end of member function _construitFormulaire
 
} // end of HTML_formulaireListe
 
 
 
 
 
?>
/tags/2014_06_04/classes/HTML_listeDocuments.class.php
New file
0,0 → 1,390
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_listeDocuments.class.php,v 1.10 2008-08-25 15:14:17 alexandre_tb Exp $
/**
* Application projet
*
* La classe HTML_listeDocuments
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.10 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE des constantes |
// +------------------------------------------------------------------------------------------------------+
 
define ("FICHIER_ICONE_COUPER", "cut.gif") ;
define ("FICHIER_ICONE_COLLER", "paste.gif") ;
define ("FICHIER_ICONE_SUPPRIMER", "trash.gif") ;
define ("FICHIER_ICONE_MODIFIER", "modif.png") ;
 
 
include_once PROJET_CHEMIN_CLASSES.'HTML_Liste.class.php';
/**
* class HTML_listeDocuments
*
*/
class HTML_listeDocuments extends HTML_Liste
{
/*** Attributes: ***/
 
/**
* Une url.
* @access private
*/
var $_url;
/**
* Tableau contenant les actions possibles. "couper" => 1, "modifier" => 2,
* "supprimer" => 3 Elles seront passées en paramètre aux url des icones des
* documents.
* @access private
*/
var $_actions = array ("couper" => 1, "modifier" => 2, "supprimer" => 3) ;
 
/**
* Indique le chemin des icones couper, coller, modifier, supprimer.
* @access private
*/
var $_chemin_icone = "icones/";
/**
* L'identifiant du repertoire que l'on est en train d'observer.
* @access private
*/
var $_id_repertoire;
 
/**
* Un tableau contenant les id et les noms du chemin des répertoires. 0 => ["id"],
* ["nom"] etc.
* @access private
*/
var $_chemin_navigation = array ();
 
/**
* un pointeur vers une authentificatin PEAR
* @access private
*/
var $_auth ;
/**
* le style d affichage
* @access private
*/
var $_mode_affichage ;
/**
*
*
* @param bool utilise_pager Indique l'utilisation ou non du Pager.
* @return void
* @access public
*/
function HTML_listeDocuments(&$url, $utilise_pager = false, $id_repertoire = 0, $auth = '' )
{
HTML_Liste::HTML_Liste($utilise_pager, array('class' => 'table_cadre')) ;
$this->_url = $url ;
$this->_id_repertoire = $id_repertoire ;
if (is_object($auth)) {
$this->_auth = $auth ;
}
$this->_mode_affichage = 'standart';
} // end of member function HTML_listeDocuments
 
/**
*
*
* @param bool utilise_pager Voir HTML_listeDocuments
* @return void
* @access public
*/
function __construct( &$url, $utilise_pager = false, $id_repertoire = 0, $auth = '', $id_projet = '' )
{
$this->HTML_listeDocuments($url, $utilise_pager, $id_repertoire, $auth);
} // end of member function __construct
 
/**
*
*
* @param Array tableau_label Un tableau contenant les labels à afficher dans l'entête.
* @return void
* @access public
*/
function construitEntete( $tableau_label )
{
$this->addRow ($tableau_label, NULL, 'TH') ;
}
 
/**
*
*
* @param Array tableau_label Un tableau a deux dimensions avec les labels a afficher dans le corps du
* tableau.
* @return void
* @access public
*/
function construitListe( &$tableau_document, $droits, $mode = '', $objetDB = '', $id_projet = '')
{
if ($this->_mode_affichage == 'standart') {
$compteur = 0 ;$class[0] = 'ligne_impaire'; $class[1] = 'ligne_paire' ;
//var_dump ($tableau_document);
for ($i = 0; $i < count ($tableau_document) ; $i++) {
// Premiere condition : est-ce que le fichier a pour pere le repertoire courant, si oui on l'affiche
if ($tableau_document[$i]->_id_pere == $this->_id_repertoire || $mode == 'ignore_repertoire') {
// d'abord l'image
$icone = '<img src="'.$tableau_document[$i]->getCheminIcone().'" />' ;
// Si le document est un repertoire, on ajoute id_repertoire au lien.
if ($tableau_document[$i]->isRepertoire()) {
$this->_url->addQueryString ('id_repertoire', $tableau_document[$i]->getIdDocument()) ;
$lien = $this->_url->getURL() ;
} else { // Si c'est un fichier, on fait un lien direct
$this->_url->addQueryString('id_document', $tableau_document[$i]->getIdDocument());
$this->_url->addQueryString('service', 'telechargement');
$lien = $this->_url->getURL() ;
$this->_url->removeQueryString('service');
$this->_url->removeQueryString('id_document');
$lien = 'http://'.$this->_url->host.'/projets/'.$this->_url->querystring[PROJET_VARIABLE_ID_PROJET].'/telechargement/'.$tableau_document[$i]->getIdDocument();
}
// pour eviter des effets de bords, on enleve id_repertoire de l'url
// dans le cas d'un repertoire, pour les fichiers on le laisse pour
// qu'apres une operation, on reste dans le repertoire ou a eu lieu l'operation
if ($tableau_document[$i]->isRepertoire()) $this->_url->removeQueryString('id_repertoire') ;
// on insere le lien
$lien_nom = '<a href="'.$lien.'">'.$icone.' '.$tableau_document[$i]->getNomLong()."</a>\n" ;
$taille = $tableau_document[$i]->getTailleFormatee();
// Recuperation de l'auteur
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$annuaire = new annuaire($objetDB, array('table' => PROJET_ANNUAIRE, 'identifiant' => PROJET_CHAMPS_ID,
'nom' => PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
$annuaire->setId($tableau_document[$i]->_id_proprietaire) ;
$nom_prenom = $annuaire->getInfo('nom').' '.$annuaire->getInfo('prenom') ;
// On rempli le tableau a donner en parametre a HTML_Table avec toutes ces infos, une par colonne
$ligne_tableau = array($lien_nom, $taille, $nom_prenom, $tableau_document[$i]->getDateMiseAJour()) ;
if ($droits <= PROJET_DROIT_CONTRIBUTEUR) array_push ($ligne_tableau, $tableau_document[$i]->getVisibilite()) ;
// On ajoute au tableau, les action couper / modifier / supprimer
if ($droits <= PROJET_DROIT_COORDINATEUR || $this->_auth->getAuthData(PROJET_CHAMPS_ID) == $tableau_document[$i]->_id_proprietaire)
array_push ($ligne_tableau, $this->_actions ($tableau_document[$i])) ;
if ($tableau_document[$i]->getVisibilite() != 'prive' || $droits < PROJET_DROIT_AUCUN) {
$this->addRow ($ligne_tableau, array('class' => $class[$compteur]), 'TD', true) ;
// enfin , s'il y a une description, on l'ajoute, mais sur une ligne entière (colspan)
if ($tableau_document[$i]->getDescription() != "") {
$this->addRow (array ($tableau_document[$i]->getDescription()),
array ('colspan' => $this->getColCount(), 'class' => $class[$compteur])) ;
$this->updateRowAttributes ($this->getRowCount()-1, array ('class' => $class[$compteur]), true) ;
}
}
$compteur++;
}
if ($compteur == 2) $compteur = 0 ;
}
$this->_url->removeQueryString('id_document');
$this->updateColAttributes(0, array ('class' => 'col1')) ;
} else {
}
} // end of member function construitListe
 
/**
*
*
* @param Array actions Un tableau avec les valeurs d'actions comme cle. "couper", modifier",
* "supprimer".
* @return void
* @access public
*/
function setAction( $actions )
{
$this->_actions = $actions ;
}
 
/**
*
*
* @param string le mode, valeur possible standart ou ajax
* @return void
* @access public
*/
function setModeAffichage( $mode )
{
$this->_mode_affichage = $mode ;
}
 
/**
*
*
* @param string chemin Le chemin vers les icones couper, coller ...
* @return void
* @access public
*/
function setCheminIcones( $chemin )
{
$this->_chemin_icone = $chemin ;
}
 
/**
* Surcharge de l'operation de la classe mere. Ajoute la navigation dans les
* repertoires.
*
* @return string
* @access public
*/
function toHTML($id_projet = '', $droits)
{
if ($this->_mode_affichage == 'standart') {
$chemin_navig = "" ;
if ($this->_id_repertoire != "") {
$this->_url->removeQueryString(PROJET_VARIABLE_ID_REPERTOIRE) ;
$chemin_navig = "<p>" ;
$chemin_navig .= "<a href=\"".$this->_url->getURL()."\">".PROJET_RACINE."</a>\n" ;
$this->_url->addQueryString(PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
for ($i = 0; $i < count ($this->_chemin_navigation); $i++) {
$chemin_navig .= "&gt;&nbsp;" ;
$doc = new document ($this->_chemin_navigation[$i], $GLOBALS['projet_db']);
$nom = $doc->getNomLong() ;
$this->_url->addQueryString ('id_repertoire', $this->_chemin_navigation[$i]) ;
$chemin_navig .= "<a href=\"".$this->_url->getURL()."\">".$nom."</a>\n" ;
}
$chemin_navig .= "</p>\n" ;
}
$res = $chemin_navig.HTML_Liste::toHTML() ;
if ($this->getRowCount() == 1 && $this->_id_repertoire == '') {
return '<div>'.PROJET_PAS_DE_DOCUMENTS.'</div>'."\n";
}
} else {
GEN_stockerFichierScript('dojo', 'api/js/dojo/dojo.js', 'text/javascript');
GEN_stockerFichierScript('dojoScriptProjet', 'client/projet/js/arbreDocument.js');
$res = '' ;
$RCPUrl = PROJET_CHEMIN_APPLI.'services/ecouteArbreFichier.php?id_projet='.$id_projet;
$this->_url->addQueryString(PROJET_VARIABLE_SERVICE, 'ecouteArbreFichier');
$RCPUrl = $this->_url->getURL();
// Le noeud racine
if ($droits <= PROJET_DROIT_CONTRIBUTEUR) {
$tree = '<div dojoType="Tree" DNDMode="between" selector="treeSelector" DNDAcceptTypes="bandTree" widgetId="bandTree" controller="treeController" eventNames="moveTo:nodeRemoved">';
} else {
$tree = '<div dojoType="Tree" selector="treeSelector" DNDAcceptTypes="bandTree" widgetId="bandTree" controller="treeController">';
}
$res .= '<div dojoType="TreeLoadingController" RPCUrl="'.$RCPUrl.'" widgetId="treeController" DNDController="create"></div>
<div dojoType="TreeSelector" widgetId="treeSelector"></div>'.$tree.
'<div dojoType="TreeNode" title="Racine" widgetId="rootNode" objectId="root" isFolder="true"></div></div>';
}
return $res ;
} // end of member function toHTML
 
/**
*
*
* @param Array tableau_navigation Un tableau contenant les identifiants et les noms des repertoires. 0 => ["id"],
* ["nom"] etc.
* @return void
* @access public
*/
function setCheminNavigation( $tableau_navigation )
{
$this->_chemin_navigation = $tableau_navigation ;
} // end of member function setCheminNavigation
 
/**
* Affiche la legende des actions du module "documents"
*
* @return string
* @access public
*/
function affLegende( )
{
$res = "<h2 class=\"titre2_projet\">".PROJET_LEGENDE."</h2>\n" ;
$res .= "<p><img src=\"".$this->_chemin_icone."/cut.gif\" title=\"couper\" alt=\"couper\">".PROJET_LEGENDE_DEPLACE."</p>\n" ;
$res .= "<p><img src=\"".$this->_chemin_icone."/modif.png\" title=\"modifier\" alt=\"modifier\"> ".PROJET_LEGENDE_MODIFIE."</p>\n" ;
$res .= "<p><img src=\"".$this->_chemin_icone."/trash.gif\" title=\"supprimer\" alt=\"supprimer\"> ".PROJET_LEGENDE_SUPPR."</p>\n" ;
return $res ;
}
 
 
/**
* Renvoie le chemin HTML, depuis le repertoire courant jusqu'a la racine.
*
* @return string
* @access private
*/
function _getCheminHTML( )
{
$path = "" ;
 
return $path ;
}
 
/**
* Renvoie une chaine contenant le code html des icones des actions possibles sur un
* fichier, c'est a dire couper, modifier, supprimer.
*
* @return string
* @access private
*/
function _actions($document)
{
$this->_url->addQueryString ('id_document', $document->getIdDocument()) ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["couper"]) ;
$couper = ' '.PROJET_FICHIER_COUPER ;
$couper = '<a href="'.$this->_url->getURL().'">'.$couper.'</a>' ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["modifier"]) ;
$modifier = '<a href="'.$this->_url->getURL().'">'.PROJET_FICHIER_MODIFIER.'</a> ' ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["supprimer"]) ;
$supprimer= '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm (\''.PROJET_FICHIER_SUPPRIMER.' ?\');">'.PROJET_FICHIER_SUPPRIMER.'</a>' ;
$this->_url->removeQueryString ('id_document') ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT) ;
return $modifier.$supprimer.$couper ;
} // end of member function _action
 
 
} // end of HTML_listeDocuments
?>
/tags/2014_06_04/classes/HTML_listeProjet.class.php
New file
0,0 → 1,197
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_listeProjet.class.php,v 1.7 2006-09-15 12:35:54 alexandre_tb Exp $
/**
* Application projet
*
* La classe controleur projet
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.7 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once PROJET_CHEMIN_CLASSES.'HTML_Liste.class.php' ;
 
/**
* class HTML_listeProjet
*
*/
class HTML_listeProjet extends HTML_Liste
{
/*** Attributes: ***/
/**
* 0 mode normal 1 mode modification, rajoute un formulaire pour modifier le statut
* d'un utilisateur.
* @access private
*/
var $_mode;
/**
* Un objet PEAR::Net_URL
* @access private
*/
var $_url;
 
/**
*
*
* @param bool utilise_pager Indique si les résultats sont divisés en page.
* @return void
* @access public
*/
function HTML_listeProjet( $utilise_pager = false )
{
HTML_Liste::HTML_Liste($utilise_pager, array ('class' => 'table_cadre', 'summary' => PROJET_LISTE)) ;
} // end of member function HTML_listeProjet
 
/**
*
*
* @return void
* @access public
*/
function __construct($utilise_pager = false)
{
$this->HTML_listeProjet($utilise_pager);
} // end of member function __cosntruct
 
/**
*
*
* @param Array label_entete Un tableau contenant les labels pour l'entête de la liste.
* @return void
* @access public
*/
function construitEntete( $label_entete )
{
$this->addRow ($label_entete, '', 'TH') ;
} // end of member function construitEntete
 
/**
*
*
* @param Array label_liste Un tableau à double dimension contenant les valeurs de la liste. du type
* 0 =>'label', 'label2',
* 1 => ...
* @return void
* @access public
*/
function construitListe( $label_liste, $tableau_statut = '' )
{
for ($i = 0; $i < count ($label_liste) ; $i++) {
if ($this->_mode == 1) {
$id_projet = array_shift ($label_liste[$i]) ;
$id_statut = array_pop ($label_liste[$i]) ;
}
$resume = array_shift ($label_liste[$i]) ;
$this->addRow ($label_liste[$i]) ;
if ($this->_mode == 1 && $id_statut < 3) {
$this->_url->addQueryString ('identifiant_projet', $id_projet) ;
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET) ;
$select = '<form action="'.$this->_url->getURL().'" method="post" class="magali">'."\n" ;
$select .= '<select name="statut" onchange="javascript:this.form.submit();">' ;
foreach ($tableau_statut as $cle =>$element_statut) {
$select .= '<option value="'.$cle.'"' ;
if ($cle == $id_statut) {
$select .= ' selected="selected"' ;
}
$select .= '>'.$element_statut.'</option>'."\n" ;
}
$select .= '</select>'."\n".'</form>'."\n" ;
if (is_int($id_statut)) {
//$this->setCellContents($i+1, 2, $select) ;
$this->setCellContents($this->getRowCount() - 1, 2, $select) ;
} else {
$this->setCellContents($i+1, 2, PROJET_PAS_DE_LISTE) ;
}
}
// On affiche le résumé dans la deuxième ligne
if (PROJET_LISTE_RESUME) {
$this->addRow (array ($resume), array('colspan' => $this->getColCount()));
}
}
$this->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire')) ;
} // end of member function construitListe
 
/**
*
*
* @return void
* @access public
*/
function setModeModification( )
{
$this->_mode = 1 ;
} // end of member function setModeModification
 
/**
*
*
* @param Net_URL url Un objet PEAR::Net_URL
* @return void
* @access public
*/
function setURL(& $url )
{
$this->_url = $url ;
} // end of member function setURL
/**
* Alternates the row attributes starting at $start
* @param int $start Row index of row in which alternating begins
* @param mixed $attributes1 Associative array or string of table row attributes
* @param mixed $attributes2 Associative array or string of table row attributes
* @param bool $inTR false if attributes are to be applied in TD tags
* true if attributes are to be applied in TR tag
* @access public
*/
function altRowAttributes($start, $attributes1, $attributes2, $inTR = false)
{
for ($row = $start ; $row < $this->_rows ; $row++) {
$attributes = ( ($row+$start)%2 == 0 ) ? $attributes1 : $attributes2;
$this->updateRowAttributes($row, $attributes, $inTR);
if (PROJET_LISTE_RESUME) {
$row++;
$this->updateRowAttributes($row, $attributes, $inTR);
$start++;
}
}
} // end func altRowAttributes
 
} // end of HTML_listeProjet
?>
/tags/2014_06_04/classes/HTML_formulaireDocument.class.php
New file
0,0 → 1,146
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_formulaireDocument.class.php,v 1.4 2007-02-13 15:11:39 jp_milcent Exp $
/**
* Application projet
*
* La classe HTML_formulaireDocument
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
 
require_once 'HTML/QuickForm.php' ;
require_once 'HTML/QuickForm/checkbox.php' ;
require_once 'HTML/QuickForm/select.php' ;
 
/**
* class HTML_formulaireDocument
*
*/
class HTML_formulaireDocument extends HTML_QuickForm
{
/** Le type d'un document, par défaut 'fichier'
*
* @access private
*/
var $_type = 'fichier';
 
/**
* Constructeur
*
* @param string formName Le nom du formulaire
* @param string method Méthode post ou get
* @param string action L'action du formulaire.
* @param int target La cible.
* @param Array attributes Les attributs HTML en plus.
* @param bool trackSubmit ??
* @return void
* @access public
*/
function HTML_formulaireDocument( $formName, $method = "post", $action, $target = "_self", $attributes = '', $trackSubmit = false )
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
} // end of member function HTML_formulaireDocument
 
/**
*
*
* @return void
* @access public
*/
function construitFormulaire($action = PROJET_NOUVEAU_FICHIER)
{
$this->addElement ('text', 'document_nom', PROJET_FICHIER_NOM_DOCUMENT, array ('size' => 40)) ;
$this->addRule ('document_nom', PROJET_FICHIER_ALERTE, 'required', '', 'client') ;
$this->addElement ('html', '<tr><td colspan="2">'.PROJET_FICHIER_NOM_DOCUMENT_EXPLICATION.'</td></tr>') ;
$this->addElement ('textarea', 'document_description', PROJET_FICHIER_DESCRIPTION, array('cols'=>40, 'rows'=>10)) ;
// on fait un groupe avec les boutons radio pour les mettres sur la même ligne
 
$radio[] = &HTML_QuickForm::createElement('radio', 'document_visibilite', 'public', PROJET_FICHIER_PUBLIC, 'public') ;
$radio[] = &HTML_QuickForm::createElement('radio', 'document_visibilite', 'prive', PROJET_FICHIER_PRIVEE, 'prive');
$this->addGroup($radio, null, PROJET_FICHIERS_VISIBILITE, '&nbsp;');
// Le champs fichier si le type du document est un fichier
if ($this->_type == 'fichier' && $action == PROJET_NOUVEAU_FICHIER) {
$GLOBALS['fichier'] = $this->addElement ('file', 'fichier', PROJET_FICHIER_LE_FICHIER) ;
$this->setMaxFileSize(PROJET_UPLOAD_MAX_FILE_SIZE) ;
$this->addRule ('fichier', PROJET_FICHIER_ALERTE_PAS_DE_FICHIER, 'required', '', 'client') ;
}
$url_annuler = new Net_URL($this->getAttribute('action')) ;
$url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
// on fait un groupe avec les boutons pour les mettres sur la même ligne
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
// qui remplacent deux fois les & par des &amp;
// ce qui fait échouer le lien
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', PROJET_FICHIER_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
$this->applyFilter('document_nom', 'addslashes') ;
$this->applyFilter('document_description', 'addslashes') ;
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.PROJET_CHAMPS_REQUIS) ;
} // end of member function construitFormulaire
 
/**
* Permet de spécifier le type de formulaire à montrer
*
* @param string type Le type d'un document, 'fichier' ou 'repertoire'
* @return void
* @access public
*/
function setType( $type )
{
if ($type != 'fichier' && $type != 'repertoire') trigger_error ('type invalide', E_USER_ERROR) ;
$this->_type = $type ;
} // end of member function setType
 
/**
*
*
* @return string
* @access public
*/
function toHTML( )
{
$res = HTML_QuickForm::toHTML() ;
return $res ;
} // end of member function toHTML
 
 
} // end of HTML_formulaireDocument
?>
/tags/2014_06_04/classes/HTML_formulaireCreationWikini.class.php
New file
0,0 → 1,108
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_formulaireCreationWikini.class.php,v 1.2 2005-09-27 16:39:47 alexandre_tb Exp $
/**
* Application projet
*
* La classe HTML_formulaireCreationWikini
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class HTML_formulaireCreationWikini
*
*/
class HTML_formulaireCreationWikini extends HTML_QuickForm
{
 
/*** Attributes: ***/
 
/**
* Constructeur
*
* @return void
* @access public
*/
function HTML_formulaireCreationWikini($formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false)
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
} // end of member function HTML_formulaireCreationWikini
 
/**
*
*
* @return void
* @access public
*/
function construitFormulaire( )
{
$this->addElement ('html', '<p>'.PROJET_WIKINI_NOM_EXPLICATION.'</p>') ;
$this->addElement ('text', 'nom_wikini', PROJET_WIKINI_CHOISIR_NOM) ;
$this->addRule ('nom_wikini', PROJET_NOM_WIKINI_REQUIS, 'required', '', 'client') ;
$this->addRule ('nom_wikini', PROJET_WIKINI_NOM_INVALIDE, 'regex', '/^[A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*$/', 'client') ;
/*
$this->addElement ('text', 'prefixe_wikini', PROJET_PREFIXE_WIKINI) ;
$this->addRule ('prefixe_wikini', PROJET_PREFIXE_WIKINI_REQUIS, 'required', '', 'client');
*/
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.PROJET_CHAMPS_REQUIS) ;
$url_annuler = new Net_URL($this->getAttribute('action')) ;
$url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
// on fait un groupe avec les boutons pour les mettres sur la même ligne
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
// qui remplacent deux fois les & par des &amp;
// ce qui fait échouer le lien
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', PROJET_FICHIER_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
} // end of member function construitFormulaire
 
/**
* Renvoie le code HTML du formulaire.
*
* @return string
* @access public
*/
function toHTML( )
{
$res = HTML_QuickForm::toHTML() ;
return $res ;
} // end of member function toHTML
 
} // end of HTML_formulaireCreationWikini
?>
/tags/2014_06_04/classes/HTML_formulaireMail.class.php
New file
0,0 → 1,117
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_formulaireMail.class.php,v 1.3 2006-07-05 09:44:11 alexandre_tb Exp $
/**
* Application projet
*
* La classe HTML_formulaireMail
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
 
require_once 'HTML/QuickForm.php' ;
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE des constantes |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class HTML_formulaireMail
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
*/
class HTML_formulaireMail extends HTML_QuickForm
{
/**
* Constructeur
*
* @param string formName Le nom du formulaire.
* @param string method Soit get soit post, voir le protocole HTTP
* @param string action L'action du formulaire.
* @param string target La cible du formulaire.
* @param Array attributes Des attributs supplémentaires pour la balise <form>
* @param bool trackSubmit Pour repérer si la formulaire a été soumis.
* @return void
* @access public
*/
function HTML_formulaireProjet( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
} // end of member function HTML_formulaireProjet
 
/**
* Renvoie le code HTML du formulaire.
*
* @return string
* @access public
*/
function toHTML( )
{
$res = HTML_QuickForm::toHTML() ;
return $res ;
} // end of member function toHTML
 
 
 
/**
* Ajoute les champs nécessaire au formulaire.
*
* @return void
* @access public
*/
function construitFormulaire()
{
$this->addElement ('text', 'mail_titre', PROJET_MAIL_TITRE, array ('size' => 60, 'id' => 'titre_mail')) ;
$this->addRule ('mail_titre', PROJET_MAIL_TITRE_REQUIS, 'required', '', 'client') ;
$this->addElement ('textarea', 'mail_corps', PROJET_MAIL_CORPS, array('cols'=>80, 'rows'=>30, 'id' => 'corps_mail')) ;
$url_annuler = new Net_URL($this->getAttribute('action')) ;
$url_annuler->removeQueryString(PROJET_VARIABLE_ACTION) ;
// on fait un groupe avec les boutons pour les mettres sur la même ligne
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', PROJET_FICHIER_ANNULER,
preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER); // Le preg_replace contourne un pb de QuickForm et Net_URL
// qui remplacent deux fois les & par des &amp;
// ce qui fait échouer le lien
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', PROJET_FICHIER_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.PROJET_CHAMPS_REQUIS) ;
} // end of member function _construitFormulaire
 
 
 
} // end of HTML_formulaireProjet
?>
/tags/2014_06_04/classes/inscription_liste.class.php
New file
0,0 → 1,238
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: inscription_liste.class.php,v 1.5 2006-04-19 13:50:49 alexandre_tb Exp $
/**
* Application projet
*
* La classe inscription_liste
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.5 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class isncription_liste
*
*/
class inscription_liste
{
/*** Attributes: ***/
 
/**
* Identifiant de la liste
* @access private
*/
var $_id_liste;
/**
* Identifiant de l'utilisateur
* @access private
*/
var $_id_utilisateur;
/**
* Une ressource PEAR::DB
* @access private
*/
var $_db;
/**
* Le type d'inscription indique : - 0 : pas d'email - 1 : normale - 2 : résumé
* @access private
*/
var $_type_inscription;
 
/**
* Constructeur
*
* @param DB objetDB Une ressource PEAR::DB
* @return void
* @access public
*/
function inscription_liste( &$objetDB )
{
$this->_db = $objetDB ;
} // end of member function inscription_liste
 
/**
* Renvoie un tableau avec la liste des inscrit à une liste.
*
* @param int id_liste L'identifiant de la liste
* @return Array
* @access public
*/
function getInscritsListe( $id_liste )
{
 
} // end of member function getInscritsListe
 
/**
*
*
* @param annire utilisateur
* @param liste_discussion id_liste
* @param int type_inscription
* @return void
* @access public
*/
function inscrireUtilisateur( &$utilisateur, &$liste, $type_inscription )
{
$requete = 'update projet_inscription_liste set '.
'pil_id_liste='.$this->_db->escapeSimple($liste->getId()).', pil_id_statut='.$this->_db->escapeSimple($type_inscription).
' where pil_id_utilisateur='.$this->_db->escapeSimple($utilisateur->getInfo('identifiant')) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
echo ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
if ($this->_db->affectedRows() == 0) {
$requete = 'insert into projet_inscription_liste set pil_id_utilisateur='.$this->_db->escapeSimple($utilisateur->getInfo('identifiant')).
', pil_id_liste='.$this->_db->escapeSimple($liste->getId()).', pil_id_statut='.$this->_db->escapeSimple($type_inscription) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
echo ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
}
 
// Ajout dans la liste des commandes au serveur
// On inscrit le créateur de la liste
$resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
$liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$utilisateur->getInfo('mail')) ;
 
} // end of member function inscrireUtilisateur
 
/**
*
*
* @param int id_utilisateur
* @param int id_liste
* @return void
* @access public
*/
function desinscrireUtilisateur( &$utilisateur, &$liste )
{
$requete = 'delete from projet_inscription_liste where pil_id_utilisateur='.$this->_db->escapeSimple($utilisateur->getInfo('identifiant')).
' and pil_id_liste='.$this->_db->escapeSimple($liste->getId()) ;
$resultat = $this->_db->query ($requete) ;
$resultat_suppression_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/suppression_abonne.php?domaine='.
$liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$utilisateur->getInfo('mail')) ;
 
} // end of member function desinscrireUtilisateur
 
/**
*
*
* @param int id_liste
* @param int id_utilisateur
* @param int type_inscription
* @return void
* @access public
*/
function modifierTypeInscription( $liste, $utilisateur, $type_inscription )
{
 
// envoie d'une demande d'inscription par email à la liste
//include_once 'Mail.php' ;
 
switch ($type_inscription) {
case 0 :
 
// Ajout du modérateur en tant qu'utilisateur
$resultat_suppression_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/suppression_abonne.php?domaine='.
$liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$utilisateur->getInfo('mail')) ;
 
break ;
case 1 :
 
break ;
case 2 :
 
// Ajout d'un utilisateur
$resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
$liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$utilisateur->getInfo('mail')) ;
break ;
}
} // end of member function modifierTypeInscription
 
/**
* Renvoie la liste des statuts d'un utilisateur
*
* @param int id_utilisateur
* @return Array
* @access public
*/
function getStatutsInscrit( $id_utilisateur )
{
 
$requete = 'select pil_id_liste, pil_id_statut from projet_inscription_liste where pil_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur) ;
$resultat = $this->_db->query ($requete) ;echo $requete;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$tableau_resultat = array() ;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$tableau_resultat[$ligne->pil_id_liste] = $ligne->pil_id_statut ;
}
return $tableau_resultat ;
 
 
} // end of member function getStatutsInscrit
 
/**
* Renvoie le statut d'un inscrit à une liste
*
* @param int id_liste
* @param int id_utilisateur
* @return int
* @access public
*/
function getStatutInscrit( $id_liste, &$auth )
{
 
// Récupération de la liste des listes !!
$requete = 'select pl_nom_liste, pl_domaine from projet_liste where pl_id_liste='.$this->_db->escapeSimple($id_liste) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
$xml = file_get_contents(PROJET_SERVEUR_VPOPMAIL.'/liste_abonnes.php?domaine='.
$ligne->pl_domaine.'&liste='.$ligne->pl_nom_liste) ;
$tableau_mail = array() ;
$tableau_ligne = explode ('<email>', $xml) ;
foreach ($tableau_ligne as $ligne) array_push ($tableau_mail, strip_tags($ligne)) ;
array_shift($tableau_mail) ;
if (in_array($auth->getUsername(), $tableau_mail)) {
return 2; // Inscrit est le statut 2
}
return 0 ;
} // end of member function getStatutInscrit
} // end of isncription_liste
?>
/tags/2014_06_04/classes/annuaire.class.php
New file
0,0 → 1,150
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: annuaire.class.php,v 1.5 2006-07-04 09:25:38 alexandre_tb Exp $
/**
* Application annuaire
*
* La classe annuaire
*
*@package annuaire
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.5 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once 'PEAR.php' ;
 
/**
* class annuaire
*
*/
class annuaire extends PEAR
{
 
/*** Attributes: ***/
 
/**
*
* @access private
*/
var $_db;
/**
*
* @access private
*/
var $_id_utilisateur;
/**
* Tableau contenant les noms des champs
* @access private
*/
var $_champs_base;
 
/**
*
*
* @param int objetDB Une ressource PEAR::DB
* @param Array param un tableau indiquant les noms des champs dans la base. 'nom' => 'CHAMPS_NOM',
'prenom' => .. 'date_inscription' => .. 'identifiant' => ... 'ville' => ...
'pays' => ...
* @return void
* @access public
*/
function annuaire( &$objetDB, $param )
{
$this->_db = $objetDB ;
$this->_champs_base = $param ;
} // end of member function annuaire
 
/**
* Spécifie l'identifiant d'un utilisateur ou plusieurs utilisateurs
*
* @param mixed id_utilisateur L'identifiant d'un utilisateur
* @return void
* @access public
*/
function setId( $id_utilisateur )
{
$this->_id_utilisateur = $id_utilisateur ;
} // end of member function setId
 
/**
* Renvoie l'info de l'utilisateur courant. Sans paramètre, renvoie un tableau avec
* tous les champs.
*
* @param string parametre Un paramètre de l'objet : - 'nom', 'prenom' ....
* @return void
* @access public
*/
function getInfo( $parametre )
{
$requete = 'select '.$this->_champs_base[$parametre].
' from '.$this->_champs_base['table'].
' where '.$this->_champs_base['identifiant'].'='.$this->_id_utilisateur ;
$resultat = $GLOBALS['projet_db']->query($requete) ;
if (DB::isError($resultat)) {
echo $requete.' erreur '.$resultat->getMessage() ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_ASSOC) ;
return $ligne[$this->_champs_base[$parametre]] ;
} // end of member function getInfo
 
/**
* Renvoie la liste de tous el inscris ou celle dont le champs passé en paramètre
* ressemble à la valeur souhaité. Ex : $maliste->getListe (array('nom' => '%toto'))
* ; renvoie la liste des adhérents dont le nom commence par toto.
*
* @param Array param Un tableau du type 'nom' => 'chaine'
* @return void
* @access public
*/
function getListe( $param )
{
} // end of member function getListe
 
/**
* Renvoie la liste des inscrits dont le nom commence par lettre
*
* @param char lettre La lettre
* @return void
* @access public
*/
function getListeAlphabetique( $lettre )
{
} // end of member function getListeAlphabetique
 
 
 
 
 
} // end of annuaire
?>
/tags/2014_06_04/classes/index.php
New file
0,0 → 1,19
<?php
// An even simpler version of the index page than version 1. All the actual work of
// determining what needs to be included and what needs to be run is now in the main class.
// Also, 'register_globals' doesn't need to be 'on' anymore.
 
require_once("ezmlm.php");
 
$ezmlm = new ezmlm_php();
 
$action = ($_POST['action'] ? $_POST['action'] : ($_GET['action'] ? $_GET['action'] : "list_info"));
$actionargs = ($_POST['actionargs'] ? $_POST['actionargs'] : ($_GET['actionargs'] ? $_GET['actionargs'] : ""));
 
$ezmlm->set_action($action);
$ezmlm->set_actionargs($actionargs);
$ezmlm->run();
 
unset($ezmlm);
 
?>
/tags/2014_06_04/classes/projet.class.php
New file
0,0 → 1,1000
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projet.class.php,v 1.14 2008-09-16 14:11:05 alexandre_tb Exp $
/**
* Application projet
*
* La classe projet
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.14 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'liste_discussion.class.php' ;
/* Permet la recuperation d'un nouvel identifiant d'une table.*/
require_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'sql/SQL_manipulation.fonct.php';
include_once 'Mail.php' ;
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
 
 
/**
* class projet
*
*/
class projet
{
 
/** Aggregations: */
 
/**
* Le tableau d'objet document associés au projet
*
*/
var $_documents_associes = array();
 
var $_listes_associes = array();
 
/** Compositions: */
 
/*** Attributes: ***/
 
/**
* L'identifiant du projet.
* @access private
*/
var $_id_projet;
 
/**
* Le titre du projet, tel que dans la base de donnée.
* @access private
*/
var $_titre;
/**
* La description du projet, tel que dans la base.
* @access private
*/
var $_description;
/**
* L'URL d'un site sur le projet. Facultatif.
* @access private
*/
var $_espace_internet;
/**
* Le nom du wikini associe au projet, avec la syntaxe wikini. Vide par defaut.
* @access private
*/
var $_nom_wikini;
/**
* Date de creation du projet. A priori ne varie pas dans le temps.
* @access private
*/
var $_date_creation;
/**
* Le chemin relatif vers le repertoire contenant les wikinis.
* @access private
*/
var $_chemin_wikini;
/**
* Une connexion vers la base de donnee.
* @access private
*/
var $_db;
 
/**
* Contient le nom du repertoire du projet tel que sur le disque.
* @access private
*/
var $_nom_repertoire;
 
/**
* Le chemin jusqu'au repertoire ou seront stockes les fichiers.
* @access private
*/
var $_chemin_repertoire;
 
/**
* Vaut vrai si le projet est un projet racine et s'il est le seul.
* @access private
*/
var $_est_racine;
/**
* Le resume du projet
* @access private
*/
var $_resume;
/**
* Contient le numero du type du projet
* @access private
*/
var $_type;
 
/**
* Indique si l'inscription au projet est moderes
* @access private
*/
var $_isModere;
 
/**
* Indique si le projet a des documents
* @access private
*/
var $_avoirDocument;
 
/**
* tableau contenant les themes associes au projet
*/
var $_themes = array();
/**
*
* PHP5
* @return projet
* @access public
*/
function __construct( &$dbObject, $id_projet = "")
{
$this->projet($dbObject, $id_projet);
 
} // end of member function __construct
 
/**
*
*
* @param DB dbObject Un objet PEAR:DB
* @param int id_projet On passe un identifiant de projet au constructeur. Cela lui permet de faire une
* premiere requete pour les infos de bases comme le titre, le description etc.
* @return projet
* @access public
*/
function projet( &$dbObject, $id_projet = "")
{
$this->_db = $dbObject ;
if (intval($id_projet)) {
$resultat = $this->_db->query(sprintf("SELECT * FROM projet WHERE p_id=%d -- %s",
intval($id_projet),
__FILE__ . ':' . __LINE__));
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
 
// Affectations dans les proprietes
$this->_id_projet = $ligne->p_id ;
$this->_titre = $ligne->p_titre ;
$this->_description = $ligne->p_description ;
$this->_espace_internet = $ligne->p_espace_internet ;
$this->_date_creation = $ligne->p_date_creation ;
$this->_nom_wikini = $ligne->p_wikini ;
$this->_resume = $ligne->p_resume;
$this->_type = $ligne->p_type ;
// On recupere le nom du repertoire
$this->_nom_repertoire = $ligne->p_nom_repertoire ;
$this->_isModere = $ligne->p_modere;
$this->_avoirDocument = $ligne->p_avoir_document;
// on regarde si on a a faire au projet racine
if (PROJET_UTILISE_HIERARCHIE) {
$requete = 'select ph_id_projet_pere, ph_id_projet_fils from projet_hierarchie where ph_id_projet_fils='.$this->_db->escapeSimple($this->_id_projet) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
return ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
}
if (!$resultat->numRows()) {
$this->_est_racine = true ;
} else {
$this->_est_racine = false ;
}
}
 
/** Recuperation des themes */
$requete_theme = 'select pat_id_theme, pt_label_theme from projet_avoir_theme, projet_theme'.
' where pat_id_projet='.$this->_db->escapeSimple($this->_id_projet).' and pat_id_theme=pt_id_theme';
$resultat_theme = $GLOBALS['projet_db']->query ($requete_theme);
if (DB::isError($resultat_theme)) {
return ("Echec de la requete : $requete_theme<br />".$resultat_theme->getMessage()) ;
}
if ($resultat_theme->numRows() != 0) {
 
while ($ligne_theme = $resultat_theme->fetchRow(DB_FETCHMODE_OBJECT)) {
$this->_themes[$ligne_theme->pat_id_theme] = $ligne_theme->pt_label_theme;
}
 
}
}
} // end of member function projet
 
/**
*
*
* @param DB dbObject Un objet PEAR:DB
* @param int id_projet On passe un identifiant de projet au constructeur.
* @return bool
* @access public
*/
function projetExiste( &$dbObject, $id_projet)
{
if (intval($id_projet)) {
$resultat = $dbObject->query(sprintf("SELECT * FROM projet WHERE p_id=%d -- %s",
intval($id_projet),
__FILE__ . ':' . __LINE__));
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
if ($resultat->numRows() != 0) {
return true ;
}
}
} // end of member function projet
 
/**
*
*
* @param int id_projet
* @return string
* @access public
*/
function getTitre( $id_projet = "" )
{
return $this->_titre ;
} // end of member function getTitre
 
/**
*
*
* @return string
* @access public
*/
function getResume( )
{
return $this->_resume ;
} // end of member function getResume
 
/**
* Renvoie l'identifiant du projet courant.
*
* @return int
* @access public
*/
function getId( )
{
return $this->_id_projet ;
} // end of member function getId
 
/**
*
*
* @return string
* @access public
*/
function getDescription( )
{
return $this->_description;
} // end of member function getDescription
 
/**
*
*
* @return string
* @access public
*/
function getEspaceInternet( )
{
return $this->_espace_internet;
} // end of member function getEspaceInternet
 
/**
* Charge dans l'objet projet, les listes de discussion
* ['nom_liste']
* ['domaine']
* ['adresse']
*
* @return boolean true en cas de succès
* @access public
*/
function getListesAssociees( )
{
// On rajoute un test pour eviter l'appel SQL si il a deja ete fait une fois
if (count($this->_listes_associes) > 0) return ;
$requete = "select pl_id_liste from projet_lien_liste where pl_id_projet=".$this->_db->escapeSimple($this->_id_projet) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
return ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
}
$retour = array() ;
if ($resultat->numRows()) {
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$this->_listes_associes[] = new liste_discussion($ligne->pl_id_liste, $this->_db) ;
 
}
} // end of member function getListesAssociees
 
/**
* Renvoie vrai si le projet a au moins une liste
*
* @return bool
* @access public
*/
function avoirListe( )
{
$this->getListesAssociees() ;
if (count($this->_listes_associes)) {
return true ;
}
return false ;
}
 
/**
* Renvoie vrai si le projet a au moins un document, fichier ou repertoire
*
* Mis en place pour des raisons de performances avant la methode getListesDocuments etait utilisee
*
* @return bool
* @access public
*/
function avoirDocument( )
{
return $this->_avoirDocument;
}
 
/**
* Permet de fixer la colonne p_avoir_document a 1
*
* Mis en place pour des raisons de performances avant la methode getListesDocuments etait utilisee
*
* @param bool
* @return mixed true si la requete fonctionne
* @access public
*/
function setAvoirDocument($bool)
{
$val = 0 ;
if ($bool) $val = 1;
$requete = 'update projet set p_avoir_document='.$this->_db->escapeSimple($val).' where p_id='.$this->_db->escapeSimple($this->_id_projet);
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
echo ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
return true;
}
 
/**
* Renvoie la liste des documents associes sous forme d'un tableau, avec les
* informations afferentes. 0 => "nom (cliquable)"
"Taille"
"Date
* de creation" "Prorietaire" "Visibilite" "Action
* (cliquable)"
*
* @param visibilite visibilite Si visibilite est prive, tous les fichiers sont renvoyes ainsi qu'une entree
* pour indiquer la visibilite du document.
* @return Array
* @access public
*/
function getListesDocuments( $chemin, $chemin_icones = "icones/", $id_repertoire = '', $date = '' )
{
// On realise une requete sur projet_documents avec une jointure sur l'annuaire
// et sur gen_type_de_fichier pour envoyer un resultat complet.
// On exclue les fichiers racines cad pd_pere is null
$requete = "select pd_id from projet_documents where pd_ce_projet=".$this->_db->escapeSimple($this->_id_projet) ;
if ($id_repertoire != '') $requete .= ' and pd_pere='.$this->_db->escapeSimple($id_repertoire);
if ($id_repertoire != '' && $id_repertoire == 0) $requete .= ' and pd_pere=0';
if ($date != '') $requete .= ' and pd_date_de_mise_a_jour > date_sub (NOW(), interval 1 week)';
$requete .= ' order by pd_nom' ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$tableau_document = array() ;
// Un compteur
$i = 0 ;
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) {
array_push ($tableau_document, new document ($ligne->pd_id, $i, $chemin, $chemin_icones)) ;
}
return $tableau_document ;
}
 
 
/**
* Renvoie un tableau avec tous les repertoires d'un projet, imbrique. ['rep1'],
* ['rep2'] => array (['rep21'], ['rep22']), etc .
*
* @return Array
* @access public
*/
function getListeRepertoireHierarchisee( )
{
// On ne prend que les repertoires
$requete = "select pd_id, pd_pere, pd_nom from projet_documents where pd_ce_projet=".$this->_db->escapeSimple($this->_id_projet).' and pd_ce_type=0 order by pd_nom' ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$tableau_document = array() ;
/*
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) {
array_push ($tableau_document, new document ($ligne->pd_id, $this->_db));
}
*/
$tableau = array();
$tab = array();
 
 
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) {
array_push ($tableau, array ('id' => $ligne->pd_id,
'id_pere' => $ligne->pd_pere,
'fils' => array(),
'label' => $ligne->pd_nom));
 
}
 
// la $tableau reste un tableau de valeur a plat
 
 
$i = 0;
foreach ($tableau as $noeud) {
// On teste si le noeud est racine si oui on l ajoute a l arbre sinon on ne l ajoute pas
if ($noeud['id_pere'] == 0) {
$tab[$i] = $noeud;
$this->construireArbre($tab[$i], $tableau) ;
}
$i++;
}
return $tab;
} // end of member function getListeRepertoireHierarchisee
 
function construireArbre(&$noeud, $tableau) {
$j = 0;
foreach ($tableau as $element) {
// pour chaque element on teste
if ($element['id_pere'] == $noeud['id']) {
$noeud['fils'][$j]= $element ;
$this->construireArbre($noeud['fils'][$j],$tableau);
}
$j++;
}
}
 
/**
* Renvoie un tableau comprenant tous les objets projet de la base.
*
* @return Array
* @static
* @access public
*/
function getTousLesProjets(&$objetDB, $exclu = '')
{
$sql = '';
if (is_object($this) && isset ($this->_projet_exclu) && count($this->_projet_exclu)) {
$sql = 'where p_id not in (';
foreach ($this->_projet_exclu as $valeur) {
$sql .= $objetDB->escapeSimple($valeur).',' ;
}
$sql[count($sql)-1] = ')';
}
$requete = 'select p_id from projet '.$sql.' order by p_titre' ;
$resultat = $objetDB->query ($requete) ;
if (DB::isError($resultat)) {
echo ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$tableau_resultat = array() ;
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) {
array_push ($tableau_resultat, new projet ($objetDB, $ligne->p_id)) ;
}
return $tableau_resultat ;
} // end of member function getTousLesProjets
 
/**
* Renvoie un tableau comprenant les objets projet de la base du type $type.
*
* @return Array
* @static
* @access public
*/
function getProjetDuType($type, &$objetDB)
{
$requete = "select p_id from projet where p_type=".$objetDB->escapeSimple($type)." order by p_titre" ;
$resultat = $objetDB->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$tableau_resultat = array() ;
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) {
array_push ($tableau_resultat, new projet ($objetDB, $ligne->p_id)) ;
}
return $tableau_resultat ;
} // end of member function getTousLesProjets
 
/**
* Renvoie un le projet racine.
*
* @return projet
* @static
* @access public
*/
function getProjetRacine(&$objetDB)
{
$requete = "select p_id from projet where p_id not in (select ph_id_projet_fils from projet_hierarchie)" ;
$resultat = $objetDB->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
if ($resultat->numRows() == 1) {
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
return new projet($objetDB, $ligne->p_id) ;
}
$tableau_resultat = array() ;
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) {
array_push ($tableau_resultat, new projet ($objetDB, $ligne->p_id)) ;
}
return $tableau_resultat ;
} // end of member function getTousLesProjets
 
/**
* Desctructeur de la classe. Libere la memoire, ferme les connexions et fichiers.
*
* @return void
* @access public
*/
function __destruct( )
{
 
} // end of member function __destruct
 
/**
* Supprime le projet courrant. Il s'ensuit une suppression en cascade de tous les
* elements lies.
*
* @return void
* @access public
*/
function supprimer( )
{
 
} // end of member function supprimer
 
/**
* Permet d'enregistrer une ligne dans la table concernee.
*
* @param Array tableau_de_valeur Le tableau de valeur a inserer dans la base avec pour cle les noms des elements
* du formulaire.
* @return int
* @access public
*/
function enregistrerSQL( $tableau_de_valeur )
{
$nom_repertoire = projet::genereNomRepertoire($tableau_de_valeur['projet_titre'], $this->_db) ;
if (!$this->_creationRepertoire ($nom_repertoire)) {
echo 'Impossible de cr&eacute;e un r&eacute;pertoire'.$nom_repertoire ;
return false ;
}
// Traitement du type
if (!PROJET_UTILISE_TYPE) {
$tableau_de_valeur['projet_type'] = 0 ;
}
$id = SQL_obtenirNouveauId($this->_db, 'projet', 'p_id') ;
$requete = 'insert into projet set p_id='.$this->_db->escapeSimple($id) ;
if (!isset($tableau_de_valeur['projet_wikini'])) {
$tableau_de_valeur['projet_wikini']='';
}
$requete .= ', p_titre="'.$tableau_de_valeur['projet_titre'].'", p_description="'.$tableau_de_valeur['projet_description'].'"'.
', p_espace_internet="'.$tableau_de_valeur['projet_espace_internet'].'", p_date_creation=NOW()'.
', p_wikini="'.$tableau_de_valeur['projet_wikini'].'", p_nom_repertoire="'.$nom_repertoire.'", p_resume="'.$tableau_de_valeur['projet_resume'].
'", p_type="'.$tableau_de_valeur['projet_type'].'", p_modere="'.$tableau_de_valeur['projet_moderation'].'"' ;
$resultat = $this->_db->query ($requete) ;
 
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
 
// On affecte a l'objet projet son identifiant
$this->_id_projet = $id ;
 
//insertion dans projet_herarchie
if (PROJET_UTILISE_HIERARCHIE) {
$requete = 'insert into projet_hierarchie set ph_id_projet_pere='.$this->_db->escapeSimple($tableau_de_valeur['projet_asso']).
', ph_id_projet_fils='.$this->_db->escapeSimple($id) ;
$resultat = $this->_db->query ($requete) ;
}
 
/** enregistrement dans projet_avoir_theme */
$requete_theme = '';
foreach ($tableau_de_valeur['projet_theme'] as $cle => $valeur) {
$requete_theme = 'insert into projet_avoir_theme set pat_id_projet='.$this->_db->escapeSimple($id).', pat_id_theme='.$this->_db->escapeSimple($cle);
$resultat_theme = $GLOBALS['projet_db']->query($requete_theme);
if (DB::isError($resultat_theme)) {
return $resultat_theme->getMessage();
}
}
return true ;
}
 
/**
* Permet de mettre a jour une ligne dans la table concernee.
*
* @param Array tableau_de_valeur Le tableau de valeur a inserer dans la base avec pour cle les noms des elements
* du formulaire.
* @return int
* @access public
*/
function majSQL( $tableau_de_valeur )
{
// Traitement du type
if (!PROJET_UTILISE_TYPE) {
$tableau_de_valeur['projet_type'] = 0 ;
}
$requete = 'update projet set ';
$requete .= 'p_titre="'.$tableau_de_valeur['projet_titre'].'", p_description="'.$tableau_de_valeur['projet_description'].'"'.
', p_espace_internet="'.$tableau_de_valeur['projet_espace_internet'].'"'.
', p_resume="'.$tableau_de_valeur['projet_resume'].'", p_type="'.$tableau_de_valeur['projet_type'].'"'.
', p_modere='.$tableau_de_valeur['projet_moderation'].
' where p_id="'.$this->_id_projet.'"' ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
 
if (PROJET_UTILISE_HIERARCHIE) {
// suppression dans projet_hierarchie
 
$requete = 'delete from projet_hierarchie where ph_id_projet_fils='.$this->_db->escapeSimple($this->_id_projet) ;
$resultat = $this->_db->query ($requete) ;
 
//insertion dans projet_hierarchie
 
$requete = 'insert into projet_hierarchie set ph_id_projet_pere='.$this->_db->escapeSimple($tableau_de_valeur['projet_asso']).
', ph_id_projet_fils='.$this->_id_projet ;
$resultat = $this->_db->query ($requete) ;
}
 
/** enregistrement dans projet_avoir_theme */
 
$requete_suppression_theme = 'delete from projet_avoir_theme where pat_id_projet='.$this->_db->escapeSimple($this->_id_projet);
$resultat_suppression_theme = $GLOBALS['projet_db']->query($requete_suppression_theme);
 
$requete_theme = '';
foreach ($tableau_de_valeur['projet_theme'] as $cle => $valeur) {
$requete_theme = 'insert into projet_avoir_theme set pat_id_projet='.$this->_db->escapeSimple($this->_id_projet).
', pat_id_theme='.$this->_db->escapeSimple($cle);
$resultat_theme = $GLOBALS['projet_db']->query($requete_theme);
if (DB::isError($resultat_theme)) {
return $resultat_theme->getMessage();
}
}
return true ;
} // end of member function enregistrerSQL
 
/**
* Met a jour dans la base de donnee le champs p_nom_wikini
*
* @param int nom_wikini Le nouveau nom wikini
* @return bool
* @access public
*/
function majNomWikini( $nom_wikini )
{
$requete = 'update projet set p_wikini="'.$nom_wikini.'" where p_id="'.$this->_id_projet.'"' ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
return ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
return true ;
} // end of member function majNomWikini
 
function majSQLVisibilite($id_liste, $visible) {
 
$requete = 'UPDATE projet_liste set pl_visibilite='.$this->_db->escapeSimple($visible).' '.
'WHERE pl_id_liste ='.$id_liste;
 
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
return true;
}
 
/**
*
*
* @param string code_sql
* @return bool
* @access public
*/
function suppressionSQL()
{
$msg = '' ;
// Supression du repertoire du projet
if (!$this->_suppression_repertoire()) {
$msg = 'La suppression du repertoire n\'a pas fonctionne' ;
}
// A ajouter la suppression des documents associes
 
// La suppression des evenements associés
 
// Le projet lui-meme
$requete = "delete from projet where p_id=".$this->_db->escapeSimple($this->_id_projet) ;
$resultat = $this->_db->query ($requete) ;
 
if (PROJET_UTILISE_HIERARCHIE) {
$requete = "delete from projet_hierarchie where ph_id_projet_fils=".$this->_db->escapeSimple($this->_id_projet) ;
$resultat = $this->_db->query ($requete) ;
}
$requete = "delete from projet_statut_utilisateurs where psu_id_projet=".$this->_db->escapeSimple($this->_id_projet) ;
$resultat = $this->_db->query ($requete) ;
return $msg ;
} // end of member function suppressionSQL
 
/**
* Supprime le repertoire associe au projet (le repertoire doit etre vide).
*
* @return void
* @access private
*/
function _suppression_repertoire( )
{
return rmdir ($this->_chemin_repertoire.$this->_nom_repertoire) ;
} // end of member function _suppression_repertoire
 
/**
* Permet de creer le repertoire associe au projet.
*
* @param string nom_repertoire Le nom du répertoire à créer.
* @return boolean
* @access private
*/
function _creationRepertoire( $nom_repertoire )
{
return mkdir ($this->_chemin_repertoire.$nom_repertoire) ;
} // end of member function _creationRepertoire
 
/**
* Permet d'indiquer ou seront stockes les fichiers.
*
* @param string cheminRepertoire Le chemin jusqu'au repertoire ou seront stockes les fichiers.
* @return void
* @access public
*/
function setCheminRepertoire( $cheminRepertoire )
{
$this->_chemin_repertoire = $cheminRepertoire ;
} // end of member function setCheminRepertoire
 
/**
* Genere un nom de repertoire a partir de la premiere lettre de la chaine passe en
* parametre et de l'identifiant du dernier projet.
*
* @param string chaine Une chaine a partir de laquelle sera generer le nom du repertoire.
* @param DB objetDB un objet PEAR::DB
* @return string
* @static
* @access public
*/
function genereNomRepertoire( $chaine, &$objetDB )
{
$requete = "select p_id from projet order by p_id desc limit 0,1" ;
$resultat = $objetDB->query ($requete) ;
if (DB::isError ($resultat)) {
return ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
}
if ($resultat->numRows() > 0) {
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$nom = strtoupper(substr($chaine, 0, 1)) ;
$nom .= $ligne->p_id + 1 ;
}
else {
$nom = strtoupper(substr($chaine, 0, 1)) ;
$nom .= 1 ;
}
return $nom ;
 
} // end of member function genereNomRepertoire
 
/**
* Permet de recuperer le nom du repertoire d'un projet.
*
* @return string
* @access public
*/
function getNomRepertoire( )
{
return $this->_nom_repertoire ;
} // end of member function getNomRepertoire
 
/**
* Ajoute une liste a un projet
* Effectue une insertion dans projet_lien_liste
*
* @param liste_discussion liste Une instance de la classe liste_discussion
* @return void
* @access public
*/
function ajouterListe( &$liste )
{
$requete = "insert into projet_lien_liste set pl_id_liste=".$this->_db->escapeSimple($liste->getId()).
', pl_id_projet='.$this->_db->escapeSimple($this->_id_projet) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
return ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
}
}
 
/**
* Supprime la liste de discussion associee au projet
*
* @return void
* @access public
*/
function supprimerListe(&$liste)
{
$requete = 'delete from projet_lien_liste where pl_id_liste='.$this->_db->escapeSimple($liste->getId()) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
return ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$requete = 'delete from projet_liste where pl_id_liste='.$this->_db->escapeSimple($liste->getId()) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
return ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
}
 
 
/**
* Renvoie vrai si le projet est racine.
*
* @return bool
* @access public
*/
function isRacine( )
{
return $this->_est_racine ;
} // end of member function isRacine
 
/**
* Renvoie le nombre d'inscrits au projet. Effectue une requete dans la table
* projet_statut_utilisateurs
*
* @return int
* @access public
*/
function getNombreInscrits( )
{
$requete = 'select count(psu_id_utilisateur) as nbre from projet_statut_utilisateurs where psu_id_projet='.$this->_db->escapeSimple($this->_id_projet) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
return $ligne->nbre ;
} // end of member function getNombreInscrits
 
 
/**
* Renvoie un tableau contenant les identifiants des fils du projet courant.
*
* @return Array
* @access public
*/
function getHierarchie( )
{
$requete = 'select ph_id_projet_fils from projet_hierarchie where ph_id_projet_pere='.$this->_db->escapeSimple($this->_id_projet) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$tableau_resultat = array() ;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
array_push ($tableau_resultat, $ligne->ph_id_projet_fils) ;
}
return $tableau_resultat ;
} // end of member function getHierarchie
 
/**
* Renvoie l'identifiant du pere du projet courrant.
*
* @return int
* @access public
*/
function getIdPere()
{
$requete = 'select ph_id_projet_pere from projet_hierarchie where ph_id_projet_fils='.$this->_db->escapeSimple($this->_id_projet) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$tableau_resultat = array() ;
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
return $ligne->ph_id_projet_pere ;
} // end of member function getIdPere()
 
/**
* Renvoie le nom Wiki du wikini associe au projet.
*
* @return string
* @access public
*/
function getWikini( )
{
return $this->_nom_wikini ;
} // end of member function getWikini
 
/**
* Renvoie le type du projet, ou zero si le projet n'a pas de type.
*
* @return int
* @access public
*/
function getType( )
{
return $this->_type ;
} // end of member function getType
 
/**
* Renvoie les themes du projet, ou zero si le projet n'a pas de type.
*
* @return int
* @access public
*/
function getThemes( )
{
return $this->_themes ;
} // end of member function getType
 
/**
* Renvoie 1 si les inscriptions au projet sont moderees.
*
* @return int
* @access public
*/
function isModere( )
{
return $this->_isModere ;
} // end of member function getType
 
 
 
/**
* initAttributes sets all projet attributes to its default value make
* sure to call this method within your class constructor
*/
function initAttributes( )
{
$this->chemin_wikini = "projet/wikini/";
}
 
 
} // end of projet
?>
/tags/2014_06_04/classes/enteteColonneTriable.class.php
New file
0,0 → 1,259
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: enteteColonneTriable.class.php,v 1.1 2008-08-25 15:17:13 alexandre_tb Exp $
/**
* Application projet
*
* Fichier de presentation de la liste des projets pour Tela Botanica nouvelle version
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2008
// +------------------------------------------------------------------------------------------------------+
*/
 
 
 
/**
* class enteteColonneTriable
*/
class enteteColonneTriable
{
 
 
/*** Attributes: ***/
 
/**
* Nom de la colonne dont on veut afficher le lien
* @access private
*/
private $colonne;
 
/**
* Nom de la colonne dont on veut afficher le lien
* @access private
*/
private $var_colonneDeTri;
 
/**
* Nom de la colonne clique par l utilisateur
* @access private
*/
private $colonneCliquee;
 
/**
* @access private
*/
private $ordre = 'asc';
 
/**
* @access private
*/
private $var_ordre ;
/**
* @access private
*/
private $icone_asc;
 
/**
* @access private
*/
private $icone_desc;
 
/**
* icone par defaut lorsqu aucun tri n est demande
* @access private
*/
private $icone_base;
 
 
/**
*
* @param string nom_colonne Le nom de la colonne sur laquelle va s'effectuer les tris
 
* @return
* @access public
*/
public function enteteColonneTriable( $nom_colonne ) {
$this->colonne = $nom_colonne;
} // end of member function enteteColonneTriable
 
/**
*
* @param string colonneDeTri
* @return bool
* @access public
*/
public function setColonneCliquee( $colonneDeTri, $var_colonneDeTri ) {
$this->colonneCliquee = $colonneDeTri;
$this->var_colonneDeTri = $var_colonneDeTri;
} // end of member function setColonneCliquee
 
/**
* Precise l ordre ascendant ou descendant
* Ne peut prendre que 2 valeurs asc ou desc
*
* @param string ordre
* @return
* @access public
*/
public function setOrdre( $ordre, $var_ordre ) {
if ($ordre != 'asc' && $ordre != 'desc') return false;
//if ($this->colonne == $this->colonneCliquee) $this->ordre = $ordre;
// C subtil, il faut inverser l ordre de tri pour la colonne dont le tri est
// actif, afin de pouvoir inverser le tri
$this->ordre = $ordre;
if ($this->colonne == $this->colonneCliquee) {
if ($ordre == 'asc') $this->ordre = 'desc'; else $this->ordre = 'asc';
}
$this->var_ordre = $var_ordre;
} // end of member function setOrdre
 
/**
* Pour indiquer le chemin vers l icone de fleche vers le bas
* Renvoie false si le chemin vers l icone n existe pas
*
* @param string chemin_icone Le chemin vers l icone
 
* @return
* @access public
*/
public function setIconeAsc( $chemin_icone ) {
$this->icone_asc = $chemin_icone;
} // end of member function setIconeAsc
 
/**
* Pour indiquer le chemin vers l icone de fleche vers le bas
* Renvoie false si le chemin vers l icone n existe pas
*
* @param string chemin_icone Chemin vers l icone indiquant un classement descendant, en general une fleche
vers le haut
 
* @return bool
* @access public
*/
public function setIconeDesc( $chemin_icone ) {
$this->icone_desc = $chemin_icone;
} // end of member function setIconeDesc
 
/**
*
* @param string chemin_icone chemin vers un fichier
 
* @return bool
* @access public
*/
public function setIconeSansTri( $chemin_icone ) {
$this->icone_base = $chemin_icone;
} // end of member function setIconeSansTri
 
/**
* Permet d attribuer un template d affichage
*
* @param string template Permet d attribuer un template d affichage
 
* @return
* @access public
*/
public function setTemplate( $template ) {
} // end of member function setTemplate
 
/**
* Renvoie l icone approprie pour l entete de la colonne
*
* @return string
* @access public
*/
public function getIcone( ) {
if ($this->colonne == $this->colonneCliquee) {
if ($this->ordre == 'asc') {
return $this->icone_asc;
} else {
return $this->icone_desc;
}
} else {
return $this->icone_base;
}
} // end of member function getIcone
 
/**
* Renvoie la classe approprie pour l entete de la colonne
*
* @return string
* @access public
*/
public function getClasse( ) {
if ($this->colonne == $this->colonneCliquee) {
if ($this->ordre == 'asc') {
return 'tri_bas';
} else {
return 'tri_haut';
}
} else {
return 'tri_sans';
}
} // end of member function getIcone
/**
* Renvoie le lien de la colonne
*
* @return string
* @access public
*/
public function getLien($url) {
$url->addQueryString('projet_tri', $this->colonne);
$url->addQueryString('projet_ordre_tri', $this->ordre);
return $url->getURL();
} // end of member function getLien
 
/**
* Renvoie l entete
*
* @return string
* @access public
*/
public function getEntete( ) {
} // end of member function getEntete
 
/**
* similaire a getEntete()
*
* @return string
* @access public
*/
public function toHTML( ) {
return getEntete();
} // end of member function toHTML
 
 
 
 
 
} // end of enteteColonneTriable
?>
/tags/2014_06_04/classes/fichier.class.php
New file
0,0 → 1,293
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: fichier.class.php,v 1.8 2008-08-25 15:16:25 alexandre_tb Exp $
/**
* Application projet
*
* La classe fichier
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.8 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once PROJET_CHEMIN_CLASSES.'type_fichier_mime.class.php' ;
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class fichier
* Cette classe représente un fichier au sens physique du terme. Elle fonctionne
* pour les système UNIX. A faire : adaptation selon les système. L'objectif est de
* gérer correctement l'upload de fichier.
*/
class fichier
{
/*** Attributes: ***/
/**
* Le nom du fichier, avec son extension.
* @access private
*/
var $_nom;
/**
* Le chemin UNIX ou Windows pour accéder au fichier sur le serveur (par ex;
* /var/www/fichier.txt
* @access private
*/
var $_chemin;
/**
* Cet attribut contient une valeur du type 755, indiquant les droits afférent à un
* fichier selon le système UNIX (propriétaire, groupe, autres)
* @access private
*/
var $_droits_unix;
/**
* Le type indique si le fichier est un répertoire, un lien ou un fichier.
* @access private
*/
var $_type = 'fichier';
/**
* l'identifiant du type mime.
* @access private
*/
var $_type_mime;
/**
* Le chemin vers le fichier, en partant du répertoire de travail.
* @access private
*/
var $_prefixe_chemin;
 
/**
*
*
* @return void
* @access public
*/
function fichier( $chemin, &$objetDB)
{
$this->_chemin = $chemin ;
// On analyse l'extension pour découvrir le type mime
$partie_chemin = pathinfo ($this->_chemin) ;
if (is_object($objetDB) && isset($partie_chemin['extension'])) {
$this->_type_mime = type_fichier_mime::factory ($partie_chemin['extension']) ;
}
// calcul du type
if (is_dir ($this->_chemin)) $this->_type = 'repertoire' ;
} // end of member function fichier
 
/**
* Le constructeur de la classe.
*
* @param string chemin Le chemin du fichier sur le serveur.
* @return fichier
* @access public
*/
function __construct( $chemin, &$objetDB)
{
$this->fichier($chemin, $objetDB);
} // end of member function __construct
 
/**
*
*
* @return void
* @access public
*/
function suppression()
{
if ($this->_type == 'repertoire') rmdir ($this->_chemin) ;
if ($this->_type == 'fichier') unlink ($this->_chemin) ;
} // end of member function suppression
 
/**
* Réalise l'upload d'un fichier vers chemin_destination.
*
* @param string chemin_destination Il s'agit du chemin UNIX de destination du fichier. Le script doit avoir les
* droits en écriture sur le répertoire.
* @global mixed une référence vers un objet HTML_QuickForm_File
* @return void
* @access public
*/
function upload( $chemin_destination )
{
if (move_uploaded_file($_FILES['fichier']['tmp_name'], $chemin_destination)) {
return true ;
} else {
return false ;
}
} // end of member function upload
 
/**
* Déplace un fichier, renvoie vrai en cas de succès.
*
* @param string origine L'emplacement de départ du fichier.
* @param string destination Le répertoire d'arrivé.
* @return bool
* @access public
*/
function deplace( $origine, $destination )
{
if (rename ($origine, $destination )) return true ;
return false ;
} // end of member function deplace
 
/**
*
*
* @param int id_type_mime L'identifiant du type mime du document.
* @return type_fichier_mime
* @access public
*/
function getTypeMime( )
{
return $this->_type_mime;
} // end of member function getTypeMime
 
/**
* Renvoie vrai si le document est un répertoire.
*
* @return bool
* @access public
*/
function isRepertoire( )
{ $isRep = is_dir ($this->_chemin) ;
return $isRep ;
} // end of member function isRepertoire
 
 
/**
*
*
* @param int id_type_mime L'identifiant du type mime.
* @return void
* @access public
*/
function setTypeMime( $id_type_mime )
{
$this->_type_mime = $id_type_mime ;
} // end of member function set TypeMime
 
 
/**
* Renvoie la taille du fichier en octet. Nécessite un accès au disque.
*
* @return int
* @access public
*/
function getTaille( )
{
if ($this->isRepertoire()) {
return $this->_tailleRepertoire($this->_chemin) ;
}
return @filesize ($this->_chemin) ;
} // end of member function getTaille
 
/**
* Renovie le nom du fichier, sur le disque.
*
* @return string
* @access public
*/
function getNom( )
{
} // end of member function getNom
 
/**
* Renvoie le chemin du fichier.
*
* @return string
* @access public
*/
function getChemin( )
{
return $this->_chemin ;
} // end of member function getChemin
 
/**
* Permet de calculer la taille en octet du repertoire courrant
*
* @return int
* @access protected
*/
function _tailleRepertoire($rep)
{
$taille = 0 ;
$liste_fichier = scandir ($rep) ;
foreach ($liste_fichier as $key => $value) {
if (is_dir ($rep."/".$value) && $value != ".." && $value != ".") {
$taille += $this->_tailleRepertoire ($rep.$value."/") ;
} else {
if ($value != '..' && $value != '.') $taille += @filesize ($rep.$value) ;
}
}
return $taille ;
} // end of member function _tailleRepertoire
 
 
/**
* initAttributes sets all fichier attributes to its default value make
* sure to call this method within your class constructor
*/
function initAttributes( )
{
$this->_type = 'fichier';
}
 
 
} // end of fichier
 
if(!function_exists("scandir"))
{
function scandir($dirstr)
{
// php.net/scandir (PHP5)
$files = array();
$fh = opendir($dirstr);
while (false !== ($filename = readdir($fh)))
{
array_push($files, $filename);
}
closedir($fh);
return $files;
}
}
?>
/tags/2014_06_04/classes/liste_externe.class.php
New file
0,0 → 1,166
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: liste_externe.class.php,v 1.3 2008-09-16 14:12:04 alexandre_tb Exp $
/**
* Application projet
*
* La classe liste_externe
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class liste_externe
*
*/
class liste_externe
{
/*** Attributes: ***/
 
/**
* Identifiant de la liste, dans la table agora et dans la table
* projet_lien_liste_externe
* @access private
*/
var $_id_liste;
/**
*
* @access private
*/
var $_db;
/**
* Constructeur
*
* @param DB objetDB Un objet PEAR::DB
* @return void
* @access public
*/
function liste_externe(&$objetDB )
{
$this->_db = $objetDB ;
} // end of member function liste_externe
 
/**
* Renvoie un tableau avec en clé l'identifiant d'une liste et en valeur le nom de
* la liste.
*
* @return Array
* @access public
*/
function getListeNom( )
{
$requete = 'select AGO_A_ID, AGO_A_NOMGRPLG from agora' ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$tableau_resultat = array() ;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$tableau_resultat[$ligne['AGO_A_ID']] = $ligne['AGO_A_NOMGRPLG'] ;
}
return $tableau_resultat ;
} // end of member function getListeNom
 
/**
* Renvoie un tableau avec les identifiants des listes associées au projet passé en
* paramètre.
*
* @param int id_projet L'identifiant du projet
* @return Array
* @access public
*/
function getListesAssociees( $id_projet )
{
if(!intval($id_projet)) return NULL;
$requete = sprintf('SELECT plle_id_liste FROM projet_lien_liste_externe WHERE plle_id_projet=%d -- %s',
intval($id_projet),
__FILE__ . ':' . __LINE__);
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$tableau_resultat = array() ;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
array_push ($tableau_resultat, $ligne->plle_id_liste) ;
}
return $tableau_resultat ;
} // end of member function getListesAssociees
 
/**
* enregistrerSQL
*
* @return
*/
function enregistrerSQL ($valeur, $id_projet) {
// on commence par supprimer
$requete = 'delete from projet_lien_liste_externe where plle_id_projet='.intval($id_projet) ;
$resultat = $this->_db->query ($requete) ;
// puis on réinsère
foreach ($valeur as $cle => $val) {
if (!preg_match ('/liste_/', $cle)) continue ;
$id_liste = preg_replace ('/liste_/', '', $cle) ;
$requete = 'insert into projet_lien_liste_externe set plle_id_liste='.$this->_db->escapeSimple($id_liste).
', plle_id_projet='.inval($id_projet) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
}
}
 
/**
* Renvoie un tableau avec les infos sur la liste, voir les noms des champs de la
* table agora pour une description plus détaillé.
*
* @param int id_liste L'identifiant de la liste
* @return void
* @access public
*/
function getInfoListe( $id_liste )
{
$requete = 'select * from agora where AGO_A_ID='.$this->_db->escapeSimple($id_liste) ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
return ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
return $ligne ;
} // end of member function getInfoListe
 
} // end of liste_externe
?>
/tags/2014_06_04/classes/document.class.php
New file
0,0 → 1,665
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: document.class.php,v 1.10 2008-08-26 12:41:10 alexandre_tb Exp $
/**
* Application projet
*
* La classe document
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.10 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once PROJET_CHEMIN_CLASSES.'fichier.class.php' ;
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
/**
* class document
* Représente un document associé à un projet. C'est à dire un fichier
* téléchargeable disposant en plus d'une visibilité, d'un nom long, d'une
* description et d'une url.
*/
class document extends fichier
{
/*** Attributes: ***/
 
/**
* Description qui apparaitra à l'écran.
* @access private
*/
var $_description;
/**
* Date de dernière mise à jour des attributs du fichier.
* @access private
*/
var $_date_mise_a_jour;
/**
* Soit public, soit privé.
* @access private
*/
var $_visibilite;
/**
* Le nom du fichier tel qu'il apparaitra à l'écran.
* @access private
*/
var $_nom_long;
/**
* Un objet PEAR:DB
* @access private
*/
var $_db;
 
/**
* L'identifiant du document dans la table projet_document.
* @access private
*/
var $_id;
 
/**
*
* @access private
*/
var $_chemin_icone;
 
/**
* L'identifiant du père, peut être à NULL
* @access private
*/
var $_id_pere;
 
/**
* L'identifiant du propriétaire. Provient d'un annuaire. Peut être à NULL.
* @access private
*/
var $_id_proprietaire;
/**
* L'identifiant du projet auquel appartient le document. Peut être à NULL.
* @access private
*/
var $_id_projet;
 
/**
* Le chemin du fichier, depuis le répertoire du projet
*
*/
var $_pd_lien ;
 
var $nom_fichier ;
/**
*
*
* @param int id_document L'identifiant du document dans la base.
* @param int objetDB un objet PEAR:DB
* @return void
* @access public
*/
function document( $id_document = "", &$objetDB, $chemin = '', $chemin_icones = '')
{
if (is_object($objetDB)) {
$GLOBALS['projet_db'] = $objetDB;
}
$this->_chemin_icone = $chemin_icones ;
if ($id_document != "") {
$requete = "select * from projet_documents where pd_id=".$GLOBALS['projet_db']->escapeSimple($id_document) ;
$resultat = $GLOBALS['projet_db']->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
if ($resultat->numRows()>0) {
$this->nom_fichier = $ligne->pd_lien;
$this->_id_projet = $ligne->pd_ce_projet;
$this->_id = $ligne->pd_id ;
fichier::fichier($chemin.$this->getChemin(), $GLOBALS['projet_db']) ;
 
if (is_object ($this->_type_mime)) $this->_type_mime->setCheminIcone ($chemin_icones) ;
$this->_id_proprietaire = $ligne->pd_ce_utilisateur ;
$this->_nom_long = $ligne->pd_nom ;
$this->_visibilite = $ligne->pd_visibilite ;
$this->_date_mise_a_jour = $ligne->pd_date_de_mise_a_jour ;
$this->_description = $ligne->pd_description ;
$this->_pd_lien = $ligne->pd_lien;
 
if ($this->_isRacine($ligne->pd_pere)) {
$this->_id_pere = 0 ;
} else {
$this->_id_pere = $ligne->pd_pere ;
}
}
}
 
} // end of member function document
 
/**
*
*
* @param int id_document L'identifiant du document dans la base.
* @param int objetDB Un objet PEAR:DB
* @return document
* @access public
*/
function __construct( $id_document = "", &$objetDB, $chemin = '', $chemin_icones = '' )
{
 
$this->document($id_document, $objetDB, $chemin, $chemin_icones);
 
} // end of member function __construct
 
 
/**
* Renvoie le nom long du fichier.
*
* @return string
* @access public
*/
function getNomLong( )
{
return $this->_nom_long ;
} // end of member function getNomLong
 
/**
* Renvoie la visibilité du document, soit "public" soit "prive"
*
* @return visibilite
* @access public
*/
function getVisibilite( )
{
return $this->_visibilite ;
} // end of member function getVisibilite
 
/**
* Renvoie la description du document, sous forme de chaine.
*
* @return string
* @access public
*/
function getDescription( )
{
return $this->_description ;
} // end of member function getDescription
 
/**
* Renvoie la date de création ou de mise à jour du fichier.
*
* @return date
* @access public
*/
function getDateMiseAJour( )
{
return $this->_date_mise_a_jour ;
} // end of member function getDateMiseAJour
 
/**
* Renvoie l'identifiant d'un document.
*
* @return int
* @access public
*/
function getIdDocument( )
{
return $this->_id ;
} // end of member function getIdDocument
 
/**
* Renvoie le chemin de l'icone du fichier. Fait un appel à type_fichier_mime.
*
* @return string
* @access public
*/
function getCheminIcone()
{
if ($this->isRepertoire()) {
return $this->_chemin_icone."repertoire.gif" ;
} else {
if (is_object ($this->_type_mime)) return $this->_type_mime->getCheminIcone() ;
}
} // end of member function getCheminIcone
 
/**
* Permet de récupérer le nom du répertoire racine associé à un projet.
*
* @param int id_projet L'identifiant du projet dont on veux récupérer le répertoire racine.
* @param DB objetDB Un objet PEAR:DB
* @return string
* @static
* @access public
*/
function getNomRepertoireProjet( $id_projet , &$objetDB)
{
// Dans la table projet_documents, pour les répertoires racines, pd_pere = null
$requete = "select pd_nom from projet_documents where pd_ce_projet=".$GLOBALS['projet_db']->escapeSimple($id_projet)." and pd_pere is null" ;
$resultat = $objetDB->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
return $ligne->pd_nom ;
} // end of member function getNomRepertoireProjet
 
 
/**
* Renvoie true si le document passé en paramètre est le répertoire racine.
*
* @param int id_document L'identifiant du document dont on veut savoir si c'est la racine.
* @return bool
* @access public
*/
function _isRacine( $id_document )
{
if ($id_document) {
$requete = "select pd_pere from projet_documents where pd_id=".$GLOBALS['projet_db']->escapeSimple($id_document) ;
$resultat = $GLOBALS['projet_db']->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
if ($resultat->numRows() >0) {
if ($ligne->pd_pere == null){
return true ;
}
}
}
return false ;
} // end of member function _isRacine
 
/**
* Renvoie le chemin d'un fichier ou d'un répertoire. Contrairement à la classe
* mère, cette méthode renvoie une URL projet et non pas un fichier.
*
* @return string
* @access public
*/
function getChemin($prefixe = '')
{
$chemin_repertoire_entre_racine_et_fichier = '';
 
include_once PROJET_CHEMIN_CLASSES.'projet.class.php';
$projet = new projet ($GLOBALS['projet_db'], $this->_id_projet);
// l arborescence des repertoires
 
$tableau_navigation = $this->getPath($this->_id) ;
if (is_array ($tableau_navigation))$tableau_navigation = array_reverse($tableau_navigation);
for ($i = 0; $i < count ($tableau_navigation); $i++) {
$chemin_repertoire_entre_racine_et_fichier.= $tableau_navigation[$i]."/";
}
return $projet->getNomRepertoire().'/'.$chemin_repertoire_entre_racine_et_fichier.$this->nom_fichier ;
}
 
 
/**
* Renvoie pour le repertoire ou le fichier courant, les identifiants et les noms de tous les
* répertoires père jusqu'à la racine. 0 => ['id'], ['nom'] 1 => [id'], ['nom'] etc.
* En commençant par la racine et en descendant. Pour la racine id vaut "" et nom
* vaut "".
*
* @param int id_repertoire L'identifiant d'un répertoire.
* @return Array
* @access public
*/
 
function getCheminIdRepertoire( $id_doc, &$objetDB )
{
if ($id_doc == "") $id_doc = 0;
// on commence par rechercher le répertoire père, dans la base de donnée
$requete = 'select pd_pere, pd_nom, pd_id, pd_ce_type from projet_documents where pd_id='.$GLOBALS['projet_db']->escapeSimple($id_doc) ;
$resultat = $objetDB->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$chemin_rep_id_nom = array() ;
if ($resultat->numRows()>0) {
if ($ligne->pd_pere == 0) {
return array ($ligne->pd_id);
}
array_push ($chemin_rep_id_nom, $ligne->pd_id) ;
$tab = document::getCheminIdRepertoire($ligne->pd_pere, $objetDB) ;
$chemin_rep_id_nom = array_merge ($tab, $chemin_rep_id_nom) ;
}
return ($chemin_rep_id_nom);
}
 
function getPath( $id_doc)
{
if ($id_doc == "") $id_doc = 0;
// on commence par rechercher le répertoire père, dans la base de donnée
$requete = 'select pd_pere, pd_nom, pd_id, pd_ce_type from projet_documents where pd_id='.$GLOBALS['projet_db']->escapeSimple($id_doc) ;
$resultat = $GLOBALS['projet_db']->query ($requete) ;
 
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
 
$chemin_rep_id_nom = array() ;
if ($resultat->numRows()>0 && $ligne->pd_pere != 0 && $ligne->pd_pere != $ligne->pd_id) {
 
array_push ($chemin_rep_id_nom, $ligne->pd_pere) ;
 
// Récursion sur le répertoires ou fichiers fils
$chemin_rep_id_nom = array_merge ($chemin_rep_id_nom, document::getPath($ligne->pd_pere) );
}
 
return $chemin_rep_id_nom;
}
 
/**
* Calcule le chemin vers le fichier ou le répertoire uploadé
* renvoie un chaine de la forme dir1/dir2/fichier.ext
* En prenant comme racine le répertoire du projet, exclu.
* @return string Le chemin
*/
 
function calculeCheminUploaded ($radical) {
 
if (isset($_FILES['fichier']['name'])) {
$extension = preg_replace("/^([^\.]+)\.(\w+$)/", "\\2", $_FILES['fichier']['name']) ;
}
 
if ($this->_id_pere != '') {
// On appelle la méthode getCheminIdRepertoire qui renvoie un tableau avec la liste
// des répertoires jusqu'à la racine, on enlève la racine ($i = 0) et on concatène
// toutes les entrées pour obtenir le chemin jusqu'au répertoire courant
$chemin_repertoire_entre_racine_et_repertoire_a_cree = '' ;
$doc_pere = new document ($this->_id_pere, $GLOBALS['projet_db']);
return $doc_pere->getChemin();
$tableau_navigation = $this->getPath($this->_id_pere) ;
 
for ($i = 0; $i < count ($tableau_navigation); $i++) $chemin_repertoire_entre_racine_et_repertoire_a_cree.= $tableau_navigation[$i]."/";
$chemin = $chemin_repertoire_entre_racine_et_repertoire_a_cree ;
} else {
// Si l'on est à la racine du projet, le chemin vide
return $radical ;
}
return $chemin ;
}
 
/**
* Enregistre une ligne dans la table projet_document
* Le tableau de valeur doit contenir les éléments suivants 'document_nom','document_description','document_visibilite','fichier'
*
* @param Array tableau_de_valeur Le tableau de valeur a insérer dans la base avec pour clé les noms des éléments
* @access public
* @return void
*/
 
function enregistrerSQL ($valeur, $chemin) {
 
// On teste si on a affaire à un répertoire ou un fichier
if (isset ($_FILES['fichier']['name'])) {
// On tente de déterminer le type du fichier à partir de son nom dans $valeur['$fichier']
$tableau_nom = explode (".", $_FILES['fichier']['name']) ;
 
// On prend le dernier élément du tableau, si c'est un tableau
if (is_array($tableau_nom)) {
$extension = array_pop($tableau_nom) ;
$type = type_fichier_mime::factory($extension) ;
$id_extension = $type->getIdType() ;
} else {
$id_extension = 12 ;
}
$pd_lien = $chemin ;
} else { // Le cas ou on a affaire à un répertoire
$id_extension = 0 ;
// Le nom du répertoire est son identifiant avec un slash à la fin
$pd_lien = $chemin."/" ;
if ($this->_id_pere != '') {
// On appelle la méthode getCheminIdRepertoire qui renvoie un tableau avec la liste
// des répertoires jusqu'à la racine, on enlève la racine ($i = 0) et on concatène
// toutes les entrées pour obtenir le chemin jusqu'au répertoire courant
$chemin_repertoire_entre_racine_et_repertoire_a_cree = '' ;
$tableau_navigation = $this->getCheminIdRepertoire($this->_id_pere, $GLOBALS['projet_db']) ;
for ($i = 0; $i < count ($tableau_navigation); $i+=2) $chemin_repertoire_entre_racine_et_repertoire_a_cree.= $tableau_navigation[$i]."/";
$pd_lien .= $chemin_repertoire_entre_racine_et_repertoire_a_cree ;
}
//$pd_lien .= SQL_obtenirNouveauId($GLOBALS['projet_db'], 'projet_documents', 'pd_id')."/" ;
$pd_lien = SQL_obtenirNouveauId($GLOBALS['projet_db'], 'projet_documents', 'pd_id')."/" ;
}
$id = SQL_obtenirNouveauId($GLOBALS['projet_db'], 'projet_documents', 'pd_id') ;
 
$requete = "insert into projet_documents set pd_id=".$id ;
$requete .= ", pd_nom=\"".$valeur['document_nom']."\", pd_description=\"".$valeur['document_description']."\"".
", pd_visibilite=\"".$valeur['document_visibilite']."\", pd_date_de_mise_a_jour=NOW(),".
"pd_ce_projet=\"".$this->_id_projet."\", pd_ce_utilisateur=\"".$this->_id_proprietaire."\"".
", pd_pere=\"$this->_id_pere\", pd_ce_type=\"$id_extension\", pd_lien=\"$pd_lien\"" ;
 
$resultat = $GLOBALS['projet_db']->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$this->_id = $id ;
return $pd_lien;
}
 
function genereNouveauNom ($radical, $ancien_nom, $id) {
$extension = preg_replace("/^([^\.]+)\.(\w+$)/", "\\2", $ancien_nom) ;
$nouveau_nom = $radical."_".$id.".".$extension ;
return $nouveau_nom;
}
 
/**
* Met à jour une ligne dans la table projet_document
* Le tableau de valeur doit contenir les éléments suivants 'document_nom','document_description','document_visibilite','fichier'
*
* @param Array tableau_de_valeur Le tableau de valeur a insérer dans la base avec pour clé les noms des éléments
* @access public
* @return void
*/
 
function majSQL ($valeur) {
$requete = "update projet_documents set pd_nom=\"".$valeur['document_nom']."\", pd_description=\"".$valeur['document_description']."\"".
", pd_visibilite=\"".$valeur['document_visibilite']."\", pd_date_de_mise_a_jour=NOW()".
" where pd_id=".$GLOBALS['projet_db']->escapeSimple($this->_id);
 
$resultat = $GLOBALS['projet_db']->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
return ;
}
 
/** Supprime les donnéexs du document dans la table projet_documents
*
*
* @return true en cas de succès
*/
 
function suppressionSQL () {
$requete = 'delete from projet_documents where pd_id='.$GLOBALS['projet_db']->escapeSimple($this->_id) ;
$resultat = $GLOBALS['projet_db']->query ($requete) ;
if ($GLOBALS['projet_db']->affectedRows()) return true ;
return false ;
}
 
/**
* Déplace un document au sein d'un même projet
*
* @param int repertoire_destination L'identifiant du répertoire destination.
* @return bool
* @access public
*/
function deplace( $repertoire_destination, $repertoire_projet )
{
 
// On récupère les informations du répertoire cible
if ($repertoire_destination != 0) {
$repertoire_cible = new document ($repertoire_destination, $GLOBALS['projet_db']) ;
$chemin_rep_cible = $repertoire_cible->getChemin();
} else {
// Si le repertoire destination est la racine cad id =0
// on cree un document qui aura pour chemin le repertoire du projet
include_once PROJET_CHEMIN_CLASSES.'projet.class.php';
$projet = new projet ($GLOBALS['projet_db'], $this->_id_projet);
$chemin_rep_cible = $projet->getNomRepertoire().'/';
}
 
$nom_fichier = $this->_pd_lien ;
$requete = 'update projet_documents set pd_pere='.$GLOBALS['projet_db']->escapeSimple($repertoire_destination).' where pd_id='.$GLOBALS['projet_db']->escapeSimple($this->_id) ;
$resultat = $GLOBALS['projet_db']->query ($requete) ;
if (DB::isError($resultat)) {
echo ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
return false ;
}
//echo $this->_chemin.'<br>'.PROJET_CHEMIN_FICHIER.$chemin_rep_cible.$nom_fichier;
return fichier::deplace ($this->_chemin, PROJET_CHEMIN_FICHIER.$chemin_rep_cible.$nom_fichier) ;
 
} // end of member function deplace
 
 
/**
* Pour modifier l'identifiant du projet auquel appartient un document.
*
* @param int id_projet L'identifiant du projet.
* @return void
* @access public
*/
function setIdProjet( $id_projet )
{
$this->_id_projet = $id_projet ;
} // end of member function setIdProjet
 
/**
* Permet de modifier l'identifiant du propietaire d'un projet.
*
* @param int id_proprietaire L'identifiant du proprietaire d'un document.
* @return void
* @access public
*/
function setIdProprietaire( $id_proprietaire )
{
$this->_id_proprietaire = $id_proprietaire ;
} // end of member function setIdProprietaire
 
/**
* Permet de modifier l'identifiant du répertoire d'un document.
*
* @param int id_repertoire L'identifiant du repertoire d'un document.
* @return void
* @access public
*/
function setIdRepertoire( $id_repertoire )
{
$this->_id_pere = $id_repertoire;
} // end of member function setIdRepertoire
 
/**
* initAttributes sets all document attributes to its default value make
* sure to call this method within your class constructor
*/
function initAttributes( )
{
$this->_visibilite = "public";
}
 
/**
* Renvoie les derniers documents de l'ensemble des projets.
*
* @param int nombre Le nombre de document à renvoyer
* @return Array
* @static
* @access public
*/
function getDocumentsRecents( $nombre = 10, &$objetDB, $chemin, $chemin_icones, $id_projet = '', $visible = true)
{
// on recherche les documents, hors repertoire
$requete = 'select pd_id from projet_documents where pd_ce_type<>0 ';
if ($id_projet != '') $requete .= ' and pd_ce_projet='.$GLOBALS['projet_db']->escapeSimple($id_projet).' ';
if (!$visible) $requete .= ' and pd_visibilite="public" ';
$requete .= 'order by pd_date_de_mise_a_jour desc limit 0,'.$nombre ;
$resultat = $objetDB->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$tableau_document = array() ;
 
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) {
array_push ($tableau_document, new document ($ligne->pd_id, $objetDB, $chemin, $chemin_icones)) ;
}
return $tableau_document ;
} // end of member function getDocumentsRecents
 
/**
* Renvoie les documents du projet passe en parametre sous forme d arbre d objet document
*
* @param int l identifiant du projet
* @return Array
* @static
* @access public
*/
function getArbreDocument($id_projet, $objetDB = '') {
$requete = 'select pd_id, pd_nom, pd_ce_type, pd_pere from projet_documents where pd_ce_projet='.$GLOBALS['projet_db']->escapeSimple($id_projet);
$resultat = $GLOBALS['projet_db']->getAll($requete, null, DB_FETCHMODE_OBJECT);
if (DB::isError ($resultat)) {
return ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
 
return $resultat;
}
/**
* Renvoie la taille du document formatee avec une unite adapte
*
* @return string La taille formate
* @access public
*/
function getTailleFormatee($precision = 1) {
$taille = $this->getTaille();
if ($taille > 1000000) {
$diviseur = 1000000;
$unite = 'Mo';
} else {
$diviseur = 1000 ;
$unite = 'Ko';
}
return round ($taille / $diviseur, $precision).'&nbsp;'.$unite;
}
 
/**
* Renvoie une liste de document, enfant du document courant
* qui doit etre un repertoire bien sur
*
* @return mixed un tableau de document
* @access public
*/
function getDocumentsEnfant() {
 
}
 
} // end of document
 
 
?>
/tags/2014_06_04/classes/AJAX_arbreDocuments.class.php
New file
0,0 → 1,353
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: AJAX_arbreDocuments.class.php,v 1.2 2007-10-10 13:52:52 alexandre_tb Exp $
/**
* Application projet
*
* La classe AJAX_arbreDocuments
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE des constantes |
// +------------------------------------------------------------------------------------------------------+
 
define ("FICHIER_ICONE_COUPER", "cut.gif") ;
define ("FICHIER_ICONE_COLLER", "paste.gif") ;
define ("FICHIER_ICONE_SUPPRIMER", "trash.gif") ;
define ("FICHIER_ICONE_MODIFIER", "modif.png") ;
 
// Appel de la bibliotheque dojo
include_once PROJET_CHEMIN_CLASSES.'HTML_Liste.class.php';
GEN_stockerFichierScript('dojo', 'api/js/dojo/dojo.js', 'text/javascript');
 
/**
* class HTML_listeDocuments
*
*/
class AJAX_arbreDocuments extends HTML_Liste
{
/*** Attributes: ***/
 
/**
* Une url.
* @access private
*/
var $_url;
/**
* Tableau contenant les actions possibles. "couper" => 1, "modifier" => 2,
* "supprimer" => 3 Elles seront passées en paramètre aux url des icones des
* documents.
* @access private
*/
var $_actions = array ("couper" => 1, "modifier" => 2, "supprimer" => 3) ;
 
/**
* Indique le chemin des icones couper, coller, modifier, supprimer.
* @access private
*/
var $_chemin_icone = "icones/";
/**
* L'identifiant du répertoire que l'on est en train d'observer.
* @access private
*/
var $_id_repertoire;
 
/**
* Un tableau contenant les id et les noms du chemin des répertoires. 0 => ["id"],
* ["nom"] etc.
* @access private
*/
var $_chemin_navigation = array ();
 
/**
* un pointeur vers une authentificatin PEAR
* @access private
*/
var $_auth ;
/**
*
*
* @param bool utilise_pager Indique l'utilisation ou non du Pager.
* @return void
* @access public
*/
function AJAX_arbreDocuments(&$url, $utilise_pager = false, $id_repertoire = 0, $auth = '' )
{
//HTML_Liste::HTML_Liste($utilise_pager, array('class' => 'table_cadre')) ;
$this->_url = $url ;
$this->_id_repertoire = $id_repertoire ;
if (is_object($auth)) {
$this->_auth = $auth ;
}
} // end of member function HTML_listeDocuments
 
function AJAX_construitListe($id_projet, $droits, $mode = '', $objetDB = '') {
GEN_stockerFichierScript('dojoScriptProjet', 'client/projet/js/arbreDocument.js');
$res = '' ;
$RCPUrl = PROJET_CHEMIN_APPLI.'services/ecouteArbreFichier.php?id_projet='.$id_projet;
// Le noeud racine
$res .= '<div dojoType="TreeLoadingController" RPCUrl="'.$RCPUrl.'" widgetId="treeController" DNDController="create"></div>
<div dojoType="TreeSelector" widgetId="treeSelector"></div>
<div dojoType="Tree" DNDMode="between" selector="treeSelector" DNDAcceptTypes="bandTree" widgetId="bandTree" controller="treeController" eventNames="moveTo:nodeRemoved">
<div dojoType="TreeNode" title="Racine" widgetId="eisleyRoot" objectId="root" isFolder="true"></div>';
 
 
 
return $res ;
}
/**
*
*
* @param bool utilise_pager Voir HTML_listeDocuments
* @return void
* @access public
*/
function __construct( &$url, $utilise_pager = false, $id_repertoire = 0, $auth = '' )
{
$this->AJAX_arbreDocuments($url, $utilise_pager, $id_repertoire, $auth);
} // end of member function __construct
 
/**
*
*
* @param Array tableau_label Un tableau contenant les labels à afficher dans l'entête.
* @return void
* @access public
*/
function construitEntete( $tableau_label )
{
$this->addRow ($tableau_label, NULL, 'TH') ;
} // end of member function construitEntete
 
/**
*
*
* @param Array tableau_label Un tableau à deux dimensions avec les labels à afficher dans le corps du
* tableau.
* @return void
* @access public
*/
function construitListe( &$tableau_document, $droits, $mode = '', $objetDB = '')
{
$compteur = 0 ;$class[0] = 'ligne_impaire'; $class[1] = 'ligne_paire' ;
 
for ($i = 0; $i < count ($tableau_document) ; $i++) {
// Première condition : est-ce que le fichier a pour père le répertoire courant, si oui on l'affiche
if ($tableau_document[$i]->_id_pere == $this->_id_repertoire || $mode == 'ignore_repertoire') {
// d'abord l'image
$icone = '<img src="'.$tableau_document[$i]->getCheminIcone().'" />' ;
// Si le document est un répertoire, on ajoute id_repertoire au lien.
if ($tableau_document[$i]->isRepertoire()) {
$this->_url->addQueryString ('id_repertoire', $tableau_document[$i]->getChemin()) ;
$lien = $this->_url->getURL() ;
} else { // Si c'est un fichier, on fait un lien direct
$lien = $tableau_document[$i]->getChemin() ;
}
// pour éviter des effets de bords, on enlève id_repertoire de l'url
// dans le cas d'un répertoire, pour les fichiers on le laisse pour
// qu'après une opération, on reste dans le répertoire où a eu lieu l'opération
if ($tableau_document[$i]->isRepertoire()) $this->_url->removeQueryString('id_repertoire') ;
// on insère le lien
$lien_nom = '<a href="'.$lien.'">'.$icone.' '.$tableau_document[$i]->getNomLong()."</a>\n" ;
// Pour la taille on divise par 1000 et on écrit Ko
$taille = round($tableau_document[$i]->getTaille() / 1000).'&nbsp;Ko' ;
// Récupération de l'auteur
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$annuaire = new annuaire($objetDB, array('table' => PROJET_ANNUAIRE, 'identifiant' => PROJET_CHAMPS_ID,
'nom' => PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
$annuaire->setId($tableau_document[$i]->_id_proprietaire) ;
$nom_prenom = $annuaire->getInfo('nom').' '.$annuaire->getInfo('prenom') ;
// On rempli le tableau à donner en paramètre à HTML_Table avec toutes ces infos, une par colonne
$ligne_tableau = array($lien_nom, $taille, $nom_prenom, $tableau_document[$i]->getDateMiseAJour()) ;
if ($droits <= PROJET_DROIT_CONTRIBUTEUR) array_push ($ligne_tableau, $tableau_document[$i]->getVisibilite()) ;
// On ajoute au tableau, les action couper / modifier / supprimer
if ($droits <= PROJET_DROIT_COORDINATEUR || $this->_auth->getAuthData(PROJET_CHAMPS_ID) == $tableau_document[$i]->_id_proprietaire)
array_push ($ligne_tableau, $this->_actions ($tableau_document[$i])) ;
if ($tableau_document[$i]->getVisibilite() != 'prive' || $droits < PROJET_DROIT_AUCUN) {
$this->addRow ($ligne_tableau, array('class' => $class[$compteur]), 'TD', true) ;
// enfin , s'il y a une description, on l'ajoute, mais sur une ligne entière (colspan)
if ($tableau_document[$i]->getDescription() != "") {
$this->addRow (array ($tableau_document[$i]->getDescription()),
array ('colspan' => $this->getColCount(), 'class' => $class[$compteur])) ;
$this->updateRowAttributes ($this->getRowCount()-1, array ('class' => $class[$compteur]), true) ;
}
}
$compteur++;
}
if ($compteur == 2) $compteur = 0 ;
}
$this->updateColAttributes(0, array ('class' => 'col1')) ;
} // end of member function construitListe
 
/**
*
*
* @param Array actions Un tableau avec les valeurs d'actions comme clé. "couper", modifier",
* "supprimer".
* @return void
* @access public
*/
function setAction( $actions )
{
$this->_actions = $actions ;
} // end of member function setAction
/**
*
*
* @param string chemin Le chemin vers les icones couper, coller ...
* @return void
* @access public
*/
function setCheminIcones( $chemin )
{
$this->_chemin_icone = $chemin ;
} // end of member function setCheminIcones
 
/**
* Surcharge de l'opération de la classe mère. Ajoute la navigation dans les
* répertoires.
*
* @return string
* @access public
*/
function toHTML( )
{
$chemin_navig = "" ;
if ($this->_id_repertoire != "") {
$this->_url->removeQueryString(PROJET_VARIABLE_ID_REPERTOIRE) ;
$chemin_navig = "<p>" ;
$chemin_navig .= "<a href=\"".$this->_url->getURL()."\">".PROJET_RACINE."</a>\n" ;
$this->_url->addQueryString(PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
for ($i = 0; $i < count ($this->_chemin_navigation); $i+=2) {
$chemin_navig .= "&gt;&nbsp;" ;
$nom = $this->_chemin_navigation[$i+1] ;
$this->_url->addQueryString ('id_repertoire', $this->_chemin_navigation[$i]) ;
$chemin_navig .= "<a href=\"".$this->_url->getURL()."\">".$nom."</a>\n" ;
}
$chemin_navig .= "</p>\n" ;
}
$res = $chemin_navig.HTML_Liste::toHTML() ;
if ($this->getRowCount() == 1 && $this->_id_repertoire == '') {
return '<div>'.PROJET_PAS_DE_DOCUMENTS.'</div>'."\n";
}
return $res ;
} // end of member function toHTML
 
/**
*
*
* @param Array tableau_navigation Un tableau contenant les identifiants et les noms des répertoires. 0 => ["id"],
* ["nom"] etc.
* @return void
* @access public
*/
function setCheminNavigation( $tableau_navigation )
{
$this->_chemin_navigation = $tableau_navigation ;
} // end of member function setCheminNavigation
 
/**
* Affiche la légende des actions du module "documents"
*
* @return string
* @access public
*/
function affLegende( )
{
$res = "<h2 class=\"titre2_projet\">".PROJET_LEGENDE."</h2>\n" ;
$res .= "<p><img src=\"".$this->_chemin_icone."/cut.gif\" title=\"couper\" alt=\"couper\">".PROJET_LEGENDE_DEPLACE."</p>\n" ;
$res .= "<p><img src=\"".$this->_chemin_icone."/modif.png\" title=\"modifier\" alt=\"modifier\"> ".PROJET_LEGENDE_MODIFIE."</p>\n" ;
$res .= "<p><img src=\"".$this->_chemin_icone."/trash.gif\" title=\"supprimer\" alt=\"supprimer\"> ".PROJET_LEGENDE_SUPPR."</p>\n" ;
return $res ;
} // end of member function affLegende
 
 
/**
* Renvoie le chemin HTML, depuis le répertoire courant jusqu'à la racine.
*
* @return string
* @access private
*/
function _getCheminHTML( )
{
$path = "" ;
 
return $path ;
} // end of member function _getCheminHTML
 
 
 
/**
* Renvoie une chaine contenant le code html des icones des actions possibles sur un
* fichier, c'est à dire couper, modifier, supprimer.
*
* @return string
* @access private
*/
function _actions($document)
{
$this->_url->addQueryString ('id_document', $document->getIdDocument()) ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["couper"]) ;
$couper = ' '.PROJET_FICHIER_COUPER ;
if (!$document->isRepertoire()) $couper = '<a href="'.$this->_url->getURL().'">'.$couper.'</a>' ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["modifier"]) ;
$modifier = '<a href="'.$this->_url->getURL().'">'.PROJET_FICHIER_MODIFIER.'</a> ' ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["supprimer"]) ;
$supprimer= '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm (\''.PROJET_FICHIER_SUPPRIMER.' ?\');">'.PROJET_FICHIER_SUPPRIMER.'</a>' ;
$this->_url->removeQueryString ('id_document') ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT) ;
return $modifier.$supprimer.$couper ;
} // end of member function _action
 
 
} // end of HTML_listeDocuments
?>
/tags/2014_06_04/classes/HTML_listeParticipants.class.php
New file
0,0 → 1,216
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_listeParticipants.class.php,v 1.5 2008-08-25 15:13:17 alexandre_tb Exp $
/**
* Application projet
*
* La classe HTML_listeParticipants
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.5 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once PROJET_CHEMIN_CLASSES.'HTML_Liste.class.php' ;
 
 
/**
* class HTML_listeParticipants
*
*/
class HTML_listeParticipants extends HTML_Liste
{
/*** Attributes: ***/
 
/**
* Le mode, par défaut 0 => normal 1 => modification En mode modification, une
* colonne de plus pour désinscrire un utilisateur
* @access private
*/
var $_mode;
/**
* L'url vers la page affichant la liste
* @access private
*/
var $_url;
 
/**
*
*
* @return void
* @access public
*/
function HTML_listeParticipants( $utilise_pager)
{
HTML_Liste::HTML_Liste($utilise_pager, array('class' => 'table_cadre')) ;
} // end of member function HTML_listeParticipants
 
/**
*
*
* @param Array elements Tableau des éléments de l'entête. Des labels.
* @return void
* @access public
*/
function construitEntete( $elements )
{
if ($this->_mode == 1) {
array_push ($elements, PROJET_SUPPRIMER) ;
}
$this->addRow ($elements, '', 'TH') ;
} // end of member function construitEntete
 
/**
*
*
* @param Array elements Tableau à deux dimension contenant les éléments à afficher.
* @return void
* @access public
*/
function construitListe( $elements, $tableau_statut = '', &$projet )
{
for ($i = 0; $i < count ($elements) ; $i++) {
// L'identifiant de l'utilisateur est le premier élément du tableau
$id_utilisateur = array_shift ($elements[$i]) ;
// L'identifiant du statut est le dernier
if (count ($elements)>5) $inscrit_liste = (int) array_pop ($elements[$i]);
$id_statut = (int) array_pop ($elements[$i]) ;
// En mode modif on ajoute la colonne supprimer
if ($this->_mode == 1) {
$this->_url->addQueryString ('id_utilisateur', $id_utilisateur) ;
$this->_url->addQueryString('statut', 4) ;
$supprimer = '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.PROJET_SUPPRIMER.' ?\')">'.PROJET_SUPPRIMER.'</a>';
if (count ($elements) > 5) array_push ($elements[$i], '');
array_push ($elements[$i], '', $supprimer);
$this->_url->removeQueryString('statut') ;
}
// La colonne avec l inscription a la liste de discussion
$this->addRow ($elements[$i]) ;
// mise à jour du champs mail en l'entourant par la balise mailto
/// $i+1 pour sauter la ligne de titre,
if (strlen ($elements[$i][2]) > 10) {
$mail_racourci = substr($elements[$i][2], 0, 10).'...' ;
}
$this->setCellContents ($i+1, 2, '<a href="mailto:'.$elements[$i][2].'">'.$mail_racourci.'</a>') ;
// Mise à jour de la cellule contenant le statut
if ($this->_mode == 1) {
$this->_url->addQueryString ('id_utilisateur', $id_utilisateur) ;
$select = '<form action="'.$this->_url->getURL().'" method="post">'."\n" ;
$select .= '<select name="statut" onchange="javascript:this.form.submit();">' ;
foreach ($tableau_statut as $cle =>$element_statut) {
$select .= '<option value="'.$cle.'"' ;
if ($cle == $id_statut) {
$select .= ' selected="selected"' ;
}
$select .= '>'.$element_statut.'</option>'."\n" ;
}
$select .= '</select>'."\n".'</form>'."\n" ;
$this->setCellContents($i+1, 4, $select) ;
// Colonne avec l inscription a la liste de discussion
if (count ($elements)>5) {
$this->_url->addQueryString ('id_utilisateur', $id_utilisateur) ;
$select = '<form action="'.$this->_url->getURL().'" method="post">'."\n" ;
$select .= '<select name="inscription_liste" onchange="javascript:this.form.submit();">' ;
$select .= '<option value="0">Non inscrit</option>';
$select .= '<option value="1"'.($inscrit_liste ? ' selected="selected"': '').'>Inscrit</option>';
$select .= '</select>'."\n".'</form>'."\n" ;
$this->setCellContents($i+1, 5, $select) ;
}
}
if ($id_statut == 1 && $this->_mode != 1) {
$this->setCellContents($i + 1, 4, PROJET_CHEF) ;
$this->updateRowAttributes ($i + 1, array('style' => 'font-weight:bold'), true) ;
}
if ($this->_mode != 1 && $id_statut != 1) {
$this->setCellContents($i + 1, 4, $tableau_statut[$id_statut]) ;
}
$this->updateCellAttributes ($i + 1, 0, array ('class' => 'nom')) ;
$this->updateCellAttributes ($i + 1, 1, array ('class' => 'prenom')) ;
}
} // end of member function construitListe
 
/**
*
*
* @return void
* @access public
*/
function setModeModification( )
{
$this->_mode = 1 ;
} // end of member function setModeModification
 
/**
* Renvoie le code HTML de la table.
*
* @return string
* @access public
*/
function toHTML( )
{
// Application de style
$this->altRowAttributes(1, array('class' =>'ligne_paire'), array('class' =>'ligne_impaire'), true) ;
// s'il n'y a qu'une seule ligne, on renvoie un message indiquant qu'il n'y a pas de participants
if ($this->getRowCount() == 1) {
return '<div>'.PROJET_PAS_D_INSCRIT.'</div>'."\n";
}
$res = HTML_Table::toHTML() ;
return $res ;
} // end of member function toHTML
 
/**
* Fixe la valeur de l'URL
*
* @param Net_URL url Un pointeur vers un objet Net_URL
* @return void
* @access public
*/
function setURL( &$url )
{
$this->_url = $url ;
} // end of member function setURL
 
} // end of HTML_listeParticipants
?>
/tags/2014_06_04/projet.desinscription.inc.php
New file
0,0 → 1,86
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projet.desinscription.inc.php,v 1.4 2008-09-16 14:10:06 alexandre_tb Exp $
/**
* Inscription
*
* Le fichier de desinscription de projet, appele par l'inscription
* en cas de desinscription d'un utilisateur
*
*@package projet
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2006
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// On recupere id_utilisateur, l'identifiant de la personne qui se desinscrit
// On se trouve dans la fonction afficherContenuCorps de inscription.php
 
 
 
include_once 'client/projet/configuration/projet.config.inc.php' ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
$participant = new participe($GLOBALS['ins_db']) ;
 
 
$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
 
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$annuaire = new annuaire($GLOBALS['ins_db'], array('identifiant' => INS_CHAMPS_ID, 'mail' => INS_CHAMPS_MAIL, 'table' => INS_ANNUAIRE, 'nom' => INS_CHAMPS_NOM,
'prenom' => INS_CHAMPS_PRENOM)) ;
$annuaire->setId($id_utilisateur) ;
 
// On boucle sur chaque projet et on desinscrit l'utilisateur
foreach ($tableau_projet as $projet) {
// On verifie si l utilisateur est le dernier coordinateur
// auquel cas on previent les administrateurs
if ($participant->isCoordinateur($id_utilisateur, $projet->getId(), $GLOBALS['ins_db'])) {
$controleur = new projetControleur($GLOBALS['ins_db'], $GLOBALS['AUTH'], $GLOBALS['ins_url']);
$controleur->setIdProjet($projet->getId());
$coord = $participant->getCoordinateurs($projet->getId());
if (count($coord) == 0) {
$controleur->notifierCoordinateurs(PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD, $annuaire);
}
}
 
// Le statut 4 desinscrit l'utilisateur, dans la methode setStatut
$participant->setStatut(4, $id_utilisateur, $projet->getId()) ;
$projet->getListesAssociees() ;
 
if ($projet->avoirListe()) {
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$desinscription= new inscription_liste($GLOBALS['ins_db']) ;
$desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
 
}
}
 
 
?>
/tags/2014_06_04/langues/pro_langue_es.inc.php
New file
0,0 → 1,128
<?php
/* +-----------------------------------------------------------------------+
* |pro_langue_fr.inc.php |
* +-----------------------------------------------------------------------+
* | Copyright (c) 2001 - 2003 Tela Botanica |
* +-----------------------------------------------------------------------+
* | Module projet, permet la création de projet, avec une gestion de la |
* | propriétés des documents... |
* +-----------------------------------------------------------------------+
* | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
* +-----------------------------------------------------------------------+
 
* $Id: pro_langue_es.inc.php,v 1.3 2005-09-28 16:29:39 ddelon Exp $
*/
 
 
// ========== Partie concernant la description su projet =================================
define ('PROJET_SYNTHESE', 'Synthesis') ;
define ("PROJET_ALERTE_TITRE", "pacio titulo no debe estar vacio") ;
define ("PROJET_DECONNEXION", "Desconectar") ;
define ("PROJET_ADMINISTRATION", "Aqministracion") ;
define ("PROJET_ADMINISTRATEUR", "Administrador") ;
define ("PROJET_NOUVEAU_PROJET", "Nuevo proyecto") ;
define ("PROJET_DESTRUCTION_PROJET", "Anulacion de un proyecto") ;
define ("PROJET_GESTION_UTILISATEUR", "Administracion de los usuarios") ;
define ("PROJET_NOUVEAU_UTILISATEUR", "Nuevo utilizador") ;
define ("PROJET_MOD_UTILISATEUR", "Cancelacion de un usuario") ;
define ("PROJET_DESTRUCTION_UTILISATEUR", "Administrar los ficheros") ;
define ("PROJET_GERER", "Administrar") ;
define ("PROJET_VOIR_PROJET", "Ver el proyecto") ;
define ("PROJET_GERER_FICHIERS", "Administrar los ficheros") ;
define ("PROJET_VOIR_FICHIER", "Ver los ficheros") ;
define ("PROJET_PRENOM", "Nombre") ;
define ("PROJET_MAIL", "Correo ") ;
define ("PROJET_LABEL_PAYS", "Pais") ;
define ("PROJET_DATE_INSCRIPTION", "Fecha de inscripcion") ;
define ("PROJET_STATUT", "Estatu") ;
define ("PROJET_CHEF", "Coordinador") ;
define ("PROJET_PAS_D_INSCRIT", "Ningun inscritoLos ") ;
define ("PROJET_PARTICIPER", "proyectos en los cuales Usted participa") ;
define ("PROJET_VOUS_PARTICIPEZ", "Ustad participa en") ;
define ("PROJET_TOUS", "todos los proyectos.") ;
define ("PROJET_DESTRUCTION_LAIUS", "La Anulacion de un proyecto implica la suprecionde todos los derechos de los usuarios de este proyecto, asi como los lazos que los otros proyectos tienen con el.") ;
define ("PROJET_DESTRUCTION_EFFECTUEE", "Anulacion efectuada") ;
define ("PROJET_GESTION_PROJET", "Administracion del proyecto") ;
define ("PROJET_EN_TANT_QUE", "Mientras tanto ") ;
define ("PROJET_INTERVENIR", "Usted puede intervenir en los items siguientes") ;
define ("PROJET_PROPRIETES", "Propiedades de un proyecto") ;
define ("PROJET_ACTION", "Accion") ;
define ("PROJET_FICHIERS_ASSOCIES", "Los ficheros asociados al proyecto") ;
define ("PROJET_FICHIERS_NOM", "Nombre") ;
define ("PROJET_FICHIERS_CREE_LE", "Creado el") ;
define ("PROJET_FICHIERS_PAR", "Por") ;
define ("PROJET_FICHIERS_TAILLE", "Tamaño") ;
define ("PROJET_RACINE", "Raiz") ;
define ("PROJET_FICHIERS_VISIBILITE", "Visibilidad") ;
define ("PROJET_METTRE_FICHIER", "Hacer un nuevo fichero") ;
define ("PROJET_CREER_REP", "Hacer un nuevo agenda") ;
define ("PROJET_FICHIERS_ACTION", "Accion") ;
define ("PROJET_LEGENDE", "Explicacion") ;
define ("PROJET_LEGENDE_DEPLACE", "Mover un fichero") ;
define ("PROJET_LEGENDE_MODIFIE", "Modificar las informaciones de un documento") ;
define ("PROJET_LEGENDE_SUPPR", "Cancelar un fichero") ;
define ("PROJET_EMAIL", "Correo electronico") ;
define ("PROJET_MOT_DE_PASSE", "Contraseña") ;
define ("PROJET_TEXTE_PERDU", "Si ha perdido su contraseña, indique su correo electronico en el espaciologin y haga clic en Ingresar") ;
 
//================ Partie concernant l'upload de fichier=======================================
define ("PROJET_DOCUMENT_DU_PROJET", "Documento del proyecto") ;
define ("PROJET_FICHIER_MISE_EN_LIGNE", "Puesta en linea de un fichero etapa 2") ;
define ("PROJET_FICHIER_NOM_DOCUMENT", "Sello") ;
define ("PROJET_FICHIER_DESCRIPTION", "Descripci&oacute;n") ;
define ("PROJET_FICHIER_PUBLIC", "para todos") ;
define ("PROJET_FICHIER_PRIVEE", "solo el proyecto") ;
define ("PROJET_FICHIER_TYPE", "Tipo") ;
define ("PROJET_FICHIER_TRANSFERT_T", "Transferencia terminada") ;
define ("PROJET_FICHIER_VALIDER", "Ingresar") ;
define ("PROJET_FICHIER_MODIFIER", "Modificar") ;
define ("PROJET_FICHIER_COLLER", "PEGARCANCELAR") ;
define ("PROJET_FICHIER_LE_FICHIER", "El fichero") ;
define ("PROJET_FICHIER_NOM_DOCUMENT_EXPLICATION", "Saisissez un nom explicite, il correspond ".
"au texte sur lequel il faudra cliquer pour acc&eacute;der au fichier.") ;
define ("PROJET_FICHIER_CONTINUER", "Continuer") ;
// Creacion de la agenda
 
define ("PROJET_REP", "Hacer de nuevo la agenda del proyecto") ;
define ("PROJET_REP_CREER", "Hacer un nuevo agenda") ;
define ("PROJET_REP_MODIFIER", "Modificacion de una agenda ") ;
define ("PROJET_REP_SUPPRIMER", "esta seguro de cancelar la agenda") ;
 
//======= Parte concerniente a los wikis========================================
define ('PROJET_ASSOCIER_WIKI', 'Associer un wikini') ;
define ("PROJET_WIKINI_POSSEDE", "Este proyecto posee un espacio wiki") ;
define ("PROJET_WIKINI_ALLER", "Ir al wiki") ;
define ("PROJET_WIKINI_SUPPRIMER", "Cancelar el wiki") ;
define ("PROJET_WIKINI_CHOISIR_NOM", "Escoja un nombre para el wiki") ;
define ("PROJET_WIKINI_NOM_EXPLICATION", "El nombre debe estar en formato wiki, es decir, sin acentos, sin espacios ycon al menos dos mayusculas. Ej MiProyecto") ;
define ("PROJET_WIKINI_NOM_INVALIDE", "Este no es nombre wiki valido") ;
define ("PROJET_WIKINI_NOM_EXISTE", "Ya existe un wiki con ese nombre!") ;
define ("PROJET_LISTE_PARTICIPANT", "Lista de los particpantes") ;
define ("PROJET_LISTE_PARTICIPANT_LAIUS", "Usted es jefe del proyecto. Puede a ese titulo, modificar el estatu de los participantes o desincribirlos en caso de un problema. Cuidado con las consecuencias que esto puede tener...<br />Como jefe del proyecto, Usted no puede modificar su estatu. Si Usted deseaabandonar esta funcion, hay que hacer la solicitud al administrador delsistema &nbsp;&nbsp;") ;
 
//==================== labels pour projet_liste=======================================================
define ("PROJET_LISTE", "Lista de Proyectos") ;
define ("PROJET_NOMBRE_EN_COURS", "Numéro de proyectos en curso.") ;
 
// ========== Labels pour projet_inscription ===========================================
define ("PROJET_PROJET", "Proyecto") ;
define ("PROJET_VOTRE_STATUT", "Votre statut par rapport au projet") ;
define ("BAZ_EST_INSCRIT_COMME", "est inscrit comme") ;
define ("BAZ_PAS_INSCRIT", "n'est pas inscrit &agrave; ce projet") ;
define ("BAZ_JE_SOUHAITE", "Je souhaite m'inscrire &agrave; ce projet ou modifier mon inscription") ;
define ("BAZ_INSCRIT_CONTRIBUTEUR", "Je m'inscris comme contributeur au projet") ;
define ("BAZ_INSCRIT_OBSERVATEUR", "Je m'inscris comme observateur au projet") ;
define ("BAZ_LAIUS_CONTRIBUTEUR", "Les acteurs d'un projet collaborent activement &agrave; sa r&eacute;alisation en relation avec le chef du projet et l'ensemble des autres membres du projet. Ils ont droit &agrave; citation comme co-auteur des travaux r&eacute;alis&eacute;s.") ;
define ("BAZ_LAIUS_OBSERVATEUR", "Si vous manquez de disponibilit&eacute; ou que vos comp&eacute;tences ne vous permettent pas de travailler activement au projet, vous pouvez cependant suivre son &eacute;volution et apporter vos critiques constructives en vous inscrivant comme observateur. Vous ne pourrez pas, normalement, pr&eacute;tendre &agrave; &ecirc;tre cit&eacute; comme co-auteur du projet") ;
define ("BAZ_INSCRIT_SUPPRIMER", "Je supprime mon inscription") ;
define ("BAZ_LAIUS_DESINSCRIPTION", "Vous ne souhaitez plus, momentan&eacute;ment ou d&eacute;finitivement, participer &agrave; ce projet. Vous pourrez vous r&eacute;inscrire ult&eacute;rieurement.") ;
define ("BAZ_VALIDER", "Valider modification") ;
define ("BAZ_ANNULER", "Annuler") ;
define ("BAZ_RETOUR_LISTE", "Retourner &agrave; la liste des projets") ;
 
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_SUJET", "I-Jumelage : une personne souhaite s'inscrire à un projet ") ;
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_CORPS_1", "La personne avec le mail suivant :\n") ;
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_CORPS_2", "\nsouhaite s'inscrire au projet : \n") ;
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_CORPS_3", "\nEn tant que coordinateur, vous devez modérer cette inscription.") ;
define ("BAZ_DEMANDE_INSCRIPTION_PRISE_EN_COMPTE", "Votre demande d'inscription a &eacute;t;&eacute; transmise aux coordinateurs du projet") ;
?>
/tags/2014_06_04/langues/pro_langue_fr.inc.php
New file
0,0 → 1,281
<?php
/* +-----------------------------------------------------------------------+
* |pro_langue_fr.inc.php |
* +-----------------------------------------------------------------------+
* | Copyright (c) 2001 - 2003 Tela Botanica |
* +-----------------------------------------------------------------------+
* | Module projet, permet la création de projet, avec une gestion de la |
* | propriétés des documents... |
* +-----------------------------------------------------------------------+
* | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
* +-----------------------------------------------------------------------+
 
* $Id: pro_langue_fr.inc.php,v 1.16.2.3 2008-04-16 12:42:11 alexandre_tb Exp $
*/
 
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langue_fr.local.php')) {
include_once PROJET_CHEMIN_APPLI.'langues/pro_langue_fr.local.php' ;
}
 
// LA liste des projet
 
define ('PROJET_TEXTE_NON_IDENTIFIE', 'Vous n\'êtes pas identifié. Identifiez-vous pour accéder à vos projets ou pour vous inscrire aux projets') ;
define ('PROJET_TEXTE_PARTICIPANT_NON_IDENTIFIE', 'Vous n\'êtes pas identifié. Identifiez-vous pour accéder à la liste des participants') ;
 
// ========== Partie concernant la description su projet =================================
 
define ('PROJET_PROJET', 'Projet') ;
define ('PROJET_PAS_DE_PROJET', 'Il n\'y a aucun projet pour le moment.');
define ("PROJET_ALERTE_TITRE", "Le champs titre ne doit pas &ecirc;tre vide") ;
define ("PROJET_TITRE", "Titre") ;
if (!defined ('PROJET_RESUME')) {
define ('PROJET_RESUME', 'Résumé') ;
}
define ('PROJET_SYNTHESE', 'Synthèse') ;
define ("PROJET_DECONNEXION", "D&eacute;connexion") ;
define ("PROJET_ADMINISTRATION", "Administration") ;
define ("PROJET_ADMINISTRATEUR", 'administrateur') ;
define ("PROJET_NOUVEAU_PROJET", "Nouveau projet") ;
define ('PROJET_ACCUEIL', 'Description du projet') ;
define ('PROJET_PERE', 'Projet père') ;
define ('PROJET_MODIFIER_PROPRIETES', 'Modifier le projet') ;
define ("PROJET_DESTRUCTION_PROJET", "Destruction d'un projet") ;
define ("PROJET_GESTION_UTILISATEUR", "Gérer les participants") ;
define ("PROJET_NOUVEAU_UTILISATEUR", "Nouveau participant") ;
define ('PROJET_NOUVEAU_UTILISATEUR_LAIUS', 'Pour ajouter un participant, inscrivez son adresse mail ci-contre et cliquer sur '.PROJET_NOUVEAU_UTILISATEUR) ;
define ("PROJET_MOD_UTILISATEUR", "Modification d'un utilisateur") ;
define ("PROJET_DESTRUCTION_UTILISATEUR", "Suppression d'un utilisateur") ;
define ("PROJET_VOIR_PROJET", "Voir le projet") ;
define ('PROJET_S_INSCRIRE', 'S\'inscrire') ;
define ('PROJET_SE_DESINSCRIRE_LISTE', 'Se désinscrire') ;
define ('PROJET_SE_DESINSCRIRE_CONFIRMATION', 'Etes vous sûr de vouloir vous désinscrire ?') ;
define ("PROJET_GERER", "G&eacute;rer") ;
define ("PROJET_GERER_FICHIER", "G&eacute;rer fichiers") ;
define ("PROJET_VOIR_FICHIER", "Voir fichiers") ;
define ('PROJET_NOM', 'Nom') ;
define ("PROJET_PRENOM", "Pr&eacute;nom") ;
define ("PROJET_MAIL", "E mail") ;
define ('PROJET_DETAIL_PROJET', 'Détail du projet') ;
define ("PROJET_LABEL_PAYS", "Pays") ;
define ("PROJET_DATE_INSCRIPTION", "Date d'inscription") ;
define ("PROJET_STATUT", "Statut") ;
define ('PROJET_VOUS_ETES', 'Vous êtes ') ;
define ("PROJET_CHEF" ,"Coordonnateur") ;
define ('PROJET_CONTRIBUTEUR', 'Participants') ;
define ('PROJET_NON_INSCRIT', 'non inscrit') ;
define ("PROJET_PAS_D_INSCRIT", "Il n' y a pas d'inscrit à ce projet") ;
define ("PROJET_PARTICIPER", "Les projets auxquels vous participez") ;
define ("PROJET_VOUS_PARTICIPEZ", "Vous participez &agrave; ce projet") ;
define ("PROJET_TOUS", "tous les projets.") ;
define ("PROJET_PROJETS", "projets") ;
define ('PROJET_TYPE', 'Type du projet') ;
define ("PROJET_VOTRE_STATUT", "Votre statut") ;
define ("PROJET_ACTION", "Action") ;
define ('PROJET_SUPPRIMER', 'supprimer') ;
define ('PROJET_SUPPRIMER_LE_PROJET', 'Supprimer le projet') ;
define ('PROJET_SUPPRIMER_PROJET_CONFIRMATION', 'Supprimer le projet ?') ;
define ("PROJET_DESTRUCTION_LAIUS", "La destruction d'un projet implique la suppression de tous les droits ".
"de tous les utilisateurs de ce projet, ainsi que les liens que les autres projets ont ".
"avec lui.") ;
define ("PROJET_DESTRUCTION_EFFECTUEE", "Destruction effectu&eacute;e") ;
define ("PROJET_GESTION_PROJET", "Gestion du projet") ;
define ("PROJET_EN_TANT_QUE", "En tant que") ;
define ("PROJET_INTERVENIR", "vous pouvez intervenir sur les items suivants") ;
define ("PROJET_PROPRIETES", "Propri&eacute;t&eacute;s du projet") ;
define ("PROJET_SELECTIONNER", "S&eacute;lectionner un r&eacute;pertoire cible pour") ;
define ("PROJET_PB_COPIE", "Probl&eagrave;me lors de la copie") ;
define ("PROJET_RETABLISSEMENT", "R&eacute;tablissement de la base de donnée...") ;
define ("PROJET_RETBLISSEMENT_EFFECTUE", "R&eacute;tablissement effectu&eacute;. Vous pouvez r&eacute;essayer.") ;
define ("PROJET_METTRE_FICHIER", "Mettre un fichier en ligne") ;
define ("PROJET_CREER_REP", "Cr&eacute;er un r&eacute;pertoire") ;
define ("PROJET_FICHIERS_ASSOCIES", "Les fichiers associ&eacute;s au projet") ;
define ('PROJET_PAS_DE_DOCUMENTS', 'Pas de documents associés à ce projet') ;
define ("PROJET_FICHIERS_NOM", "Nom") ;
define ("PROJET_FICHIERS_CREE_LE", "Cr&eacute;&eacute; le") ;
define ("PROJET_FICHIERS_PAR", "Par") ;
define ("PROJET_FICHIERS_TAILLE", "Taille") ;
define ("PROJET_RACINE", "Racine") ;
define ("PROJET_FICHIERS_VISIBILITE", "Visibilit&eacute;");
define ("PROJET_FICHIERS_ACTION", "Action") ;
define ("PROJET_LEGENDE", "L&eacute;gende") ;
define ("PROJET_LEGENDE_DEPLACE", "D&eacute;place un fichier");
define ("PROJET_LEGENDE_MODIFIE", "Modifie les informations d'un document") ;
define ("PROJET_LEGENDE_SUPPR", "Supprime un fichier");
define ("PROJET_CHAMPS_REQUIS", "D&eacute;signe les champs obligatoires") ;
define ("PROJET_EMAIL", "e-mail") ;
define ("PROJET_MOT_DE_PASSE", "Mot de passe") ;
define ("PROJET_TEXTE_PERDU", "Si vous avez perdu votre mot de passe, indiquer ".
"votre adresse email dans le champs login ci-dessus et cliquez sur \"Valider\"") ;
define ("PROJET_DESCRIPTION", "Description") ;
define ("PROJET_ESPACE_INTERNET", "Espace internet") ;
define ('PROJET_PAS_DE_SITE', 'Pas d\'espace internet externe') ;
define ("PROJET_DESTRUCTION_ALERTE", "Etes-vous sûr de vouloir supprimer ce projet ?") ;
define ("PROJET_MENU_GENERAL", "Menu G&eacute;n&eacute;ral") ;
define ('PROJET_MENU_COORD', 'Menu du coordinateur') ;
define ('PROJET_MENU_CONTRI', 'Menu du Contributeur') ;
define ('PROJET_MENU_OBS', 'Menu de l\'observateur') ;
 
define ('PROJET_CREER_LISTE', 'Créer un forum de discussion') ;
define ('PROJET_LISTE_DE_DISCUSSION', 'Forum de discussion') ;
define ('PROJET_SUPPRIMER_LISTE', 'Supprimer le forum de discussion') ;
define ('PROJET_SUPPRIMER_LISTE_CONFIRMATION', 'Supprimer le forum ?') ;
define ('PROJET_NOM_DE_LA_LISTE', 'Nom du forum') ;
define ('PROJET_NOM_DE_LA_LISTE_REQUIRED', 'Le nom du forum est requis') ;
define ('PROJET_DOMAINE_DE_LA_LISTE', 'Domaine du forum') ;
define ('PROJET_DOMAINE_LISTE_REQUIRED', 'Le domaine est requis') ;
define ('PROJET_MESSAGE_LISTE_DOUBLE', 'Un forum de ce nom la existe déjà') ;
define ('PROJET_PAS_DE_LISTE', 'Pas de forum') ;
define ('PROJET_FORUM', 'Forum') ;
if (!defined ('PROJET_PROPOSER_PROJET')) {
define ('PROJET_PROPOSER_PROJET', '<h1>Proposer un projet</h1><p>');
}
define ('PROJET_RETOUR_RESUME', 'Retour au résumé');
 
define ('PROJET_VOIR_PROFIL', 'Voir le profil de ce participant');
 
define ('PROJET_MODERE', 'Inscription modérée');
define ('PROJET_NON_MODERE', 'Inscription non modérée');
define ('PROJET_INSCRIPTION', 'Inscription') ;
define ('PROJET_DEMANDE_INSCRIPTION', 'Demande d\'inscription au projet');
define ('PROJET_EN_ATTENTE', 'en attente de validation');
 
define ('PROJET_LAIUS_INSCRIPTION_MODERE', 'Votre demande d\'inscription au projet "nom_du_projet" a &eacute;t&eacute; enregistr&eacute;e et
est propos&eacute;e pour acceptation au coordonnateur du projet"<br /><br />
Un accus&eacute; r&eacute;ception vous sera envoy&eacute; à votre courriel d\'inscription
confirmant l\'acception de votre inscription.<br /><br />
Vous pourrez alors acc&eacute;der à toutes les fonctions du projet "nom_du_projet"');
 
// ========== Partie concernant l'upload de fichier =================================
 
define ("PROJET_DOCUMENT_DU_PROJET", "Documents du projet") ;
define ('PROJET_FICHIERS_RECENTS', 'Les derniers documents du projet') ;
define ("PROJET_FICHIER_MISE_EN_LIGNE", "Mise en ligne d'un fichier") ;
define ("PROJET_FICHIER_NOM_DOCUMENT", "Nom du document") ;
define ("PROJET_FICHIER_NOM_DOCUMENT_EXPLICATION", "Saisissez un nom explicite, il correspond ".
"au texte sur lequel il faudra cliquer pour acc&eacute;der au fichier.") ;
define ("PROJET_FICHIER_ALERTE", "Vous devez saisir un nom pour le document") ;
define ("PROJET_FICHIER_DESCRIPTION", "Description") ;
define ("PROJET_FICHIER_PUBLIC", "Tout public") ;
define ("PROJET_FICHIER_PRIVEE", "Projet seulement") ;
define ("PROJET_FICHIER_LE_FICHIER", "Le fichier") ;
define ("PROJET_FICHIER_ALERTE_PAS_DE_FICHIER", "Vous devez sélectionner un fichier") ;
define ("PROJET_FICHIER_CONTINUER", "Continuer") ;
define ("PROJET_FICHIER_MISE_EN_LIGNE_2", "Mise en ligne d'un fichier &eacute;tape 2") ;
define ("PROJET_FICHIER_LABEL", "Label") ;
define ("PROJET_FICHIER_TYPE", "Type") ;
define ("PROJET_FICHIER_TRANSFERT_T", "Transfert termin&eacute;...");
define ("PROJET_FICHIER_VALIDER", "Valider") ;
define ("PROJET_FICHIER_MODIFIER", "Modifier") ;
define ("PROJET_FICHIER_COLLER", "COLLER") ;
define ("PROJET_FICHIER_COUPER", "Déplacer") ;
define ("PROJET_FICHIER_ANNULER", "Annuler") ;
define ("PROJET_FICHIER_SUPPRIMER", "Supprimer") ;
define ('PROJET_CHOISISSEZ_REPERTOIRE', 'Choisissez un répertoire pour ce fichier') ;
define ('PROJET_CHANGER_REPERTOIRE', 'CHANGER UN FICHIER DE REPERTOIRE') ;
define ('PROJET_FICHIER_A_DEPLACER', 'Fichier à déplacer : ') ;
define ('PROJET_DOCUMENT', 'Documents') ;
define ('PROJET_AFFICHAGE_ARBORESCENT', 'Affichage arborescent');
define ('PROJET_AFFICHAGE_CLASSIQUE', 'Affichage classique');
// Création de répertoire
define ("PROJET_REP", "R&eacute;pertoire du projet") ;
define ("PROJET_REP_CREER", "Cr&eacute;ation d'un nouveau r&eacute;pertoire") ;
define ("PROJET_REP_MODIFIER", "Modification d'un r&eacute;pertoire") ;
define ("PROJET_REP_SUPPRIMER", "&ecirc;tes-vous s&ucirc;r de vouloir supprimer le r&eacute;pertoire") ;
 
// ========== Partie concernant les wikini ===========================================
 
define ('PROJET_CREER_WIKI', 'Gestion Wikinis') ;
define ('PROJET_ASSOCIER_WIKI', 'Associer un Wikini');
if (!defined ('PROJET_WIKI_ASSOCIE')) {
define ('PROJET_WIKI_ASSOCIE', 'Espace de rédaction collaborative') ;
}
define ("PROJET_WIKINI_POSSEDE", "Ce projet poss&egrave;de un espace wikini") ;
define ("PROJET_WIKINI_ALLER", "") ;
define ("PROJET_WIKINI_SUPPRIMER", "Supprimer le wikini") ;
define ("PROJET_WIKINI_CHOISIR_NOM", "Choisissez un nom pour le wikini") ;
define ("PROJET_WIKINI_NOM_EXPLICATION", "Le nom doit &ecirc;tre au format wikini, c'est &agrave; dire sans accents, sans espaces et avec au moins deux majuscule. ex MonProjet") ;
define ("PROJET_WIKINI_NOM_INVALIDE", "Ce n'est pas un nom wiki valide") ;
define ("PROJET_WIKINI_NOM_EXISTE", "Il existe d&eacute;j&agrave; un wikini de ce nom la !!") ;
define ("PROJET_WIKINI_PAS", "Pas de Wikini pour ce projet.") ;
define ("PROJET_WIKINI_PAS_REDIR", 'Pour consulter et/ou participer à la rédaction collaborative de ce projet,<br />vous pouvez vous rendre dans le <a class="acceder-outil" href="%s">wikini mis à votre disposition</a>') ;
define ('PROJET_NOM_WIKINI_REQUIS', 'Le nom Wikini est requis') ;
define ('PROJET_PREFIXE_WIKINI', 'Préfixe wikini') ;
define ('PROJET_PREFIXE_WIKINI_REQUIS', 'Le préfixe est requis') ;
if (!defined('PROJET_WIKINI')) {
define ('PROJET_WIKINI', 'Wikini') ;
}
define ("PROJET_NOM_WIKINI", "Nom Wikini") ;
define ("PROJET_PAGE_WIKINI", "Page de démarrage") ;
define ("PROJET_CHOISIR_WIKINI", "Choisir") ;
define ("PROJET_SELECTIONNER_WIKINI", "Selection") ;
 
 
define ("PROJET_LISTE_PARTICIPANT", "Liste des participants") ;
define ("PROJET_LISTE_PARTICIPANT_LAIUS", "Vous &ecirc;tes chef du projet. Vous pouvez &agrave; ce titre, modifier le statut ".
"des participants ou les d&eacute;sinscrire en cas de probl&egrave;me.<br />".
"ttention aux cons&eacute;quences que cela peut avoir...<br />".
"En tant que chef de projet, vous ne pouvez pas modifier votre statut. Si vous souhaitez abandonner ".
"cette fonction, il faut en faire la demande &agrave; l'administrateur du syst&egrave;me&nbsp;&nbsp;") ;
define ("PROJET_DESINSCRIRE_SUR", "&ecirc;tes-vous s&ucirc;r de vouloir d&eacute;sinscrire") ;
define ('PROJET_MAIL_ABSENT', 'L\'email que vous avez saisi n\'est pas dans l\'annuaire') ;
define ('PROJET_ALLER_SUR_WIKINI', 'Entrer dans la page') ;
 
// ========== Labels pour projet_liste ===========================================
 
define ("PROJET_LISTE", "Liste des projets") ;
define ('PROJET_TOUS_LES_PROJETS', 'Les autres projets du réseau') ;
define ("PROJET_NOMBRE_EN_COURS" ,"Nombre de projets en cours") ;
if (!defined ('PROJET_INSCRIT_AUCUN_PROJET')) define ('PROJET_INSCRIT_AUCUN_PROJET', 'Vous n\'êtes inscrit à aucun projet<br />
- <a href="http://www.tela-botanica.org/page:aide_projet">Qu\'est-ce qu\'un projet ?</a><br />
Le réseau Tela Botanica est organisé autour de projets, discussions ou
échanges liés à  la botanique. Vous pouvez y participer en vous
inscrivant.') ;
define ('PROJET_CREATION_LISTE', 'Création d\'un forum de discussion') ;
define ('PROJET_LISTES_EXTERNES_ASSOCIEES', 'Forum associé du projet') ;
define ('PROJET_REFERENCER_LISTE', 'Référencer un forum externe') ;
 
// ========== Labels pour projet_inscription ===========================================
 
define ("PROJET_VOTRE_STATUT_AU_PROJET", "Votre statut par rapport au projet") ;
if (!defined ('PROJET_INSCRIPTION_LISTE_NORMAL')) define ('PROJET_INSCRIPTION_LISTE_NORMAL', 'Je reçois les messages du forum') ;
if (!defined ('PROJET_INSCRIPTION_LISTE_RESUME')) define ('PROJET_INSCRIPTION_LISTE_RESUME', 'Je m\'inscrit à la version résumé du forum') ;
if (!defined ('PROJET_INSCRIPTION_PAS_DE_MAIL')) define ('PROJET_INSCRIPTION_PAS_DE_MAIL', 'Je ne souhaite pas recevoir de messages de ce forum') ;
define ('PROJET_INSCRIPTION_PROJET', 'Inscription au projet') ;
define ('PROJET_S_INSCRIRE_AU_PROJET', 'S\'inscrire au projet') ;
define ('PROJET_MESSAGE_LISTE', 'Messages du forum') ;
define ('PROJET_ADRESSE_ECRIRE', 'Adresse pour écrire au forum') ;
define ('PROJET_TOUS_LES_MESSAGES', 'Tous les messages') ;
define ('PROJET_DERNIERS_MESSAGES', 'Derniers messages du forum du projet') ;
define ('PROJET_DERNIER_MESSAGE', 'Dernier message') ;
define ('PROJET_MESSAGE_DU_MOIS', 'Messages du mois ') ;
define ('PROJET_RECEVOIR_MESSAGES', 'Recevoir les messages') ;
define ('PROJET_NE_PAS_RECEVOIR_MESSAGES', 'Ne plus recevoir de messages') ;
define ('PROJET_MESSAGES_DE', 'Messages de ') ;
define ('PROJET_FILE_DE_DISCUSSION', 'fil de discussion') ;
define ('PROJET_VOUS_N_ETES_PAS_INSCRIT', 'Vous n\'êtes pas inscrit à ce projet') ;
define ('PROJET_VOUS_ETES_PARTICIPANT', 'Vous êtes participant à ce projet') ;
define ('PROJET_SE_DESINSCRIRE', 'Se désinscrire du projet') ;
 
 
// ======================= Labels pour l'envoie d'email ==================================
define ("PROJET_MAIL_TITRE", "Titre") ;
define ("PROJET_MAIL_TITRE_REQUIS", "Vous devez indiquer au moins un titre") ;
define ("PROJET_MAIL_CORPS", "Corps") ;
define ("PROJET_ECRIRE_LISTE", "Ecrire au forum") ;
define ('PROJET_LISTES_ASSOCIEES', 'Forum associé au projet') ;
 
define ('PROJET_RECEVOIR_LES_MESSAGES', 'Recevoir les messages') ;
define ('PROJET_NE_PAS_RECEVOIR', 'Pas de messages') ;
define ('PROJET_RECEVOIR_DES_RESUMES', 'Recevoir des résumés') ;
define ('PROJET_VOUS_ETES_INSCRIT', 'Vous êtes inscrit à ce forum.') ;
define ('PROJET_LISTE_PRIVE', 'Vous devez inscrit pour être');
// Label pour l'affichage des messages dans le forum
define ('PROJET_PRECEDENT', 'précédent') ;
define ('PROJET_SUIVANT', 'suivant') ;
define ('PROJET_REPONDRE', 'répondre') ;
define ('PROJET_REDIGER_REPONSE', 'Rédiger votre réponse') ;
define ('PROJET_FORUMS_VISIBILITE', 'Forum public') ;
define ('PROJET_OUI', 'oui') ;
define ('PROJET_NON', 'non') ;
define ('PROJET_MESSAGE_LISTE_PRIVEE', 'Cette liste est privée, vous devez être inscrit au projet pour y accéder') ;
?>
/tags/2014_06_04/langues/pro_langue_en.inc.php
New file
0,0 → 1,243
<?php
/* +-----------------------------------------------------------------------+
* |pro_langue_fr.inc.php |
* +-----------------------------------------------------------------------+
* | Copyright (c) 2001 - 2003 Tela Botanica |
* +-----------------------------------------------------------------------+
* | Module projet, permet la création de projet, avec une gestion de la |
* | propriétés des documents... |
* +-----------------------------------------------------------------------+
* | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
* +-----------------------------------------------------------------------+
 
* $Id: pro_langue_fr.inc.php,v 1.17 2008-02-08 09:05:21 alexandre_tb Exp $
*/
 
 
// LA liste des projet
 
define ('PROJET_TEXTE_NON_IDENTIFIE', 'You are not logged in. Log in to access your projects or to subscribe projects') ;
define ('PROJET_TEXTE_PARTICIPANT_NON_IDENTIFIE', 'You are not logged in. Log in to access the participant list.') ;
define ('PROJET_S_INSCRIRE', 'Subscribe') ;
define ('PROJET_S_INSCRIRE_AU_PROJET', 'Subscribe to this project') ;
define ('PROJET_MESSAGE_LISTE_PRIVEE', 'This list is private. You have to be logged in to access.') ;
define ('PROJET_VOUS_ETES', 'You are ') ;
define ('PROJET_VOUS_N_ETES_PAS_INSCRIT', 'You are not member of this project') ;
define ('PROJET_VOUS_ETES_PARTICIPANT', 'You are a member of this project') ;
define ('PROJET_CONTRIBUTEUR', 'Participants') ;
define ('PROJET_INSCRIPTION_PROJET', 'Project subscription') ;
define ('PROJET_MESSAGE_LISTE', 'Forum messages') ;
define ('PROJET_INSCRIPTION_LISTE_NORMAL', 'I want a copy of each message in my email box') ;
define ('PROJET_INSCRIPTION_PAS_DE_MAIL', 'I don\'t want to receive email. I will consult messages via the Forum tab.') ;
define ("PROJET_FICHIER_ANNULER", "Cancel") ;
define ('PROJET_LAIUS_INSCRIPTION_MODERE', 'Your subscription demand has been transfered to project manager. A confirmation email will be sent to you as soon as you subription will be accepted. Then you will have access to every function');
define ('PROJET_FERMER_FENETRE', 'Close window');
 
define ('PROJET_EN_ATTENTE', 'Waiting validation by project manager');
define ('PROJET_MODERE', 'Moderate subscription');
define ('PROJET_NON_MODERE', 'Free subscription');
define ('PROJET_INSCRIPTION', 'Inscription') ;
define ("PROJET_NOUVEAU_UTILISATEUR", "New user") ;
 
define ('PROJET_NOM', 'First name');
define ('PROJET_PRENOM', 'Last name');
define ('PROJET_MAIL', 'Email');
define ('PROJET_DATE_INSCRIPTION', 'Subscription date');
define ('PROJET_STATUT', 'Status');
define ('PROJET_LISTE_DE_DISCUSSION', 'Forum');
define ('PROJET_FICHIER_SUPPRIMER', 'Delete');
 
define('PROJET_INSCRIT', 'Registered');
define('PROJET_NON_INSCRIT', 'Non registered');
define ('PROJET_SE_DESINSCRIRE', 'Unsubscribe project') ;
define ('PROJET_DOCUMENT', 'Documents') ;
define ('PROJET_FORUM', 'Forum') ;
 
define ('PROJET_ADRESSE_ECRIRE', 'Email adress to write to forum') ;
define ('PROJET_TOUS_LES_MESSAGES', 'All the messages') ;
 
define ("PROJET_ECRIRE_LISTE", "Send a message") ;
define ('PROJET_NE_PAS_RECEVOIR_MESSAGES', 'Do not receive messages by mail') ;
define ('PROJET_CREER_LISTE', 'Create a Forum') ;
define ('PROJET_LISTE_DE_DISCUSSION', 'Forum') ;
define ('PROJET_SUPPRIMER_LISTE', 'Delete Forum') ;
define ('PROJET_SUPPRIMER_LISTE_CONFIRMATION', 'Delete forum ?') ;
define ('PROJET_NOM_DE_LA_LISTE', 'Forum name') ;
define ('PROJET_NOM_DE_LA_LISTE_REQUIRED', 'Forum name is required') ;
define ('PROJET_DOMAINE_DE_LA_LISTE', 'Forum domain') ;
define ('PROJET_DOMAINE_LISTE_REQUIRED', 'Domain is required') ;
define ('PROJET_MESSAGE_LISTE_DOUBLE', 'Forum already exists') ;
define ('PROJET_PAS_DE_LISTE', 'No forum') ;
define ('PROJET_FORUM', 'Forum') ;
if (!defined ('PROJET_PROPOSER_PROJET')) {
define ('PROJET_PROPOSER_PROJET', '<h1>Propose a project</h1><p>');
}
define ('PROJET_RETOUR_RESUME', 'Back to summary');
define ('PROJET_REFERENCER_LISTE', 'Associate an external forum') ;
define ('PROJET_MODIFIER_PROPRIETES', 'Edit project') ;
define ('PROJET_SUPPRIMER_LE_PROJET', 'Delete project') ;
define ('PROJET_SUPPRIMER_PROJET_CONFIRMATION', 'Delete project ?') ;
define ('PROJET_CREER_WIKI', 'Manage wikinis') ;
define ('PROJET_ASSOCIER_WIKI', 'Associate a Wikini');
 
define ('PROJET_NOUVEAU_UTILISATEUR_LAIUS', 'For adding one new participant, fill-in the mail field and click on '.PROJET_NOUVEAU_UTILISATEUR) ;
define ("PROJET_FICHIER_COUPER", "Move") ;
 
define ("PROJET_CHAMPS_REQUIS", "Required fields") ;
 
define ("PROJET_MAIL_TITRE", "Title") ;
define ("PROJET_MAIL_TITRE_REQUIS", "Title is required") ;
define ("PROJET_MAIL_CORPS", "Body") ;
 
define ('PROJET_LISTES_ASSOCIEES', 'Forum associated to project') ;
define ('PROJET_RECEVOIR_MESSAGES', 'Receive forum message by mail') ;
define ("PROJET_TITRE", "Title") ;
 
 
// ========== Onglets ===============================
define ('PROJET_SYNTHESE', 'Summary') ;
define ('PROJET_DESCRIPTION', 'Description') ;
define ('PROJET_WIKINI', 'Wikini') ;
 
// ========== Synthèse ===============================
define ('PROJET_RESUME', 'Summary') ;
define ('PROJET_WIKI_ASSOCIE', 'Linked wiki') ;
define ('PROJET_ALLER_SUR_WIKINI', 'Go to wiki') ;
define ('PROJET_ESPACE_INTERNET', 'Home page') ;
define ('PROJET_PAS_DE_SITE', 'No external website') ;
define ('PROJET_DERNIERS_MESSAGES', 'Last message in the discussion list') ;
define ('PROJET_FICHIERS_RECENTS', 'Last uploaded files') ;
define ('PROJET_PAS_DE_DOCUMENTS', 'No associated documents') ;
 
// ========== Partie concernant la description su projet =================================
define ("PROJET_ALERTE_TITRE", "The title field must be filled in") ;
define ("PROJET_DECONNEXION", "Sign off") ;
define ("PROJET_ADMINISTRATION", "Administration") ;
define ("PROJET_ADMINISTRATEUR", "Administrator") ;
define ("PROJET_NOUVEAU_PROJET", "New project") ;
define ("PROJET_DESTRUCTION_PROJET", "Cancel a project") ;
define ("PROJET_GESTION_UTILISATEUR", "Users administration") ;
define ("PROJET_NOUVEAU_UTILISATEUR", "New user") ;
define ("PROJET_MOD_UTILISATEUR", "User modification") ;
define ("PROJET_DESTRUCTION_UTILISATEUR", "Delete a user") ;
define ("PROJET_GERER", "Administrate") ;
define ("PROJET_GERER_FICHIER", "Files administration") ;
define ("PROJET_VOIR_PROJET", "To see the project") ;
define ("PROJET_VOIR_FICHIER", "See files") ;
define ("PROJET_PRENOM", "First name") ;
define ("PROJET_MAIL", "E-mail") ;
define ("PROJET_LABEL_PAYS", "Country") ;
define ("PROJET_DATE_INSCRIPTION", "Registration date") ;
define ("PROJET_STATUT", "Status") ;
define ("PROJET_CHEF", "Coordinator") ;
define ("PROJET_PAS_D_INSCRIT", "No registered user") ;
define ("PROJET_PARTICIPER", "Projects you are participating in") ;
define ("PROJET_VOUS_PARTICIPEZ", "you are participating in") ;
define ("PROJET_TOUS", "all projects.") ;
define ("PROJET_PROJETS", "projects") ;
define ("PROJET_VOTRE_STATUT", "Your status") ;
define ("PROJET_ACTION", "Action") ;
define ("PROJET_DESTRUCTION_LAIUS", "The cancellation of a project implies the end of all the rights of its".
"users, as well as the links with other projects.") ;
define ("PROJET_DESTRUCTION_EFFECTUEE", "Cancellation done") ;
define ("PROJET_GESTION_PROJET", "Project administration") ;
define ("PROJET_EN_TANT_QUE", "As") ;
define ("PROJET_INTERVENIR", "You can take part in the following items") ;
define ("PROJET_PROPRIETES", "Project ownership") ;
define ("PROJET_SELECTIONNER", "Select a target directory") ;
define ("PROJET_PB_COPIE", "A problem has been encountered while copying") ;
define ("PROJET_RETABLISSEMENT", "Restoration of the data base") ;
define ("PROJET_RETBLISSEMENT_EFFECTUE", "Restoration done. You can try again.") ;
define ("PROJET_METTRE_FICHIER", "Publish a file on line") ;
define ("PROJET_CREER_REP", "Create a directory") ;
define ("PROJET_FICHIERS_ASSOCIES", "Files associated to this project") ;
define ("PROJET_FICHIERS_NOM", "Name") ;
define ("PROJET_FICHIERS_CREE_LE", "Created on the") ;
define ("PROJET_FICHIERS_PAR", "By") ;
define ("PROJET_FICHIERS_TAILLE", "Size") ;
define ("PROJET_RACINE", "Usenet hierarchy") ;
define ("PROJET_FICHIERS_VISIBILITE", "Visibility") ;
define ("PROJET_FICHIERS_ACTION", "Action") ;
define ("PROJET_LEGENDE", "Legend") ;
define ("PROJET_LEGENDE_DEPLACE", "Move a file") ;
define ("PROJET_LEGENDE_MODIFIE", "Modify the informations of a document") ;
define ("PROJET_LEGENDE_SUPPR", "Delete a file") ;
 
define ("PROJET_EMAIL", "E-mail") ;
define ("PROJET_MOT_DE_PASSE", "Password") ;
define ("PROJET_TEXTE_PERDU", "If you forgot your password, enter your e-mail address in the Login ".
"field below and click on Validate");
 
// ========== Partie concernant l'upload de fichier =================================
 
define ("PROJET_DOCUMENT_DU_PROJET", "Project document") ;
define ("PROJET_FICHIER_MISE_EN_LIGNE", "Publish a file online, step 1") ;
define ("PROJET_FICHIER_NOM_DOCUMENT", "Name of the document") ;
define ("PROJET_FICHIER_NOM_DOCUMENT_EXPLICATION", "Enter an explicit name since it will correspond to the text giving ".
"access to the file with a click.") ;
define ("PROJET_FICHIER_DESCRIPTION", "Description") ;
define ("PROJET_FICHIER_PUBLIC", "All type of users") ;
define ("PROJET_FICHIER_PRIVEE", "Project only") ;
define ("PROJET_FICHIER_LE_FICHIER", "The file") ;
define ("PROJET_FICHIER_CONTINUER", "Continue") ;
define ("PROJET_FICHIER_MISE_EN_LIGNE_2", "Publish a file online, step 2") ;
define ("PROJET_FICHIER_LABEL", "Label") ;
define ("PROJET_FICHIER_TYPE", "Type") ;
define ("PROJET_FICHIER_TRANSFERT_T", "File transfer done...") ;
define ("PROJET_FICHIER_VALIDER", "Validate") ;
define ("PROJET_FICHIER_MODIFIER", "Edit") ;
define ("PROJET_FICHIER_COLLER", "PASTE") ;
define ("", "CANCEL") ;
 
// Directory creation
define ("PROJET_REP", "Project directory") ;
define ("PROJET_REP_CREER", "Creation of a new directory") ;
define ("PROJET_REP_MODIFIER", "Modification of a directory") ;
define ("PROJET_REP_SUPPRIMER", "Are you sure you want to delete this directory.") ;
 
// ========== Partie concernant les wikini ===========================================
 
define ('PROJET_ASSOCIER_WIKI', 'Associer un wikini') ;
define ("PROJET_WIKINI_POSSEDE", "This project has a wiki site") ;
define ("PROJET_WIKINI_ALLER", "Go on the wiki site") ;
define ("PROJET_WIKINI_SUPPRIMER", "Supress wiki ") ;
define ("PROJET_WIKINI_CHOISIR_NOM", "Choose a name for the wiki") ;
define ("PROJET_WIKINI_NOM_EXPLICATION", "The name has to be in wiki format, this means without accents, without ".
"spaces and with at least two capital letters. ex MyProject.") ;
define ("PROJET_WIKINI_NOM_INVALIDE", "This is not a valid wiki name") ;
define ("PROJET_WIKINI_NOM_EXISTE", "This wiki name already exists!") ;
define ("PROJET_LISTE_PARTICIPANT", "Participants list") ;
define ("PROJET_LISTE_PARTICIPANT_LAIUS", "As project manager you are allowed to modify the status of the ".
"participants or unsubscribe them if necessary.<br /> ".
"Attention! this action can have some consequences...<br /> ".
"As project manager, you cannot modify your own status. If you wish to ".
"leave this function, ask the system administrator. &nbsp;&nbsp; ");
define ("PROJET_DESINSCRIRE_SUR", "Are you sure you want to unsubscribe?") ;
 
// ========== Labels pour projet_liste ===========================================
 
define ("PROJET_LISTE", "Projects list") ;
define ("PROJET_NOMBRE_EN_COURS", "Number of projects in progress") ;
 
// ========== Labels pour projet_inscription ===========================================
define ("PROJET_PROJET", "Project") ;
define ("PROJET_VOTRE_STATUT", "Your status") ;
define ("BAZ_EST_INSCRIT_COMME", "is registered as") ;
define ("BAZ_PAS_INSCRIT", "is not registered for this project") ;
define ("BAZ_JE_SOUHAITE", "I want to be a member of the project's team") ;
define ("BAZ_INSCRIT_CONTRIBUTEUR", "I want to be an active member in this project") ;
define ("BAZ_INSCRIT_OBSERVATEUR", "I want to be an observer in this project") ;
define ("BAZ_LAIUS_CONTRIBUTEUR", "Active members work in collaboration with the project manager and with members of the team. They appear as co-author of resulting achievements.") ;
define ("BAZ_LAIUS_OBSERVATEUR", "If you do not have the opportunity or skills to be an active member, you can still register as an observer in order to bring your own personal remarks throughout the steps of the project. However you will not be considered as co-author.") ;
define ("BAZ_INSCRIT_SUPPRIMER", "I don't want to be part of the project team") ;
define ("BAZ_LAIUS_DESINSCRIPTION", "You do not wish to be part of the project team. You can still register in the future.") ;
define ("BAZ_VALIDER", "Update changes") ;
define ("BAZ_ANNULER", "Cancel") ;
define ("BAZ_RETOUR_LISTE", "Back to project list") ;
 
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_SUJET", "I-Jumelage : une personne souhaite s'inscrire à un projet ") ;
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_CORPS_1", "La personne avec le mail suivant :\n") ;
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_CORPS_2", "\nsouhaite s'inscrire au projet : \n") ;
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_CORPS_3", "\nEn tant que coordinateur, vous devez modérer cette inscription.") ;
define ("BAZ_DEMANDE_INSCRIPTION_PRISE_EN_COMPTE", "Votre demande d'inscription a &eacute;t;&eacute; transmise aux coordinateurs du projet") ;
?>
/tags/2014_06_04/langues/pro_langue_pt.inc.php
New file
0,0 → 1,150
<?php
/* +-----------------------------------------------------------------------+
* |pro_langue_en.inc.php |
* +-----------------------------------------------------------------------+
* | Copyright (c) 2001 - 2004 Tela Botanica |
* +-----------------------------------------------------------------------+
* | Module projet, permet la création de projet, avec une gestion de la |
* | propriétés des documents... |
* +-----------------------------------------------------------------------+
* | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
* +-----------------------------------------------------------------------+
 
* $Id: pro_langue_pt.inc.php,v 1.3 2005-09-28 16:29:39 ddelon Exp $
*/
 
 
// ========== Partie concernant la description su projet =================================
define ("PROJET_ALERTE_TITRE", "The title field must be filled in") ;
define ("PROJET_DECONNEXION", "Sign off") ;
define ("PROJET_ADMINISTRATION", "Administration") ;
define ("PROJET_ADMINISTRATEUR", "Administrator") ;
define ("PROJET_NOUVEAU_PROJET", "New project") ;
define ("PROJET_DESTRUCTION_PROJET", "Cancel a project") ;
define ("PROJET_GESTION_UTILISATEUR", "Users administration") ;
define ("PROJET_NOUVEAU_UTILISATEUR", "New user") ;
define ("PROJET_MOD_UTILISATEUR", "User modification") ;
define ("PROJET_DESTRUCTION_UTILISATEUR", "Delete a user") ;
define ("PROJET_GERER", "Administrate") ;
define ("PROJET_GERER_FICHIER", "Files administration") ;
define ("PROJET_VOIR_PROJET", "To see the project") ;
define ("PROJET_VOIR_FICHIER", "See files") ;
define ("PROJET_PRENOM", "First name") ;
define ("PROJET_MAIL", "E-mail") ;
define ("PROJET_LABEL_PAYS", "Country") ;
define ("PROJET_DATE_INSCRIPTION", "Registration date") ;
define ("PROJET_STATUT", "Status") ;
define ("PROJET_CHEF", "Coordinator") ;
define ("PROJET_PAS_D_INSCRIT", "No registered user") ;
define ("PROJET_PARTICIPER", "Projects you are participating in") ;
define ("PROJET_VOUS_PARTICIPEZ", "you are participating in") ;
define ("PROJET_TOUS", "all projects.") ;
define ("PROJET_PROJETS", "projects") ;
define ("PROJET_VOTRE_STATUT", "Your status") ;
define ("PROJET_ACTION", "Action") ;
define ("PROJET_DESTRUCTION_LAIUS", "The cancellation of a project implies the end of all the rights of its".
"users, as well as the links with other projects.") ;
define ("PROJET_DESTRUCTION_EFFECTUEE", "Cancellation done") ;
define ("PROJET_GESTION_PROJET", "Project administration") ;
define ("PROJET_EN_TANT_QUE", "As") ;
define ("PROJET_INTERVENIR", "You can take part in the following items") ;
define ("PROJET_PROPRIETES", "Project ownership") ;
define ("PROJET_SELECTIONNER", "Select a target directory") ;
define ("PROJET_PB_COPIE", "A problem has been encountered while copying") ;
define ("PROJET_RETABLISSEMENT", "Restoration of the data base") ;
define ("PROJET_RETBLISSEMENT_EFFECTUE", "Restoration done. You can try again.") ;
define ("PROJET_METTRE_FICHIER", "Publish a file on line") ;
define ("PROJET_CREER_REP", "Create a directory") ;
define ("PROJET_FICHIERS_ASSOCIES", "Files associated to this project") ;
define ("PROJET_FICHIERS_NOM", "Name") ;
define ("PROJET_FICHIERS_CREE_LE", "Created on the") ;
define ("PROJET_FICHIERS_PAR", "By") ;
define ("PROJET_FICHIERS_TAILLE", "Size") ;
define ("PROJET_RACINE", "Usenet hierarchy") ;
define ("PROJET_FICHIERS_VISIBILITE", "Visibility") ;
define ("PROJET_FICHIERS_ACTION", "Action") ;
define ("PROJET_LEGENDE", "Legend") ;
define ("PROJET_LEGENDE_DEPLACE", "Move a file") ;
define ("PROJET_LEGENDE_MODIFIE", "Modify the informations of a document") ;
define ("PROJET_LEGENDE_SUPPR", "Delete a file") ;
 
define ("PROJET_EMAIL", "E-mail") ;
define ("PROJET_MOT_DE_PASSE", "Password") ;
define ("PROJET_TEXTE_PERDU", "If you forgot your password, enter your e-mail address in the Login ".
"field below and click on Validate");
 
 
// ========== Partie concernant l'upload de fichier =================================
 
define ("PROJET_DOCUMENT_DU_PROJET", "Project document") ;
define ("PROJET_FICHIER_MISE_EN_LIGNE", "Publish a file online, step 1") ;
define ("PROJET_FICHIER_NOM_DOCUMENT", "Name of the document") ;
define ("PROJET_FICHIER_NOM_DOCUMENT_EXPLICATION", "Enter an explicit name since it will correspond to the text giving ".
"access to the file with a click.") ;
define ("PROJET_FICHIER_DESCRIPTION", "Description") ;
define ("PROJET_FICHIER_PUBLIC", "All type of users") ;
define ("PROJET_FICHIER_PRIVEE", "Project only") ;
define ("PROJET_FICHIER_LE_FICHIER", "The file") ;
define ("PROJET_FICHIER_CONTINUER", "Continue") ;
define ("PROJET_FICHIER_MISE_EN_LIGNE_2", "Publish a file online, step 2") ;
define ("PROJET_FICHIER_LABEL", "Label") ;
define ("PROJET_FICHIER_TYPE", "Type") ;
define ("PROJET_FICHIER_TRANSFERT_T", "File transfer done...") ;
define ("PROJET_FICHIER_VALIDER", "Validate") ;
define ("PROJET_FICHIER_MODIFIER", "MODIFY-") ;
define ("PROJET_FICHIER_COLLER", "PASTE") ;
define ("", "CANCEL") ;
 
// Directory creation
define ("PROJET_REP", "Project directory") ;
define ("PROJET_REP_CREER", "Creation of a new directory") ;
define ("PROJET_REP_MODIFIER", "Modification of a directory") ;
define ("PROJET_REP_SUPPRIMER", "Are you sure you want to delete this directory.") ;
 
// ========== Partie concernant les wikini ===========================================
 
define ('PROJET_ASSOCIER_WIKI', 'Associer un wikini');
define ("PROJET_WIKINI_POSSEDE", "This project has a wiki site") ;
define ("PROJET_WIKINI_ALLER", "Go on the wiki site") ;
define ("PROJET_WIKINI_SUPPRIMER", "Supress wiki ") ;
define ("PROJET_WIKINI_CHOISIR_NOM", "Choose a name for the wiki") ;
define ("PROJET_WIKINI_NOM_EXPLICATION", "The name has to be in wiki format, this means without accents, without ".
"spaces and with at least two capital letters. ex MyProject.") ;
define ("PROJET_WIKINI_NOM_INVALIDE", "This is not a valid wiki name") ;
define ("PROJET_WIKINI_NOM_EXISTE", "This wiki name already exists!") ;
define ("PROJET_LISTE_PARTICIPANT", "Participants list") ;
define ("PROJET_LISTE_PARTICIPANT_LAIUS", "As project manager you are allowed to modify the status of the ".
"participants or unsubscribe them if necessary.<br /> ".
"Attention! this action can have some consequences...<br /> ".
"As project manager, you cannot modify your own status. If you wish to ".
"leave this function, ask the system administrator. &nbsp;&nbsp; ");
define ("PROJET_DESINSCRIRE_SUR", "Are you sure you want to unsubscribe?") ;
 
// ========== Labels pour projet_liste ===========================================
 
define ("PROJET_LISTE", "Projects list") ;
define ("PROJET_NOMBRE_EN_COURS", "Number of projects in progress") ;
 
// ========== Labels pour projet_inscription ===========================================
define ("PROJET_PROJET", "Project") ;
define ("PROJET_VOTRE_STATUT", "Your status") ;
define ("BAZ_EST_INSCRIT_COMME", "is registered as") ;
define ("BAZ_PAS_INSCRIT", "is not registered for this project") ;
define ("BAZ_JE_SOUHAITE", "I want to be a member of the project's team") ;
define ("BAZ_INSCRIT_CONTRIBUTEUR", "I want to be an active member in this project") ;
define ("BAZ_INSCRIT_OBSERVATEUR", "I want to be an observer in this project") ;
define ("BAZ_LAIUS_CONTRIBUTEUR", "Active members work in collaboration with the project manager and with members of the team. They appear as co-author of resulting achievements.") ;
define ("BAZ_LAIUS_OBSERVATEUR", "If you do not have the opportunity or skills to be an active member, you can still register as an observer in order to bring your own personal remarks throughout the steps of the project. However you will not be considered as co-author.") ;
define ("BAZ_INSCRIT_SUPPRIMER", "I don't want to be part of the project team") ;
define ("BAZ_LAIUS_DESINSCRIPTION", "You do not wish to be part of the project team. You can still register in the future.") ;
define ("BAZ_VALIDER", "Update changes") ;
define ("BAZ_ANNULER", "Cancel") ;
define ("BAZ_RETOUR_LISTE", "Back to project list") ;
 
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_SUJET", "I-Jumelage : une personne souhaite s'inscrire à un projet ") ;
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_CORPS_1", "La personne avec le mail suivant :\n") ;
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_CORPS_2", "\nsouhaite s'inscrire au projet : \n") ;
define ("BAZ_MAIL_DEMANDE_INSCRIPTION_CORPS_3", "\nEn tant que coordinateur, vous devez modérer cette inscription.") ;
define ("BAZ_DEMANDE_INSCRIPTION_PRISE_EN_COMPTE", "Votre demande d'inscription a &eacute;t;&eacute; transmise aux coordinateurs du projet") ;
?>
 
/tags/2014_06_04/squelettes/document.tpl.html
New file
0,0 → 1,28
<h1><?= PROJET_PROJET ; ?> : <?= $projet->getTitre(); ?></h1>
<div id="projet_bloc_action">
<?php if (!$loggue) : ?>
<?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?>
<?php endif; ?>
<?php if ($loggue && $droits == PROJET_DROIT_AUCUN) : ?><?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?><br style="clear:both;" /><?php endif; ?>
<?php if ($droits == PROJET_DROIT_EN_ATTENTE) : ?>
<div id="projet_lien_login">
<a href="<?= $lien_login; ?>">En attente de validation</a>
<p><?= $laius_inscription_modere; ?></p>
</div>
<?php endif; ?>
</div>
<?php if (!$loggue) : ?><br style="clear:left" /><?php endif; ?>
<?= $bouton_desinscription_projet;?>
<h2><?php echo PROJET_DOCUMENT_DU_PROJET; ?></h2>
 
<?php if ($loggue && ($droits < PROJET_DROIT_AUCUN)) : ?>
<?= $bouton_deposer_doc; ?>
<?= $bouton_creer_repertoire; ?>
<?php endif; ?>
<?php echo $html_no_script; ?>
<?php if ($pas_de_document) : ?>
<p class="information">Ce dossier ne contient pas de documents.</p>
<?php else : ?>
<?php echo $html_document; ?>
<?php endif; ?>
<br style="clear:both" />
/tags/2014_06_04/squelettes/resume.tpl.html
New file
0,0 → 1,36
<h1><?= PROJET_PROJET ; ?> : <?= $projet->getTitre(); ?></h1>
<?php if (isset($message_retour)) echo $message_retour; ?>
<div id="projet_bloc_action">
<?php if (!$loggue) : ?>
<?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?>
<!-- <div id="projet_ou">OU</div>
<?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_login.tpl.html'; ?> -->
<br style="clear:left;" />
<?php endif; ?>
<?php if ($loggue && $droits == PROJET_DROIT_AUCUN) : ?><?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?><br style="clear:both;" /><?php endif; ?>
<?php if ($droits == PROJET_DROIT_EN_ATTENTE) : ?>
<div id="projet_lien_login">
<a href="<?= $lien_login; ?>">En attente de validation</a>
<p><?= $laius_inscription_modere; ?></p>
</div>
<?php endif; ?>
</div>
<h2><?= PROJET_RESUME ;?></h2>
<?= $bouton_resume; ?>
 
<div><?= $resume; ?></div>
 
<h2><?= PROJET_WIKI_ASSOCIE ; ?></h2>
<?= $wiki_res ; ?>
<?= $sortie_web ; ?>
<h2><?= PROJET_DERNIERS_MESSAGES ; ?></h2>
<?php if (!$avoir_liste_externe) echo $bouton_poster; ?><br />
<?= $liste_ext_res.$sortie_liste ; ?>
 
<h2><?= PROJET_FICHIERS_RECENTS; ?></h2>
<?= $bouton_deposer_doc; ?>
<?= $vue_liste_document->toHTML('', '') ; ?>
<br style="clear:both" />
<?= $bouton_desinscription_projet;?>
/tags/2014_06_04/squelettes/participants.tpl.html
New file
0,0 → 1,87
<h1><?= PROJET_PROJET ; ?> : <?= $projet->getTitre(); ?></h1>
<div id="projet_bloc_action">
<?php if (!$loggue) : ?>
<?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?>
<p><?php echo PROJET_TEXTE_PARTICIPANT_NON_IDENTIFIE; ?></p>
</div>
<?php else : ?>
<?php if ($loggue && $droits == PROJET_DROIT_AUCUN) : ?>
<?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?>
<?php endif; ?>
<?php if ($droits == PROJET_DROIT_EN_ATTENTE) : ?>
<div id="projet_lien_login">
<a href="<?= $lien_login; ?>">En attente de validation</a>
<p><?= $laius_inscription_modere; ?></p>
</div>
<?php endif; ?>
</div>
<br style="clear:left" />
<?= $bouton_desinscription_projet;?>
<h2><?php echo $nombre_participants; ?> participants</h2>
<?php if ($droits <= PROJET_DROIT_COORDINATEUR) : ?>
<?php echo PROJET_NOUVEAU_UTILISATEUR_LAIUS ; ?>
<form action="<?php echo $url; ?>" method="post">
<?php if (isset ($msg) && $msg != '') : ?>
<div><?php echo $msg; ?></div>
<?php endif; ?>
<input type="text" name="mail_utilisateur" size="32" />
<input type="submit" value="<?php echo PROJET_NOUVEAU_UTILISATEUR; ?>" />
</form><br />
<?php endif; ?>
<table class="table_cadre">
<tr>
<th>Nom</th>
<th>Pr&eacute;nom</th>
<th>E mail</th>
<th>Date d'inscription</th>
<th>Statut</th>
<th>Forum de discussion</th>
<?php if ($droits <= PROJET_DROIT_COORDINATEUR) : ?><th>supprimer</th><?php endif; ?>
</tr>
<?php foreach ($info_utilisateur as $utilisateur) : ?>
<tr class="<?php if ($pair) : ?>ligne_paire<?php $pair = false; ?><?php else : ?>ligne_impaire<?php $pair = true; ?><?php endif; ?>"<?php if ($utilisateur[5] == 1) : ?> style="font-weight:bold;"<?php endif; ?>>
<?php if(defined('PROJET_LIEN_ANNUAIRE') && PROJET_LIEN_ANNUAIRE != '') { ?>
<td><a href="<?php echo PROJET_LIEN_ANNUAIRE.$utilisateur[0] ?>" title="<?php echo PROJET_VOIR_PROFIL ?>"><?php echo $utilisateur[1] ;?></a></td>
<td><a href="<?php echo PROJET_LIEN_ANNUAIRE.$utilisateur[0] ?>" title="<?php echo PROJET_VOIR_PROFIL ?>"><?php echo $utilisateur[2] ;?></a></td>
<?php } else { ?>
<td><?php echo $utilisateur[1] ;?></td>
<td><?php echo $utilisateur[2] ;?></td>
<?php } ?>
<td><a href="mailto:<?php echo $utilisateur[3] ;?>"><?php echo substr($utilisateur[3], 0, 10); ?>...</a></td>
<td><?php echo $utilisateur[4] ;?></td>
<td><?php if ($droits <= PROJET_DROIT_COORDINATEUR) : ?>
<?php $this->_url->addQueryString ('id_utilisateur', $utilisateur[0]) ; ?>
<form action="<?php echo $this->_url->getURL(); ?>" method="post">
<select name="statut" onchange="javascript:this.form.submit();">
<?php foreach ($statuts as $cle =>$element_statut) : ?>
<option value="<?php echo $cle ;?>"<?php if ($cle == $utilisateur[5]) : ?> selected="selected"<?php endif; ?>><?php echo $element_statut; ?></option>
<?php endforeach; ?>
</select></form>
<?php else : ?>
<?php echo $statuts[$utilisateur[5]]; ?>
<?php endif; ?>
</td>
<td><?php if ($droits <= PROJET_DROIT_COORDINATEUR) : ?>
<form action="<?php echo $this->_url->getURL(); ?>" method="post">
<select name="inscription_liste" onchange="javascript:this.form.submit();">
<option value="0"<?php echo ($utilisateur[6] ? '' : ' selected="selected"');?> >Non inscrit</option>';
<option value="1"<?php echo ($utilisateur[6] ? ' selected="selected"': '');?>>Inscrit</option>
</select></form>
<?php else : ?>
<?php echo $statuts_inscription_liste[$utilisateur[6]]; ?>
<?php endif; ?>
</td>
<?php if ($droits <= PROJET_DROIT_COORDINATEUR) : ?>
<td><?php $this->_url->addQueryString ('statut', 4); ?>
<a href="<?php echo $this->_url->getURL(); ?>" onclick="javascript:return confirm('supprimer ?');">supprimer</a>
</td><?php $this->_url->removeQueryString ('statut'); ?>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</table>
 
<br style="clear:both" />
<?php endif; ?>
/tags/2014_06_04/squelettes/description.tpl.html
New file
0,0 → 1,21
<h1><?= PROJET_PROJET ; ?> : <?= $projet->getTitre(); ?></h1>
<div id="projet_bloc_action">
<?php if (!$loggue) : ?>
<?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?>
<?php endif; ?>
<?php if ($loggue && $droits == PROJET_DROIT_AUCUN) : ?><?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?><br style="clear:both;" /><?php endif; ?>
<?php if ($droits == PROJET_DROIT_EN_ATTENTE) : ?>
<div id="projet_lien_login">
<a>En attente de validation</a>
<p><?= $laius_inscription_modere; ?></p>
</div>
<?php endif; ?>
</div>
<h2><?= PROJET_RESUME ;?></h2>
<?= $bouton_resume; ?><br style="clear:left;" />
<div><?= $projet->getResume(); ?></div>
<h2>Description</h2>
<div id="description_projet"><?= $projet->getDescription(); ?></div>
<?= $bouton_desinscription_projet;?>
<br style="clear:left;" />
/tags/2014_06_04/squelettes/liste_projet.tpl.html
New file
0,0 → 1,51
<h1>Liste des projets et forums de Tela Botanica</h1>
<div id="projet_choix_mode"><?= $lien_interface_simple; ?>&nbsp;&nbsp;<?= $lien_interface_expert; ?></div>
<div class="projet_recherche"><h2>Rechercher dans les projets</h2>
<form action="<?= $url; ?>" method="get">
<fieldset>
<input type="text" name="projet_recherche" id="projet_recherche" value="<?= $valeur_projet_recherche; ?>" />
<input type="submit" value="Ok" id="projet_recherche_submit" />
</fieldset>
</form>
</div>
<hr />
<div class="information_projet importance4">
<h2>Qu'est-ce qu'un projet ?</h2>
C'est un espace o&ugrave; l'on peut &eacute;changer sur une th&eacute;matique li&eacute;e &agrave; la botanique.
Vous disposez dans cet espace de divers outils.
<ul>
<li><a href="http://www.tela-botanica.org/page:informations_sur_les_projets#infoprojets_utiliser" title="Lien vers l'aide pour utiliser les outils">une liste de discussion (forum)</a></li>
<li><a href="http://www.tela-botanica.org/page:informations_sur_les_projets#infoprojets_utiliser" title="Lien vers l'aide pour utiliser les outils">un wikini</a></li>
<li><a href="http://www.tela-botanica.org/page:informations_sur_les_projets#infoprojets_utiliser" title="Lien vers l'aide pour utiliser les outils">un espace document</a></li>
</ul>
</div>
<div id="cartouche_liste_projet">
<div id="projet_range">Projets <span class="nombre"><?= $range[0]; ?></span> &agrave; <span class="nombre"><?= $range[1]; ?></span> sur <span class="nombre"><?= $nombre_projets; ?></span></div>
 
</div>
<div id="projet_theme">
<h1>Th&egrave;mes - <?= $tableau_theme[$theme_selectionne]['label']; ?></h1>
<ul>
<?php foreach ($tableau_theme as $theme) : ?>
<li><?php if ($theme['id'] == $theme_selectionne) : ?><strong><?php endif; ?>
<a href="<?= $theme['lien']; ?>"><?= $theme['label']; ?></a>
<?php if ($theme['id'] == $theme_selectionne) : ?></strong><?php endif; ?>
( <?= $theme['nombre_projet']; ?> )</li>
<?php endforeach ;?>
</ul>
</div>
<div class="pager"><?= $links['all']; ?></div>
<ul class="liste_projet">
<?php foreach ($tableau_donnees as $projet) : ?>
<li>
<h3><a href="<?= $projet['lien'] ;?>"><?= $projet['titre']; ?></a></h3>
<h4>(<?= $projet['nombre_participants']; ?> participants) <span class="<?= $projet['classe_projet_activite']; ?>">(<?= $projet['activite']; ?>)</span></h4>
<?= $projet['resume']; ?>
<?= $projet['forum'] ; ?>
<?php if ($projet['nombre_message']) : ?>
( + <span class="nombre_message"><?php echo $projet['nombre_message']; ?> nouveaux messages</span> )
<?php endif; ?>
</li>
<?php endforeach ; ?>
</ul>
<div class="pager"><?= $links['all']; ?></div>
/tags/2014_06_04/squelettes/message.tpl.html
New file
0,0 → 1,16
<h1><?= PROJET_PROJET ; ?> : <?= $projet->getTitre(); ?></h1>
<?php if ($message != PROJET_MESSAGE_LISTE_PRIVEE) : ?>
<h2>Adresse pour &eacute;crire au forum</h2>
<a href="mailto:<?php echo $adresse_envoie; ?>"><?php echo $adresse_envoie; ?></a>
<h2>Message N°<?= $numero_message; ?>/<?= $total_message; ?></h2>
<?php echo $derniers_messages; ?>
<?php echo $navigation; ?>
<?php echo $message; ?>
 
<?php else : ?>
Cette liste est priv&eacute;e, vous devez vous inscrire pour y accéder.
<?php endif; ?>
<?php if ($avoir_liste_externe) : ?>
<h2>Vers l'espace Yahoo !</h2>
<?php echo $liste_ext_res; ?>
<?php endif; ?>
/tags/2014_06_04/squelettes/boutons/bouton_login.tpl.html
New file
0,0 → 1,5
<div id="projet_lien_login"><a>
<img src="client/projet/images/identification.png" />
<span>S'identifier</span></a><br style="clear:both;" />
<!-- PAPYRUS_IDENTIFICATION -->
</div>
/tags/2014_06_04/squelettes/boutons/bouton_inscription.tpl.html
New file
0,0 → 1,17
<div id="projet_lien_inscription"><a<?php if ($lien_inscription != '#') : ?> href="<?= $lien_inscription; ?>"<?php endif; ?>>
<img src="<?= PROJET_CHEMIN_APPLI; ?>images/inscription.png" alt="" />
<span><?= $label_url_inscription; ?></span>
</a>
</div><br style="clear:both" />
<?php if (!$loggue) : ?>
<div id="projet_bloc_inscription">
<strong>D&eacute;j&agrave; membre de Tela Botanica, identifiez-vous&nbsp;:</strong>
<!-- PAPYRUS_IDENTIFICATION -->
<br />
<strong>Nouveau sur le site : <a href="http://www.tela-botanica.org/inscription">inscrivez-vous au r&eacute;seau Tela Botanica</a></strong>
</div>
<script type="text/javascript">
$("#projet_bloc_inscription").css("display", "none");
</script>
<?php endif; ?>
/tags/2014_06_04/squelettes/forum.tpl.html
New file
0,0 → 1,43
<h1><?= PROJET_PROJET ; ?> : <?= $projet->getTitre(); ?></h1>
<?php if (isset($message_retour)) echo $message_retour; ?>
<?php if ($message != PROJET_MESSAGE_LISTE_PRIVEE) : ?>
<div id="projet_bloc_action">
<?php if (!$loggue) : ?>
<?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?>
<br style="clear:left;" />
<?php endif; ?>
<?php if ($loggue && $droits == PROJET_DROIT_AUCUN) : ?><?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?><br style="clear:both;" /><?php endif; ?>
<?php if ($droits == PROJET_DROIT_EN_ATTENTE) : ?>
<div id="projet_lien_login">
<a href="<?= $lien_login; ?>">En attente de validation</a>
<p><?= $laius_inscription_modere; ?></p>
</div>
<?php endif; ?>
</div>
<h2>Adresse pour &eacute;crire au forum</h2>
<a href="mailto:<?php echo $adresse_envoie; ?>"><?php echo $adresse_envoie; ?></a>
<?php if ($avoir_liste_externe) : ?>
<p class="information">La liste de discussion de ce projet est h&eacute;berg&eacute;e par Yahoo Groupes <img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/>.
<br />Pour vous inscrire à cette liste : <a href="mailto:<?php echo $adresse_inscription; ?>"><?php echo $adresse_inscription; ?></a>.<br />
Une fois inscrit, vous pourrez envoyer des messages en utilisant l'adresse pour &eacute;crire au forum (liste de discussion).<br />
Pour plus d'information sur le fonctionnement des Yahoo Groupes, <a href="http://help.yahoo.com/l/fr/yahoo/groups/">http://help.yahoo.com/l/fr/yahoo/groups/</a>.
</p>
<?php endif; ?>
<?php if ($loggue && ($droits < PROJET_DROIT_AUCUN) && !$avoir_liste_externe) echo $bouton_poster; ?>
<br style="clear:left;" />
<h2>Tous les messages</h2>
<?php echo $calendrier; ?>
<h2>Les derniers messages</h2>
<?php echo $derniers_messages; ?>
<?php echo $navigation; ?>
<?php echo $message; ?>
 
<?php else : ?>
Cette liste est priv&eacute;e, vous devez vous inscrire pour y accéder.
<?php endif; ?>
<?php if ($avoir_liste_externe) : ?>
<h2>Vers l'espace Yahoo !</h2>
<?php echo $liste_ext_res; ?>
<?php endif; ?>
<?php echo $bouton_desinscription_liste; ?>
<br style="clear:left;" />
/tags/2014_06_04/squelettes/liste_projet_expert.tpl.html
New file
0,0 → 1,66
<h1>Liste des projets et forums de Tela Botanica</h1>
<div id="projet_choix_mode"><?= $lien_interface_simple; ?>&nbsp;&nbsp;<?= $lien_interface_expert; ?></div>
<h2><a href="javascript:animatedcollapse.toggle('legende');">L&eacute;gende (ouvrir / fermer)</a></h2>
<div id="legende">
A Chaque ligne du tableau correspond un projet, les diff&eacute;rentes colonnes donnent des indications sur les projets.
<h3>Les forums</h3>
<p>L'ic&ocirc;ne <img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/> indique qu'un liste Yahoo ! est associée &agrave; ce projet.
Le nombre entre parenth&egrave;ses indique le nombre de messages &eacute;chang&eacute; sur ce forum cette semaine.</p>
<p>L'ic&ocirc;ne <img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /> indique un liste de discussion associ&eacute;e
au projet et h&eacute;berg&eacute;e par Tela Botanica. Le nombre entre parenth&egrave;ses indique le nombre de nouveaux messages de la semaine.</p>
<h3>Lien vers les flux RSS</h3>
Les flux RSS <img src="sites/commun/generique/images/rss.gif" alt="rss"/> (Ressource Site Summary), vous permettent de suivre les mises &agrave; jour des wikinis associ&eacute;s au projet.
Tout comme les listes de discussion, le nombre entre parenth&egrave;ses indique si des modifications ont eu lieu cette derni&egrave;re semaine.
<a href="http://fr.wikipedia.org/wiki/Flux_RSS"> Plus d'informations sur les flux RSS</a>.
<h3>Le nombre de participants</h3>
<p>Le nombre de participants est soit :</p>
<ul><li>le nombre de participants au projet, si la liste de discussion associ&eacute;e est h&eacute;berg&eacute;e par Tela Botanica</li>
<li>le nombre d'inscrits &agrave; la liste Yahoo!, si la liste est h&eacute;berg&eacute;e par Yahoo!</li>
</ul>
<p>Le nombre entre parenth&egrave;s indique les nouveaux inscrits de la semaine.</p>
<h3>L'activit&eacute;</h3>
<p>Le pourcentage d'activit&eacute; est calcul&eacute; &agrave; partir d'&eacute;l&eacute;ments de la derni&egrave;re semaine :</p>
<ul><li>Le nombre de messages &eacute;chang&eacute;s</li>
<li>Les modifications sur les Wikinis</li>
<li>Les nouveaux documents</li>
<li>Les nouveaux inscrits au projet</li>
</ul>
<?php if ($loggue) : ?>
<h3>Votre inscription</h3>
<p>Lorsque vous &ecirc;tes identifi&eacute; sur le site de Tela Botanica, une colonne intitul&eacute;e "Votre inscription" s'affiche. Elle permet de voir rapidement les projets auxquels vous êtes inscrit et votre statut dans ces projets :</p>
<ul>
<li>Une &eacute;toile verte <img src="http://www.tela-botanica.org/client/projet/icones/etoile_verte.png" alt="étoile verte" /> indique que vous &ecirc;tes <b>Participant</b> &agrave; ce projet.</li>
<li>Une &eacute;toile rouge <img src="http://www.tela-botanica.org/client/projet/icones/etoile_rouge.png" alt="étoile rouge" /> signale que vous êtes <b>Coordonnateur</b> de ce projet.</li>
<li>Une &eacute;toile grise <img src="http://www.tela-botanica.org/client/projet/icones/etoile_grise.png" alt="étoile verte" /> signifie que vous avez demand&eacute; votre inscription &agrave; ce projet et que votre demande est <b>en attente de validation</b> par un mod&eacute;rateur.</li>
</ul>
<?php endif; ?>
</div>
<script type="text/javascript">
$("#legende").css("display", "none");
</script>
<div id="cartouche_liste_projet">
<div id="projet_range">Projets <span class="nombre"><?= $range[0]; ?></span> &agrave; <span class="nombre"><?= $range[1]; ?></span> sur <span class="nombre"><?= $nombre_projets; ?></span></div>
 
</div>
 
<table class="table_cadre" id="table_projet" summary="Liste des projets">
<tr><th><a href="<?= $lien_tri_titre ; ?>" class="<?= $enteteTri['p_titre']->getClasse(); ?>">Titre</a></th><th>Forum</th><th>Wiki</th><th>RSS</th>
<th><a href="<?= $lien_tri_doc;?>" class="<?= $enteteTri['ps_doc_derniere_semaine']->getClasse(); ?>">Documents</a></th>
<th><a href="<?= $lien_tri_participants; ?>" class="<?= $enteteTri['ps_nombre_inscrit']->getClasse(); ?>">Participants</a></th>
<th><a href="<?= $lien_tri_activite ; ?>" class="<?= $enteteTri['ps_pourcent']->getClasse(); ?>">Activit&eacute;</a></th>
<?php if ($loggue) : ?><th><a href="<?= $lien_tri_statut ; ?>" class="<?= $enteteTri['psu_id_statut']->getClasse(); ?>">Votre inscription</a></th><?php endif; ?>
</tr>
<?php foreach ($tableau_donnees as $projet) : ?>
<tr <?php if ($pair) {echo ' class="ligne_paire"'; $pair = false; } else { echo 'class="ligne_impaire"'; $pair = true;} ?>>
<td><a href="<?= $projet['lien'] ;?>"><?= $projet['titre']; ?></a></td>
<td><?= $projet['forum'] ; ?><?php if ($projet['nombre_message']) : ?><span title="Nombres de messages échangés cette semaine">( + <?php echo $projet['nombre_message']; ?> )</span><?php endif; ?></td>
<td><?= $projet['wikini'] ; ?></td>
<td><?= $projet['wikini_rss'] ; ?></td>
<td><?= $projet['document'] ; ?></td>
<td><a href="<?= $projet['lien_participants'];?>"><?= $projet['nombre_participants'];?></a> <?= $projet['ps_nombre_inscrit_derniere_semaine']; ?></td>
<td><?= $projet['activite'] ; ?></td>
<?php if ($loggue) :?><td style="text-align:center;"><?php echo $projet['statut_icone']; ?></td><?php endif; ?>
</tr>
<?php endforeach ; ?>
</table>
/tags/2014_06_04/squelettes/mes_projets.tpl.html
New file
0,0 → 1,29
<h1>Liste des projets et forums de Tela Botanica</h1>
 
<p class="importance4">
Les projets en dormance sont affichés seulement sur l'interface <em>"expert"</em>.
Si vous souhaitez visualiser tous les projets auxquels vous êtes inscrit, passez en mode <em>"expert"</em>.
<span id="projet_choix_mode"><?= $lien_interface_simple; ?>&nbsp;&nbsp;<?= $lien_interface_expert; ?></span>
</p>
<div id="cartouche_liste_projet">
<div id="projet_range">
Projets <span class="nombre"><?= $range[0]; ?></span>
&agrave; <span class="nombre"><?= $range[1]; ?></span>
sur <span class="nombre"><?= $nombre_projets; ?></span>
</div>
</div>
<div class="pager"><?= $links['all']; ?></div>
<ul class="liste_projet">
<?php foreach ($tableau_donnees as $projet) : ?>
<li>
<h3><a href="<?= $projet['lien'] ;?>"><?= $projet['titre']; ?></a></h3>
<h4>(<?= $projet['nombre_participants']; ?> participants) <span class="<?= $projet['classe_projet_activite']; ?>">(<?= $projet['activite']; ?>)</span></h4>
<?= $projet['resume']; ?>
<?= $projet['forum'] ; ?>
<?php if ($projet['nombre_message']) : ?>
( + <span class="nombre_message"><?php echo $projet['nombre_message']; ?> nouveaux messages</span> )
<?php endif; ?>
</li>
<?php endforeach ; ?>
</ul>
<div class="pager"><?= $links['all']; ?></div>
/tags/2014_06_04/squelettes/wikini.tpl.html
New file
0,0 → 1,16
<h1><?= PROJET_PROJET ; ?> : <?= $projet->getTitre(); ?></h1>
<div id="projet_bloc_action">
<?php if (!$loggue) : ?>
<?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?>
<?php endif; ?>
<?php if ($loggue && $droits == PROJET_DROIT_AUCUN) : ?><?php include_once PROJET_CHEMIN_APPLI.'squelettes/boutons/bouton_inscription.tpl.html'; ?><br style="clear:both;" /><?php endif; ?>
<?php if ($droits == PROJET_DROIT_EN_ATTENTE) : ?>
<div id="projet_lien_login">
<a>En attente de validation</a>
<p><?= $laius_inscription_modere; ?></p>
</div>
<?php endif; ?>
</div>
<br style="clear:left;" />
<?php echo $wiki_res; ?>
 
/tags/2014_06_04/actions/resume.php
New file
0,0 → 1,324
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: resume.php,v 1.13 2007-08-28 10:33:50 alexandre_tb Exp $
/**
* Application projet
*
* Action resume
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.13 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
$retour = '';
$loggue = false;
 
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
 
/** Bloc resume avec lien resume */
$resume = $projet->getResume();
$bouton_resume = '';
$bouton_s_inscrire_au_projet = '';
 
 
$lien_inscription = '';
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet) ;
 
// creation de la vue liste de document, on nettoie l'url
//$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
$vue_liste_document = new HTML_listeDocuments($this->_url, false, '', $this->_auth) ;
$bouton_deposer_doc = '';
// reglage de parametres de la vue
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
 
$bouton_poster = '';
$bouton_desinscription_projet = '';
 
// verification des droits de l'utilisateur
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
 
if ($this->_auth->getAuth()) {
$loggue = true;
$droits = PROJET_DROIT_AUCUN;
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
$isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $this->_db) ;
if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR;
if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
$isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
if ($isAdm) $isCoord = true ;
 
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
$projet->getListesAssociees();
foreach ($projet->_listes_associes as $info_liste) {
$inscription_liste = new inscription_liste($this->_db) ;
if ($inscription_liste->getStatutInscrit($info_liste->getId(), $this->_auth) == 0) {
$action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
$label_inscription = 'S\'inscrire &agrave; la liste' ;
} else {
// L'action envoyer un mail
$action_inscription = PROJET_ENVOYER_UN_MAIL ;
$label_inscription = PROJET_ECRIRE_LISTE ;
}
}
 
switch ($participant->getStatut($id_u, $this->_id_projet))
{
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
 
break;
case PROJET_DROIT_CONTRIBUTEUR :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$bouton_deposer_doc .= '<br style="clear:both" />';
 
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET);
$bouton_desinscription_projet = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire du projet', 'cross');
$bouton_desinscription_projet .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
break;
case PROJET_DROIT_COORDINATEUR || PROJET_DROIT_ADMINISTRATEUR :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION);
$bouton_resume = bouton::toHTML($this->_url->getURL(), PROJET_MODIFIER_PROPRIETES, 'modifier');
$bouton_resume .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$bouton_deposer_doc .= '<br style="clear:both" />';
 
if ($projet->avoirListe()) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
 
}
 
break;
case PROJET_DROIT_EN_ATTENTE : $droits = PROJET_DROIT_EN_ATTENTE;
GEN_stockerFichierScript('mootools', 'api/js/mootools/mootools-release-1.11.js');
GEN_stockerCodeScript('window.addEvent(\'domready\', function(){'."\n".
'var fx = new Fx.Styles($(\'projet_lien_login\'), {duration:500, wait:false});' ."\n".
'element = $(\'projet_lien_login\');'."\n".
'element.addEvent(
\'click\', function() {
fx.start({
\'height\' : \'320px\'
})
}
)});');
$laius_inscription_modere = str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
$lien_login = '#';
break;
}
$bouton_poster .= '<br style="clear:both" />';
 
$statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
// si participant, on ajoute le champs visibilite
 
if ($statut !='' || $isAdm) {
array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
$visible = true ;
} else {
$visible = false ;
}
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
 
 
// si chef de projet ou si proprietaire d'au moins 1 document
$proprietaire_un_document = false ;
 
foreach ($liste_documents as $document) {
if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) {
$proprietaire_un_document = true ;
$droits = PROJET_DROIT_PROPRIETAIRE ;
}
}
if ($droits <= PROJET_DROIT_COORDINATEUR || $proprietaire_un_document) {
array_push ($entete_liste, PROJET_ACTION) ;
}
} else {
$droits = PROJET_DROIT_AUCUN ;
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
 
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$lien_login = '#';
}
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
 
$vue_liste_document->construitEntete($entete_liste) ;
$vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $this->_db) ;
 
$wiki_res = '' ;
// Les wikinis associes au projet
if ($wiki = $projet->getWikini()) {
if (strpos($wiki, "http://www.tela-botanica.org/wikini/") === 0) {// Si le wiki, ne peut pas être intégré
$wiki_res .= '<div style="line-height: 2em;">'.sprintf(PROJET_WIKINI_PAS_REDIR, $wiki).'</div>'."\n";
} else {
$url = $GLOBALS['_GEN_commun']['url'] ;
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link = $this->_url->getURL();
$wiki_res .= '<div><a href="'.$link.'">'.PROJET_ALLER_SUR_WIKINI.'</a> ('.$wiki.')</div>';
}
} else {
$wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n";
}
// On charge les listes de discussion du projet
// Pour le moment seul ezmlm est supportee
 
$projet->getListesAssociees();
$sortie_liste = '' ;
 
 
$liste_ext_res = '' ;
if ($projet->avoirListe()) {
ob_start() ;
include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
foreach ($projet->_listes_associes as $info_liste) {
$liste = new ezmlm_php() ;
// Param�trage de la liste
 
$liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
 
$liste->listname = $info_liste->getNom() ;
$liste->listdomain = $info_liste->getDomaine();
 
if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
$liste->set_action($GLOBALS['action']) ;
$liste->set_actionargs($GLOBALS['actionargs']) ;
} else {
$liste->set_action('list_info') ;
}
$liste->sendheaders = false;
$liste->sendbody = false;
$liste->sendfooters = false;
$liste->forcehref = $this->_url->getURL() ;
 
 
 
if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
switch ($liste->action) {
case "list_info":
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
$xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
$info_liste->getNom(), $GLOBALS['lang'],
$this->_url->getURL()) ;
 
$xml_parser->reset() ;
$xml_parser->setAction ('derniers_messages');
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$derniers_messages = ob_get_contents() ;
ob_end_clean();
echo $derniers_messages ;
break;
}
} else {
print PROJET_MESSAGE_LISTE_PRIVEE;
}
$sortie_liste = ob_get_contents() ;
ob_end_clean() ;
}
}
 
// Site internet associe
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
if ($projet->getEspaceInternet() != '') {
$sortie_web .= '<a href="'.$projet->getEspaceInternet().'">'.$projet->getEspaceInternet().'</a>'."\n" ;
} else {
$sortie_web .= PROJET_PAS_DE_SITE ;
}
 
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$listes_ext = new liste_externe ($this->_db) ;
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
 
if (count ($tableau_liste) != 0) {
$liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
for ($i = 0; $i < count ($tableau_liste); $i++) {
$info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
//$liste_ext_res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
//$liste_ext_res .= '<p>'.$info_liste->AGO_A_RESUMLG.'</p>'."\n" ;
$liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'" target="_blank">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
//$liste_ext_res .= '<br />'."\n" ;
}
$avoir_liste_externe = true;
} else {
$avoir_liste_externe = false;
}
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre();
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/resume.tpl.html';
 
$retour .= ob_get_contents();
ob_end_clean();
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log$
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
?>
/tags/2014_06_04/actions/documents.php
New file
0,0 → 1,175
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: documents.php,v 1.11 2008-08-25 15:02:49 alexandre_tb Exp $
/**
* Application projet
*
* Action documents
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.11 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
if (!isset($retour)) $retour = '';
 
$bouton_deposer_doc = '';
$bouton_creer_repertoire = '';
 
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
// recuperation de la liste des documents associes
 
$liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES, $this->_id_repertoire) ;
 
//$html_document = print_r($liste_documents, true);
// creation de la vue liste de document, on nettoie l'url
//$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
 
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
 
$vue_liste_document = new HTML_listeDocuments($this->_url, false, $this->_id_repertoire, $this->_auth) ;
if (count ($liste_documents) == 0) $pas_de_document = true;
 
// reglage de parametres de la vue
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
 
$tableau_navigation = document::getCheminIdRepertoire($this->_id_repertoire, $this->_db) ;
 
$vue_liste_document->setCheminNavigation ($tableau_navigation) ;
 
// verification des droits de l'utilisateur
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
$loggue = false;
if ($this->_auth->getAuth()) {
$loggue = true;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$droits = $participant->getStatut($id_u, $this->_id_projet);
 
// si participant, on ajoute le champs visibilite
if ($droits <= PROJET_DROIT_CONTRIBUTEUR) {
array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
}
// si chef de projet ou si proprietaire d'au moins 1 document
$proprietaire_un_document = false ;
 
if ($droit <= PROJET_DROIT_CONTRIBUTEUR ) {
array_push ($entete_liste, PROJET_ACTION) ;
}
switch ($droits)
{
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
break;
}
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$bouton_deposer_doc .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE);
$bouton_creer_repertoire = bouton::toHTML($this->_url->getURL(), 'Cr&eacute;er un r&eacute;pertoire', 'repertoire');
$bouton_creer_repertoire .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT);
} else {
$droits = PROJET_DROIT_AUCUN ;
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$label_url_inscription = 'S\'inscrire &agrave; au projet';
}
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
 
$vue_liste_document->construitEntete($entete_liste) ;
$vue_liste_document->construitListe ($liste_documents, $droits, '', $this->_db) ;
 
 
// Les liens pour l affichage classique ou arborescent (avec dojo)
$this->_url->addQueryString('affichage', 'ajax');
$url_ajax = $this->_url->getURL();
$this->_url->addQueryString('affichage', 'standart');
$url_classique = $this->_url->getURL();
$this->_url->removeQueryString('affichage');
 
$arbre = document::getArbreDocument($this->_id_projet) ;
 
if (!isset ($_SESSION['mode_affichage'])) {
if (isset($_GET['affichage'])) $_SESSION['mode_affichage'] = $_GET['affichage']; else $_SESSION['mode_affichage'] = 'standart';
} else {
if (isset($_GET['affichage'])) $_SESSION['mode_affichage'] = $_GET['affichage'];
}
$vue_liste_document->setModeAffichage($_SESSION['mode_affichage']);
 
$html_no_script = '';
if ($vue_liste_document->_mode_affichage == 'ajax') {
$html_no_script .= '<noscript>';
$vue_liste_document->setModeAffichage('standart');
$html_no_script .= $vue_liste_document->toHTML('', '') ;
$html_no_script .= '</noscript>';
}
 
 
$html_document .= $vue_liste_document->toHTML($projet->getId(), $droits);
$this->_url->removeQueryString(PROJET_VARIABLE_SERVICE);
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_DOCUMENT;
 
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/document.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/actions/participants.php
New file
0,0 → 1,211
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: participants.php,v 1.9 2008-09-01 14:38:34 alexandre_tb Exp $
/**
* Application projet
*
* Action participants
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.9 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
$res = '' ;
$pair = true;
$loggue = $this->_auth->getAuth();
$url = $this->_url->getURL();
 
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
//$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
$titre = '<h2>'.PROJET_LISTE_PARTICIPANT.'</h2>'."\n" ;
$participants = new participe($this->_db) ;
 
// On teste ici s'il y a une mise a jour de statut
if (isset($_REQUEST['statut'])) {
$participants->setStatut($_REQUEST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ;
// Si désinscription de l'utilisateur (statut 4)
if ($_REQUEST['statut'] == 4) {
$projet->getListesAssociees() ;
if ($projet->avoirListe()) {
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$annuaire = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
$annuaire->setId($_GET['id_utilisateur']) ;
// on désinscrit l'utilisateur des listes associées au projet
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$desinscription= new inscription_liste($this->_db) ;
$desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
}
}
}
// On teste ici s'il y a une mise a jour de l inscription a la liste
if (isset($_POST['inscription_liste'])) {
$projet->getListesAssociees();
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$annuaire = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
$annuaire->setId($_GET['id_utilisateur']) ;
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$inscription= new inscription_liste($this->_db) ;
if ($_POST['inscription_liste'] == 1) {
$inscription->inscrireUtilisateur($annuaire, $projet->_listes_associes[0], 2) ; // 2 est le statut d inscription normale
} else {
$inscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
}
}
// Ce qui suit doit etre ameliore pour sortir la requete sur l'annuaire
// On teste s'il y a un ajout d'utilisateur voir HTML_listeParticipants
if (isset($_POST['mail_utilisateur'])) {
$requete = 'select '.PROJET_CHAMPS_ID.' from '.PROJET_ANNUAIRE.' where '.PROJET_CHAMPS_MAIL.'="'.$_POST['mail_utilisateur'].'"';
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
if (!$resultat->numRows()) {
$msg = PROJET_MAIL_ABSENT;
} else {
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
// Le statut 2 est le statut participant
$participants->setStatut(2, $ligne[PROJET_CHAMPS_ID], $this->_id_projet) ;
}
}
 
if ($this->_auth->getAuth()) {
$statut = participe::getStatutSurProjetCourant($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
if ($statut == 1) $droits = PROJET_DROIT_COORDINATEUR ;
if ($statut == 2) $droits = PROJET_DROIT_CONTRIBUTEUR ;
if ($statut == 3) $droits = PROJET_DROIT_EN_ATTENTE;
if ($statut == 4) {
$droits = PROJET_DROIT_AUCUN ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
}
if (participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db)) $droits = PROJET_DROIT_ADMINISTRATEUR ;
if ($droits <= PROJET_DROIT_COORDINATEUR || participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db)) {
$res = PROJET_NOUVEAU_UTILISATEUR_LAIUS ;
$res .= '<form action="'.$this->_url->getURL().'" method="post">'."\n" ;
if (isset ($msg) && $msg != '') {
$res .= '<div>'.$msg.'</div>' ;
}
$res .= '<input type="text" name="mail_utilisateur" size="32" />' ;
$res .= '<input type="submit" value="'.PROJET_NOUVEAU_UTILISATEUR.'" />'."\n" ;
$res .= '</form><br />'."\n" ;
}
// Mise en place de l'url
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
// Construction de l'entete
$info_utilisateur = $participants->getInscrits($this->_id_projet, $droits);
$nombre_participants = count ($info_utilisateur);
include_once PROJET_CHEMIN_CLASSES.'statut.class.php' ;
if ($projet->avoirListe()) {
/** recuperation des abonnees a la liste */
include_once PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php';
$ezmlm = new ezmlmAccessObject('liste_abonnes', $projet->_listes_associes[0]->getDomaine(),
$projet->_listes_associes[0]->getNom());
$ezmlm->load();
$tableau_mail = $ezmlm->parse();
 
for ($i = 0; $i < count ($info_utilisateur); $i++) {
$tableau_mail_utilisateur[$info_utilisateur[$i][3]] = $i;
$info_utilisateur[$i][6] = 0; // Initialisation du tableau avec la valeur 0
}
foreach ($tableau_mail->children() as $email) {
$email = (string) $email;
if (isset($tableau_mail_utilisateur[$email])) {
$id = (int) $tableau_mail_utilisateur[$email];
$info_utilisateur[$id][6] = 1;
}
}
}
$statuts = statut::getTousLesStatuts(PROJET_STATUT_SAUF_ADM, $this->_db);
$statuts_inscription_liste[0] = 'non inscrit';
$statuts_inscription_liste[1] = 'inscrit';
} else {
$droits = PROJET_DROIT_AUCUN ;
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$lien_login = '#';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
}
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_LISTE_PARTICIPANT;
//$retour .= $titre.$res.$xml; ;
 
 
 
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/participants.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
 
 
$this->_url->removeQueryString ('statut');
$this->_url->removeQueryString ('id_utilisateur');
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
$GLOBALS['url']->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.8 2008-08-25 15:02:49 alexandre_tb
* mise en place des squelettes
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/actions/description.php
New file
0,0 → 1,171
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: description.php,v 1.4 2008-08-25 15:02:35 alexandre_tb Exp $
/**
* Application projet
*
* Action description
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
if ($this->_auth->getAuth()) {
$loggue = true;
$droits = PROJET_DROIT_AUCUN;
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
$isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $this->_db) ;
if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR;
if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
$isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
if ($isAdm) $isCoord = true ;
 
switch ($participant->getStatut($id_u, $this->_id_projet))
{
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
$bouton_s_inscrire = '<span id="laius_inscription">'.$laius_inscription.'</span> <div id="projet_lien_inscription">
<a href="'.$lien_inscription.'">'.$label_url_inscription.'</a>
</div>';
break;
case PROJET_DROIT_CONTRIBUTEUR :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET);
$bouton_desinscription_projet = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire du projet', 'cross');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
break;
case PROJET_DROIT_COORDINATEUR :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION);
$bouton_resume = bouton::toHTML($this->_url->getURL(), PROJET_MODIFIER_PROPRIETES, 'modifier');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
break;
case PROJET_DROIT_EN_ATTENTE : $droits = PROJET_DROIT_EN_ATTENTE;
GEN_stockerFichierScript('mootools', 'api/js/mootools/mootools-release-1.11.js');
GEN_stockerCodeScript('window.addEvent(\'domready\', function(){'."\n".
'var fx = new Fx.Styles($(\'projet_lien_login\'), {duration:500, wait:false});' ."\n".
'element = $(\'projet_lien_login\');'."\n".
'element.addEvent(
\'click\', function() {
fx.start({
\'height\' : \'320px\'
})
}
)});');
$laius_inscription_modere = str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
$lien_login = '#';
break;
}
$statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
// si participant, on ajoute le champs visibilite
if ($statut !='' || $isAdm) {
array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
$visible = true ;
} else {
$visible = false ;
}
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
 
// si chef de projet ou si proprietaire d'au moins 1 document
$proprietaire_un_document = false ;
 
foreach ($liste_documents as $document) {
if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) {
$proprietaire_un_document = true ;
$droits = PROJET_DROIT_PROPRIETAIRE ;
}
}
if ($droits <= PROJET_DROIT_COORDINATEUR || $proprietaire_un_document) {
array_push ($entete_liste, PROJET_ACTION) ;
}
} else {
$droits = PROJET_DROIT_AUCUN ;
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$lien_login = '#';
}
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_DESCRIPTION;
 
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/description.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/actions/wikini.php
New file
0,0 → 1,131
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: wikini.php,v 1.17 2007-06-25 12:15:06 alexandre_tb Exp $
/**
* Application projet
*
* Action participants
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.17 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
$droits = PROJET_DROIT_AUCUN ;
$res = '' ;
$loggue = $this->_auth->getAuth();
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$lien_inscription = PROJET_LIEN_INSCRIPTION_CMS;
 
$wiki_res = '' ;
$script_wiki = '$(document).ready(function() {
$(\'#projet_lien_inscription\').bind(\'click\', function() {
$(\'#projet_bloc_inscription\').toggle();
return false;
});
});';
GEN_stockerCodeScript($script_wiki);
// Les wikinis associes au projet
 
if ($loggue) {
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($this->_db) ;
$droits = $participant->getStatut($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet);
switch ($droits) {
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = "S'inscrire &agrave; ce projet";
break;
}
}
if ($wiki = $projet->getWikini()) {
// Si le wiki, ne peut pas être intégré
if (strpos($wiki, "http://www.tela-botanica.org/wikini/") === 0) {
$wiki_res .= '<div style="line-height: 2em;">'.sprintf(PROJET_WIKINI_PAS_REDIR, $wiki).'</div>'."\n" ;
} else {
if ($projet->isModere()) {
if ($this->_auth->getAuth()) {
if ($participant->getStatutSurProjetCourant($this->_auth->getAuthData(PROJET_CHAMPS_ID), $projet->getId(), $this->_db) < 3) {
$wiki_res .= '<a href="http://'.$GLOBALS['_GEN_commun']['url']->host.'/'.
PROJET_CHEMIN_WIKINI.$projet->getWikini().'">'.PROJET_WIKINI_ALLER.'</a>';
$GLOBALS['_GEN_commun']['info_application']->wikini = $wiki;
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ACTION,'wikini');
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ID_PROJET,$this->_id_projet);
require_once 'client/integrateur_wikini/bibliotheque/iw_integrateur.fonct.php';
$wiki_res.= afficherPageWikini();
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_MENU'] =afficherPageMenuWikini();
 
} else {
$wiki_res .= PROJET_VOUS_N_ETES_PAS_INSCRIT;
}
} else {
$bouton_s_inscrire = '<span id="laius_inscription">'.$laius_inscription.'</span> '.
'<div id="projet_lien_inscription">'.
'<a href="'.$lien_inscription.'">'.$label_url_inscription.'</a>'.
'</div>';
$loggue = false;
$wiki_res .= PROJET_TEXTE_NON_IDENTIFIE;
}
} else {
$wiki_res .= '<a href="http://'.$GLOBALS['_GEN_commun']['url']->host.'/'.
PROJET_CHEMIN_WIKINI.$projet->getWikini().'" target="_blank" id="aller_sur_wikini">'.
PROJET_WIKINI_ALLER.'</a>';
$GLOBALS['_GEN_commun']['info_application']->wikini = $wiki;
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ACTION,'wikini');
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ID_PROJET,$this->_id_projet);
require_once 'client/integrateur_wikini/bibliotheque/iw_integrateur.fonct.php';
$wiki_res.= afficherPageWikini();
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_MENU'] = afficherPageMenuWikini();
}
}
} else {
$wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n";
}
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_WIKINI;
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/wikini.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
?>
/tags/2014_06_04/actions/forums.php
New file
0,0 → 1,406
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: forums.php,v 1.14 2008-09-16 14:12:43 alexandre_tb Exp $
/**
* Application projet
*
* Action forums
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.14 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php' ;
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
 
// creation de l'objet projet courant
$projet = new projet ($this->_db, $this->_id_projet) ;
 
/* contiendra le lien vers la liste yahoo */
$liste_ext_res = '' ;
 
$url_page_en_cours = $this->_url->getURL();
 
$inscription_laius ='' ;
$bouton_poster = '';
$bouton_desinscription_liste = '';
 
$loggue = $this->_auth->getAuth();
 
// Un appel a papyrus pour modifier le titre de la page
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_FORUM;
 
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$listes_ext = new liste_externe ($this->_db) ;
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
 
if (count ($tableau_liste) != 0) {
//$liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
for ($i = 0; $i < count ($tableau_liste); $i++) {
$info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
$liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
$liste_ext_res .= '<br />'."\n" ;
}
$avoir_liste_externe = true;
$adresse_envoie = $info_liste->AGO_A_MAILSEND;
$adresse_inscription = $info_liste->AGO_A_MAILABO;
} else {
$avoir_liste_externe = false;
}
 
 
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet);
if ($projet->avoirListe()) {
foreach ($projet->_listes_associes as $info_liste) {
ob_start() ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
if ($this->_auth->getAuth()) {
$participant = new participe($this->_db) ;
$droits = $participant->getStatut($id_u, $this->_id_projet);
} else {
$droits = PROJET_DROIT_AUCUN;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
}
switch ($droits) {
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
break;
}
// gestion de l'inscription desinscription a la liste
// TODO : la gestion de linscription au resume
$inscription_liste = new inscription_liste($this->_db) ;
$statut = $inscription_liste->getStatutInscrit( $info_liste->getId(), $this->_auth ) ;
if ($this->_auth->getAuth() && isset($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) {
if ($statut == 2) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
$inscription_laius ='<h2>'.PROJET_VOUS_ETES_INSCRIT.'</h2>'."\n" ;
$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_SE_DESINSCRIRE_LISTE.'</a>'."\n" ;
} else {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_INSCRIPTION_LISTE);
$inscription_laius ='<h2>'.PROJET_VOUS_N_ETES_PAS_INSCRIT.'</h2>'."\n" ;
$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>'."\n" ;
}
}
if ($inscription_liste->getStatutInscrit($info_liste->getId(), $this->_auth) == 0) {
$action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
$label_inscription = 'S\'inscrire &agrave; la liste' ;
} else {
// L'action envoyer un mail
$action_inscription = PROJET_ENVOYER_UN_MAIL ;
$label_inscription = PROJET_ECRIRE_LISTE ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
$bouton_desinscription_liste = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire de la liste','cross');
}
if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
$liste = new ezmlm_php() ;
// Parametrage de la liste
$liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
$liste->listname = $info_liste->getNom() ;
$liste->listdomain = $info_liste->getDomaine();
if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
$liste->set_action($GLOBALS['action']) ;
$liste->set_actionargs($GLOBALS['actionargs']) ;
} else {
$liste->set_action('list_info') ;
}
$liste->sendheaders = false;
$liste->sendbody = false;
$liste->sendfooters = false;
$liste->forcehref = $this->_url->getURL() ;
if (!$avoir_liste_externe) {
$adresse_envoie = $info_liste->getAdresseEnvoi();
}
print '<a href="mailto:'.$adresse_envoie.'">' . $adresse_envoie ;
print "</a><br />\n";
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum))
print '<a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a><br />';
print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
if ($liste->action != 'show_message') {
$xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
$info_liste->getNom(), $GLOBALS['lang'],
$this->_url->getURL()) ;
$xml_parser->load();
ob_start();
$resultat = $xml_parser->parse() ;
$calendrier = ob_get_contents();
ob_end_clean();
$xml_parser->reset();
}
//$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
// On teste si l'on vient d'une reponse a un email, si oui
// on modifie $liste->action pour renvoyer le message auquelon vient de repondre
if (isset($_POST['messageid'])) {
$liste->action = 'show_msg' ;
}
switch ($liste->action) {
case "show_msg":
if (count($liste->actionargs) < 2) {
$liste->error(EZMLM_INVALID_SYNTAX,TRUE);
}
// actionargs[0] contient le nom du repertoire et actionargs[1] le nom du fichier
// On appelle la fonction qui affiche un fichier
$xml_parser->setAction ('message');
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$mail = ob_get_contents() ;
ob_end_clean();
$mimeDecode = new Mail_mimeDecode($mail) ;
$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true',
'include_bodies' => 'true')) ;
$message = new ezmlm_msgdisplay() ;
$message->listname = $info_liste->getNom();
$numero_message = $xml_parser->getNumeroMessage();
$total_message = $xml_parser->getNombreTotalMessage();
$this->_url->addQueryString ('action', 'show_msg');
ob_start();
if ($xml_parser->getNumeroFichierPrecedent() != 0) {
$lien_precedent = $this->_url->getURL(). '&amp;actionargs[]='.
$xml_parser->getNumeroRepertoirePrecedent().'&amp;actionargs[]='.
$xml_parser->getNumeroFichierPrecedent();
$bouton_precedent = bouton::toHTML($lien_precedent, PROJET_PRECEDENT, 'gauche', 'projet_bouton_inline');
$navigation = $bouton_precedent;
}
if ($xml_parser->getNumeroFichierSuivant() != '' && (int) $numero_message < (int) $total_message) {
$lien_suivant = $this->_url->getURL(). '&amp;actionargs[]='.
$xml_parser->getNumeroRepertoireSuivant().'&amp;actionargs[]='.
$xml_parser->getNumeroFichierSuivant();
$bouton_suivant = bouton::toHTML($lien_suivant ,PROJET_SUIVANT, 'droite', 'projet_bouton_inline');
$navigation .= $bouton_suivant;
}
$this->_url->addQueryString ('action', 'repondre');
$bouton_repondre = bouton::toHTML($this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
'&amp;actionargs[]='.$liste->actionargs[1], PROJET_REPONDRE, 'repondre', 'projet_bouton_inline');
$this->_url->removeQueryString('action');
/*
Un bouton pour revenir a la liste des messages
*/
$navigation .= bouton::toHTML($this->_url->getURL() ,'retour', 'haut', 'projet_bouton_inline');
if (!$avoir_liste_externe && $droits <= PROJET_DROIT_CONTRIBUTEUR) $navigation .= $bouton_repondre;
if ($droits == PROJET_DROIT_COORDINATEUR || $droits == PROJET_DROIT_ADMINISTRATEUR) {
$this->_url->addQueryString ('action', 'supprimer');
 
$bouton_suppression_message = bouton::toHTML($this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
'&amp;actionargs[]='.$liste->actionargs[1], 'Supprimer', 'cross', 'projet_bouton_inline');
$navigation .= $bouton_suppression_message;
}
$this->_url->removeQueryString ('action');
print '<div class="message">' ;
print $message->parse_entete_mail($mailDecode) ;
$message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
print $message->message_rendu;
print '</div>' ;
$message = ob_get_contents();
ob_end_clean();
break;
case "list_info":
$xml_parser->reset() ;
$xml_parser->setAction ('derniers_messages');
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$derniers_messages = ob_get_contents() ;
ob_end_clean();
 
break;
case "show_threads":
$xml_parser->reset() ;
$xml_parser->setAction ('messages_thread');
$xml_parser->setMois($liste->actionargs[0]);
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$messages_thread = ob_get_contents() ;
ob_end_clean();
$message = $messages_thread ;
break;
case "show_author_msgs" :
$xml_parser->reset() ;
$xml_parser->setAction ('messages_auteur');
$xml_parser->setHashAuteur($liste->actionargs[0]);
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$messages_auteur = ob_get_contents() ;
ob_end_clean();
$message = $messages_auteur ;
break;
case 'show_month' :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, 'forums');
$this->_url->addQueryString('action', 'show_threads');
$this->_url->addQueryString('actionargs[]', $liste->actionargs[0]);
$message = '[<a href="'.$this->_url->getURL().'">par fil de discussion</a>]';
$xml_parser->reset() ;
$xml_parser->setAction ('messages_mois');
$xml_parser->setMois($liste->actionargs[0]);
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$messages_mois = ob_get_contents() ;
ob_end_clean();
$message .= $messages_mois ;
break;
case 'repondre' :
if (count($liste->actionargs) < 2) {
$liste->error(EZMLM_INVALID_SYNTAX,TRUE);
}
$xml_parser->setAction ('message');
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$message = ob_get_contents() ;
ob_end_clean();
$mimeDecode = new Mail_mimeDecode($message) ;
$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
if (isset($_SESSION['formulaire_mail'])) {
unset ($_SESSION['formulaire_mail']) ;
}
$formulaireReponse = new HTML_formulaireMail('formulaire_reponse', 'post',
str_replace('&amp;', '&', $this->_url->getURL()).
'&action='.PROJET_ENVOYER_UN_MAIL_V.
'&actionargs[]='.$liste->actionargs[0].
'&actionargs[]='.$liste->actionargs[1].
'&'.PROJET_VARIABLE_ACTION.'='.PROJET_ENVOYER_UN_MAIL_V) ;
$formulaireReponse->construitFormulaire() ;
$repondre = new ezmlm_repondre();
$repondre->listdir = $liste->listdir ;
$this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
$repondre->forcehref = $this->_url->getURL();
$repondre->listname = $info_liste->getNom() ;
// actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
// On appelle la fonction qui affiche un fichier
$message = '<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
$repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
$repondre->parse_template($mailDecode, $liste->actionargs[0], $liste->actionargs[1]);
$formulaireReponse->addElement ('hidden', 'messageid', $mailDecode->headers['message-id']) ;
// Ajout de > au début de chaque ligne du message
$tableau = explode ("\n", $repondre->message_rendu) ;
$repondre->message_rendu = "> ".implode ("\n> ", $tableau) ;
$formulaireReponse->setDefaults(array('mail_corps' => $repondre->message_rendu,
'mail_titre' => 'Re : '.$repondre->decode_iso ($mailDecode->headers['subject']))) ;
$message .= $formulaireReponse->toHTML() ;
 
break;
case 'supprimer' :
$xml_parser->reset() ;
$xml_parser->setAction ('supprimer');
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
$xml_parser->load();
$message = '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
$xml_parser->reset() ;
$xml_parser->setAction ('derniers_messages');
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$message .= ob_get_contents() ;
ob_end_clean();
break;
}
} else {
$message = PROJET_MESSAGE_LISTE_PRIVEE ;
}
ob_end_clean() ;
}
}
 
 
if ($liste->action == 'show_msg') $squelette = 'message'; else $squelette = 'forum';
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/'.$squelette.'.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
 
 
$this->_url->removeQueryString ('actionargs');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.13 2008-08-25 15:02:49 alexandre_tb
* mise en place des squelettes
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/tmp/vide.txt
--- tags/2014_06_04/projet.modification.inc.php (revision 0)
+++ tags/2014_06_04/projet.modification.inc.php (revision 430)
@@ -0,0 +1,83 @@
+<?php
+/*vim: set expandtab tabstop=4 shiftwidth=4: */
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 4.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This library is free software; you can redistribute it and/or |
+// | modify it under the terms of the GNU Lesser General Public |
+// | License as published by the Free Software Foundation; either |
+// | version 2.1 of the License, or (at your option) any later version. |
+// | |
+// | This library is distributed in the hope that it will be useful, |
+// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | Lesser General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU Lesser General Public |
+// | License along with this library; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id: projet.modification.inc.php,v 1.1 2008-10-27 16:56:08 aperonnet Exp $
+/**
+* Inscription
+*
+* Le fichier de modification de projet, appele par l'inscription
+* en cas de modification d'un utilisateur
+*
+*@package projet
+//Auteur original :
+*@author Aurelien Peronnet <aurelien@tela-botanica.org>
+*@copyright Tela-Botanica 2000-2006
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+// +------------------------------------------------------------------------------------------------------+
+// | ENTETE du PROGRAMME |
+// +------------------------------------------------------------------------------------------------------+
+
+// On recupere id_utilisateur, l'identifiant de la personne qui se desinscrit
+// On se trouve dans la fonction afficherContenuCorps de inscription.php
+
+
+
+include_once 'client/projet/configuration/projet.config.inc.php' ;
+include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
+include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
+include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
+$participant = new participe($GLOBALS['ins_db']) ;
+
+
+$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
+
+// On boucle sur chaque projet et on desinscrit l'utilisateur
+foreach ($tableau_projet as $projet) {
+
+ // si le projet possède une liste associée
+ if ($projet->avoirListe()) {
+
+ $est_abonne = '0' ;
+ // on vérifie si l'utilisateur y est abonné
+ $projet->getListesAssociees() ;
+
+ try {
+ $xml_abonne = new SimpleXMLElement(file_get_contents(URL_LISTE_ACTU.'est_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$ancien_mail)) ;
+ $est_abonne = $xml_abonne[0] ;
+
+ // si c'est le cas
+ if($est_abonne == '1') {
+ // on supprime l'ancien mail et on rajoute le nouveau
+ $suppression_abonne = file_get_contents(URL_LISTE_ACTU.'suppression_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$ancien_mail) ;
+ $suppression_abonne = file_get_contents(URL_LISTE_ACTU.'ajout_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$nouveau_mail) ;
+ }
+ }
+ catch(Exception $e) {
+ trigger_error($e->getMessage()) ;
+ }
+
+ }
+}
+
+
+?>
\ No newline at end of file
/tags/2014_06_04/images/vide.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/vide.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/arbre.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/arbre.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/feuille_droite.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/feuille_droite.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/puce.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/puce.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/fleche_droite.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/fleche_droite.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/bouton_survol.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/bouton_survol.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/racine.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/racine.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/feuille_gauche.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/feuille_gauche.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/haut.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/haut.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/fleche_gauche.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/fleche_gauche.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/identification.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/identification.jpg
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/feuille2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/feuille2.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/barre_blanche.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/barre_blanche.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/branche_droite.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/branche_droite.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/inscription.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/inscription.jpg
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/piece_jointe.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/piece_jointe.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/branche_gauche.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/branche_gauche.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/tronc.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/tronc.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/bouton.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/bouton.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/feuille.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/feuille.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/images/valider.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/images/valider.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/configuration/projet.config.inc.php
New file
0,0 → 1,197
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projet.config.inc.php,v 1.13 2008-11-19 09:28:46 aperonnet Exp $
/**
* Application projet, fichier de configuration
*
* Fichier de configuration
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.13 $
// +------------------------------------------------------------------------------------------------------+
*/
 
/**
//==================================== LES URLS ==================================
* Constantes liées à l'utilisation des url
//==================================================================================
*/
 
// Définition du lien vers "voir le projet"
define ("PROJET_LIEN_VOIR", "") ;
 
 
 
/**
//==================================== LES CHEMINS =================================
* Constantes définissant les chemins d'accé au différents fichiers inclus dans les
* applications.
//==================================================================================
*/
define ('PROJET_CHEMIN_APPLI','client/projet/');//le chemin vers l'application courante
define ('PROJET_CHEMIN_API_ARBRE', 'api/arbre/') ;
 
/** Chemin vers la bibliothèque API.*/
define ('PROJET_CHEMIN_BIBLIOTHEQUE_API', GEN_CHEMIN_API);
define ('PROJET_CHEMIN_ICONES', PROJET_CHEMIN_APPLI."icones/") ;
define ('PROJET_CHEMIN_CLASSES', PROJET_CHEMIN_APPLI.'classes/');//le chemin vers les fichiers propre à GSITE
define ('PROJET_CHEMIN_FONCTIONS', PROJET_CHEMIN_APPLI.'fonctions/') ;
define ('PROJET_CHEMIN_LIBRAIRIE','bibliotheque/');//le chemin de la librairie de fichier php
define ('PROJET_CHEMIN_FICHIER', "client/projet/fichiers/") ; // Chemin ou seront créer les dossiers
 
// Chemin vers les classes pour lire les listes de discussion
define ('PROJET_CHEMIN_CLASSES_LISTES', PROJET_CHEMIN_CLASSES."ezmlm-php-2.0/") ;
 
// Langue pas defaut
define ('PROJET_LANGUE_DEFAUT', "fr") ;
 
// Gestion de l'authentification
$GLOBALS['projet_auth'] = $GLOBALS['_GEN_commun']['pear_auth'];
 
// Un objet PEAR:DB connecté
$GLOBALS['projet_db'] = $GLOBALS['_GEN_commun']['pear_db'];
 
$GLOBALS['url'] = &$GLOBALS['_GEN_commun']['url'] ;
 
// La langue
if (!isset ($GLOBALS['lang'])) $GLOBALS['lang'] = PROJET_LANGUE_DEFAUT ;
/**
//==================================== CONSTANTES ==================================
* Constantes des noms de tables et de champs dans l'annuaire
//==================================================================================
*/
 
define ("PROJET_ANNUAIRE", "gen_annuaire") ; // Nom de la table d'annuaire
define ("PROJET_CHAMPS_NOM", "ga_nom") ; // Nom du champs nom
define ("PROJET_CHAMPS_MAIL", "ga_mail") ; // Nom du champs mail
define ("PROJET_CHAMPS_PRENOM", "ga_prenom") ; // Nom du champs prénom
define ("PROJET_CHAMPS_ID", "ga_id_administrateur") ;
 
// Lien vers l inscription du cms
define ('PROJET_LIEN_INSCRIPTION_CMS', '');
define ('PROJET_LIEN_ANNUAIRE','http://www.tela-botanica.org/page:inscription?m=annuaire_fiche_utilisateur_consultation&id_annuaire=1&id_utilisateur=');
 
/**
//==================================== CONSTANTES ==================================
* Constantes des chemins associés aux wikinis
//==================================================================================
*/
 
define ("PROJET_CHEMIN_WIKINI", "wikini/") ;
define ("PROJET_HOTE_WIKINI", "localhost") ;
define ("PROJET_UTILISATEUR_WIKINI", "") ;
define ("PROJET_MDP_WIKINI", "") ;
define ("PROJET_DB_WIKINI", "") ;
define ("PROJET_URL_WIKINI", "") ; // L'url vers le wikini
 
/**
//==================================== CONSTANTES ==================================
* Constantes des emails des administrateurs
//==================================================================================
*/
define ("PROJET_MAIL_ADMINISTRATEUR", "") ;
 
 
define ("PROJET_VARIABLE_ID_PROJET", "id_projet") ;
define ("PROJET_VARIABLE_ACTION", "act") ;
define ("PROJET_VARIABLE_ID_REPERTOIRE", "id_repertoire") ;
define ("PROJET_VARIABLE_ID_DOCUMENT", "id_document") ;
define ('PROJET_VARIABLE_SERVICE', 'service');
 
 
 
/**
//==================================== CONSTANTES ==================================
* Constantes pour les listes de discussion
//==================================================================================
*/
 
define ('PROJET_CHEMIN_LISTES', '') ;
define ('PROJET_DOMAINE_LISTE', 'localhost') ;
define ('PROJET_CHEMIN_ATELIERS', 'http://domaine.ext/papyrus.php?site=<>&menu=<>&id_projet=<>') ;
define ('PROJET_SERVEUR_VPOPMAIL', 'http://vpopmail.domaine.ext') ;
 
 
/**
//==================================== CONSTANTES ==================================
* Constantes pour des options
//==================================================================================
*/
define ('PROJET_UTILISE_TYPE', false) ;
define ('PROJET_UTILISE_HIERARCHIE', false) ;
define ('PROJET_LISTE_RESUME',true);
 
// Mettre à true si les utilisateurs peuvent déposer des projets
define ('PROJET_UTILISATEURS_COORD', false) ;
// Taille maximume des fichiers pouvant être uploadé : modifier aussi dans php.ini les variables :post_max_size et upload_max_filesize
define ('PROJET_UPLOAD_MAX_FILE_SIZE', 4*1024*1024) ;// 4 Mo
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.12 2008-10-29 15:49:24 aperonnet
* fichier de configuration de l'appli projet
*
* Revision 1.11 2008-05-21 14:37:48 alexandre_tb
* ajout de la constante PROJET_LIEN_INSCRIPTION_CMS
*
* Revision 1.10 2007-04-19 09:19:52 alexandre_tb
* constante PROJET_VARIABLE_SERVICE pour les liaisons asynchrone
*
* Revision 1.9 2007/02/13 15:11:39 jp_milcent
* Ajout d'une constante pour l'upload de fichier.
*
* Revision 1.8 2006/07/04 09:30:56 alexandre_tb
* Ajout d'une variable global lang pour éviter les warning dans certains cas
*
* Revision 1.7 2006/06/26 11:48:50 alexandre_tb
* typographie
*
* Revision 1.6 2006/03/02 09:24:36 mathilde
* remplacement des noms de tables de l'annuaire
*
* Revision 1.5 2006/02/15 16:33:42 alexandre_tb
* ajout de la constante PROJET_UTILISATEUR_COORD
*
* Revision 1.4 2006/01/26 14:06:07 florian
* ajout des constantes d'accès à vpopmail.
*
* Revision 1.3 2005/11/14 10:14:30 ddelon
* Projets Wikini
*
* Revision 1.2 2005/10/20 10:28:25 ddelon
* Wikini complet dans l'intégrateur Wikini
*
* Revision 1.1 2005/09/27 12:50:28 ddelon
* Projet configuration
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
 
?>
/tags/2014_06_04/documentation/installation.txt
New file
0,0 → 1,50
Installation du module projet.
 
1. Uploader tous les fichiers de client/projet vers le serveur distant
2. Editer configuration/projet.config.inc.php, mettre des valeurs adéquates
3. Effectuer les requetes du fichier documentation/installation_projet.sql
4. Ajouter un administrateur dans la table projet_statut_utilisateurs avec comme
statut 0
5. Déployer l'application dans un menu de papyrus, mettre en argument presentation=arbre
afin de pouvoir créer un premier projet
6. S'identifier avec le compte administrateur
7. Aller sur l'appli projet et créer le premier projet
8. éventuellement enlever le paramètre presentation
 
## Les paramètres
presentation=(arbre,liste) Note lorsqu'on choisit liste, les menus apparaissent par défaut
c'est une liste qui apparait mais sans les menus (cad seulement un point d'accès aux projets
exclure=(un nombre) n'affichera pas le projet dont le numéro est indiqué,
sert à créer des projets qui n'apparaissent pas mais sont accessible via une url
on peut indiquer plusieur numéro en les séparant par des virgules
projet_type=(un_type) permet de filtrer les projets selon leur type
seulement_forum=(nombre) n'affiche que le projet nombre et uniquement la page forum
utilise lorsqu'on veut un simple forum
seulement=(identifiant projet) n'affichera qu'un seul projet
prive=(0/1) si nombre = 1 alors les utilisateurs ne peuvent pas s'inscrire seul,
il faut l'intervention du coordonateur ou plus.
telechargement=1 Affiche un porte-document juste pour télécharger les fichier, à utiliser conjointement
avec "seulement"
## NOTE
dans la présentation par arbre, il faut veiller à avoir une cime, cad un projet qui n'a pas de père
 
 
Installation des forums
 
dans php.ini, verifier que le safe_mode est à On
créer dans /usr/local/lib/safe_mode des liens symbolique vers les exécutables
de ezmlm
----
lrwxrwxrwx 1 root staff 30 Jul 9 16:09 ezmlm-idx -> /usr/local/bin/ezmlm/ezmlm-idx
lrwxrwxrwx 1 root staff 31 Jul 9 16:09 ezmlm-list -> /usr/local/bin/ezmlm/ezmlm-list
lrwxrwxrwx 1 root staff 31 Jul 9 16:10 ezmlm-make -> /usr/local/bin/ezmlm/ezmlm-make
lrwxrwxrwx 1 root staff 30 Jul 9 16:10 ezmlm-sub -> /usr/local/bin/ezmlm/ezmlm-sub
lrwxrwxrwx 1 root staff 32 Jul 9 16:10 ezmlm-unsub -> /usr/local/bin/ezmlm/ezmlm-unsub
 
également :
lrwxrwxrwx 1 root staff 7 Jul 9 16:35 rm -> /bin/rm
 
 
Puis écrire une entrée dans le fichier /etc/hosts du serveur pointant vers lui-même,
ce doit être la même que la constante PROJET_SERVEUR_VPOPMAIL
/tags/2014_06_04/documentation/installation_projet.sql
New file
0,0 → 1,306
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Jeu 10 Juin 2010 à 08:10
-- Version du serveur: 5.1.36
-- Version de PHP: 5.3.0
 
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
 
--
-- Base de données: `plantnet`
--
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet`
--
 
CREATE TABLE IF NOT EXISTS `projet` (
`p_id` int(10) unsigned NOT NULL DEFAULT '0',
`p_titre` varchar(255) NOT NULL DEFAULT '',
`p_resume` varchar(255) NOT NULL DEFAULT '',
`p_description` text,
`p_espace_internet` varchar(255) DEFAULT NULL,
`p_wikini` varchar(255) NOT NULL DEFAULT '',
`p_date_creation` date NOT NULL DEFAULT '0000-00-00',
`p_nom_repertoire` varchar(255) NOT NULL DEFAULT '',
`p_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
`p_modere` tinyint(3) unsigned NOT NULL,
`p_avoir_document` tinyint(3) unsigned NOT NULL DEFAULT '0',
`p_nombre_participants` int(10) unsigned NOT NULL,
`p_en_dormance` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`p_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_avoir_theme`
--
 
CREATE TABLE IF NOT EXISTS `projet_avoir_theme` (
`pat_id_projet` int(10) unsigned NOT NULL,
`pat_id_theme` int(10) unsigned NOT NULL,
PRIMARY KEY (`pat_id_projet`,`pat_id_theme`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_documents`
--
 
CREATE TABLE IF NOT EXISTS `projet_documents` (
`pd_id` int(10) unsigned NOT NULL DEFAULT '0',
`pd_ce_projet` int(10) unsigned NOT NULL DEFAULT '0',
`pd_ce_utilisateur` int(11) DEFAULT '0',
`pd_ce_type` int(11) NOT NULL DEFAULT '0',
`pd_nom` varchar(255) DEFAULT NULL,
`pd_lien` varchar(255) DEFAULT NULL,
`pd_pere` int(10) unsigned NOT NULL DEFAULT '0',
`pd_permissions` smallint(5) unsigned DEFAULT NULL,
`pd_date_de_mise_a_jour` date DEFAULT NULL,
`pd_description` text,
`pd_visibilite` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`pd_id`),
KEY `pd_ce_projet` (`pd_ce_projet`),
KEY `pd_date_de_mise_a_jour` (`pd_date_de_mise_a_jour`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_documents_sauvegarde`
--
 
CREATE TABLE IF NOT EXISTS `projet_documents_sauvegarde` (
`pd_id` int(10) unsigned NOT NULL DEFAULT '0',
`pd_ce_projet` int(10) unsigned NOT NULL DEFAULT '0',
`pd_ce_utilisateur` int(11) DEFAULT '0',
`pd_ce_type` int(11) NOT NULL DEFAULT '0',
`pd_nom` varchar(255) DEFAULT NULL,
`pd_lien` varchar(255) DEFAULT NULL,
`pd_pere` int(10) unsigned NOT NULL DEFAULT '0',
`pd_permissions` smallint(5) unsigned DEFAULT NULL,
`pd_date_de_mise_a_jour` date DEFAULT NULL,
`pd_description` text,
`pd_visibilite` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`pd_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_evenement`
--
 
CREATE TABLE IF NOT EXISTS `projet_evenement` (
`pe_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`pe_ce_utilisateur` int(11) NOT NULL DEFAULT '0',
`pe_ce_projet` int(10) unsigned NOT NULL DEFAULT '0',
`pe_date_debut` date DEFAULT NULL,
`pe_titre` varchar(255) DEFAULT NULL,
`pe_description` text,
`pe_date_fin` date DEFAULT NULL,
PRIMARY KEY (`pe_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_hierarchie`
--
 
CREATE TABLE IF NOT EXISTS `projet_hierarchie` (
`ph_id_projet_pere` int(10) unsigned NOT NULL DEFAULT '0',
`ph_id_projet_fils` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`ph_id_projet_pere`,`ph_id_projet_fils`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_inscription_liste`
--
 
CREATE TABLE IF NOT EXISTS `projet_inscription_liste` (
`pil_id_liste` int(10) unsigned NOT NULL DEFAULT '0',
`pil_id_utilisateur` int(10) unsigned NOT NULL DEFAULT '0',
`pil_id_statut` tinyint(3) unsigned NOT NULL DEFAULT '0',
`pil_date_inscription` date NOT NULL,
PRIMARY KEY (`pil_id_liste`,`pil_id_utilisateur`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_lien_forum`
--
 
CREATE TABLE IF NOT EXISTS `projet_lien_forum` (
`PLF_ID_PROJET` int(10) unsigned NOT NULL DEFAULT '0',
`PLF_ID_FORUM` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`PLF_ID_PROJET`,`PLF_ID_FORUM`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Table des qui relie les forums et les projets';
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_lien_liste`
--
 
CREATE TABLE IF NOT EXISTS `projet_lien_liste` (
`pl_id_liste` int(10) unsigned NOT NULL DEFAULT '0',
`pl_id_projet` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`pl_id_liste`,`pl_id_projet`),
KEY `pl_id_projet` (`pl_id_projet`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='table faisant le lien entre les projets et les listes de dis';
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_lien_liste_externe`
--
 
CREATE TABLE IF NOT EXISTS `projet_lien_liste_externe` (
`plle_id_projet` int(10) unsigned NOT NULL DEFAULT '0',
`plle_id_liste` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`plle_id_projet`,`plle_id_liste`),
KEY `plle_id_projet` (`plle_id_projet`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_liste`
--
 
CREATE TABLE IF NOT EXISTS `projet_liste` (
`pl_id_liste` int(10) unsigned NOT NULL AUTO_INCREMENT,
`pl_nom_liste` varchar(255) NOT NULL DEFAULT '',
`pl_domaine` varchar(255) NOT NULL DEFAULT '',
`pl_adresse_liste` varchar(255) DEFAULT NULL,
`pl_adresse_inscription` varchar(255) DEFAULT NULL,
`pl_adresse_desinscription` varchar(255) DEFAULT NULL,
`pl_adresse_aide` varchar(255) DEFAULT NULL,
`pl_visibilite` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`pl_id_liste`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=70 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_liste_statut`
--
 
CREATE TABLE IF NOT EXISTS `projet_liste_statut` (
`pls_id_statut` tinyint(3) unsigned NOT NULL DEFAULT '0',
`pls_statut_nom` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`pls_id_statut`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_preferences_utilisateurs`
--
 
CREATE TABLE IF NOT EXISTS `projet_preferences_utilisateurs` (
`ppu_id` int(10) unsigned DEFAULT NULL,
`ppu_ce_utilisateur` int(11) NOT NULL,
`ppu_preferences` text
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_statistiques`
--
 
CREATE TABLE IF NOT EXISTS `projet_statistiques` (
`ps_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ps_ce_projet` int(10) unsigned NOT NULL,
`ps_msg_derniere_semaine` int(10) unsigned DEFAULT NULL,
`ps_doc_derniere_semaine` int(10) unsigned DEFAULT NULL,
`ps_nombre_inscrit_derniere_semaine` int(11) NOT NULL,
`ps_nombre_inscrit` int(10) unsigned DEFAULT NULL,
`ps_nombre_inscrit_liste` int(10) unsigned DEFAULT NULL,
`ps_nombre_membre_yahoo` int(10) unsigned NOT NULL,
`ps_modifwiki_derniere_semaine` int(10) unsigned DEFAULT NULL,
`ps_date` datetime NOT NULL,
`ps_maj` datetime NOT NULL,
`ps_somme` float unsigned NOT NULL,
`ps_pourcent` tinyint(3) unsigned NOT NULL,
`ps_dernier` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`ps_id`),
KEY `ps_date` (`ps_date`),
KEY `ps_ce_projet` (`ps_ce_projet`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6908 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_statut`
--
 
CREATE TABLE IF NOT EXISTS `projet_statut` (
`ps_id_statut` int(10) unsigned NOT NULL DEFAULT '0',
`ps_statut_nom` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`ps_id_statut`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_statut_utilisateurs`
--
 
CREATE TABLE IF NOT EXISTS `projet_statut_utilisateurs` (
`psu_id_statut` int(10) unsigned NOT NULL DEFAULT '0',
`psu_id_utilisateur` int(11) NOT NULL DEFAULT '0',
`psu_id_projet` int(10) unsigned NOT NULL DEFAULT '0',
`psu_date_inscription` date DEFAULT '0000-00-00',
PRIMARY KEY (`psu_id_statut`,`psu_id_utilisateur`,`psu_id_projet`),
KEY `psu_id_projet` (`psu_id_projet`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_template`
--
 
CREATE TABLE IF NOT EXISTS `projet_template` (
`pt_id_template` smallint(5) unsigned NOT NULL DEFAULT '0',
`pt_i18n` varchar(5) NOT NULL DEFAULT '',
`pt_template` text NOT NULL,
PRIMARY KEY (`pt_id_template`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_theme`
--
 
CREATE TABLE IF NOT EXISTS `projet_theme` (
`pt_id_theme` tinyint(3) unsigned NOT NULL DEFAULT '0',
`pt_label_theme` varchar(255) NOT NULL,
PRIMARY KEY (`pt_id_theme`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `projet_type`
--
 
CREATE TABLE IF NOT EXISTS `projet_type` (
`pt_id_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
`pt_label_type` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`pt_id_type`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/tags/2014_06_04/documentation/projet_v0.24.sql
New file
0,0 → 1,194
INSERT INTO `gen_application` ( `gap_id_application` , `gap_nom` , `gap_description` , `gap_chemin` , `gap_bool_applette` )
VALUES (
'18', 'Projets', 'Application de gestion de projets', 'client/projet/projet.php', '0'
);
 
CREATE TABLE `projet` (
`p_id` int(10) unsigned NOT NULL default '0',
`p_titre` varchar(255) NOT NULL default '',
`p_resume` varchar(255) NOT NULL default '',
`p_description` text,
`p_espace_internet` varchar(255) default NULL,
`p_wikini` varchar(255) NOT NULL default '',
`p_date_creation` date NOT NULL default '0000-00-00',
`p_nom_repertoire` varchar(255) NOT NULL default '',
`p_type` smallint(5) unsigned NOT NULL default '0',
`p_modere` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`p_id`)
);
 
 
 
CREATE TABLE `projet_documents` (
`pd_id` int(10) unsigned NOT NULL default '0',
`pd_ce_projet` int(10) unsigned NOT NULL default '0',
`pd_ce_utilisateur` int(11) default '0',
`pd_ce_type` int(11) NOT NULL default '0',
`pd_nom` varchar(255) default NULL,
`pd_lien` varchar(255) default NULL,
`pd_pere` int(10) unsigned NOT NULL default '0',
`pd_permissions` smallint(5) unsigned default NULL,
`pd_date_de_mise_a_jour` date default NULL,
`pd_description` text,
`pd_visibilite` varchar(64) NOT NULL default '',
PRIMARY KEY (`pd_id`)
);
 
 
CREATE TABLE `projet_evenement` (
`pe_id` int(10) unsigned NOT NULL auto_increment,
`pe_ce_utilisateur` int(11) NOT NULL default '0',
`pe_ce_projet` int(10) unsigned NOT NULL default '0',
`pe_date_debut` date default NULL,
`pe_titre` varchar(255) default NULL,
`pe_description` text,
`pe_date_fin` date default NULL,
PRIMARY KEY (`pe_id`)
);
 
CREATE TABLE `projet_hierarchie` (
`ph_id_projet_pere` int(10) unsigned NOT NULL default '0',
`ph_id_projet_fils` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`ph_id_projet_pere`,`ph_id_projet_fils`)
);
 
 
CREATE TABLE `projet_inscription_liste` (
`pil_id_liste` int(10) unsigned NOT NULL default '0',
`pil_id_utilisateur` int(10) unsigned NOT NULL default '0',
`pil_id_statut` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`pil_id_liste`,`pil_id_utilisateur`)
);
 
 
CREATE TABLE `projet_lien_liste` (
`pl_id_liste` int(10) unsigned NOT NULL default '0',
`pl_id_projet` int(10) unsigned NOT NULL default '0'
);
 
 
CREATE TABLE `projet_lien_liste_externe` (
`plle_id_projet` int(10) unsigned NOT NULL default '0',
`plle_id_liste` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`plle_id_projet`,`plle_id_liste`)
);
 
CREATE TABLE `projet_liste` (
`pl_id_liste` int(10) unsigned NOT NULL auto_increment,
`pl_nom_liste` varchar(255) NOT NULL default '',
`pl_domaine` varchar(255) NOT NULL default '',
`pl_adresse_liste` varchar(255) default NULL,
`pl_adresse_inscription` varchar(255) default NULL,
`pl_adresse_desinscription` varchar(255) default NULL,
`pl_adresse_aide` varchar(255) default NULL,
`pl_visibilite` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`pl_id_liste`)
);
 
 
CREATE TABLE `projet_liste_statut` (
`pls_id_statut` tinyint(3) unsigned NOT NULL default '0',
`pls_statut_nom` varchar(255) NOT NULL default '',
PRIMARY KEY (`pls_id_statut`)
);
 
INSERT INTO `projet_liste_statut` VALUES (0, 'Pas d''email');
INSERT INTO `projet_liste_statut` VALUES (2, 'Email');
CREATE TABLE `projet_statut` (
`ps_id_statut` int(10) unsigned NOT NULL default '0',
`ps_statut_nom` varchar(255) NOT NULL default '',
PRIMARY KEY (`ps_id_statut`)
);
 
INSERT INTO `projet_statut` VALUES (0, 'Administrateur');
INSERT INTO `projet_statut` VALUES (1, 'Coordonateur');
INSERT INTO `projet_statut` VALUES (2, 'Participant');
CREATE TABLE `projet_statut_utilisateurs` (
`psu_id_statut` int(10) unsigned NOT NULL default '0',
`psu_id_utilisateur` int(11) NOT NULL default '0',
`psu_id_projet` int(10) unsigned NOT NULL default '0',
`psu_date_inscription` date default '0000-00-00',
PRIMARY KEY (`psu_id_statut`,`psu_id_utilisateur`,`psu_id_projet`)
);
-- La table projet_statut_utilisateurs possède une entré avec psu_id_projet = 0
-- pour indiquer un administrateur
 
INSERT INTO `projet_statut_utilisateurs` ( `psu_id_statut` , `psu_id_utilisateur` , `psu_id_projet` , `psu_date_inscription` )
VALUES (
'0', '1', '0', '0000-00-00'
);
 
 
 
CREATE TABLE `gen_type_de_fichier` (
`gtf_id_type` int(11) NOT NULL default '0',
`gtf_nom` varchar(255) NOT NULL default '',
`gtf_extension` varchar(255) NOT NULL default '',
`gtf_type_icone` varchar(255) NOT NULL default 'default.gif',
`gtf_type_mime` varchar(255) NOT NULL default '',
`gtf_description` varchar(255) default NULL,
PRIMARY KEY (`gtf_id_type`)
) ;
 
--
-- Contenu de la table `gen_type_de_fichier`
--
 
INSERT INTO `gen_type_de_fichier` VALUES (1, 'Fichier Document', 'doc', 'docdoc.gif', 'application/msword', '');
INSERT INTO `gen_type_de_fichier` VALUES (2, 'Fichier Texte', 'txt', 'doctxt.gif', 'text/plain', '');
INSERT INTO `gen_type_de_fichier` VALUES (3, 'Fichier Texte Enrichi', 'rtf', 'docdoc.gif', 'text/rtf', '');
INSERT INTO `gen_type_de_fichier` VALUES (4, 'Fichier Compressà', 'zip', 'doczip.gif', 'application/zip', '');
INSERT INTO `gen_type_de_fichier` VALUES (5, 'Document PDF', 'pdf', 'pdf.gif', 'application/pdf', '');
INSERT INTO `gen_type_de_fichier` VALUES (6, 'Page Web', 'htm', 'web.gif', 'text/html', 'htm, html');
INSERT INTO `gen_type_de_fichier` VALUES (7, 'Feuille de Calcul Excel', 'xls', 'docxls.gif', 'application/vnd.ms-excel', '');
INSERT INTO `gen_type_de_fichier` VALUES (8, 'Pr&eacute;sentation Power Point', 'ppt', 'docppt.gif', 'application/vnd.ms-powerpoint', '');
INSERT INTO `gen_type_de_fichier` VALUES (9, 'Image JPG', 'jpg', 'docimg.gif', 'image/jpg', 'jpg, jpeg');
INSERT INTO `gen_type_de_fichier` VALUES (10, 'Image GIF', 'gif', 'docimg.gif', 'image/gif', '');
INSERT INTO `gen_type_de_fichier` VALUES (11, 'Image PNG', 'png', 'docimg.gif', 'image/png', '');
INSERT INTO `gen_type_de_fichier` VALUES (12, 'Inconnu', '', 'default.gif', '', '');
INSERT INTO `gen_type_de_fichier` VALUES (13, 'Fichier PHP', 'php', 'php.gif', '', '');
INSERT INTO `gen_type_de_fichier` VALUES (14, 'Fichier Photoshop', 'psd', 'docpsd.gif', 'image/psd', 'psd');
INSERT INTO `gen_type_de_fichier` VALUES (15, 'Pr&eacute;sentation OpenOffice Impress', 'sxi', 'docppt.gif', 'application/vnd.sun.xml.impress', 'sxi');
INSERT INTO `gen_type_de_fichier` VALUES (16, 'Image JPG', 'jpg', 'docimg.gif', 'image/jpeg', 'jpg, jpeg');
INSERT INTO `gen_type_de_fichier` VALUES (17, 'Image JPG', 'jpg', 'docimg.gif', 'image/pjpeg', 'jpg, jpeg');
CREATE TABLE `projet_type` (
`pt_id_type` tinyint(3) unsigned NOT NULL default '0',
`pt_label_type` varchar(255) NOT NULL default '',
PRIMARY KEY (`pt_id_type`)
) ;
 
CREATE TABLE `projet_template` (
`pt_id_template` smallint(5) unsigned NOT NULL default '0',
`pt_i18n` varchar(5) NOT NULL default '',
`pt_template` text NOT NULL,
PRIMARY KEY (`pt_id_template`)
);
 
#
# Contenu de la table `projet_template`
#
 
INSERT INTO `projet_template` VALUES (1, 'fr-FR', 'L\'utilisateur {nom} {prenom} souhaite &ecirc;tre inscrit au projet {nom_projet} dont vous &ecirc;tes mod&eacute;rateur.\r\nCliquez sur le lien suivant pour mod&eacute;rer son inscription.\r\n{lien}\r\n');
 
CREATE TABLE `projet_avoir_theme` (
`pat_id_projet` int(10) unsigned NOT NULL,
`pat_id_theme` int(10) unsigned NOT NULL,
PRIMARY KEY (`pat_id_projet`,`pat_id_theme`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
 
CREATE TABLE `projet_theme` (
`pt_id_theme` tinyint(3) unsigned NOT NULL default '0',
`pt_label_theme` varchar(255) NOT NULL,
PRIMARY KEY (`pt_id_theme`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
--
-- Contenu de la table `projet_theme`
--
 
INSERT INTO `projet_theme` VALUES (1, 'Th&egrave;mes g&eacute;n&eacute;ralistes');
/tags/2014_06_04/documentation/projet_v0.25.sql
New file
0,0 → 1,2
# Mise a jour performance
ALTER TABLE `projet` ADD `p_avoir_document` TINYINT UNSIGNED DEFAULT '0' NOT NULL ;
/tags/2014_06_04/presentation/mes_projets.php
New file
0,0 → 1,505
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: mes_projets.php,v 1.1 2008-09-01 14:36:48 alexandre_tb Exp $
/**
* Application projet
*
* Fichier de presentation de la liste des projets pour Tela Botanica nouvelle version
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
define ('PROJET_VARIABLE_MODE_AFFICHAGE', 'projet_affichage');
define ('PROJET_VARIABLE_TRI', 'projet_tri');
define ('PROJET_VARIABLE_ORDRE_TRI', 'projet_ordre_tri');
define ('PROJET_VARIABLE_THEME', 'theme');
 
if (PROJET_UTILISE_TYPE && $this->_type != '') {
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
} else {
// Un tableau de tous les projets dans $projetListe
//$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ;
}
 
$_SESSION['_PROJET_']['motif_recherche'] = '';
 
$url = $this->_url->getURL();
$loggue = $this->_auth->getAuth();
 
// Verification sur l ordre de tri et mise en place
// du tri par defaut sur le titre
 
$valeur_acceptable_tri = array ('p_titre', 'ps_pourcent', 'ps_nombre_inscrit', 'ps_doc_derniere_semaine', 'psu_id_statut'); // Securite
 
if (isset($_GET[PROJET_VARIABLE_TRI]) && $_GET[PROJET_VARIABLE_TRI] != '' && in_array($_GET[PROJET_VARIABLE_TRI], $valeur_acceptable_tri)) {
$tri = $_GET[PROJET_VARIABLE_TRI];
 
} else {
$tri = 'p_titre';
}
 
$valeur_acceptable_ordre_tri = array ('asc', 'desc'); // securite
 
if (isset($_GET[PROJET_VARIABLE_ORDRE_TRI]) && $_GET[PROJET_VARIABLE_ORDRE_TRI] != ''
&& in_array ($_GET[PROJET_VARIABLE_ORDRE_TRI], $valeur_acceptable_ordre_tri)) {
$ordre_tri = $_GET[PROJET_VARIABLE_ORDRE_TRI];
 
} else {
$ordre_tri = '';
}
 
// variable de session pour se rappeler des choix du visiteur
if (!isset ($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && isset($_SESSION['_PROJET_']['projet_affichage']) && ($_SESSION['_PROJET_']['projet_affichage'] == 'simple' || $_SESSION['_PROJET_']['projet_affichage'] == 'expert')) {
$_GET[PROJET_VARIABLE_MODE_AFFICHAGE] = $_SESSION['_PROJET_']['projet_affichage'];
}
 
if (isset($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && $_GET[PROJET_VARIABLE_MODE_AFFICHAGE] != '') {
$_SESSION['_PROJET_']['projet_affichage'] = $_GET[PROJET_VARIABLE_MODE_AFFICHAGE];
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'simple');
$lien_interface_simple = '[<a href="'.$this->_url->getURL().'">Affichage simple</a>]';
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
$lien_interface_expert = '';
} else {
$_SESSION['_PROJET_']['projet_affichage'] = 'simple';
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
$lien_interface_simple = '';
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]';
}
} else {
$_SESSION['_PROJET_']['projet_affichage'] = 'simple';
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
$lien_interface_simple = '';
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]';
}
 
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert') {
$ordre_tri = 'desc';
$tri = 'ps_pourcent';
}
/** Affichage des themes de projets */
$requete_type = 'SELECT count( p_id ) AS nbe, pt_label_theme,pt_id_theme
FROM projet, projet_avoir_theme, projet_theme
WHERE p_id = pat_id_projet
AND pat_id_theme = pt_id_theme and p_en_dormance=0
GROUP BY pt_id_theme';
 
$resultat_type = $GLOBALS['projet_db']->query($requete_type);
 
if (DB::isError($resultat_type)) return $resultat_type->getMessage();
 
$tableau_theme = array();
 
$requete_nb_pj = 'select count(*) as nb from projet';
$nombre_total_projet = $GLOBALS['projet_db']->getOne($requete_nb_pj);
 
// On ajoute le theme tous
$tableau_theme[0]['label'] = 'Tous les projets';
$tableau_theme[0]['id'] = 0;
$tableau_theme[0]['nombre_projet'] = $nombre_total_projet;
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE);
$tableau_theme[0]['lien'] = $this->_url->getURL();
 
// Et le theme en dormance
$requete_dormance = 'select count(p_id) as nb_p_dorman from projet where p_en_dormance=1';
$nb_p_dormant = $GLOBALS['projet_db']->getOne($requete_dormance);
 
 
 
while ($ligne_type = $resultat_type->fetchRow(DB_FETCHMODE_OBJECT)) {
$tableau_theme[$ligne_type->pt_id_theme]['label'] = $ligne_type->pt_label_theme;
$tableau_theme[$ligne_type->pt_id_theme]['id'] = $ligne_type->pt_id_theme;
$tableau_theme[$ligne_type->pt_id_theme]['nombre_projet'] = $ligne_type->nbe;
$this->_url->addQueryString(PROJET_VARIABLE_THEME, $ligne_type->pt_id_theme);
$tableau_theme[$ligne_type->pt_id_theme]['lien'] = $this->_url->getURL();
}
$tableau_theme[9]['label'] = 'En dormance';
$tableau_theme[9]['id'] = 9;
$tableau_theme[9]['nombre_projet'] = $nb_p_dormant;
$this->_url->addQueryString(PROJET_VARIABLE_THEME, 9);
$tableau_theme[9]['lien'] = $this->_url->getURL();
 
 
$this->_url->removeQueryString(PROJET_VARIABLE_THEME);
 
// Contruction de la requete, soit avec le moteur de recherche
// soit la liste des projets
if (isset($_GET['projet_recherche']) && $_GET['projet_recherche'] != '') {
$_SESSION['_PROJET_']['motif_recherche'] = $_GET['projet_recherche'];
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php';
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php';
 
$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']);
$recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']);
$moteur->ajouterRecherche($recherche_projet);
$resultats = $moteur->rechercherMotif();
 
// $chaine_id_projet contient une liste d identifiant separer par une virgule
if (!empty($resultats)) {
$chaine_id_projet = '';
foreach ($resultats as $projet) {
$chaine_id_projet .= $projet['id'].',';
}
$chaine_id_projet = substr($chaine_id_projet, 0, -1);
$where_recherche = ' where p_id in ('.$chaine_id_projet.')';
 
$valeur_projet_recherche = $_GET['projet_recherche'];
}
} else {
$where_recherche = '';
$valeur_projet_recherche = '';
}
$select = '';
$from_recherche = '';
if (isset($_GET[PROJET_VARIABLE_THEME])) {
$from_recherche = ' left join projet_avoir_theme on pat_id_projet=p_id left join projet_theme on pat_id_theme=pt_id_theme';
$where_recherche = ' where pat_id_theme='.$this->_db->escapeSimple($_GET[PROJET_VARIABLE_THEME]);
$theme_selectionne = $_GET[PROJET_VARIABLE_THEME];
} else {
$theme_selectionne = 0;
}
 
if ($this->_auth->getAuth()) {
/** on recherche egalement le statut si l utilisateur est loggue */
// On recherche les projets auquels l utilisateur participe
include_once PROJET_CHEMIN_CLASSES.'participe.class.php';
$participant = new participe ($this->_db);
$tableau_projet = $participant->getInformationsUtilisateurs($this->_auth->getAuthData(PROJET_CHAMPS_ID));
$chaine_id_projet = '';
if (count ($tableau_projet) == 0) {
return '<p class="information">Vous n\'&ecirc;tes inscrit &agrave; aucun projet</p>';
}
foreach ($tableau_projet as $projet) {
$chaine_id_projet .= $projet[3].',';
}
$chaine_id_projet = substr($chaine_id_projet, 0, -1);
$where_recherche .= ' where p_id in ('.$chaine_id_projet.')';
 
$from_recherche .= ' left join projet_statut_utilisateurs on psu_id_projet=p_id and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID)).
' left join projet_statut on psu_id_statut=ps_id_statut';
$select = 'psu_id_statut, ps_statut_nom,';
}
$requete = 'select '.$select.'p_id, p_titre, p_resume, pl_id_liste, plle_id_liste, p_avoir_document, ps_nombre_inscrit, ps_pourcent,'.
' p_wikini, ps_doc_derniere_semaine, p_avoir_document, ps_nombre_inscrit_derniere_semaine, '.
' ps_nombre_membre_yahoo, ps_msg_derniere_semaine, ps_modifwiki_derniere_semaine, p_en_dormance from'.
' projet left join projet_lien_liste on p_id=pl_id_projet'.
' left join projet_lien_liste_externe on p_id=plle_id_projet'.
' left join projet_statistiques on p_id=ps_ce_projet and ps_dernier=1'.
$from_recherche.
$where_recherche.
' group by p_id order by '.$tri.' '.$ordre_tri ;
 
if ($ordre_tri == '') {
$ordre_tri = 'desc';
}
 
$resultat = $this->_db->query($requete) ;
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
 
$nombre_resultat = $resultat->numRows();
 
/* Si l utilisateur est loggue, on recherche son statut par rapport aux projets */
if ($this->_auth->getAuth()) {
$requete_statut = 'select psu_id_projet, psu_id_statut, ps_statut_nom from projet_statut_utilisateurs, projet_statut'.
' where ps_id_statut=psu_id_statut and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID));
$resultat_statut = $GLOBALS['projet_db']->query($requete_statut);
while ($ligne_statut = $resultat_statut->fetchRow(DB_FETCHMODE_OBJECT)) {
$tableau_statut[$ligne_statut->psu_id_projet]['id_statut'] = $ligne_statut->psu_id_statut;
$tableau_statut[$ligne_statut->psu_id_projet]['nom_statut'] = $ligne_statut->ps_statut_nom;
}
}
 
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php';
 
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
// Si le projet est en dormance, on ne l affiche pas dans le mode normal
// Sauf si le theme choisit est "en dormance"
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1 && $theme_selectionne != 9) {
 
} else {
$donnees[] = $ligne;
}
 
}
 
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
$perpage = $nombre_resultat;
} else {
$perpage = 20;
}
// Parametre du pager
$params = array (
'mode' => 'Sliding',
'perPage' => $perpage,
'delta' => '5',
'linkClass' => 'num_page',
'curPageLinkClassName' => 'page_courante',
'spacesBeforeSeparator' => 0,
'spacesAfterSeparator' => 0,
'separator' => '',
'prevImg' => '&lt;&lt; Page pr&eacute;c&eacute;dente',
'nextImg' => 'Page suivante &gt;&gt;',
'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'],
PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']),
'itemData' => $donnees
);
$pager = & Pager::factory($params);
$links = $pager->getLinks();
$data = $pager->getPageData();
$nombre_projets = $pager->numItems();
$range = $pager->getOffsetByPageId();
 
// On inclue un fichier local
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
// On verifie si l'utilisateur participe a des projets
 
$projetNonParticipantListe = & $projetListe ;
 
 
$liste_projet = array() ;
// La liste
 
 
$tableau_donnees = array();
foreach ($data as $ligne) {
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
 
$tableau_donnees[$ligne->p_id]['lien'] = $this->_url->getURL();
$tableau_donnees[$ligne->p_id]['titre'] = $ligne->p_titre;
 
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_inscrit;
 
$tableau_donnees[$ligne->p_id]['resume'] = $ligne->p_resume;
if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') {
if ($ligne->ps_pourcent < 33) {
$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible';
} else if ($ligne->ps_pourcent < 66) {
$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne';
} else if ($ligne->ps_pourcent <= 100) {
$tableau_donnees[$ligne->p_id]['activite'] = 'Tr&egrave;s actif';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee';
}
} else {
$tableau_donnees[$ligne->p_id]['activite'] = $ligne->ps_pourcent.'%';
}
$res .= $ligne->p_resume ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n";
 
// Recherche du forum
if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) {
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
 
$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /></a>'."\n";
$res .= $forum;
 
} else {
 
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$listes_ext = new liste_externe ($this->_db) ;
if ($ligne->plle_id_liste != null) {
$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
 
$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
'"><img src="sites/commun/generique/images/icones/yahoo.png" alt="Yahoo"/></a>';
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo;
} else {
$forum = '-';
}
}
if ($ligne->ps_msg_derniere_semaine != 0) {
$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine;
} else {
$tableau_donnees[$ligne->p_id]['nombre_message'] = 0;
}
$tableau_donnees[$ligne->p_id]['forum'] = $forum;
if ($ligne->p_wikini) {
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link=$this->_url->getURL();
$wiki_res = '<a href="'.$link.'">voir</a>' ;
if ($ligne->ps_modifwiki_derniere_semaine != 0) {
$wiki_res .= ' <span title="Nouvelles contributions cette semaine"> ( +'.$ligne->ps_modifwiki_derniere_semaine.' )</span>';
}
$this->_url->removeQueryString ('act');
} else {
$wiki_res = '-' ;
}
$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res;
$titre = '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
 
if ($ligne->p_avoir_document != 0) {
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
if ($ligne->ps_doc_derniere_semaine != 0) {
$document .= ' <span title="Nouveaux documents cette semaine">( + '.$ligne->ps_doc_derniere_semaine.')</span>';
}
} else {
$document = '-' ;
}
$tableau_donnees[$ligne->p_id]['document'] = $document;
 
if ($ligne->p_wikini) {
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link=$this->_url->getURL();
$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml');
$wiki_rss = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
$this->_url->removeQueryString ('act');
$this->_url->removeQueryString ('wiki');
} else {
$wiki_rss = '-' ;
}
$tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss;
 
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
$tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL();
if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) {
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>';
} else {
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '';
}
 
$ligne_projet = array ( '', $titre, $forum, // le nom du projet
$wiki_res, $wiki_rss,$document, $participant);
 
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
array_push ($liste_projet, $ligne_projet) ;
 
if ($loggue) {
switch ($ligne->psu_id_statut) {
case 1 : $icone_statut = 'etoile_rouge';
$tableau_donnees[$ligne->p_id]['id_statut'] = 3;
break;
case 2 : $icone_statut = 'etoile_verte';
$tableau_donnees[$ligne->p_id]['id_statut'] = 2;
break;
case 3 : $icone_statut = 'etoile_grise';
$tableau_donnees[$ligne->p_id]['id_statut'] = 1;
break;
default :
$tableau_donnees[$ligne->p_id]['statut_icone'] = '';
$tableau_donnees[$ligne->p_id]['id_statut'] = 0;
$icone_statut = false;
}
if ($icone_statut) {
$tableau_donnees[$ligne->p_id]['statut_icone'] = '<img src="'.PROJET_CHEMIN_ICONES.$icone_statut.'.png" alt="'.$ligne->ps_statut_nom.'" title="'.$ligne->ps_statut_nom.'" />';
}
 
}
$res .= '</li>'."\n";
}
$res .= '</ul>'."\n";
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
 
// Correction bug tri par participant
if ($_GET[PROJET_VARIABLE_TRI] == 'ps_nombre_inscrit') {
foreach ($tableau_donnees as $key => $row) {
$nombre_inscrit[$key] = $row['nombre_participants'];
}
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') {
$flag = SORT_ASC ;
} else {
$flag = SORT_DESC ;
}
array_multisort($nombre_inscrit, $flag, $tableau_donnees);
}
 
// Correction bug tri sur les statuts
if ($_GET[PROJET_VARIABLE_TRI] == 'psu_id_statut') {
foreach ($tableau_donnees as $key => $row) {
$id_statut[$key] = $row['id_statut'];
}
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') {
$flag = SORT_ASC ;
} else {
$flag = SORT_DESC ;
}
array_multisort($id_statut, $flag, $tableau_donnees);
}
 
$pair = true;
 
ob_start();
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'legende\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
include_once PROJET_CHEMIN_CLASSES.'enteteColonneTriable.class.php';
foreach ($valeur_acceptable_tri as $var_tri) {
$enteteTri[$var_tri] = new enteteColonneTriable($var_tri);
$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI);
$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI);
}
 
$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url);
$lien_tri_activite = $enteteTri['ps_pourcent']->getLien($this->_url);
$lien_tri_participants = $enteteTri['ps_nombre_inscrit']->getLien($this->_url);
$lien_tri_doc = $enteteTri['ps_doc_derniere_semaine']->getLien($this->_url);
$lien_tri_statut = $enteteTri['psu_id_statut']->getLien($this->_url);
include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet_expert.tpl.html';
} else {
include_once PROJET_CHEMIN_APPLI.'/squelettes/mes_projets.tpl.html';
}
$res = ob_get_contents();
ob_end_clean();
 
 
// Nettoyage de l'url
$this->_url->removeQueryString(PROJET_VARIABLE_ID_PROJET);
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE);
$this->_url->removeQueryString(PROJET_VARIABLE_ORDRE_TRI);
$this->_url->removeQueryString(PROJET_VARIABLE_TRI);
return $res;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: mes_projets.php,v $
* Revision 1.1 2008-09-01 14:36:48 alexandre_tb
* version intiale
* sert a afficher les projets auquels on est inscrit
*
* Revision 1.1 2008-08-25 15:00:28 alexandre_tb
* version initiale
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/presentation/arbre.php
New file
0,0 → 1,97
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: arbre.php,v 1.3 2007-04-19 15:34:35 neiluj Exp $
/**
* Application projet
*
* Fichier de présentation de la liste des projets par arbre
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// ON est dans la méthode mesProjets() de la classe projetControleur
 
$titre = '<h1>Arbre des Projets</h1>'."\n" ;
 
if (PROJET_UTILISE_TYPE && $this->_type != '') {
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
} else {
// Un tableau de tous les projets dans $projetListe
$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ;
}
include_once PROJET_CHEMIN_API_ARBRE.'arbre.class.php' ;
// initialisation de variables
$intensite_feuille = '' ; $longueur_branche = '' ;
$arbre = new arbre() ;
// recherche du projet principal
 
$cime='';
 
foreach ($projetListe as $projet) {
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
$lien_feuille = $this->_url->getURL() ;
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
 
if ($projet->isRacine()) {
$cime = $arbre->cime($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(), $lien_feuille, '') ;
} else {
 
$arbre->addBranche($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(),
$lien_feuille, $lien_feuille, $intensite_feuille, $longueur_branche) ;
}
}
return $titre.'<table id="arbre">'.$cime.$arbre->affBranche().$arbre->affRacine().'</table>';
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2.2.1 2007/04/11 14:26:00 alexandre_tb
* ajout d'un include de projet.class.php et participe.class.php pour limiter le nombre de fichier inclu par projetControleur.class.php
*
* Revision 1.2 2006/03/02 16:07:17 alexandre_tb
* ajout d'un id pour l'arbre
*
* Revision 1.1 2005/11/25 14:47:51 alexandre_tb
* version initiale
*
 
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
 
?>
/tags/2014_06_04/presentation/liste.php
New file
0,0 → 1,258
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: liste.php,v 1.8 2007-06-25 12:15:07 alexandre_tb Exp $
/**
* Application projet
*
* Fichier de présentation de la liste des projets
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.8 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
$titre = '<h1>'.PROJET_LISTE.'</h1>'."\n" ;
 
if (PROJET_UTILISE_TYPE && $this->_type != '') {
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
} else {
// Un tableau de tous les projets dans $projetListe
$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ;
}
// On inclue un fichier local
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php'))
include_once PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php' ;
// On verifie si l'utilisateur participe a des projets
//echo PROJET_CHEMIN_APPLI.'langues/pro_langue_'.$GLOBALS['lang'].'.local.inc.php';
// Entete de la liste, qu'on recupere dans un template
 
if (PROJET_UTILISE_TYPE && $this->_type != "") {
include_once PROJET_CHEMIN_CLASSES.'projetTemplate.class.php' ;
include_once 'HTML/Template/IT.php';
$template = new projetTemplate ($this->_db) ;
$chaine = $template->getTemplate(2, $GLOBALS['lang'], $this->_type);
if (projetTemplate::isError ($chaine)) return $chaine->getMessage() ;
$tpl = new HTML_Template_IT() ;
$tpl -> setTemplate($chaine);
}
 
if ($auth){
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$utilisateur_liste = new inscription_liste($this->_db) ;
// On teste ici s'il y a une mise a jour de statut
if (isset($_POST['statut'])) {
// $_POST['statut'] et $_GET['identifiant_projet'] proviennent du formulaire voir HTML_listeProjet
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$annuaire = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
$annuaire->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
$projet = new projet ($this->_db, $_GET['identifiant_projet']) ;
$projet->getListesAssociees() ;
$utilisateur_liste->modifierTypeInscription($projet->_listes_associes[0],$annuaire, $_POST['statut']) ;
}
if (count($participant->getIdProjetsStatuts($id_u))) {
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ;
$HTML_projetListe = new HTML_listeProjet(true) ;
$entete_liste = array($auth ? PROJET_VOUS_PARTICIPEZ : PROJET_LISTE) ;
if ($auth) array_push ($entete_liste, PROJET_SE_DESINSCRIRE, PROJET_LISTE_DE_DISCUSSION) ;
 
 
$tableau_resultat = array () ;
 
$HTML_projetListe->construitEntete ($entete_liste) ;
 
// On construit $tableau_resultat avec une ligne par projet contenant un tableau (titre, statut_nom, id_statut, id_projet)
include_once PROJET_CHEMIN_CLASSES.'statut_liste.class.php' ;
$statut_liste = new statut_liste($this->_db) ;
$tableau_statut = $statut_liste->getTousLesStatuts() ;
 
$statut = '' ;
$i = 0 ;
$HTML_projetListe->setModeModification() ;
$HTML_projetListe->setURL($this->_url) ;
foreach ($projetListe as $projet) {
if (participe::getStatutSurProjetCourant($id_u, $projet->getId(), $this->_db) == 4) continue ;
if ($auth) {
if ($projet->avoirListe()) {
$projet->getListesAssociees() ;
$statut = $utilisateur_liste->getStatutInscrit($projet->_listes_associes[0]->getId(), $this->_auth) ;
//if ($statut == '') $statut = 0 ;
}
}
 
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
$ligne_tableau = array ($projet->getId(), $projet->getResume(),
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>'
) ;
if ($auth) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ;
array_push ($ligne_tableau, '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.
PROJET_SE_DESINSCRIRE_CONFIRMATION.'\');">'.PROJET_SE_DESINSCRIRE.'</a>') ;
if ($projet->avoirListe()) {
array_push ($ligne_tableau, $statut) ;
} else {
array_push($ligne_tableau, '') ;
}
array_push ($tableau_resultat, $ligne_tableau) ;
$this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
}
$statut = '' ;
}
$HTML_projetListe->construitListe ($tableau_resultat, $tableau_statut) ;
 
 
if ($HTML_projetListe->getRowCount() > 1) {
$res .= '<p>'.PROJET_PARTICIPER.'</p>';
$res .= $HTML_projetListe->toHTML() ;
}
} else {
$res .= '<p>'.PROJET_INSCRIT_AUCUN_PROJET.'</p>' ;
}
}
 
// Un texte pour ceux qui ne sont pas identifiés
if (!$auth) {
$res .= '<p>'.PROJET_TEXTE_NON_IDENTIFIE.'</p>'."\n" ;
}
 
// Maintenant la liste des projets ou l'utilisateur ne participe pas.
// Et si pas loggue tous les projets
if ($auth) {
$projetNonParticipantListe = $participant -> getProjetsNonParticipant($id_u) ;
// Si certain projet sont à exclure, on les exclu
$projet_a_exclure = array() ;
if (count($this->_projet_exclu)) {
arsort($this->_projet_exclu) ;
foreach ($this->_projet_exclu as $valeur) {
for ($i = 0; $i < count($projetNonParticipantListe); $i++) {
if ($projetNonParticipantListe[$i]->getId() == $valeur) array_push ($projet_a_exclure, $i);}
}
}
if (PROJET_UTILISE_TYPE && $this->_type != '') {
for ($i = 0; $i < count($projetNonParticipantListe); $i++) {
if ($projetNonParticipantListe[$i]->getType() != $this->_type) array_push ($projet_a_exclure, $i) ;
}
}
 
foreach ($projet_a_exclure as $valeur) {
unset ($projetNonParticipantListe[$valeur]) ;
}
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php';
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
$entete_liste = array (PROJET_LISTE) ;
array_push ($entete_liste, PROJET_S_INSCRIRE) ;
 
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
 
$liste_projet = array() ;
// La liste
 
foreach ($projetNonParticipantListe as $projet) {
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
$ligne_projet = array ($projet->getResume(),
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>' // le nom du projet
) ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
array_push ($ligne_projet, '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>') ;
 
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
array_push ($liste_projet, $ligne_projet) ;
}
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
$HTML_projetNonParticipantListe->construitListe($liste_projet) ;
if ($HTML_projetNonParticipantListe->getRowCount() > 1) $res .= $HTML_projetNonParticipantListe->toHTML() ;
} else {
$projetNonParticipantListe = & $projetListe ;
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ;
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
$entete_liste = array (PROJET_LISTE) ;
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
 
$liste_projet = array() ;
// La liste
foreach ($projetNonParticipantListe as $projet) {
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
$ligne_projet = array ( $projet->getResume(),
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>', // le nom du projet
) ;
 
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
array_push ($liste_projet, $ligne_projet) ;
}
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
$HTML_projetNonParticipantListe->construitListe($liste_projet) ;
if ($HTML_projetNonParticipantListe->getRowCount() > 1) {
$res .= '<p>'.PROJET_TOUS_LES_PROJETS.'</p>' ;
$res .= $HTML_projetNonParticipantListe->toHTML() ;
}
}
// Nettoyage de l'url
 
if (PROJET_UTILISE_TYPE && $this->_type != '') {
$tpl->setVariable('liste_projet', $res) ;
$res = $tpl->get();
}
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
return $titre.$res ;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.7 2007-06-01 13:56:13 alexandre_tb
* ajout d un include manquant
*
* Revision 1.6 2007/04/19 15:34:35 neiluj
* préparration release (livraison) "Narmer" - v0.25
*
* Revision 1.5 2006/12/19 09:48:50 alexandre_tb
* amélioration du retour erreur lors de l appel au template
*
* Revision 1.4 2006/12/18 17:24:09 alexandre_tb
* inclusion du fichier de langue en utilisant la globale 'lang'
*
* Revision 1.3 2006/09/18 09:56:28 alexandre_tb
* utilisation d'un template pour l'entête de la liste des projets
*
* Revision 1.2 2005/11/28 16:25:23 alexandre_tb
* nettoyage URL en sortie de programme
*
* Revision 1.1 2005/11/25 14:47:51 alexandre_tb
* version initiale
*
 
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
 
?>
/tags/2014_06_04/presentation/tela_ergo.php
New file
0,0 → 1,486
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: tela_ergo.php,v 1.4 2008-10-27 16:54:59 aperonnet Exp $
/**
* Application projet
*
* Fichier de presentation de la liste des projets pour Tela Botanica nouvelle version
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
define ('PROJET_VARIABLE_MODE_AFFICHAGE', 'projet_affichage');
define ('PROJET_VARIABLE_TRI', 'projet_tri');
define ('PROJET_VARIABLE_ORDRE_TRI', 'projet_ordre_tri');
define ('PROJET_VARIABLE_THEME', 'theme');
 
if (PROJET_UTILISE_TYPE && $this->_type != '') {
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
} else {
// Un tableau de tous les projets dans $projetListe
//$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ;
}
 
$_SESSION['_PROJET_']['motif_recherche'] = '';
 
$url = $this->_url->getURL();
$loggue = $this->_auth->getAuth();
 
// Verification sur l ordre de tri et mise en place
// du tri par defaut sur le titre
 
$valeur_acceptable_tri = array ('p_titre', 'ps_pourcent', 'ps_nombre_inscrit', 'ps_doc_derniere_semaine', 'psu_id_statut'); // Securite
 
if (isset($_GET[PROJET_VARIABLE_TRI]) && $_GET[PROJET_VARIABLE_TRI] != '' && in_array($_GET[PROJET_VARIABLE_TRI], $valeur_acceptable_tri)) {
$tri = $_GET[PROJET_VARIABLE_TRI];
 
} else {
$tri = 'p_titre';
}
 
$valeur_acceptable_ordre_tri = array ('asc', 'desc'); // securite
 
if (isset($_GET[PROJET_VARIABLE_ORDRE_TRI]) && $_GET[PROJET_VARIABLE_ORDRE_TRI] != ''
&& in_array ($_GET[PROJET_VARIABLE_ORDRE_TRI], $valeur_acceptable_ordre_tri)) {
$ordre_tri = $_GET[PROJET_VARIABLE_ORDRE_TRI];
 
} else {
$ordre_tri = '';
}
 
// variable de session pour se rappeler des choix du visiteur
if (!isset ($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && isset($_SESSION['_PROJET_']['projet_affichage']) && ($_SESSION['_PROJET_']['projet_affichage'] == 'simple' || $_SESSION['_PROJET_']['projet_affichage'] == 'expert')) {
$_GET[PROJET_VARIABLE_MODE_AFFICHAGE] = $_SESSION['_PROJET_']['projet_affichage'];
}
 
if (isset($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && $_GET[PROJET_VARIABLE_MODE_AFFICHAGE] != '') {
$_SESSION['_PROJET_']['projet_affichage'] = $_GET[PROJET_VARIABLE_MODE_AFFICHAGE];
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'simple');
$lien_interface_simple = '[<a href="'.$this->_url->getURL().'">Affichage simple</a>]';
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
$lien_interface_expert = '';
} else {
$_SESSION['_PROJET_']['projet_affichage'] = 'simple';
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
$lien_interface_simple = '';
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]';
}
} else {
$_SESSION['_PROJET_']['projet_affichage'] = 'simple';
$this->_url->addQueryString (PROJET_VARIABLE_MODE_AFFICHAGE, 'expert');
$lien_interface_simple = '';
$lien_interface_expert = '[<a href="'.$this->_url->getURL().'">Affichage expert</a>]';
}
 
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert') {
$ordre_tri = 'desc';
$tri = 'ps_pourcent';
}
/** Affichage des themes de projets */
$requete_type = 'SELECT count( p_id ) AS nbe, pt_label_theme,pt_id_theme
FROM projet, projet_avoir_theme, projet_theme
WHERE p_id = pat_id_projet
AND pat_id_theme = pt_id_theme and p_en_dormance=0
GROUP BY pt_id_theme';
 
$resultat_type = $GLOBALS['projet_db']->query($requete_type);
 
if (DB::isError($resultat_type)) return $resultat_type->getMessage();
 
$tableau_theme = array();
 
$requete_nb_pj = 'select count(*) as nb from projet';
$nombre_total_projet = $GLOBALS['projet_db']->getOne($requete_nb_pj);
 
// On ajoute le theme tous
$tableau_theme[0]['label'] = 'Tous les projets';
$tableau_theme[0]['id'] = 0;
$tableau_theme[0]['nombre_projet'] = $nombre_total_projet;
$this->_url->removeQueryString(PROJET_VARIABLE_MODE_AFFICHAGE);
$tableau_theme[0]['lien'] = $this->_url->getURL();
 
// Et le theme en dormance
$requete_dormance = 'select count(p_id) as nb_p_dorman from projet where p_en_dormance=1';
$nb_p_dormant = $GLOBALS['projet_db']->getOne($requete_dormance);
 
 
 
while ($ligne_type = $resultat_type->fetchRow(DB_FETCHMODE_OBJECT)) {
$tableau_theme[$ligne_type->pt_id_theme]['label'] = $ligne_type->pt_label_theme;
$tableau_theme[$ligne_type->pt_id_theme]['id'] = $ligne_type->pt_id_theme;
$tableau_theme[$ligne_type->pt_id_theme]['nombre_projet'] = $ligne_type->nbe;
$this->_url->addQueryString(PROJET_VARIABLE_THEME, $ligne_type->pt_id_theme);
$tableau_theme[$ligne_type->pt_id_theme]['lien'] = $this->_url->getURL();
}
$tableau_theme[9]['label'] = 'En dormance';
$tableau_theme[9]['id'] = 9;
$tableau_theme[9]['nombre_projet'] = $nb_p_dormant;
$this->_url->addQueryString(PROJET_VARIABLE_THEME, 9);
$tableau_theme[9]['lien'] = $this->_url->getURL();
 
 
$this->_url->removeQueryString(PROJET_VARIABLE_THEME);
 
// Contruction de la requete, soit avec le moteur de recherche
// soit la liste des projets
if (isset($_GET['projet_recherche']) && $_GET['projet_recherche'] != '') {
$_SESSION['_PROJET_']['motif_recherche'] = $_GET['projet_recherche'];
if (!isset($GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'])) $GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'] = $this->_db;
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php';
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php';
 
$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']);
$recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']);
$moteur->ajouterRecherche($recherche_projet);
$resultats = $moteur->rechercherMotif();
 
// $chaine_id_projet contient une liste d identifiant separer par une virgule
if (!empty($resultats)) {
$chaine_id_projet = '';
foreach ($resultats as $projet) {
$chaine_id_projet .= $projet['id'].',';
}
$chaine_id_projet = substr($chaine_id_projet, 0, -1);
$where_recherche = ' where p_id in ('.$chaine_id_projet.')';
 
$valeur_projet_recherche = $_GET['projet_recherche'];
}
} else {
$where_recherche = '';
$valeur_projet_recherche = '';
}
$select = '';
$from_recherche = '';
if (isset($_GET[PROJET_VARIABLE_THEME])) {
$from_recherche = ' left join projet_avoir_theme on pat_id_projet=p_id left join projet_theme on pat_id_theme=pt_id_theme';
$where_recherche = ' where pat_id_theme='.$this->_db->escapeSimple(intval($_GET[PROJET_VARIABLE_THEME]));
$theme_selectionne = $_GET[PROJET_VARIABLE_THEME];
} else {
$theme_selectionne = 0;
}
 
if ($this->_auth->getAuth()) {
/** on recherche egalement le statut si l utilisateur est loggue */
 
$from_recherche .= ' left join projet_statut_utilisateurs on psu_id_projet=p_id and psu_id_utilisateur='.
$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID)).
' left join projet_statut on psu_id_statut=ps_id_statut';
$select = 'psu_id_statut, ps_statut_nom,';
}
$requete = 'select '.$select.'p_id, p_titre, p_resume, pl_id_liste, plle_id_liste, p_avoir_document, ps_nombre_inscrit, ps_pourcent,'.
' p_wikini, ps_doc_derniere_semaine, p_avoir_document, ps_nombre_inscrit_derniere_semaine, '.
' ps_nombre_membre_yahoo, ps_msg_derniere_semaine, ps_modifwiki_derniere_semaine, p_en_dormance from'.
' projet left join projet_lien_liste on p_id=pl_id_projet'.
' left join projet_lien_liste_externe on p_id=plle_id_projet'.
' left join projet_statistiques on p_id=ps_ce_projet and ps_dernier=1'.
$from_recherche.
$where_recherche.
' group by p_id order by '.$tri.' '.$ordre_tri ;
 
if ($ordre_tri == '') $ordre_tri = 'desc';
 
$resultat = $this->_db->query($requete) ;
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
 
$nombre_resultat = $resultat->numRows();
 
/* Si l utilisateur est loggue, on recherche son statut par rapport aux projets */
if ($this->_auth->getAuth()) {
$requete_statut = 'select psu_id_projet, psu_id_statut, ps_statut_nom from projet_statut_utilisateurs, projet_statut'.
' where ps_id_statut=psu_id_statut and psu_id_utilisateur='.$this->_db->escapeSimple($this->_auth->getAuthData(PROJET_CHAMPS_ID));
$resultat_statut = $GLOBALS['projet_db']->query($requete_statut);
while ($ligne_statut = $resultat_statut->fetchRow(DB_FETCHMODE_OBJECT)) {
$tableau_statut[$ligne_statut->psu_id_projet]['id_statut'] = $ligne_statut->psu_id_statut;
$tableau_statut[$ligne_statut->psu_id_projet]['nom_statut'] = $ligne_statut->ps_statut_nom;
}
}
 
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php';
 
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
 
// Si le projet est en dormance, on ne l affiche pas dans le mode normal
// Sauf si le theme choisit est "en dormance"
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1 && $theme_selectionne != 9) {
 
} else {
$donnees[] = $ligne;
}
 
}
 
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') $perpage = $nombre_resultat; else $perpage = 20;
// Parametre du pager
$params = array (
'mode' => 'Sliding',
'perPage' => $perpage,
'delta' => '5',
'linkClass' => 'num_page',
'curPageLinkClassName' => 'page_courante',
'spacesBeforeSeparator' => 0,
'spacesAfterSeparator' => 0,
'separator' => '',
'prevImg' => '&lt;&lt; Page pr&eacute;c&eacute;dente',
'nextImg' => 'Page suivante &gt;&gt;',
'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'],
PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']),
'itemData' => $donnees
);
$pager = & Pager::factory($params);
$links = $pager->getLinks();
$data = $pager->getPageData();
$nombre_projets = $pager->numItems();
$range = $pager->getOffsetByPageId();
 
 
// On inclue un fichier local
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
// On verifie si l'utilisateur participe a des projets
 
$projetNonParticipantListe = & $projetListe ;
 
 
$liste_projet = array() ;
// La liste
 
 
$tableau_donnees = array();
foreach ($data as $ligne) {
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
 
$tableau_donnees[$ligne->p_id]['lien'] = $this->_url->getURL();
$tableau_donnees[$ligne->p_id]['titre'] = $ligne->p_titre;
 
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_inscrit;
 
$tableau_donnees[$ligne->p_id]['resume'] = $ligne->p_resume;
if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') {
if ($ligne->ps_pourcent <33) {
$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible';
}
else if ($ligne->ps_pourcent < 66) {
$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne';
}
else if ($ligne->ps_pourcent <= 100) {
$tableau_donnees[$ligne->p_id]['activite'] = 'Tr&egrave;s actif';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee';
}
} else {
$tableau_donnees[$ligne->p_id]['activite'] = $ligne->ps_pourcent.'%';
}
$res .= $ligne->p_resume ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n";
 
// Recherche du forum
if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) {
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
 
$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /></a>'."\n";
$res .= $forum;
 
} else {
 
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$listes_ext = new liste_externe ($this->_db) ;
if ($ligne->plle_id_liste != null) {
$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
 
$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>';
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo;
} else {
$forum = '-';
}
}
if ($ligne->ps_msg_derniere_semaine != 0) {
 
$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine;
} else {
$tableau_donnees[$ligne->p_id]['nombre_message'] = 0;
}
$tableau_donnees[$ligne->p_id]['forum'] = $forum;
if ($ligne->p_wikini) {
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link=$this->_url->getURL();
$wiki_res = '<a href="'.$link.'">voir</a>' ;
if ($ligne->ps_modifwiki_derniere_semaine != 0) {
$wiki_res .= ' <span title="Nouvelles contributions cette semaine"> ( +'.$ligne->ps_modifwiki_derniere_semaine.' )</span>';
}
$this->_url->removeQueryString ('act');
} else {
$wiki_res = '-' ;
}
$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res;
$titre= '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
 
if ($ligne->p_avoir_document != 0) {
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
if ($ligne->ps_doc_derniere_semaine != 0) {
$document .= ' <span title="Nouveaux documents cette semaine">( + '.$ligne->ps_doc_derniere_semaine.')</span>';
}
} else {
$document = '-' ;
}
$tableau_donnees[$ligne->p_id]['document'] = $document;
 
if ($ligne->p_wikini) {
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link=$this->_url->getURL();
$url_rss = PROJET_URL_WIKINI.$ligne->p_wikini.'/wakka.php?wiki=DerniersChangementsRss/xml';
//$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml');
$wiki_rss = '<a href="'.$url_rss.'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
//$this->_url->removeQueryString ('act');
//$this->_url->removeQueryString ('wiki');
} else {
$wiki_rss = '-' ;
}
$tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss;
 
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
$tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL();
if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) {
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>';
} else {
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '';
}
 
$ligne_projet = array ( '', $titre, $forum, // le nom du projet
$wiki_res, $wiki_rss,$document, $participant) ;
 
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
array_push ($liste_projet, $ligne_projet) ;
 
if ($loggue) {
switch ($ligne->psu_id_statut) {
case 1 : $icone_statut = 'etoile_rouge';
$tableau_donnees[$ligne->p_id]['id_statut'] = 3;
break;
case 2 : $icone_statut = 'etoile_verte';
$tableau_donnees[$ligne->p_id]['id_statut'] = 2;
break;
case 3 : $icone_statut = 'etoile_grise';
$tableau_donnees[$ligne->p_id]['id_statut'] = 1;
break;
default : $tableau_donnees[$ligne->p_id]['statut_icone'] = '';
$tableau_donnees[$ligne->p_id]['id_statut'] = 0;
$icone_statut = false;
}
if ($icone_statut) $tableau_donnees[$ligne->p_id]['statut_icone'] = '<img src="'.PROJET_CHEMIN_ICONES.$icone_statut.'.png" alt="'.$ligne->ps_statut_nom.'" title="'.$ligne->ps_statut_nom.'" />';
 
}
$res .= '</li>'."\n";
}
$res .= '</ul>'."\n";
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
 
// Correction bug tri par participant
if ($_GET[PROJET_VARIABLE_TRI] == 'ps_nombre_inscrit') {
foreach ($tableau_donnees as $key => $row) {
$nombre_inscrit[$key] = $row['nombre_participants'];
}
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') $flag = SORT_ASC ; else $flag = SORT_DESC ;
array_multisort($nombre_inscrit, $flag, $tableau_donnees);
}
 
// Correction bug tri sur les statuts
if ($_GET[PROJET_VARIABLE_TRI] == 'psu_id_statut') {
foreach ($tableau_donnees as $key => $row) {
$id_statut[$key] = $row['id_statut'];
}
if ($_GET[PROJET_VARIABLE_ORDRE_TRI] == 'asc') $flag = SORT_ASC ; else $flag = SORT_DESC ;
array_multisort($id_statut, $flag, $tableau_donnees);
}
 
$pair = true;
 
ob_start();
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') {
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'legende\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
include_once PROJET_CHEMIN_CLASSES.'enteteColonneTriable.class.php';
foreach ($valeur_acceptable_tri as $var_tri) {
$enteteTri[$var_tri] = new enteteColonneTriable($var_tri);
$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI);
$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI);
 
}
 
$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url);
$lien_tri_activite = $enteteTri['ps_pourcent']->getLien($this->_url);
$lien_tri_participants = $enteteTri['ps_nombre_inscrit']->getLien($this->_url);
$lien_tri_doc = $enteteTri['ps_doc_derniere_semaine']->getLien($this->_url);
$lien_tri_statut = $enteteTri['psu_id_statut']->getLien($this->_url);
include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet_expert.tpl.html';
} else {
include_once PROJET_CHEMIN_APPLI.'/squelettes/liste_projet.tpl.html';
}
$res = ob_get_contents();
ob_end_clean();
 
 
// Nettoyage de l'url
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
$this->_url->removeQueryString (PROJET_VARIABLE_MODE_AFFICHAGE);
$this->_url->removeQueryString (PROJET_VARIABLE_ORDRE_TRI);
$this->_url->removeQueryString (PROJET_VARIABLE_TRI);
return $res ;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2008-09-16 14:07:40 alexandre_tb
* suppression du bug intermittent sur le moteur de recherche
*
* Revision 1.2 2008-09-01 14:37:15 alexandre_tb
* modification du tri par defaut
*
* Revision 1.1 2008-08-25 15:00:28 alexandre_tb
* version initiale
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/presentation/tela.php
New file
0,0 → 1,183
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: tela.php,v 1.7 2007-11-19 14:27:46 alexandre_tb Exp $
/**
* Application projet
*
* Fichier de présentation de la liste des projets pour Tela Botanica
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.7 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// La constante suivante est dans le fichier de conf
//define ('PROJET_LISTE_RESUME', false) ;
 
if (PROJET_UTILISE_TYPE && $this->_type != '') {
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ;
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ;
} else {
// Un tableau de tous les projets dans $projetListe
//$projetListe = projet::getTousLesProjets($this->_db, $this->_projet_exclu) ;
}
 
 
// requete pour recuperer la liste des projets
$requete = 'select p_id, p_titre, p_wikini, pl_id_liste, plle_id_liste, p_avoir_document from'.
' projet left join projet_lien_liste on p_id=pl_id_projet'.
' left join projet_lien_liste_externe on p_id=plle_id_projet'.
' group by p_id order by p_titre' ;
$resultat = $this->_db->query($requete) ;
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$res = '<h1>Liste des projets et forums de Tela Botanica</h1>'."\n" ;
// Ajout du cartouche resumant la creation d'un projet.
$res .= '<div class="notes">
<h4>Cr&eacute;ez votre projet...</h4>
<p class="last"> Toute personne inscrite au r&eacute;seau Tela Botanica peut demander &agrave; cr&eacute;er un forum de discussion ou monter un projet collaboratif. <br />
<a href="http://www.tela-botanica.org/page:creez_votre_projet">Voir la d&eacute;marche en d&eacute;tail</a></p>
</div>';
// On inclue un fichier local
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php'))
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ;
// On vérifie si l'utilisateur participe à des projets
 
$projetNonParticipantListe = & $projetListe ;
include_once PROJET_CHEMIN_CLASSES.'HTML_listeProjet.class.php' ;
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ;
$entete_liste = array ('Titre des projets et des forums', 'Forums', 'Wiki','RSS', 'Documents', 'Participants',) ;
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ;
 
$liste_projet = array() ;
// La liste
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $ligne->p_id) ;
// Recherche du forum
if ($ligne->pl_id_liste != null) {
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica"/></a>';
} else {
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$listes_ext = new liste_externe ($this->_db) ;
if ($ligne->plle_id_liste != null) {
$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>';
} else {
$forum = '-';
}
}
if ($ligne->p_wikini) {
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link=$this->_url->getURL();
$wiki_res = '<a href="'.$link.'">voir</a>' ;
$this->_url->removeQueryString ('act');
} else {
$wiki_res = '-' ;
}
$titre= '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
if ($ligne->p_avoir_document != 0) {
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
} else {
$document = '-' ;
}
if ($ligne->p_wikini) {
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link=$this->_url->getURL();
$wiki_rss = '<a href="'.$link.'&wiki=DerniersChangementsRSS/xml'.'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
$this->_url->removeQueryString ('act');
} else {
$wiki_rss = '-' ;
}
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
$ligne_projet = array ( '', $titre, $forum, // le nom du projet
$wiki_res, $wiki_rss,$document, $participant) ;
 
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
array_push ($liste_projet, $ligne_projet) ;
}
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
$HTML_projetNonParticipantListe->construitListe($liste_projet) ;
if ($HTML_projetNonParticipantListe->getRowCount() > 1) {
///$res .= '<p>'.PROJET_TOUS_LES_PROJETS.'</p>' ;
$res .= $HTML_projetNonParticipantListe->toHTML() ;
}
 
// Nettoyage de l'url
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET);
return $res ;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.6 2007-04-19 15:34:35 neiluj
* préparration release (livraison) "Narmer" - v0.25
*
* Revision 1.5.2.1 2007/04/11 14:24:39 alexandre_tb
* amélioration des performances par l'appel d'une requete directe
*
* Revision 1.5 2006/10/30 11:26:11 jp_milcent
* Modification du cartouche concernant la création d'un projet sur Tela.
*
* Revision 1.4 2006/01/09 21:55:19 ddelon
* flux rss dans liste des projets
*
* Revision 1.3 2005/12/07 11:02:35 jp_milcent
* Ajout d'attribut alt aux images.
*
* Revision 1.2 2005/11/28 11:15:22 alexandre_tb
* nettoyage URL en sortie de programme
*
* Revision 1.1 2005/11/25 14:47:51 alexandre_tb
* version initiale
*
 
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
 
?>
/tags/2014_06_04/bibliotheque/images/logo_tb_pr_wikini.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/bibliotheque/images/logo_tb_pr_wikini.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/bibliotheque/images/tela.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/bibliotheque/images/tela.jpg
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/bibliotheque/images/tela.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/2014_06_04/bibliotheque/images/tela.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/2014_06_04/bibliotheque/projet.fonct.rss.php
New file
0,0 → 1,108
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projet.fonct.rss.php,v 1.2 2007-03-28 08:51:22 neiluj Exp $
/**
* Générateur de flux RSS à partir de l'application projet
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
*
*@copyright Tela-Botanica 2000-2004
*@version $$
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS DU PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/** gen_RSS() - générer un fichier de flux RSS par type liste
*
* @param string Le type de l'annonce (laisser vide pour tout type d'annonce)
* @param integer Le nombre d'annonces a regrouper dans le fichier XML (laisser vide pour toutes)
* @param integer L'identifiant de l'emetteur (laisser vide pour tous)
* @param integer L'état de validation de l'annonce (laisser 1 pour les annonces validées, 0 pour les non-validées)
* @param string La requête SQL personnalisée
*
* @return string Le code du flux RSS
*/
function gen_RSS($domaine='', $nbitem='', $liste='') {
// En-tête du flux RSS version 2.0
$xml = '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n".'<rss version="2.0">'."\n";
$xml .= '<channel>'."\n".'<title>'.$nomflux.'</title>'."\n".'<link>'.BAZ_RSS_ADRESSESITE.'</link>'."\n";
$xml .= '<description>'.BAZ_RSS_DESCRIPTIONSITE.'</description>'."\n".'<language>fr-FR</language>'."\n".
'<copyright>Copyright 2005 '.BAZ_RSS_NOMSITE.'</copyright>'."\n";
// Ajout de la date actuelle de publication (suivant la DTD RSS)
$xml .= '<lastBuildDate>'.strftime('%d %b %Y %H:%M:%S GMT').'</lastBuildDate>'."\n";
// En-tête suite et fin
$xml .= '<docs>http://www.stervinou.com/projets/rss/</docs>'."\n".'<category>'.BAZ_RSS_CATEGORIE.'</category>'."\n".
'<managingEditor>'.BAZ_RSS_MANAGINGEDITOR.'</managingEditor>'."\n".'<webMaster>'.BAZ_RSS_WEBMASTER.'</webMaster>'."\n";
$xml .= '<ttl>60</ttl>'."\n".'<image>'."\n".'<title>'.BAZ_RSS_NOMSITE.'</title>'."\n".'<url>'.BAZ_RSS_LOGOSITE.'</url>'."\n".
'<link>'.BAZ_RSS_ADRESSESITE.'</link>'."\n".'</image>'."\n";
if ($resultat->numRows()>0) {
// Creation des items : titre + lien + description + date de publication
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$xml .= '<item>'."\n";
$xml .= '<title>'.$ligne['bf_titre'].'</title>'."\n";
$lien=$GLOBALS['_BAZAR_']['url'];
$lien->addQueryString('action', BAZ_VOIR_FICHE);
$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
$xml .= '<link>'.str_replace ('&', '&amp;', $lien->getURL()).'</link>'."\n";
$xml .= '<description>'."\n".'<![CDATA['.baz_voir_fiche(0,$ligne['bf_id_fiche']).']]>'."\n".'</description>'."\n";
$xml .= '<pubDate>'.strftime('%d %b %Y %H:%M:%S GMT',strtotime($ligne['bf_date_debut_validite_fiche'])).'</pubDate>'."\n";
$xml .= '</item>'."\n";
}
}
else {//pas d'annonces
$xml .= '<item>'."\n";
$xml .= '<title>'.BAZ_PAS_D_ANNONCES.'</title>'."\n";
$xml .= '<link></link>'."\n";
$xml .= '<description>'.BAZ_PAS_D_ANNONCES.'</description>'."\n";
$xml .= '<pubDate>'.strftime('%d %b %Y %H:%M:%S GMT',strtotime('12/12/2004')).'</pubDate>'."\n";
$xml .= '</item>'."\n";
}
$xml .= '</channel>'."\n".'</rss>'."\n";
return $xml;
}
 
 
/** baz_liste() Formate la liste de toutes les annonces actuelles
*
* @return string le code HTML à afficher
*/
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2005/10/25 13:50:54 alexandre_tb
* version initiale
*
 
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/2014_06_04/js/telechargement.js
New file
0,0 → 1,76
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: telechargement.js,v 1.2 2007-06-25 12:15:07 alexandre_tb Exp $
/**
* Application projet
*
* La service de telechargement
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2007
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
var dojoConfig = {
isDebug: true
};
 
dojo.require("dojo.widget.Tree");
dojo.require("dojo.widget.TreeNode");
dojo.require("dojo.widget.TreeSelector");
dojo.require("dojo.widget.TreeLoadingController");
dojo.require("dojo.event.*");
 
 
function treeSelectFired() {
 
// une reference vers treeSelector et vers le noeud selectionne
var treeSelector = dojo.widget.manager.getWidgetById('treeSelector');
var treeNode = treeSelector.selectedNode;
 
// le noeud est il un repertoire
var isFolder = treeNode['isFolder'];
 
// Si non on dirige vers le document
if ( !isFolder) {
var link = treeNode['link'];
document.location.href =link;
} else {
var repertoire = dojo.widget.manager.getWidgetById('treeController');
repertoire.expand(treeNode);
}
}
 
function init() {
// une reference vers treeSelector
var treeSelector = dojo.widget.manager.getWidgetById('treeSelector');
 
// on connecte le select event a la fonction treeSelectFired() -->
dojo.event.connect(treeSelector,'select','treeSelectFired');
// On ouvre le noeud racine
var rootNode = dojo.widget.manager.getWidgetById('rootNode');
rootNode.expand();
}
 
dojo.addOnLoad(init);
/tags/2014_06_04/js/arbreDocument.js
New file
0,0 → 1,65
var dojoConfig = {
isDebug: true
};
dojo.require("dojo.lang.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Tree");
dojo.require("dojo.widget.TreeNode");
dojo.require("dojo.widget.TreeSelector");
dojo.require("dojo.widget.TreeLoadingController");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
 
function treeSelectFired() {
 
// une reference vers treeSelector et vers le noeud selectionne
var treeSelector = dojo.widget.manager.getWidgetById('treeSelector');
var treeNode = treeSelector.selectedNode;
 
// le noeud est il un repertoire
var isFolder = treeNode['isFolder'];
 
// Si non on dirige vers le document
if ( !isFolder) {
var link = treeNode['link'];
document.location.href= link;
} else {
var repertoire = dojo.widget.manager.getWidgetById('treeController');
repertoire.expand(treeNode);
}
}
 
function init() {
// une reference vers treeSelector
var treeSelector = dojo.widget.manager.getWidgetById('treeSelector');
 
// on connecte le select event a la fonction treeSelectFired()
dojo.event.connect(treeSelector,'select','treeSelectFired');
var rootNode = dojo.widget.manager.getWidgetById('rootNode');
var loadingController = dojo.widget.manager.getWidgetById('treeController');
// L appel ci-dessous permet de charger les donnees du noeud racine
loadingController.loadRemote(rootNode);
// On ouvre le noeud racine
rootNode.expand();
//ajout d'un listener a la suppression d'un noeud
dojo.event.topic.subscribe("nodeRemoved", ioDeplaceFichier) ;
}
 
// envoie une requete asynchrone pour deplacer un fichier
 
function ioDeplaceFichier (message) {
var url = window.location.href ;
var arguments = {
url : url + "&service=serviceDeplacementFichier&enfant=" + message.child.objectId + "&parent=" + message.newParent.objectId,
mimetype: "text/json",
error : function (type, errObj) { alert ('erreur'); },
load : function (type, data, evt) {}
};
//var treeLoadingController = dojo.widget.manager.getWidgetById('treeController');
dojo.io.bind (arguments) ;
}
dojo.addOnLoad(init);
/tags/2014_06_04
New file
Property changes:
Added: svn:ignore
+.project
+.settings