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.4 2005-09-02 11:29:25 ddelon Exp $ |
// CVS : $Id: integrateur_wikini.php,v 1.5 2005-09-09 09:37:17 ddelon Exp $ |
/** |
* Integrateur de page Wikini |
* |
33,7 → 33,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.4 $ $Date: 2005-09-02 11:29:25 $ |
*@version $Revision: 1.5 $ $Date: 2005-09-09 09:37:17 $ |
* |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
93,38 → 93,28 |
function Format($text, $formatter = "wakka") { |
return $this->IncludeBuffered(IW_CHEMIN_WIKINI_COURANT_FORMATTER.$formatter.".php", "<i>Impossible de trouver le formateur \"$formatter\"</i>", compact("text")); |
} |
|
//TODO : a gauche ! |
|
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; |
return; |
} |
|
function Footer() { |
return; |
} |
|
// Le diff ne fonctionne pas avec la methode get dans papyrus. On surcharge avec du post. |
|
function FormOpen($method = "", $tag = "", $formMethod = "post") { |
|
if (($method=="diff") && $formMethod=="get") { |
$formMethod="post"; |
} |
|
// Appel methode parent |
return parent::FormOpen($method, $tag, $formMethod); |
} |
} |
|
|
138,6 → 128,65 |
} |
|
|
/** |
* Renvoie le menu général de l'integrateur Wikini : derniers changement etc. |
* |
* @return string |
* @access public |
*/ |
|
function afficherContenuMenu() |
{ |
|
// TODO |
// Changement du niveau d'erreur pour éviter les Notices PHP dues à Wikini |
// error_reporting(E_PARSE); |
|
// Autre possibilite : la page speciale MENU |
|
|
global $wiki; |
global $wikini_config_defaut; |
$sortie=''; |
$wakkaConfig = $GLOBALS['wikini_config_defaut']; |
$wiki = new Wiki_Papyrus($wakkaConfig); |
|
// Suppression des slash. |
$_REQUEST['wiki'] = preg_replace("/^\//", '', $_REQUEST['wiki']); |
|
// split into page/method |
if ( preg_match( "#^(.+?)/(.*)$#", $_REQUEST['wiki'], $matches ) ) { |
list(, $page, $method) = $matches; |
} else if ( preg_match( "#^(.*)$#", $_REQUEST['wiki'], $matches ) ) { |
list(, $page) = $matches; |
} |
|
$server=$_SERVER['PHP_SELF']; |
$_SERVER['PHP_SELF']="wakka.php"; |
|
// Affichage par defaut : |
|
$sortie=$wiki->Format("\n----PagePrincipale\nDerniersChangements\nDerniersCommentaires----"); |
$sortie.="<a href=\"".$wiki->href("edit",$page)."\" title=\"Cliquez pour éditer cette page.\">Éditer cette page</a>"; |
|
// Sinon Affichage Page Menu (configurable TODO ?) |
|
$contenu=$wiki->LoadPage("PageMenu"); |
|
$sortie.=$wiki->Format("----"); |
$sortie.=$wiki->Format($contenu['body']); |
|
$_SERVER['PHP_SELF']=$server; |
|
// TODO |
// Retour au niveau d'erreur définit dans le fichier de config de Papyrus |
// error_reporting(GEN_DEBOGAGE_NIVEAU); |
|
return $sortie; |
|
} |
|
|
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
149,6 → 198,11 |
*/ |
function afficherContenuCorps() |
{ |
|
print "la"; |
// TODO |
// Changement du niveau d'erreur pour éviter les Notices PHP dues à Wikini |
// error_reporting(E_PARSE); |
|
global $wiki; |
global $wikini_config_defaut; |
156,6 → 210,7 |
$wakkaConfig = $GLOBALS['wikini_config_defaut']; |
$wiki = new Wiki_Papyrus($wakkaConfig); |
|
|
// Gestion de la variable de session "linktracking" |
if ( ! isset( $_SESSION['linktracking'] ) ) { |
$_SESSION['linktracking'] = 1; |
190,7 → 245,10 |
$sortie.= ob_get_contents(); |
ob_end_clean(); |
|
|
// TODO |
// Retour au niveau d'erreur définit dans le fichier de config de Papyrus |
// error_reporting(GEN_DEBOGAGE_NIVEAU); |
|
return remplacerEntiteHTLM("<div id=\"wikini_page\" ondblclick=\"document.location='".$wiki->href("edit")."';"."\">"."\n".$sortie.'</div>'."\n"); |
|
|