2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
11 require_once('lib/WikiTheme.php');
12 require_once('themes/wikilens/themeinfo.php');
14 class WikiTheme_fusionforge extends WikiTheme_Wikilens {
17 global $HTML, $group_id, $group_public_name, $request, $project;
19 $pagename = $request->getArg('pagename');
21 $submenu = Template('navbar');
23 $domain = textdomain(NULL);
24 textdomain('fusionforge');
27 if (!$project->isPublic()) {
28 //if it's a private group, you must be a member of that group
30 session_require_perm('project_read', $group_id);
32 session_require(array('group'=>$group_id));
36 //for dead projects must be member of admin project
37 if (!$project->isActive()) {
38 //only SF group can view non-active, non-holding groups
39 session_require_global_perm('forge_admin');
42 $HTML->header(array('title'=> $group_public_name._(": ").htmlspecialchars($pagename),
45 'submenu' => $submenu->asXML()
49 // Display a warning banner for internal users when the wiki is opened
51 if (method_exists($project, 'getIsExternal') && $project->getIsExternal()) {
52 $external_user = false;
53 if (session_loggedin()) {
54 $user = session_get_user();
55 $external_user = $user->getIsExternal();
57 if (!$external_user) {
58 $page = $request->getPage();
59 if ($page->get('external')) {
60 $external_msg = _("This page is external.");
62 echo $HTML->warning_msg(_("This project is shared with third-party users (non Alcatel-Lucent users).") .
63 (isset($external_msg) ? ' ' . $external_msg : ''));
72 $domain = textdomain(NULL);
73 textdomain('fusionforge');
75 $HTML->footer(array());
80 function initGlobals() {
84 $script_url = deduce_script_name();
85 $script_url .= '/'. $GLOBALS['group_name'] ;
86 if ((DEBUG & _DEBUG_REMOTE) and isset($_GET['start_debug']))
87 $script_url .= ("?start_debug=".$_GET['start_debug']);
88 $folderArrowPath = dirname($this->_findData('images/folderArrowLoading.gif'));
89 $pagename = $request->getArg('pagename');
90 $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikilens.js"))));
91 $js = "var data_path = '". javascript_quote_string(DATA_PATH) ."';\n"
92 // Temp remove pagename because of XSS warning
93 // ."var pagename = '". javascript_quote_string($pagename) ."';\n"
94 ."var script_url= '". javascript_quote_string($script_url) ."';\n"
95 ."var stylepath = data_path+'/".javascript_quote_string($this->_theme)."/';\n"
96 ."var folderArrowPath = '".javascript_quote_string($folderArrowPath)."';\n"
97 ."var use_path_info = " . (USE_PATH_INFO ? "true" : "false") .";\n";
98 $this->addMoreHeaders(JavaScript($js));
104 $this->initGlobals();
107 * The Signature image is shown after saving an edited page. If this
108 * is set to false then the "Thank you for editing..." screen will
112 $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
113 // Uncomment this next line to disable the signature.
114 $this->addImageAlias('signature', false);
119 $this->setLinkIcon('http');
120 $this->setLinkIcon('https');
121 $this->setLinkIcon('ftp');
122 $this->setLinkIcon('mailto');
124 $this->setButtonSeparator("");
127 * WikiWords can automatically be split by inserting spaces between
128 * the words. The default is to leave WordsSmashedTogetherLikeSo.
130 $this->setAutosplitWikiWords(false);
133 * Layout improvement with dangling links for mostly closed wiki's:
134 * If false, only users with edit permissions will be presented the
135 * special wikiunknown class with "?" and Tooltip.
136 * If true (default), any user will see the ?, but will be presented
137 * the PrintLoginForm on a click.
139 $this->setAnonEditUnknownLinks(false);
142 * You may adjust the formats used for formatting dates and times
143 * below. (These examples give the default formats.)
144 * Formats are given as format strings to PHP strftime() function See
145 * http://www.php.net/manual/en/function.strftime.php for details.
146 * Do not include the server's zone (%Z), times are converted to the
149 $this->setDateFormat("%d %B %Y");
150 $this->setTimeFormat("%H:%M");
153 /* Callback when a new user creates or edits a page */
154 function CbNewUserEdit (&$request, $userid) {
155 $content = "{{Template/UserPage}}\n\n----\n[[CategoryWiki user]]";
156 $dbi =& $request->_dbi;
157 $page = $dbi->getPage($userid);
158 $page->save($content, WIKIDB_FORCE_CREATE, array('author' => $userid));
163 $WikiTheme = new WikiTheme_fusionforge('fusionforge');
169 // c-hanging-comment-ender-p: nil
170 // indent-tabs-mode: nil