2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
9 // $Id: themeinfo.php 8081 2011-05-19 19:27:35Z vargenau $;
11 require_once 'lib/WikiTheme.php';
12 require_once 'themes/wikilens/themeinfo.php';
14 class WikiTheme_fusionforge extends WikiTheme_Wikilens {
18 $css[] = $this->_CSSlink("", "fusionforge.css", "");
19 $css[] = $this->_CSSlink("", "fusionforge-print.css", "print");
20 $css[] = $this->_CSSlink("Fullscreen", "fusionforge-fullscreen.css", "screen", true);
21 $css[] = $this->_CSSlink("Autonumbering", "fusionforge-autonumbering.css", "", true);
22 $css[] = $this->_CSSlink("Rereading Mode", "fusionforge-rereading.css", "", true);
27 global $HTML, $group_id, $group_public_name, $request, $project;
29 $pagename = $request->getArg('pagename');
31 $submenu = Template('navbar')->asXML();
33 if (defined('FUSIONFORGE') and FUSIONFORGE) {
35 $domain = textdomain(NULL);
36 textdomain('fusionforge');
39 if (!$project->isPublic()) {
40 //if it's a private group, you must be a member of that group
41 session_require_perm('project_read', $group_id);
44 //for dead projects must be member of admin project
45 if (!$project->isActive()) {
46 //only SF group can view non-active, non-holding groups
47 session_require_global_perm('forge_admin');
50 $HTML->header(array('h1' => '',
51 'title'=> $group_public_name._(": ").htmlspecialchars($pagename),
58 // Display a warning banner for internal users when the wiki is opened
60 if (method_exists($project, 'getIsExternal') && $project->getIsExternal()) {
61 $external_user = false;
62 if (session_loggedin()) {
63 $user = session_get_user();
64 $external_user = $user->getIsExternal();
66 if (!$external_user) {
67 $page = $request->getPage();
68 if ($page->get('external')) {
69 $external_msg = _("This page is external.");
71 echo $HTML->information(_("This project is shared with third-party users") .
72 sprintf(_(" (non %s users)."), forge_get_config('company')) .
73 (isset($external_msg) ? ' ' . $external_msg : ''));
82 if (defined('FUSIONFORGE') and FUSIONFORGE) {
85 $domain = textdomain(NULL);
86 textdomain('fusionforge');
88 $HTML->footer(array());
94 function initGlobals() {
98 $script_url = deduce_script_name();
99 $script_url .= '/'. $GLOBALS['group_name'] ;
100 if ((DEBUG & _DEBUG_REMOTE) and isset($_GET['start_debug']))
101 $script_url .= ("?start_debug=".$_GET['start_debug']);
102 $folderArrowPath = dirname($this->_findData('images/folderArrowLoading.gif'));
103 $pagename = $request->getArg('pagename');
104 $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikilens.js"))));
105 $js = "var data_path = '". javascript_quote_string(DATA_PATH) ."';\n"
106 // Temp remove pagename because of XSS warning
107 // ."var pagename = '". javascript_quote_string($pagename) ."';\n"
108 ."var script_url= '". javascript_quote_string($script_url) ."';\n"
109 ."var stylepath = data_path+'/".javascript_quote_string($this->_theme)."/';\n"
110 ."var folderArrowPath = '".javascript_quote_string($folderArrowPath)."';\n"
111 ."var use_path_info = " . (USE_PATH_INFO ? "true" : "false") .";\n";
112 $this->addMoreHeaders(JavaScript($js));
118 $this->initGlobals();
121 * The Signature image is shown after saving an edited page. If this
122 * is set to false then the "Thank you for editing..." screen will
126 $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
127 // Uncomment this next line to disable the signature.
128 $this->addImageAlias('signature', false);
133 $this->setLinkIcon('http');
134 $this->setLinkIcon('https');
135 $this->setLinkIcon('ftp');
136 $this->setLinkIcon('mailto');
138 $this->setButtonSeparator("");
141 * WikiWords can automatically be split by inserting spaces between
142 * the words. The default is to leave WordsSmashedTogetherLikeSo.
144 $this->setAutosplitWikiWords(false);
147 * Layout improvement with dangling links for mostly closed wiki's:
148 * If false, only users with edit permissions will be presented the
149 * special wikiunknown class with "?" and Tooltip.
150 * If true (default), any user will see the ?, but will be presented
151 * the PrintLoginForm on a click.
153 $this->setAnonEditUnknownLinks(false);
156 * You may adjust the formats used for formatting dates and times
157 * below. (These examples give the default formats.)
158 * Formats are given as format strings to PHP strftime() function See
159 * http://www.php.net/manual/en/function.strftime.php for details.
160 * Do not include the server's zone (%Z), times are converted to the
163 $this->setDateFormat("%d %B %Y");
164 $this->setTimeFormat("%H:%M");
167 /* Callback when a new user creates or edits a page */
168 function CbNewUserEdit (&$request, $userid) {
169 $content = "{{Template/UserPage}}\n\n----\n[[CategoryWiki user]]";
170 $dbi =& $request->_dbi;
171 $page = $dbi->getPage($userid);
172 $page->save($content, WIKIDB_FORCE_CREATE, array('author' => $userid));
177 $WikiTheme = new WikiTheme_fusionforge('fusionforge');
183 // c-hanging-comment-ender-p: nil
184 // indent-tabs-mode: nil