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('h1' => '',
43 'title'=> $group_public_name._(": ").htmlspecialchars($pagename),
46 'submenu' => $submenu->asXML()
50 // Display a warning banner for internal users when the wiki is opened
52 if (method_exists($project, 'getIsExternal') && $project->getIsExternal()) {
53 $external_user = false;
54 if (session_loggedin()) {
55 $user = session_get_user();
56 $external_user = $user->getIsExternal();
58 if (!$external_user) {
59 $page = $request->getPage();
60 if ($page->get('external')) {
61 $external_msg = _("This page is external.");
63 echo $HTML->warning_msg(_("This project is shared with third-party users (non Alcatel-Lucent users).") .
64 (isset($external_msg) ? ' ' . $external_msg : ''));
73 $domain = textdomain(NULL);
74 textdomain('fusionforge');
76 $HTML->footer(array());
81 function initGlobals() {
85 $script_url = deduce_script_name();
86 $script_url .= '/'. $GLOBALS['group_name'] ;
87 if ((DEBUG & _DEBUG_REMOTE) and isset($_GET['start_debug']))
88 $script_url .= ("?start_debug=".$_GET['start_debug']);
89 $folderArrowPath = dirname($this->_findData('images/folderArrowLoading.gif'));
90 $pagename = $request->getArg('pagename');
91 $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikilens.js"))));
92 $js = "var data_path = '". javascript_quote_string(DATA_PATH) ."';\n"
93 // Temp remove pagename because of XSS warning
94 // ."var pagename = '". javascript_quote_string($pagename) ."';\n"
95 ."var script_url= '". javascript_quote_string($script_url) ."';\n"
96 ."var stylepath = data_path+'/".javascript_quote_string($this->_theme)."/';\n"
97 ."var folderArrowPath = '".javascript_quote_string($folderArrowPath)."';\n"
98 ."var use_path_info = " . (USE_PATH_INFO ? "true" : "false") .";\n";
99 $this->addMoreHeaders(JavaScript($js));
105 $this->initGlobals();
108 * The Signature image is shown after saving an edited page. If this
109 * is set to false then the "Thank you for editing..." screen will
113 $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
114 // Uncomment this next line to disable the signature.
115 $this->addImageAlias('signature', false);
120 $this->setLinkIcon('http');
121 $this->setLinkIcon('https');
122 $this->setLinkIcon('ftp');
123 $this->setLinkIcon('mailto');
125 $this->setButtonSeparator("");
128 * WikiWords can automatically be split by inserting spaces between
129 * the words. The default is to leave WordsSmashedTogetherLikeSo.
131 $this->setAutosplitWikiWords(false);
134 * Layout improvement with dangling links for mostly closed wiki's:
135 * If false, only users with edit permissions will be presented the
136 * special wikiunknown class with "?" and Tooltip.
137 * If true (default), any user will see the ?, but will be presented
138 * the PrintLoginForm on a click.
140 $this->setAnonEditUnknownLinks(false);
143 * You may adjust the formats used for formatting dates and times
144 * below. (These examples give the default formats.)
145 * Formats are given as format strings to PHP strftime() function See
146 * http://www.php.net/manual/en/function.strftime.php for details.
147 * Do not include the server's zone (%Z), times are converted to the
150 $this->setDateFormat("%d %B %Y");
151 $this->setTimeFormat("%H:%M");
154 /* Callback when a new user creates or edits a page */
155 function CbNewUserEdit (&$request, $userid) {
156 $content = "{{Template/UserPage}}\n\n----\n[[CategoryWiki user]]";
157 $dbi =& $request->_dbi;
158 $page = $dbi->getPage($userid);
159 $page->save($content, WIKIDB_FORCE_CREATE, array('author' => $userid));
164 $WikiTheme = new WikiTheme_fusionforge('fusionforge');
170 // c-hanging-comment-ender-p: nil
171 // indent-tabs-mode: nil