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_gforge extends WikiTheme_Wikilens {
17 global $HTML, $group_id, $group_public_name, $request, $project;
19 $pagename = $request->getArg('pagename');
21 $submenu = Template('navbar');
24 if (!$project->isPublic()) {
25 //if it's a private group, you must be a member of that group
26 session_require(array('group'=>$group_id));
29 //for dead projects must be member of admin project
30 if (!$project->isActive()) {
31 //only SF group can view non-active, non-holding groups
32 session_require(array('group'=>'1'));
35 $HTML->header(array('title'=> $group_public_name.': '.htmlspecialchars($pagename),
38 'submenu' => $submenu->asXML()
42 // Display a warning banner for internal users when the wiki is opened
44 if ($project->getIsExternal()) {
45 $external_user = false;
46 if (session_loggedin()) {
47 $user = session_get_user();
48 $external_user = $user->getIsExternal();
50 if (!$external_user) {
51 $page = $request->getPage();
52 if ($page->get('external')) {
53 $external_msg = _("This page is external.");
55 echo $HTML->warning_msg(_("This project is shared with third-party users (non Alcatel-Lucent users).") .
56 (isset($external_msg) ? ' ' . $external_msg : ''));
64 $HTML->footer(array());
68 function initGlobals() {
72 $script_url = deduce_script_name();
73 $script_url .= '/'. $GLOBALS['group_name'] ;
74 if ((DEBUG & _DEBUG_REMOTE) and isset($_GET['start_debug']))
75 $script_url .= ("?start_debug=".$_GET['start_debug']);
76 $folderArrowPath = dirname($this->_findData('images/folderArrowLoading.gif'));
77 $pagename = $request->getArg('pagename');
78 $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikilens.js"))));
79 $js = "var data_path = '". javascript_quote_string(DATA_PATH) ."';\n"
80 // Temp remove pagename because of XSS warning
81 // ."var pagename = '". javascript_quote_string($pagename) ."';\n"
82 ."var script_url= '". javascript_quote_string($script_url) ."';\n"
83 ."var stylepath = data_path+'/".javascript_quote_string($this->_theme)."/';\n"
84 ."var folderArrowPath = '".javascript_quote_string($folderArrowPath)."';\n"
85 ."var use_path_info = " . (USE_PATH_INFO ? "true" : "false") .";\n";
86 $this->addMoreHeaders(JavaScript($js));
95 * The Signature image is shown after saving an edited page. If this
96 * is set to false then the "Thank you for editing..." screen will
100 $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
101 // Uncomment this next line to disable the signature.
102 $this->addImageAlias('signature', false);
107 $this->setLinkIcon('http');
108 $this->setLinkIcon('https');
109 $this->setLinkIcon('ftp');
110 $this->setLinkIcon('mailto');
112 $this->setButtonSeparator("");
115 * WikiWords can automatically be split by inserting spaces between
116 * the words. The default is to leave WordsSmashedTogetherLikeSo.
118 $this->setAutosplitWikiWords(false);
121 * Layout improvement with dangling links for mostly closed wiki's:
122 * If false, only users with edit permissions will be presented the
123 * special wikiunknown class with "?" and Tooltip.
124 * If true (default), any user will see the ?, but will be presented
125 * the PrintLoginForm on a click.
127 $this->setAnonEditUnknownLinks(false);
130 * You may adjust the formats used for formatting dates and times
131 * below. (These examples give the default formats.)
132 * Formats are given as format strings to PHP strftime() function See
133 * http://www.php.net/manual/en/function.strftime.php for details.
134 * Do not include the server's zone (%Z), times are converted to the
137 $this->setDateFormat("%d %B %Y");
138 $this->setTimeFormat("%H:%M");
141 /* Callback when a new user creates or edits a page */
142 function CbNewUserEdit (&$request, $userid) {
143 $content = "{{Template/UserPage}}\n\n----\n[[CategoryWiki user]]";
144 $dbi =& $request->_dbi;
145 $page = $dbi->getPage($userid);
146 $page->save($content, WIKIDB_FORCE_CREATE, array('author' => $userid));
151 $WikiTheme = new WikiTheme_gforge('gforge');
157 // c-hanging-comment-ender-p: nil
158 // indent-tabs-mode: nil