1,5 → 1,5 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
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: iw_integrateur.fonct.php,v 1.4 2005-10-31 17:12:00 ddelon Exp $ |
// CVS : $Id: iw_integrateur.fonct.php,v 1.5 2005-10-31 17:45:41 ddelon Exp $ |
/** |
* Fonctions de l'integrateur de page Wikini |
* |
33,7 → 33,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.4 $ $Date: 2005-10-31 17:12:00 $ |
*@version $Revision: 1.5 $ $Date: 2005-10-31 17:45:41 $ |
* |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
94,13 → 94,13 |
|
// On surcharge la classe Wiki pour en faire ce qu'on en veut |
Class Wiki_Papyrus extends Wiki { |
|
|
|
|
function Header() { |
|
|
return; |
} |
|
} |
|
function Footer() { |
echo "<div class=\"footer\">"; |
echo $this->HasAccess("write") ? "<a href=\"".$this->href("edit")."\" title=\"Cliquez pour modifier cette page.\">Modifier cette page</a> ::\n" : ""; |
111,7 → 111,7 |
// if owner is current user |
if ($this->UserIsOwner()) |
{ |
echo |
echo |
"Propriétaire : vous :: \n", |
"<a href=\"",$this->href("acls")."\" title=\"Cliquez pour modifer les permissions de cette page.\">Éditer permissions</a> :: \n", |
"<a href=\"",$this->href("deletepage")."\">Supprimer</a> :: \n"; |
133,32 → 133,32 |
echo "Vous êtes "; |
echo $this->Format($this->GetUserName()); |
echo "</div>"; |
|
|
} |
|
|
function FormOpen($method = "", $tag = "", $formMethod = "post") { |
|
// Le diff ne fonctionne pas avec la methode get dans papyrus. On surcharge avec du post. |
|
|
// Le diff ne fonctionne pas avec la methode get dans papyrus. On surcharge avec du post. |
|
if (($method=="diff") && $formMethod=="get") { |
$formMethod="post"; |
$formMethod="post"; |
} |
|
|
if ($method=="edit") { |
$result = "<form id=\"ACEditor\" name=\"ACEditor\" action=\"".$this->href($method, $tag)."\" method=\"".$formMethod."\">\n"; |
return $result; |
} |
|
|
return parent::FormOpen($method,$tag, $formMethod); |
|
|
} |
// Detournement des handlers : comme ca on peut faire ce que l'on veut .... |
function Method($method) { |
|
|
if ($method=="edit") { |
|
|
$result=''; |
|
|
if ($_POST) { |
if ($_POST["submit"] == "Sauver") { |
// check for overwriting |
177,10 → 177,10 |
$this->SetMessage("Cette page n\'a pas été enregistré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(); |
190,7 → 190,7 |
$this->StopLinkTracking(); |
$this->WriteLinkTable(); |
$this->ClearLinkTable(); |
|
|
// forward |
print "hh"; |
debug_print_backtrace(); |
202,7 → 202,7 |
// fetch fields |
if (!$previous = $_POST["previous"]) $previous = $this->page["id"]; |
if (!$body = $_POST["body"]) $body = $this->page["body"]; |
|
|
// preview? |
if ($_POST["submit"] == "Aperçu") |
{ |
221,9 → 221,9 |
} |
else |
{ |
|
|
require_once(IW_CHEMIN_BIBLIO_ACEDITOR."ACeditor.buttonsBar.php"); |
|
|
$result .= |
$this->FormOpen("edit"). |
"<input type=\"hidden\" name=\"previous\" value=\"".$previous."\" />\n".$ACbuttonsBar. |
234,39 → 234,40 |
"<input name=\"submit\" type=\"submit\" value=\"Aperçu\" accesskey=\"p\" />\n". |
"<input type=\"button\" value=\"Annulation\" onclick=\"document.location='".$this->href("")."';\" />\n". |
$this->FormClose(); |
|
|
return $result; |
} |
|
|
} |
else { |
return parent::Method($method); |
} |
} |
|
|
// Surcharge Format a cause probleme de chemin. |
|
|
|
// Surcharge Format a cause probleme de chemin. |
|
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")); |
return $this->IncludeBuffered(IW_CHEMIN_WIKINI_COURANT_FORMATTER.$formatter.".php", "<i>Impossible de trouver le formateur \"$formatter\"</i>", compact("text")); |
} |
|
|
// Identification |
|
|
|
// Identification |
|
function SetUser($user, $remember=1) { |
$_SESSION["user"]["name"] = ucfirst(strtolower($GLOBALS['_GEN_commun']['pear_auth']->getAuthData($GLOBALS['_GEN_commun']['info_auth_bdd']->chp_personne_prenom))).ucfirst(strtolower($GLOBALS['_GEN_commun']['pear_auth']->getAuthData($GLOBALS['_GEN_commun']['info_auth_bdd']->chp_personne_nom)));; |
$_SESSION["user"]["password"] = "wikini"; |
$_SESSION["user"]["changescount"] = 100; |
$this->SetPersistentCookie("name", $user["name"], $remember); |
$this->SetPersistentCookie("password", $user["password"], $remember); |
$this->SetPersistentCookie("remember", $remember, $remember); |
} |
|
|
|
|
} |
|
|
|
|
|
// 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. */ |
278,23 → 279,23 |
|
$GLOBALS['_PAPYRUS_']['erreur']->setActive(1); |
/** |
* |
* |
* Fonction afficherPageMenuWikini() |
* |
* |
* Renvoie le contenu de la page Menu de Wikini |
* |
* @return string |
* @access public |
*/ |
|
|
function afficherPageMenuWikini() |
{ |
|
|
$GLOBALS['_PAPYRUS_']['erreur']->setActive(0); |
|
|
// Autre possibilite : la page speciale MENU |
|
|
// Autre possibilite : la page speciale MENU |
|
global $wiki; |
global $wikini_config_defaut; |
$sortie=''; |
313,21 → 314,21 |
|
$server=$_SERVER['PHP_SELF']; |
$_SERVER['PHP_SELF']="wakka.php"; |
|
|
$contenu=$wiki->LoadPage("PageMenu"); |
|
|
$sortie.=$wiki->Format("----"); |
$sortie.=$wiki->Format($contenu['body']); |
$sortie.=$wiki->Format($contenu['body']); |
|
$_SERVER['PHP_SELF']=$server; |
|
|
$GLOBALS['_PAPYRUS_']['erreur']->setActive(1); |
|
|
return $sortie; |
|
} |
|
|
|
} |
|
|
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
341,14 → 342,14 |
{ |
|
$GLOBALS['_PAPYRUS_']['erreur']->setActive(0); |
|
|
// Ajout d'une feuille de style externe |
GEN_stockerStyleExterne ('wikini', 'client/integrateur_wikini/presentations/styles/wikini.css') ; |
|
|
// TODO |
// Changement du niveau d'erreur pour éviter les Notices PHP dues à Wikini |
|
|
|
|
global $wiki; |
global $wikini_config_defaut; |
$sortie=''; |
356,8 → 357,8 |
$wiki = new Wiki_Papyrus($wakkaConfig); |
|
|
if ($GLOBALS['_GEN_commun']['pear_auth']->checkAuth()) { |
if (!isset($_COOKIE["name"])) { |
if ($GLOBALS['_GEN_commun']['pear_auth']->checkAuth()) { |
if (!isset($_SESSION["user"]) || ($_SESSION["user"]=="")) { |
$wiki->SetUser(''); |
} |
} |
364,7 → 365,7 |
else { |
$wiki->LogoutUser(); |
} |
|
|
// Gestion de la variable de session "linktracking" |
if ( ! isset( $_SESSION['linktracking'] ) ) { |
$_SESSION['linktracking'] = 1; |
379,23 → 380,23 |
} else if ( preg_match( "#^(.*)$#", $_REQUEST['wiki'], $matches ) ) { |
list(, $page) = $matches; |
} |
|
|
// Vérification de la méthode d'affichage employée! |
if ( ! isset( $method ) ) { |
$method = ''; |
} |
|
|
//Récupération du contenu de la page Wikini |
|
|
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(); |
|
402,8 → 403,8 |
$GLOBALS['_PAPYRUS_']['erreur']->setActive(1); |
|
//return remplacerEntiteHTLM("<div id=\"wikini_page\" onLoad=\"thisForm=document.ACEditor;\" ondblclick=\"document.location='".$wiki->href("edit")."';"."\">"."\n".$sortie.'</div>'."\n"); |
return remplacerEntiteHTLM("<script type=\"text/javascript\" src=\"".IW_CHEMIN_BIBLIO_ACEDITOR."ACeditor.js\"></script><div id=\"wikini_page\" ondblclick=\"document.location='".$wiki->href("edit")."';"."\">"."\n".$sortie.'</div>'."\n"); |
|
return remplacerEntiteHTLM("<script type=\"text/javascript\" src=\"".IW_CHEMIN_BIBLIO_ACEDITOR."ACeditor.js\"></script><div id=\"wikini_page\" ondblclick=\"document.location='".$wiki->href("edit")."';"."\">"."\n".$sortie.'</div>'."\n"); |
|
} |
|
?> |