Subversion Repositories Applications.papyrus

Rev

Rev 437 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 437 Rev 439
Line 19... Line 19...
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: integrateur_wikini.php,v 1.4 2005-09-02 11:29:25 ddelon Exp $
24
// CVS : $Id: integrateur_wikini.php,v 1.5 2005-09-09 09:37:17 ddelon Exp $
25
/**
25
/**
26
* Integrateur de page Wikini
26
* Integrateur de page Wikini
27
*
27
*
28
* Application permettant d'intégrer des pages wikini dans Papyrus.
28
* Application permettant d'intégrer des pages wikini dans Papyrus.
29
*
29
*
Line 31... Line 31...
31
//Auteur original :
31
//Auteur original :
32
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
32
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
33
//Autres auteurs :
33
//Autres auteurs :
34
*@author        Aucun
34
*@author        Aucun
35
*@copyright     Tela-Botanica 2000-2004
35
*@copyright     Tela-Botanica 2000-2004
36
*@version       $Revision: 1.4 $ $Date: 2005-09-02 11:29:25 $
36
*@version       $Revision: 1.5 $ $Date: 2005-09-09 09:37:17 $
37
*
37
*
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
Line 91... Line 91...
91
// On surcharge la classe Wiki pour en faire ce qu'on en veut
91
// On surcharge la classe Wiki pour en faire ce qu'on en veut
92
Class Wiki_Papyrus extends Wiki {
92
Class Wiki_Papyrus extends Wiki {
93
    function Format($text, $formatter = "wakka") {
93
    function Format($text, $formatter = "wakka") {
94
		return $this->IncludeBuffered(IW_CHEMIN_WIKINI_COURANT_FORMATTER.$formatter.".php", "<i>Impossible de trouver le formateur \"$formatter\"</i>", compact("text")); 
94
		return $this->IncludeBuffered(IW_CHEMIN_WIKINI_COURANT_FORMATTER.$formatter.".php", "<i>Impossible de trouver le formateur \"$formatter\"</i>", compact("text")); 
95
	}
95
	}
-
 
96
	
-
 
97
	//TODO : a gauche !
-
 
98
	
96
	function Header() {
99
	function Header() {
97
		
-
 
98
		$sortie='';
-
 
99
		$sortie.='<h1 class="wiki_name">';
-
 
100
		// Todo : Initialiser : wakka_nom
-
 
101
		$sortie.= $this->config["wakka_name"];
-
 
102
		$sortie.='</h1>';
-
 
103
		$sortie.='<h1 class="page_name">';
-
 
104
		$sortie.='<a href="';
-
 
105
		$sortie.=$this->config["base_url"];
-
 
106
		$sortie.='RechercheTexte&amp;phrase=';
-
 
107
		$sortie.=htmlentities($this->GetPageTag());
-
 
108
		$sortie.='">';
-
 
109
		$sortie.=htmlentities($this->GetPageTag()); 
-
 
110
		$sortie.='</a>';
-
 
111
		$sortie.='</h1>';
-
 
112
 
-
 
113
		$sortie.='<div class="header">';
-
 
114
		$sortie.= $this->ComposeLinkToPage($this->config["root_page"]).'::';
-
 
115
		$sortie.= $this->config["navigation_links"] ? $this->Format($this->config["navigation_links"])." :: \n" : "";
-
 
116
		$sortie.='Vous &ecirc;tes ';
-
 
117
		$sortie.= $this->Format($this->GetUserName());
-
 
118
		if ($user = $this->GetUser()) { 
-
 
119
			$sortie.="(<a href=\"".$this->config["base_url"]."ParametresUtilisateur&amp;action=logout\">D&eacute;connexion</a>)\n";
-
 
120
		}
-
 
121
		$sortie.='</div>';
-
 
122
		return $sortie;
100
		return;
123
	}
101
	}
Line 124... Line 102...
124
	
102
	
125
	function Footer() {
103
	function Footer() {
126
		return;
104
		return;
-
 
105
	}	
-
 
106
	
-
 
107
	// Le diff ne fonctionne pas avec la methode get dans papyrus. On surcharge avec du post. 
-
 
108
	
-
 
109
	function FormOpen($method = "", $tag = "", $formMethod = "post") {
-
 
110
		
-
 
111
		if (($method=="diff") && $formMethod=="get") {
-
 
112
			$formMethod="post";	
-
 
113
		}
-
 
114
		
-
 
115
		// Appel methode parent
-
 
116
		return parent::FormOpen($method, $tag, $formMethod);
127
	}	
117
	}
Line 128... Line 118...
128
}
118
}
129
 
119
 
Line 136... Line 126...
136
    /** Inclusion du fichier de traduction fr par défaut. */
126
    /** Inclusion du fichier de traduction fr par défaut. */
137
    include_once IW_CHEMIN_LANGUES.'iw_langue_fr.inc.php';
127
    include_once IW_CHEMIN_LANGUES.'iw_langue_fr.inc.php';
138
}
128
}
Line -... Line 129...
-
 
129
 
-
 
130
 
-
 
131
/**
-
 
132
 * Renvoie le menu général de l'integrateur Wikini : derniers  changement etc.
-
 
133
 *
-
 
134
 * @return string
-
 
135
 * @access public
-
 
136
 */
