Subversion Repositories Applications.wikini

Rev

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

Rev Author Line No. Line
46 jpm 1
<?php
2
if (!defined("WIKINI_VERSION"))
3
{
4
        die ("acc&egrave;s direct interdit");
5
}
6
 
7
if ($this->HasAccess("write")) {
8
        // on récupère la page et ses valeurs associées
9
        $page = $this->GetParameter('page');
10
        if (empty($page)) {
11
                $page = $this->GetPageTag();
12
                $time = $this->GetPageTime();
13
                $content = $this->page;
14
        } else {
15
                $content = $this->LoadPage($page);
16
                $time = $content["time"];
17
        }
18
        $barreredactionelements['page'] = $page;
19
        $barreredactionelements['linkpage'] = $this->href("", $page);
20
 
21
        // on choisit le template utilisé
22
        $template = $this->GetParameter('template');
23
        if (empty($template)) {
24
                $template = 'barreredaction_basic.tpl.html';
25
        }
26
 
27
        // on peut ajouter des classes à la classe par défaut .footer
28
        $barreredactionelements['class'] = ($this->GetParameter('class') ? 'footer '.$this->GetParameter('class') : 'footer');
29
 
30
	// on ajoute le lien d'édition si l'action est autorisée
31
	if ( $this->HasAccess("write", $page) ) {
32
                $barreredactionelements['linkedit'] = $this->href("edit", $page);
33
	}
34
 
35
        //
36
	if ( $time ) {
37
                 $barreredactionelements['linkrevisions'] = $this->href("revisions", $page);
38
                 $barreredactionelements['time'] = date(TEMPLATE_DATE_FORMAT, strtotime($time));
39
	}
40
 
41
	// if this page exists
42
	if ( $content ) {
43
                // if owner is current user
44
                if ($this->UserIsOwner($page) || $this->UserIsAdmin()) {
45
                       $barreredactionelements['owner'] = TEMPLATE_OWNER." : ".TEMPLATE_YOU.' - '.TEMPLATE_PERMISSIONS;
46
                        $barreredactionelements['linkacls'] = $this->href("acls", $page);
47
                        $barreredactionelements['linkdeletepage'] = $this->href("deletepage", $page);
48
                }
49
                else {
50
                        if ($owner = $this->GetPageOwner($page)) {
51
                                $barreredactionelements['owner'] = TEMPLATE_OWNER." : ".$owner;
52
                                if ($this->UserIsAdmin()) {
53
                                        $barreredactionelements['linkacls'] = $this->href("acls", $page);
54
                                        $barreredactionelements['owner'] .= ' - '.TEMPLATE_PERMISSIONS;
55
                                }
56
                                else {
57
                                        //$barreredactionelements['linkacls'] = $this->href('', $owner);
58
                                }
59
                        }
60
                        else {
61
                                $barreredactionelements['owner'] = TEMPLATE_NO_OWNER.($this->GetUser() ? " - ".TEMPLATE_CLAIM : "");
62
                                if ($this->GetUser()) $barreredactionelements['linkacls'] = $this->href("claim", $page);
63
                                //else $barreredactionelements['linkacls'] = $this->href("claim", $page);
64
                        }
65
                }
66
 
67
      }
68
 
69
        $barreredactionelements['linkreferrers'] = $this->href("referrers", $page);
70
        $barreredactionelements['linkdiaporama'] = $this->href("diaporama", $page);
71
	$barreredactionelements['linkshare'] = $this->href("share", $page);
72
 
73
        include_once('tools/templates/libs/squelettephp.class.php');
74
        $barreredactiontemplate = new SquelettePhp('tools/templates/presentation/templates/'.$template);
75
        $barreredactiontemplate->set($barreredactionelements);
76
        echo $barreredactiontemplate->analyser();
77
}
78
 
79
?>