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