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