21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: integrateur_wikini.php,v 1.1 2005-08-18 10:20:07 ddelon Exp $ |
// CVS : $Id: integrateur_wikini.php,v 1.2 2005-08-25 08:59:12 ddelon Exp $ |
/** |
* Integrateur de page Wikini |
* |
33,11 → 33,9 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2005-08-18 10:20:07 $ |
*@version $Revision: 1.2 $ $Date: 2005-08-25 08:59:12 $ |
* |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion de la classe PEAR de gestion des URL. */ |
50,9 → 48,71 |
/** Inclusion du fichier permettant d'inclure les données dans du XHTML.*/ |
require_once IW_CHEMIN_BIBLIO.'iw_affichage_xhtml.fonct.php'; |
|
/** Inclusion du fichier permettant l'utilisation de la classe wiki.*/ |
require_once IW_CHEMIN_BIBLIO_WIKINI.'wakka.php'; |
global $wiki; |
global $wiki_p; |
|
if ( ! isset( $_REQUEST['wiki'] ) ) { |
$_REQUEST['wiki'] = $GLOBALS['_GEN_commun']['info_application']->page; |
} |
|
$server=$_SERVER['PHP_SELF']; |
$_SERVER['PHP_SELF']="wakka.php"; |
|
// Utilise le wakkaconfig de la racine ... |
// TODO : generer un wakkaconfig en fonction des parametres, dans un temp et l'ecrire |
// juste avant ... : bof (car conflits possibles). |
// Ou alors : on utilise un wakkaconfig generique à minima ... |
// Dans tous les cas, il faut gerer le WakaConfig Generique ! |
// Prevoir de revoir la contrib menu ... qui doit être switchable, ou plutot, |
// Customiser son menu avec papyrus ... |
|
ob_start(); |
include_once '/home/david/workspace/papyrus/wikini/wikini_01/wakka.php'; |
ob_end_clean(); |
|
$_SERVER['PHP_SELF']=$server; |
|
|
// On surcharge la classe Wiki pour en faire ce qu'on en veut |
Class Wiki_Papyrus extends Wiki { |
function Format($text, $formatter = "wakka") { |
return $this->IncludeBuffered("/home/david/workspace/papyrus/wikini/wikini_01/formatters/".$formatter.".php", "<i>Impossible de trouver le formateur \"$formatter\"</i>", compact("text")); |
} |
function Header() { |
|
$sortie=''; |
$sortie.='<h1 class="wiki_name">'; |
// Todo : Initialiser : wakka_nom |
$sortie.= $this->config["wakka_name"]; |
$sortie.='</h1>'; |
$sortie.='<h1 class="page_name">'; |
$sortie.='<a href="'; |
$sortie.=$this->config["base_url"]; |
$sortie.='RechercheTexte&phrase='; |
$sortie.=htmlentities($this->GetPageTag()); |
$sortie.='">'; |
$sortie.=htmlentities($this->GetPageTag()); |
$sortie.='</a>'; |
$sortie.='</h1>'; |
|
$sortie.='<div class="header">'; |
$sortie.= $this->ComposeLinkToPage($this->config["root_page"]).'::'; |
$sortie.= $this->config["navigation_links"] ? $this->Format($this->config["navigation_links"])." :: \n" : ""; |
$sortie.='Vous êtes '; |
$sortie.= $this->Format($this->GetUserName()); |
if ($user = $this->GetUser()) { |
$sortie.="(<a href=\"".$this->config["base_url"]."ParametresUtilisateur&action=logout\">Déconnexion</a>)\n"; |
} |
$sortie.='</div>'; |
return $sortie; |
} |
|
function Footer() { |
return; |
} |
} |
|
|
// Appel du fichier de traduction des textes de l'application Integrateur Wikini |
if (file_exists(IW_CHEMIN_LANGUES.'iw_langue_'.IW_I18N.'.inc.php')) { |
/** Inclusion du fichier de traduction de l'application Integrateur Wikini. */ |
61,6 → 121,8 |
/** Inclusion du fichier de traduction fr par défaut. */ |
include_once IW_CHEMIN_LANGUES.'iw_langue_fr.inc.php'; |
} |
|
|
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
72,47 → 134,56 |
*/ |
function afficherContenuCorps() |
{ |
global $wiki; |
|
$sortie=''; |
|
$wakkaConfig = $GLOBALS['wikini_config_defaut']; |
|
// Démarrage de session php |
//session_start(); |
|
// Récupération du nom de la page wikini recherchée |
if ( ! isset( $_REQUEST['wiki'] ) ) { |
$GLOBALS['wiki'] = $GLOBALS['_GEN_commun']['info_application']->page; |
} else { |
$GLOBALS['wiki'] = $_REQUEST['wiki']; |
} |
|
// Gestion de la variable de session "linktracking" |
$wiki = new Wiki_Papyrus($wakkaConfig); |
|
// Gestion de la variable de session "linktracking" |
if ( ! isset( $_SESSION['linktracking'] ) ) { |
$_SESSION['linktracking'] = 1; |
} |
|
|
// Suppression des slash. |
$wiki = preg_replace("/^\//", '', $GLOBALS['wiki']); |
|
$_REQUEST['wiki'] = preg_replace("/^\//", '', $_REQUEST['wiki']); |
|
// split into page/method |
if ( preg_match( "#^(.+?)/(.*)$#", $GLOBALS['wiki'], $matches ) ) { |
if ( preg_match( "#^(.+?)/(.*)$#", $_REQUEST['wiki'], $matches ) ) { |
list(, $page, $method) = $matches; |
} else if ( preg_match( "#^(.*)$#", $GLOBALS['wiki'], $matches ) ) { |
} else if ( preg_match( "#^(.*)$#", $_REQUEST['wiki'], $matches ) ) { |
list(, $page) = $matches; |
} |
|
// Création de l'objet Wiki |
$GLOBALS['wiki'] = new Wiki( $GLOBALS['wikini_config_defaut'] ); |
|
// Vérification de la méthode d'affichage employée! |
if ( ! isset( $method ) ) { |
$method = ''; |
} |
|
|
//Récupération du contenu de la page Wikini |
$sortie = remplacerEntiteHTLM('<div id="wikini_page">'."\n".$GLOBALS['wiki']->Run($page, $method).'</div>'."\n"); |
|
return $sortie; |
ob_start(); |
|
$server=$_SERVER['PHP_SELF']; |
$_SERVER['PHP_SELF']="wakka.php"; |
|
$wiki->Run($page, $method); |
|
$_SERVER['PHP_SELF']=$server; |
|
$sortie.= ob_get_contents(); |
ob_end_clean(); |
|
|
|
return remplacerEntiteHTLM("<div id=\"wikini_page\" ondblclick=\"document.location='".$wiki->href("edit")."';"."\">"."\n".$sortie.'</div>'."\n"); |
|
|
} |
|
|
// TODO : qu'affiche-t-on en pied ? |
/** Fonction afficherContenuPied() - Fonction appelé par le gestionnaire Papyrus. |
* |
* Elle retourne le pied de l'application. |
123,26 → 194,4 |
{ |
return inclusion_html('pied_page'); |
} |
|
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
|
|
|
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2005/05/19 15:22:46 jpm |
* Ajout du remplacement des & par des & |
* |
* Revision 1.2 2005/05/19 13:17:02 jpm |
* Ajout d'une balise div pour encadre le contenu du wikini. |
* |
* Revision 1.1 2005/03/02 17:47:05 jpm |
* Ajout des fichiers necessaires à l'intégrateur de wikini. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |