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 {
16 $css[] = $this->_CSSlink("", "fusionforge.css", "");
17 $css[] = $this->_CSSlink("", "fusionforge-print.css", "print");
18 $css[] = $this->_CSSlink("Fullscreen", "fusionforge-fullscreen.css", "screen", true);
19 $css[] = $this->_CSSlink("Autonumbering", "fusionforge-autonumbering.css", "", true);
20 $css[] = $this->_CSSlink("Rereading Mode", "fusionforge-rereading.css", "", true);
25 global $HTML, $group_id, $group_public_name, $request, $project;
27 $pagename = $request->getArg('pagename');
29 $submenu = Template('navbar')->asXML();
31 if (defined('FUSIONFORGE') and FUSIONFORGE) {
33 $domain = textdomain(NULL);
34 textdomain('fusionforge');
37 if (!$project->isPublic()) {
38 //if it's a private group, you must be a member of that group
39 session_require_perm('project_read', $group_id);
42 //for dead projects must be member of admin project
43 if (!$project->isActive()) {
44 //only SF group can view non-active, non-holding groups
45 session_require_global_perm('forge_admin');
48 $HTML->header(array('h1' => '',
49 'title'=> $group_public_name._(": ").htmlspecialchars($pagename),
56 // Display a warning banner for internal users when the wiki is opened
58 if (method_exists($project, 'getIsExternal') && $project->getIsExternal()) {
59 $external_user = false;
60 if (session_loggedin()) {
61 $user = session_get_user();
62 $external_user = $user->getIsExternal();
64 if (!$external_user) {
65 $page = $request->getPage();
66 if ($page->get('external')) {
67 $external_msg = _("This page is external.");
69 echo $HTML->information(_("This project is shared with third-party users") .
70 sprintf(_(" (non %s users)."), forge_get_config('company')) .
71 (isset($external_msg) ? ' ' . $external_msg : ''));
80 if (defined('FUSIONFORGE') and FUSIONFORGE) {
83 $domain = textdomain(NULL);
84 textdomain('fusionforge');
86 $HTML->footer(array());
92 function initGlobals() {
96 $script_url = deduce_script_name();
97 $script_url .= '/'. $GLOBALS['group_name'] ;
98 if ((DEBUG & _DEBUG_REMOTE) and isset($_GET['start_debug']))
99 $script_url .= ("?start_debug=".$_GET['start_debug']);
100 $folderArrowPath = dirname($this->_findData('images/folderArrowLoading.gif'));
101 $pagename = $request->getArg('pagename');
102 $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikilens.js"))));
103 $js = "var data_path = '". javascript_quote_string(DATA_PATH) ."';\n"
104 // Temp remove pagename because of XSS warning
105 // ."var pagename = '". javascript_quote_string($pagename) ."';\n"
106 ."var script_url= '". javascript_quote_string($script_url) ."';\n"
107 ."var stylepath = data_path+'/".javascript_quote_string($this->_theme)."/';\n"
108 ."var folderArrowPath = '".javascript_quote_string($folderArrowPath)."';\n"
109 ."var use_path_info = " . (USE_PATH_INFO ? "true" : "false") .";\n";
110 $this->addMoreHeaders(JavaScript($js));
116 $this->initGlobals();
119 * The Signature image is shown after saving an edited page. If this
120 * is set to false then the "Thank you for editing..." screen will
124 $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
125 // Uncomment this next line to disable the signature.
126 $this->addImageAlias('signature', false);
131 $this->setLinkIcon('http');
132 $this->setLinkIcon('https');
133 $this->setLinkIcon('ftp');
134 $this->setLinkIcon('mailto');
136 $this->setButtonSeparator("");
139 * WikiWords can automatically be split by inserting spaces between
140 * the words. The default is to leave WordsSmashedTogetherLikeSo.
142 $this->setAutosplitWikiWords(false);
145 * Layout improvement with dangling links for mostly closed wiki's:
146 * If false, only users with edit permissions will be presented the
147 * special wikiunknown class with "?" and Tooltip.
148 * If true (default), any user will see the ?, but will be presented
149 * the PrintLoginForm on a click.
151 $this->setAnonEditUnknownLinks(false);
154 * You may adjust the formats used for formatting dates and times
155 * below. (These examples give the default formats.)
156 * Formats are given as format strings to PHP strftime() function See
157 * http://www.php.net/manual/en/function.strftime.php for details.
158 * Do not include the server's zone (%Z), times are converted to the
161 $this->setDateFormat("%d %B %Y");
162 $this->setTimeFormat("%H:%M");
165 /* Callback when a new user creates or edits a page */
166 function CbNewUserEdit (&$request, $userid) {
167 $content = "{{Template/UserPage}}\n\n----\n[[CategoryWiki user]]";
168 $dbi =& $request->_dbi;
169 $page = $dbi->getPage($userid);
170 $page->save($content, WIKIDB_FORCE_CREATE, array('author' => $userid));
175 $WikiTheme = new WikiTheme_fusionforge('fusionforge');
181 // c-hanging-comment-ender-p: nil
182 // indent-tabs-mode: nil