]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/gforge/themeinfo.php
Protect <title> with .htmlspecialchars
[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, $Language;
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($Language->getText('project_admin','external_project') .
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
59 $WikiTheme = new WikiTheme_gforge('gforge');
60 // CSS file defines fonts, colors and background images for this style.
61
62 /**
63  * The logo image appears on every page and links to the HomePage.
64  */
65 $WikiTheme->addImageAlias('logo', WIKI_NAME . 'Logo.png');
66
67 /**
68  * The Signature image is shown after saving an edited page. If this
69  * is set to false then the "Thank you for editing..." screen will
70  * be omitted.
71  */
72
73 $WikiTheme->addImageAlias('signature', WIKI_NAME . "Signature.png");
74 // Uncomment this next line to disable the signature.
75 $WikiTheme->addImageAlias('signature', false);
76
77 /*
78  * Link icons.
79  */
80 // $WikiTheme->setLinkIconAttr('after');
81 $WikiTheme->setLinkIcon('http');
82 $WikiTheme->setLinkIcon('https');
83 $WikiTheme->setLinkIcon('ftp');
84 $WikiTheme->setLinkIcon('mailto');
85 //$WikiTheme->setLinkIcon('interwiki');
86 //$WikiTheme->setLinkIcon('wikiuser');
87 //$WikiTheme->setLinkIcon('*', 'url');
88
89 $WikiTheme->setButtonSeparator("\n | ");
90
91 /**
92  * WikiWords can automatically be split by inserting spaces between
93  * the words. The default is to leave WordsSmashedTogetherLikeSo.
94  */
95 $WikiTheme->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 $WikiTheme->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 $WikiTheme->setDateFormat("%d %B %Y");
115 $WikiTheme->setTimeFormat("%H:%M");
116
117 /*
118  * To suppress times in the "Last edited on" messages, give a
119  * give a second argument of false:
120  */
121 //$WikiTheme->setDateFormat("%B %d, %Y", false); 
122
123
124 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
125 // (c-file-style: "gnu")
126 // Local Variables:
127 // mode: php
128 // tab-width: 8
129 // c-basic-offset: 4
130 // c-hanging-comment-ender-p: nil
131 // indent-tabs-mode: nil
132 // End:   
133 ?>