Subversion Repositories Applications.wikini

Rev

Rev 18 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18 jpm 1
<?php
2
 
3
if (!defined("WIKINI_VERSION")) {
4
	die ("acc&egrave;s direct interdit");
5
}
6
 
7
if (version_compare(phpversion(), '5.0') < 0) {
8
    eval('
9
    if (!function_exists("clone")) {
10
        function clone($object) {
11
                return $object;
12
        }
13
    }
14
    ');
15
}
16
 
17
$user = $this->GetUser();
18
$menu_page = $this->config["menu_page"];
19
$menu_page_admin = $this->config["menu_page_admin"];
20
if (isset($menu_page) and ($menu_page!="")) {
21
    // Ajout Menu de Navigation
22
	$wikiMenu = clone($this);
23
    $wikiMenu->tag = $menu_page;
24
    $wikiMenu->tag_admin = $menu_page_admin;
25
    $wikiMenu->SetPage($wikiMenu->LoadPage($wikiMenu->tag));
26
    $menu_normal = $wikiMenu->Format($wikiMenu->page['body'], 'wakka');
27
    $menu_admin = '';
28
    if ($user) {
29
        $wikiMenu->tag = $menu_page_admin;
30
        $wikiMenu->SetPage($wikiMenu->LoadPage($wikiMenu->tag));
31
        $menu_admin = $wikiMenu->Format($wikiMenu->page['body'], 'wakka');
32
    }
33
 
34
    $plugin_output_new = preg_replace ('/<!-- NAVIGATION -->/',
35
		'<div id="navigation">'.
36
    	'  <div id="menu">'."\n".
37
    	'		<h2 id="titre_menu"><span id="menu_debut"> Menu </span></h2>'."\n".
38
		$menu_normal.$menu_admin.
39
		"\n".'		<h2 id="titre_contenu"><span id="menu_fin"> Contenu </span></h2>'.
40
		"\n".'  </div>'."\n".
41
		"\n".'</div>'."\n".
42
		'<div id="corps">'."\n",
43
		$plugin_output_new);
44
}
45
?>