]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/gforge/themeinfo.php
Avoid direct call to file themeinfo.php
[SourceForge/phpwiki.git] / themes / gforge / themeinfo.php
1 <?php
2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
5     header("Location: /");
6     exit;
7 }
8
9 rcs_id('$Id$');
10
11 require_once('lib/WikiTheme.php');
12
13 class WikiTheme_gforge extends WikiTheme {
14
15     function header() {
16         global $HTML, $group_id, $group_public_name, $request, $project;
17
18         $pagename = $request->getArg('pagename');
19
20         $submenu = Template('navbar');
21
22         //group is private
23         if (!$project->isPublic()) {
24             //if it's a private group, you must be a member of that group
25             session_require(array('group'=>$group_id));
26         }
27
28         //for dead projects must be member of admin project
29         if (!$project->isActive()) {
30             //only SF group can view non-active, non-holding groups
31             session_require(array('group'=>'1'));
32         }
33
34         $HTML->header(array('title'=> $group_public_name.': '.htmlspecialchars($pagename),
35                             'group' => $group_id, 
36                             'toptab' => 'wiki',
37                             'submenu' => $submenu->asXML()
38                            )
39                      );
40
41         // Display a warning banner for internal users when the wiki is opened
42         // to external users.
43         if ($project->getIsExternal()) {
44                 $external_user = false;
45                 if (session_loggedin()) {
46                         $user = session_get_user();
47                         $external_user = $user->getIsExternal();
48                 }
49                 if (!$external_user) {
50                         $page = $request->getPage();
51                         if ($page->get('external')) {
52                                 $external_msg = _("This page is external.");
53                         }
54                         echo $HTML->warning_msg(_("This project is shared with third-party users (non Alcatel-Lucent users).") .
55                                                                         (isset($external_msg) ? ' ' . $external_msg : ''));
56                         }
57         }
58     }
59
60     function footer() {
61         global $HTML;
62
63         $HTML->footer(array());
64
65     }
66
67     function load() {
68
69         $this->initGlobals();
70
71         /**
72          * The Signature image is shown after saving an edited page. If this
73          * is set to false then the "Thank you for editing..." screen will
74          * be omitted.
75          */
76
77         $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
78         // Uncomment this next line to disable the signature.
79         $this->addImageAlias('signature', false);
80
81         /*
82          * Link icons.
83          */
84         $this->setLinkIcon('http');
85         $this->setLinkIcon('https');
86         $this->setLinkIcon('ftp');
87         $this->setLinkIcon('mailto');
88
89         $this->setButtonSeparator("");
90
91         /**
92          * WikiWords can automatically be split by inserting spaces between
93          * the words. The default is to leave WordsSmashedTogetherLikeSo.
94          */
95         $this->setAutosplitWikiWords(false);
96
97         /**
98          * Layout improvement with dangling links for mostly closed wiki's:
99          * If false, only users with edit permissions will be presented the
100          * special wikiunknown class with "?" and Tooltip.
101          * If true (default), any user will see the ?, but will be presented
102          * the PrintLoginForm on a click.
103          */
104         $this->setAnonEditUnknownLinks(false);
105
106         /*
107          * You may adjust the formats used for formatting dates and times
108          * below.  (These examples give the default formats.)
109          * Formats are given as format strings to PHP strftime() function See
110          * http://www.php.net/manual/en/function.strftime.php for details.
111          * Do not include the server's zone (%Z), times are converted to the
112          * user's time zone.
113          */
114         $this->setDateFormat("%d %B %Y");
115         $this->setTimeFormat("%H:%M");
116     }
117 }
118
119 $WikiTheme = new WikiTheme_gforge('gforge');
120
121 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
122 // (c-file-style: "gnu")
123 // Local Variables:
124 // mode: php
125 // tab-width: 8
126 // c-basic-offset: 4
127 // c-hanging-comment-ender-p: nil
128 // indent-tabs-mode: nil
129 // End:
130 ?>