2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
9 require_once 'lib/WikiTheme.php';
10 require_once 'themes/wikilens/themeinfo.php';
12 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);
28 global $HTML, $group_id, $group_public_name, $request, $project;
30 $pagename = $request->getArg('pagename');
32 $submenu = Template('navbar')->asXML();
34 if (defined('FUSIONFORGE') and FUSIONFORGE) {
36 $domain = textdomain(NULL);
37 textdomain('fusionforge');
40 if (!$project->isPublic()) {
41 //if it's a private group, you must be a member of that group
42 session_require_perm('project_read', $group_id);
45 //for dead projects must be member of admin project
46 if (!$project->isActive()) {
47 //only SF group can view non-active, non-holding groups
48 session_require_global_perm('forge_admin');
51 $HTML->header(array('h1' => '',
52 'title' => $group_public_name . _(": ") . htmlspecialchars($pagename),
59 // Display a warning banner for internal users when the wiki is opened
61 if (method_exists($project, 'getIsExternal') && $project->getIsExternal()) {
62 $external_user = false;
63 if (session_loggedin()) {
64 $user = session_get_user();
65 $external_user = $user->getIsExternal();
67 if (!$external_user) {
68 $page = $request->getPage();
69 if ($page->get('external')) {
70 $external_msg = _("This page is external.");
72 echo $HTML->information(_("This project is shared with third-party users") .
73 sprintf(_(" (non %s users)."), forge_get_config('company')) .
74 (isset($external_msg) ? ' ' . $external_msg : ''));
84 if (defined('FUSIONFORGE') and FUSIONFORGE) {
87 $domain = textdomain(NULL);
88 textdomain('fusionforge');
90 $HTML->footer(array());
96 function initGlobals()
101 $script_url = deduce_script_name();
102 $script_url .= '/' . $GLOBALS['group_name'];
103 if ((DEBUG & _DEBUG_REMOTE) and isset($_GET['start_debug']))
104 $script_url .= ("?start_debug=" . $_GET['start_debug']);
105 $folderArrowPath = dirname($this->_findData('images/folderArrowLoading.gif'));
106 $pagename = $request->getArg('pagename');
107 $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikilens.js"))));
108 $js = "var data_path = '" . javascript_quote_string(DATA_PATH) . "';\n"
109 // Temp remove pagename because of XSS warning
110 // ."var pagename = '". javascript_quote_string($pagename) ."';\n"
111 . "var script_url= '" . javascript_quote_string($script_url) . "';\n"
112 . "var stylepath = data_path+'/" . javascript_quote_string($this->_theme) . "/';\n"
113 . "var folderArrowPath = '" . javascript_quote_string($folderArrowPath) . "';\n"
114 . "var use_path_info = " . (USE_PATH_INFO ? "true" : "false") . ";\n";
115 $this->addMoreHeaders(JavaScript($js));
123 $this->initGlobals();
126 * The Signature image is shown after saving an edited page. If this
127 * is set to false then the "Thank you for editing..." screen will
131 $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
132 // Uncomment this next line to disable the signature.
133 $this->addImageAlias('signature', false);
138 $this->setLinkIcon('http');
139 $this->setLinkIcon('https');
140 $this->setLinkIcon('ftp');
141 $this->setLinkIcon('mailto');
143 $this->setButtonSeparator("");
146 * WikiWords can automatically be split by inserting spaces between
147 * the words. The default is to leave WordsSmashedTogetherLikeSo.
149 $this->setAutosplitWikiWords(false);
152 * Layout improvement with dangling links for mostly closed wiki's:
153 * If false, only users with edit permissions will be presented the
154 * special wikiunknown class with "?" and Tooltip.
155 * If true (default), any user will see the ?, but will be presented
156 * the PrintLoginForm on a click.
158 $this->setAnonEditUnknownLinks(false);
161 * You may adjust the formats used for formatting dates and times
162 * below. (These examples give the default formats.)
163 * Formats are given as format strings to PHP strftime() function See
164 * http://www.php.net/manual/en/function.strftime.php for details.
165 * Do not include the server's zone (%Z), times are converted to the
168 $this->setDateFormat("%d %B %Y");
169 $this->setTimeFormat("%H:%M");
172 /* Callback when a new user creates or edits a page */
173 function CbNewUserEdit(&$request, $userid)
175 $content = "{{Template/UserPage}}\n\n----\n[[CategoryWiki user]]";
176 $dbi =& $request->_dbi;
177 $page = $dbi->getPage($userid);
178 $page->save($content, WIKIDB_FORCE_CREATE, array('author' => $userid));
183 $WikiTheme = new WikiTheme_fusionforge('fusionforge');
189 // c-hanging-comment-ender-p: nil
190 // indent-tabs-mode: nil