-
 
137
   
-
 
138
function afficherContenuMenu()
-
 
139
{
-
 
140
	
-
 
141
  // TODO
-
 
142
  // Changement du niveau d'erreur pour éviter les Notices PHP dues à Wikini
-
 
143
  //  error_reporting(E_PARSE);
-
 
144
  
-
 
145
  // Autre possibilite : la page speciale MENU 
-
 
146
	
-
 
147
	
-
 
148
	global $wiki;
-
 
149
	global $wikini_config_defaut;
-
 
150
	$sortie='';
-
 
151
    $wakkaConfig = $GLOBALS['wikini_config_defaut'];
-
 
152
    $wiki  = new Wiki_Papyrus($wakkaConfig);
-
 
153
 
-
 
154
    // Suppression des slash.
-
 
155
    $_REQUEST['wiki'] = preg_replace("/^\//", '',  $_REQUEST['wiki']);
-
 
156
 
-
 
157
    // split into page/method
-
 
158
    if ( preg_match( "#^(.+?)/(.*)$#",  $_REQUEST['wiki'], $matches ) ) {
-
 
159
        list(, $page, $method) = $matches;
-
 
160
    } else if ( preg_match( "#^(.*)$#",  $_REQUEST['wiki'], $matches ) ) {
-
 
161
        list(, $page) = $matches;
-
 
162
    }
-
 
163
 
-
 
164
    $server=$_SERVER['PHP_SELF'];
-
 
165
	$_SERVER['PHP_SELF']="wakka.php";
-
 
166
    
-
 
167
    // Affichage par defaut : 
-
 
168
    
-
 
169
	$sortie=$wiki->Format("\n----PagePrincipale\nDerniersChangements\nDerniersCommentaires----");
-
 
170
    $sortie.="<a href=\"".$wiki->href("edit",$page)."\" title=\"Cliquez pour &eacute;diter cette page.\">&Eacute;diter cette page</a>";
-
 
171
    
-
 
172
    // Sinon Affichage Page Menu (configurable TODO ?) 
-
 
173
    
-
 
174
    $contenu=$wiki->LoadPage("PageMenu");
-
 
175
    
-
 
176
    $sortie.=$wiki->Format("----");
-
 
177
	$sortie.=$wiki->Format($contenu['body']);   
-
 
178
 
-
 
179
	$_SERVER['PHP_SELF']=$server;
-
 
180
	
-
 
181
	// TODO
-
 
182
	// Retour au niveau d'erreur définit dans le fichier de config de Papyrus
-
 
183
    // error_reporting(GEN_DEBOGAGE_NIVEAU);
-
 
184
    
-
 
185
	return $sortie;
-
 
186
	
-
 
187
} 
139
 
188
			
140
 
189
	
141
// +------------------------------------------------------------------------------------------------------+
190
// +------------------------------------------------------------------------------------------------------+
142
// |                                            CORPS du PROGRAMME                                        |
191
// |                                            CORPS du PROGRAMME                                        |
143
// +------------------------------------------------------------------------------------------------------+
192
// +------------------------------------------------------------------------------------------------------+
Line 147... Line 196...
147
*
196
*
148
* @return  string  du code XHTML correspondant au contenu renvoyé par l'application.
197
* @return  string  du code XHTML correspondant au contenu renvoyé par l'application.
149
*/
198
*/
150
function afficherContenuCorps()
199
function afficherContenuCorps()
151
{
200
{
-
 
201
 
-
 
202
print "la";
-
 
203
  // TODO
-
 
204
  // Changement du niveau d'erreur pour éviter les Notices PHP dues à Wikini
-
 
205
  //  error_reporting(E_PARSE);
Line 152... Line 206...
152
	
206
	
153
	global $wiki;
207
	global $wiki;
154
	global $wikini_config_defaut;
208
	global $wikini_config_defaut;
155
	$sortie='';
209
	$sortie='';
156
    $wakkaConfig = $GLOBALS['wikini_config_defaut'];
210
    $wakkaConfig = $GLOBALS['wikini_config_defaut'];
Line -... Line 211...
-
 
211
    $wiki  = new Wiki_Papyrus($wakkaConfig);
157
    $wiki  = new Wiki_Papyrus($wakkaConfig);
212
 
158
 
213
 
159
	// Gestion de la variable de session "linktracking"
214
	// Gestion de la variable de session "linktracking"
160
    if ( ! isset( $_SESSION['linktracking'] ) ) {
215
    if ( ! isset( $_SESSION['linktracking'] ) ) {
Line 188... Line 243...
188
    $_SERVER['PHP_SELF']=$server;
243
    $_SERVER['PHP_SELF']=$server;
Line 189... Line 244...
189
    
244
    
190
    $sortie.= ob_get_contents();
245
    $sortie.= ob_get_contents();
Line -... Line 246...
-
 
246
    ob_end_clean();
-
 
247
 
-
 
248
	// TODO
191
    ob_end_clean();
249
	// Retour au niveau d'erreur définit dans le fichier de config de Papyrus
192
 
250
    // error_reporting(GEN_DEBOGAGE_NIVEAU);
Line 193... Line 251...
193
 
251