source: documentation/trunk/packages/templates/greenstone-monobook/main.php.bak@ 30114

Last change on this file since 30114 was 30114, checked in by jmt12, 9 years ago

Updated Greenstone customizations for Detritus, but rearranged to move into separate plugin. Initial checkin of plugins, template, special wiki pages.

File size: 34.2 KB
Line 
1<?php
2
3/**
4 * Main file of the "monobook" template for DokuWiki
5 *
6 *
7 * LICENSE: This file is open source software (OSS) and may be copied under
8 * certain conditions. See COPYING file for details or try to contact
9 * the author(s) of this file in doubt.
10 *
11 * @license GPLv2 (http://www.gnu.org/licenses/gpl2.html)
12 * @author Andreas Haerter <[email protected]>
13 * @link http://andreas-haerter.com/projects/dokuwiki-template-monobook
14 * @link http://www.dokuwiki.org/template:monobook
15 * @link http://www.dokuwiki.org/devel:templates
16 * @link http://www.dokuwiki.org/devel:coding_style
17 * @link http://www.dokuwiki.org/devel:environment
18 * @link http://www.dokuwiki.org/devel:action_modes
19 */
20
21
22//check if we are running within the DokuWiki environment
23if (!defined("DOKU_INC")){
24 die();
25}
26
27
28/**
29 * Stores the template wide action
30 *
31 * Different DokuWiki actions requiring some template logic. Therefore the
32 * template has to know, what we are doing right now - and that is what this
33 * var is for.
34 *
35 * Please have a look at the "detail.php" file in the same folder, it is also
36 * influencing the var's value.
37 *
38 * @var string
39 * @author Andreas Haerter <[email protected]>
40 */
41$monobook_action = "article";
42//note: I used $_REQUEST before (cause DokuWiki controls and fills it. Normally,
43// using $_REQUEST is a possible security threat. For details, see
44// <http://www.suspekt.org/2008/10/01/php-53-and-delayed-cross-site-request-forgerieshijacking/>
45// and <http://forum.dokuwiki.org/post/16524>), but it did not work as
46// expected by me (maybe it is a reference and setting $monobook_action
47// also changed the contents of $_REQUEST?!). That is why I switched back,
48// checking $_GET and $_POST like I did it before.
49if (!empty($_GET["mddo"])){
50 $monobook_action = (string)$_GET["mddo"];
51}elseif (!empty($_POST["mddo"])){
52 $monobook_action = (string)$_POST["mddo"];
53}
54if (!empty($monobook_action) &&
55 $monobook_action !== "article" &&
56 $monobook_action !== "print" &&
57 $monobook_action !== "detail" &&
58 $monobook_action !== "cite"){
59 //ignore unknown values
60 $monobook_action = "article";
61}
62
63
64/**
65 * Stores the template wide context
66 *
67 * This template offers discussion pages via common articles, which should be
68 * marked as "special". DokuWiki does not know any "special" articles, therefore
69 * we have to take care about detecting if the current page is a discussion
70 * page or not.
71 *
72 * @var string
73 * @author Andreas Haerter <[email protected]>
74 */
75$monobook_context = "article";
76if (preg_match("/^".tpl_getConf("monobook_discuss_ns")."?$|^".tpl_getConf("monobook_discuss_ns").".*?$/i", ":".getNS(getID()))){
77 $monobook_context = "discuss";
78}
79
80
81/**
82 * Stores the name the current client used to login
83 *
84 * @var string
85 * @author Andreas Haerter <[email protected]>
86 */
87$loginname = "";
88if (!empty($conf["useacl"])){
89 if (isset($_SERVER["REMOTE_USER"]) && //no empty() but isset(): "0" may be a valid username...
90 $_SERVER["REMOTE_USER"] !== ""){
91 $loginname = $_SERVER["REMOTE_USER"]; //$INFO["client"] would not work here (-> e.g. if
92 //current IP differs from the one used to login)
93 }
94}
95
96
97//get needed language array
98include DOKU_TPLINC."lang/en/lang.php";
99//overwrite English language values with available translations
100if (!empty($conf["lang"]) &&
101 $conf["lang"] !== "en" &&
102 file_exists(DOKU_TPLINC."/lang/".$conf["lang"]."/lang.php")){
103 //get language file (partially translated language files are no problem
104 //cause non translated stuff is still existing as English array value)
105 include DOKU_TPLINC."/lang/".$conf["lang"]."/lang.php";
106}
107
108
109//detect revision
110$rev = (int)$INFO["rev"]; //$INFO comes from the DokuWiki core
111if ($rev < 1){
112 $rev = (int)$INFO["lastmod"];
113}
114
115
116//get tab config
117include DOKU_TPLINC."/conf/tabs.php"; //default
118if (file_exists(DOKU_TPLINC."/user/tabs.php")){
119 include DOKU_TPLINC."/user/tabs.php"; //user defined
120}
121
122
123//get boxes config
124include DOKU_TPLINC."/conf/boxes.php"; //default
125if (file_exists(DOKU_TPLINC."/user/boxes.php")){
126 include DOKU_TPLINC."/user/boxes.php"; //user defined
127}
128
129
130//get button config
131include DOKU_TPLINC."/conf/buttons.php"; //default
132if (file_exists(DOKU_TPLINC."/user/buttons.php")){
133 include DOKU_TPLINC."/user/buttons.php"; //user defined
134}
135
136
137/**
138 * Helper to render the tabs (like a dynamic XHTML snippet)
139 *
140 *
141 * NOTE: This function is heavily inspired by "writeMBPortlet(), context.php" of
142 * the "Monobook for Dokuwiki" template by Terence J. Grant.
143 *
144 * @param array The tab data to render within the snippet. Each element
145 * is represented through a subarray:
146 * $array = array("tab1" => array("text" => "hello world!",
147 * "href" => "http://www.example.com"
148 * "nofollow" => true),
149 * "tab2" => array("text" => "I did it again",
150 * "href" => DOKU_BASE."doku.php?id=foobar",
151 * "class" => "foobar-css"),
152 * "tab3" => array("text" => "I did it again and again",
153 * "href" => wl("start", false, false, "&"),
154 * "class" => "foobar-css"),
155 * "tab4" => array("text" => "Home",
156 * "wiki" => ":start"
157 * "accesskey" => "H"));
158 * Available keys within the subarrays:
159 * - "text" (mandatory)
160 * The text/label of the element.
161 * - "href" (optional)
162 * URL the element should point to (as link). Please submit raw,
163 * unencoded URLs, the encoding will be done by this function for
164 * security reasons. If the URL is not relative
165 * (= starts with http(s)://), the URL will be treated as external
166 * (=a special style will be used if "class" is not set).
167 * - "wiki" (optional)
168 * ID of a WikiPage to link (like ":start" or ":wiki:foobar").
169 * - "class" (optional)
170 * Name of an additional CSS class to use for the element content.
171 * Works only in combination with "text" or "href", NOT with "wiki"
172 * (will be ignored in this case).
173 * - "nofollow" (optional)
174 * If set to TRUE, rel="nofollow" will be added to the link if "href"
175 * is set (otherwise this flag will do nothing).
176 * - "accesskey" (optional)
177 * accesskey="<value>" will be added to the link if "href" is set
178 * (otherwise this option will do nothing).
179 * @author Andreas Haerter <[email protected]>
180 * @see _monobook_renderButtons()
181 * @see _monobook_renderBoxes()
182 * @link http://www.wikipedia.org/wiki/Nofollow
183 * @link http://de.selfhtml.org/html/verweise/tastatur.htm#kuerzel
184 * @link http://www.dokuwiki.org/devel:environment
185 * @link http://www.dokuwiki.org/devel:coding_style
186 */
187function _monobook_renderTabs($arr)
188{
189 //is there something useful?
190 if (empty($arr) ||
191 !is_array($arr)){
192 return false; //nope, break operation
193 }
194
195 //array to store the created tabs into
196 $elements = array();
197
198 //handle the tab data
199 foreach($arr as $li_id => $element){
200 //basic check
201 if (empty($element) ||
202 !is_array($element) ||
203 !isset($element["text"])){
204 continue; //ignore invalid stuff and go on
205 }
206 $li_created = true; //flag to control if we created any list element
207 $interim = "";
208 //do we have an external link?
209 if (!empty($element["href"])){
210 //add URL
211 $interim = "<a href=\"".hsc($element["href"])."\""; //@TODO: real URL encoding
212 //add rel="nofollow" attribute to the link?
213 if (!empty($element["nofollow"])){
214 $interim .= " rel=\"nofollow\"";
215 }
216 //add special css class?
217 if (!empty($element["class"])){
218 $interim .= " class=\"".hsc($element["class"])."\"";
219 } elseif (substr($element["href"], 0, 4) === "http" ||
220 substr($element["href"], 0, 3) === "ftp"){
221 $interim .= " class=\"urlextern\"";
222 }
223 //add access key?
224 if (!empty($element["accesskey"])){
225 $interim .= " accesskey=\"".hsc($element["accesskey"])."\" title=\"[ALT+".hsc(strtoupper($element["accesskey"]))."]\"";
226 }
227 $interim .= ">".hsc($element["text"])."</a>";
228 //internal wiki link
229 }else if (!empty($element["wiki"])){
230 //add special css class?
231 if (!empty($element["class"])){
232 $interim = "<span class=\"".hsc($element["class"])."\">".html_wikilink($element["wiki"], hsc($element["text"]))."</span>";
233 }else{
234 $interim = html_wikilink($element["wiki"], hsc($element["text"]));
235 }
236 /* Following works, but I think it is too heavy... //use a wiki page as content
237 } elseif ($element["wiki_include"]){
238
239 //we have to show a wiki page. get the rendered content of the
240 //defined wiki article to use as content.
241 $interim = tpl_include_page($element["wiki_include"], false);
242 if ($interim === "" ||
243 $interim === false){
244 //show creation/edit link if the defined page got no content
245 $interim = "[&#160;".html_wikilink($element["wiki_include"], hsc($lang["monobook_fillplaceholder"]." (".hsc($element["wiki_include"]).")"))."&#160;]<br />";
246 }*/
247 //text only
248 }else{
249 $interim = "<span";
250 //add special css class?
251 if (!empty($element["class"])){
252 $interim .= " class=\"".hsc($element["class"])."\"";
253 }else{
254 $interim .= " style=\"color:#ccc;\"";
255 }
256 $interim .= ">&#160;".hsc($element["text"])."&#160;</span>";
257 }
258 //store it
259 $elements[] = " <li id=\"".hsc($li_id)."\">".$interim."</li>\n";
260 }
261
262 //show everything created
263 if (!empty($elements)){
264 echo "\n"
265 ." <div id=\"p-cactions\" class=\"portlet\">\n" //don't touch the id, it is needed as css selector
266 ." <ul>\n";
267 foreach ($elements as $element){
268 echo $element;
269 }
270 echo " </ul>\n"
271 ." </div>\n";
272 }
273 return true;
274}
275
276
277/**
278 * Helper to render the boxes (like a dynamic XHTML snippet)
279 *
280 *
281 * NOTE: This function is heavily inspired by "writeMBPortlet(), context.php" of
282 * the "Monobook for Dokuwiki" template by Terence J. Grant.
283 *
284 * @param array The box data to render within the snippet. Each box is
285 * represented through a subarray:
286 * $array = array("box-id1" => array("headline" => "hello world!",
287 * "xhtml" => "I am <i>here</i>."));
288 * Available keys within the subarrays:
289 * - "xhtml" (mandatory)
290 * The content of the Box you want to show as XHTML. Attention: YOU
291 * HAVE TO TAKE CARE ABOUT FILTER EVENTUALLY USED INPUT/SECURITY. Be
292 * aware of XSS and stuff.
293 * - "headline" (optional)
294 * Headline to show above the box. Leave empty/do not set for none.
295 * @author Andreas Haerter <[email protected]>
296 * @see _monobook_renderButtons()
297 * @see _monobook_renderTabs()
298 * @link http://www.wikipedia.org/wiki/Nofollow
299 * @link http://www.wikipedia.org/wiki/Cross-site_scripting
300 * @link http://www.dokuwiki.org/devel:coding_style
301 */
302function _monobook_renderBoxes($arr)
303{
304 //is there something useful?
305 if (empty($arr) ||
306 !is_array($arr)){
307 return false; //nope, break operation
308 }
309
310 //array to store the created boxes into
311 $boxes = array();
312 $search_handled = false;
313
314 //handle the box data
315 foreach($arr as $div_id => $contents){
316 //basic check
317 if (empty($contents) ||
318 !is_array($contents) ||
319 !isset($contents["xhtml"])){
320 continue; //ignore invalid stuff and go on
321 }
322 $interim = " <div class=\"portlet\" id=\"".hsc($div_id)."\">\n";
323 if (isset($contents["headline"])
324 && $contents["headline"] !== ""){
325 //hack for search box
326 if ($search_handled === true ||
327 $div_id !== "p-search") {
328 $interim .= " <h5>".hsc($contents["headline"])."</h5>\n";
329 } else {
330 $interim .= " <h5><label for=\"qsearch__in\">".hsc($contents["headline"])."</label></h5>\n";
331 }
332 }
333 $interim .= " <div class=\"pBody\">\n"
334 ." <div class=\"dokuwiki\">\n" //dokuwiki CSS class needed cause we might have to show rendered page content
335 .$contents["xhtml"]."\n"
336 ." </div>\n"
337 ." </div>\n"
338 ." </div>\n";
339 //hack for search box
340 if ($search_handled === false &&
341 $div_id === "p-search") {
342 $interim .= " <div id=\"qsearch__out\" class=\"ajax_qsearch JSpopup\"></div>\n";
343 //set flag
344 $search_handled = true;
345 }
346 //store it
347 $boxes[] = $interim;
348 }
349 //show everything created
350 if (!empty($boxes)){
351 echo "\n";
352 foreach ($boxes as $box){
353 echo $box;
354 }
355 echo "\n";
356 }
357
358 return true;
359}
360
361
362/**
363 * Helper to render the footer buttons (like a dynamic XHTML snippet)
364 *
365 * @param array The button data to render within the snippet. Each element
366 * is represented through a subarray:
367 * $array = array("btn1" => array("img" => DOKU_TPL."static/img/button-monobook.png",
368 * "href" => "http://andreas-haerter.com/projects/dokuwiki-template-monobook",
369 * "width" => 80,
370 * "height" => 15,
371 * "title" => "monobook for DokuWiki",
372 * "nofollow" => false),
373 * "btn2" => array("img" => DOKU_TPL."user/mybutton1.png",
374 * "href" => wl("start", false, false, "&")),
375 * "btn3" => array("img" => DOKU_TPL."user/mybutton2.png",
376 * "href" => "http://www.example.com");
377 * Available keys within the subarrays:
378 * - "img" (mandatory)
379 * The relative or full path of an image/button to show. Users may
380 * place own images within the /user/ dir of this template.
381 * - "href" (mandatory)
382 * URL the element should point to (as link). Please submit raw,
383 * unencoded URLs, the encoding will be done by this function for
384 * security reasons.
385 * - "width" (optional)
386 * width="<value>" will be added to the image tag if both "width" and
387 * "height" are set (otherwise, this will be ignored).
388 * - "height" (optional)
389 * height="<value>" will be added to the image tag if both "height" and
390 * "width" are set (otherwise, this will be ignored).
391 * - "nofollow" (optional)
392 * If set to TRUE, rel="nofollow" will be added to the link.
393 * - "title" (optional)
394 * title="<value>" will be added to the link and image if "title"
395 * is set + alt="<value>".
396 * @author Andreas Haerter <[email protected]>
397 * @see _monobook_renderButtons()
398 * @see _monobook_renderBoxes()
399 * @link http://www.wikipedia.org/wiki/Nofollow
400 * @link http://www.dokuwiki.org/devel:coding_style
401 */
402function _monobook_renderButtons($arr)
403{
404 //array to store the created buttons into
405 $elements = array();
406
407 //handle the button data
408 foreach($arr as $li_id => $element){
409 //basic check
410 if (empty($element) ||
411 !is_array($element) ||
412 !isset($element["img"]) ||
413 !isset($element["href"])){
414 continue; //ignore invalid stuff and go on
415 }
416 $interim = "";
417
418 //add URL
419 $interim = "<a href=\"".hsc($element["href"])."\""; //@TODO: real URL encoding
420 //add rel="nofollow" attribute to the link?
421 if (!empty($element["nofollow"])){
422 $interim .= " rel=\"nofollow\"";
423 }
424 //add title attribute to the link?
425 if (!empty($element["title"])){
426 $interim .= " title=\"".hsc($element["title"])."\"";
427 }
428 $interim .= " target=\"_blank\"><img src=\"".hsc($element["img"])."\"";
429 //add width and height attribute to the image?
430 if (!empty($element["width"]) &&
431 !empty($element["height"])){
432 $interim .= " width=\"".(int)$element["width"]."\" height=\"".(int)$element["height"]."\"";
433 }
434 //add title and alt attribute to the image?
435 if (!empty($element["title"])){
436 $interim .= " title=\"".hsc($element["title"])."\" alt=\"".hsc($element["title"])."\"";
437 } else {
438 $interim .= " alt=\"\""; //alt is a mandatory attribute for images
439 }
440 $interim .= " border=\"0\" /></a>";
441
442 //store it
443 $elements[] = " ".$interim."\n";
444 }
445
446 //show everything created
447 if (!empty($elements)){
448 echo "\n";
449 foreach ($elements as $element){
450 echo $element;
451 }
452 }
453 return true;
454}
455
456//workaround for the "jumping textarea" IE bug. CSS only fix not possible cause
457//some DokuWiki JavaScript is triggering this bug, too. See the following for
458//info:
459//- <http://blog.andreas-haerter.com/2010/05/28/fix-msie-8-auto-scroll-textarea-css-width-percentage-bug>
460//- <http://msdn.microsoft.com/library/cc817574.aspx>
461if ($ACT === "edit" &&
462 !headers_sent()){
463 header("X-UA-Compatible: IE=EmulateIE7");
464}
465
466?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
467 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
468<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo hsc($conf["lang"]); ?>" lang="<?php echo hsc($conf["lang"]); ?>" dir="<?php echo hsc($lang["direction"]); ?>">
469<head>
470<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
471<title><?php tpl_pagetitle(); echo " - ".hsc($conf["title"]); ?></title>
472<?php
473//show meta-tags
474tpl_metaheaders();
475echo "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />";
476
477//manually load needed CSS? this is a workaround for PHP Bug #49642. In some
478//version/os combinations PHP is not able to parse INI-file entries if there
479//are slashes "/" used for the keynames (see bugreport for more information:
480//<http://bugs.php.net/bug.php?id=49692>). to trigger this workaround, simply
481//delete/rename monobook's style.ini.
482if (!file_exists(DOKU_TPLINC."style.ini")){
483 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."bug49642.php".((!empty($lang["direction"]) && $lang["direction"] === "rtl") ? "?langdir=rtl" : "")."\" />\n"; //var comes from DokuWiki core
484}
485
486//include default or userdefined favicon
487//
488//note: since 2011-04-22 "Rincewind RC1", there is a core function named
489// "tpl_getFavicon()". But its functionality is not really fitting the
490// behaviour of this template, therefore I don't use it here.
491if (file_exists(DOKU_TPLINC."user/favicon.ico")){
492 //user defined - you might find http://tools.dynamicdrive.com/favicon/
493 //useful to generate one
494 echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."user/favicon.ico\" />\n";
495}elseif (file_exists(DOKU_TPLINC."user/favicon.png")){
496 //note: I do NOT recommend PNG for favicons (cause it is not supported by
497 //all browsers), but some users requested this feature.
498 echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."user/favicon.png\" />\n";
499}else{
500 //default
501 echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."static/3rd/dokuwiki/favicon.ico\" />\n";
502}
503
504//include default or userdefined Apple Touch Icon (see <http://j.mp/sx3NMT> for
505//details)
506if (file_exists(DOKU_TPLINC."user/apple-touch-icon.png")){
507 echo "<link rel=\"apple-touch-icon\" href=\"".DOKU_TPL."user/apple-touch-icon.png\" />\n";
508}else{
509 //default
510 echo "<link rel=\"apple-touch-icon\" href=\"".DOKU_TPL."static/3rd/dokuwiki/apple-touch-icon.png\" />\n";
511}
512
513//load userdefined js?
514if (tpl_getConf("monobook_loaduserjs")){
515 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/user.js\"></script>\n";
516}
517
518//show printable version?
519if ($monobook_action === "print"){
520 //note: this is just a workaround for people searching for a print version.
521 // don't forget to update the styles.ini, this is the really important
522 // thing! BTW: good text about this: http://is.gd/5MyG5
523 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."static/css/print.css\" />\n"
524 ."<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."static/3rd/wikipedia/commonPrint.css\" />\n"
525 ."<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."user/print.css\" />\n";
526}
527
528//load language specific css hacks?
529if (file_exists(DOKU_TPLINC."lang/".$conf["lang"]."/style.css")){
530 $interim = trim(file_get_contents(DOKU_TPLINC."lang/".$conf["lang"]."/style.css"));
531 if (!empty($interim)){
532 echo "<style type=\"text/css\" media=\"all\">\n".hsc($interim)."\n</style>\n";
533 }
534}
535?>
536<!--[if lt IE 5.5000]><link rel="stylesheet" media="all" type="text/css" href="<?php echo DOKU_TPL; ?>static/3rd/monobook/IE50Fixes.css" /><![endif]-->
537<!--[if IE 5.5000]><link rel="stylesheet" media="all" type="text/css" href="<?php echo DOKU_TPL; ?>static/3rd/monobook/IE55Fixes.css" /><![endif]-->
538<!--[if IE 6]><link rel="stylesheet" media="all" type="text/css" href="<?php echo DOKU_TPL; ?>static/3rd/monobook/IE60Fixes.css" /><![endif]-->
539<!--[if IE 7]><link rel="stylesheet" media="all" type="text/css" href="<?php echo DOKU_TPL; ?>static/3rd/monobook/IE70Fixes.css" /><![endif]-->
540<!--[if lt IE 7]><script type="text/javascript" charset="utf-8" src="<?php echo DOKU_TPL; ?>static/3rd/wikipedia/IEFixes.js"></script><meta http-equiv="imagetoolbar" content="no" /><![endif]-->
541</head>
542<body class="<?php //different styles/backgrounds for different page types
543 switch (true){
544 //special: tech
545 case ($monobook_action === "detail"):
546 case ($monobook_action === "cite"):
547 case ($ACT === "media"): //var comes from DokuWiki
548 case ($ACT === "search"): //var comes from DokuWiki
549 echo "mediawiki ns-2 ltr";
550 break;
551 //special: other
552 case ($ACT === "edit"): //var comes from DokuWiki
553 case ($ACT === "draft"): //var comes from DokuWiki
554 case ($ACT === "revisions"): //var comes from DokuWiki
555 case ($monobook_context === "discuss"):
556 case (preg_match("/^wiki$|^wiki:.*?$/i", getNS(getID()))):
557 echo "mediawiki ns-1 ltr";
558 break;
559 //"normal" content
560 case ($monobook_action === "print"):
561 default:
562 echo "mediawiki ns-0 ltr";
563 break;
564 }
565 ?>">
566<div id="globalWrapper">
567
568 <div id="column-content">
569 <div id="content">
570 <a name="top" id="top"></a>
571 <a name="dokuwiki__top" id="dokuwiki__top"></a>
572 <div id="bodyContent">
573 <div class="dokuwiki">
574 <!-- start main content area -->
575 <?php
576 //show messages (if there are any)
577 html_msgarea();
578 //show site notice
579 if (tpl_getConf("monobook_sitenotice")){
580 //we have to show a custom sitenotice
581 if (empty($conf["useacl"]) ||
582 auth_quickaclcheck(cleanID(tpl_getConf("monobook_sitenotice_location"))) >= AUTH_READ){ //current user got access?
583 echo "\n <div id=\"siteNotice\" class=\"noprint\">\n";
584 //get the rendered content of the defined wiki article to use as
585 //custom sitenotice.
586 $interim = tpl_include_page(tpl_getConf("monobook_sitenotice_location"), false);
587 if ($interim === "" ||
588 $interim === false){
589 //show creation/edit link if the defined page got no content
590 echo "[&#160;";
591 tpl_pagelink(tpl_getConf("monobook_sitenotice_location"), hsc($lang["monobook_fillplaceholder"]." (".tpl_getConf("monobook_sitenotice_location").")"));
592 echo "&#160;]<br />";
593 }else{
594 //show the rendered page content
595 echo $interim;
596 }
597 echo "\n </div>\n";
598 }
599 }
600 //show breadcrumps if enabled and positioned on top
601 if ($conf["breadcrumbs"] == true &&
602 $ACT !== "media" && //var comes from DokuWiki
603 (empty($conf["useacl"]) || //are there any users?
604 $loginname !== "" || //user is logged in?
605 !tpl_getConf("monobook_closedwiki")) &&
606 tpl_getConf("monobook_breadcrumbs_position") === "top"){
607 echo "\n <div class=\"catlinks noprint\"><p>\n ";
608 tpl_breadcrumbs();
609 echo "\n </p></div>\n";
610 }
611 //show hierarchical breadcrumps if enabled and positioned on top
612 if ($conf["youarehere"] == true &&
613 $ACT !== "media" && //var comes from DokuWiki
614 (empty($conf["useacl"]) || //are there any users?
615 $loginname !== "" || //user is logged in?
616 !tpl_getConf("monobook_closedwiki")) &&
617 tpl_getConf("monobook_youarehere_position") === "top"){
618 echo "\n <div class=\"catlinks noprint\"><p>\n ";
619 tpl_youarehere();
620 echo "\n </p></div>\n";
621 }
622 ?>
623
624 <!-- start rendered wiki content -->
625 <?php
626 //flush the buffer for faster page rendering, heaviest content follows
627 if (function_exists("tpl_flush")) {
628 tpl_flush(); //exists since 2010-11-07 "Anteater"...
629 } else {
630 flush(); //...but I won't loose compatibility to 2009-12-25 "Lemming" right now.
631 }
632 //decide which type of pagecontent we have to show
633 switch ($monobook_action){
634 //"image details"
635 case "detail":
636 include DOKU_TPLINC."inc_detail.php";
637 break;
638 //"cite this article"
639 case "cite":
640 include DOKU_TPLINC."inc_cite.php";
641 break;
642 //show "normal" content
643 default:
644 tpl_content(((tpl_getConf("monobook_toc_position") === "article") ? true : false));
645 break;
646 }
647 ?>
648 <!-- end rendered wiki content -->
649
650 <br />
651 <?php
652 //show breadcrumps if enabled and positioned on bottom
653 if ($conf["breadcrumbs"] == true &&
654 $ACT !== "media" && //var comes from DokuWiki
655 (empty($conf["useacl"]) || //are there any users?
656 $loginname !== "" || //user is logged in?
657 !tpl_getConf("monobook_closedwiki")) &&
658 tpl_getConf("monobook_breadcrumbs_position") === "bottom"){
659 echo "\n <div class=\"catlinks noprint\"><p>\n ";
660 tpl_breadcrumbs();
661 echo "\n </p></div>\n";
662 }
663 //show hierarchical breadcrumps if enabled and positioned on bottom
664 if ($conf["youarehere"] == true &&
665 $ACT !== "media" && //var comes from DokuWiki
666 (empty($conf["useacl"]) || //are there any users?
667 $loginname !== "" || //user is logged in?
668 !tpl_getConf("monobook_closedwiki")) &&
669 tpl_getConf("monobook_youarehere_position") === "bottom"){
670 echo "\n <div class=\"catlinks noprint\"><p>\n ";
671 tpl_youarehere();
672 echo "\n </p></div>\n";
673 }
674 ?>
675
676 <!-- end main content area -->
677 <div class="visualClear"></div>
678 </div>
679 </div>
680 </div>
681 </div>
682
683 <div id="column-one" class="noprint">
684 <div class="portlet" id="p-logo">
685 <?php
686 //include default or userdefined logo
687 echo "<a href=\"".wl()."\" ";
688 if (file_exists(DOKU_TPLINC."user/logo.png")){
689 //user defined PNG
690 echo "style=\"background-image:url(".DOKU_TPL."user/logo.png);\"";
691 }elseif (file_exists(DOKU_TPLINC."user/logo.gif")){
692 //user defined GIF
693 echo "style=\"background-image:url(".DOKU_TPL."user/logo.gif);\"";
694 }elseif (file_exists(DOKU_TPLINC."user/logo.jpg")){
695 //user defined JPG
696 echo "style=\"background-image:url(".DOKU_TPL."user/logo.jpg);\"";
697 }else{
698 //default
699 echo "style=\"background-image:url(".DOKU_TPL."static/3rd/dokuwiki/logo.png);\"";
700 }
701 echo " accesskey=\"h\" title=\"[ALT+H]\"></a>\n";
702 ?>
703 </div>
704 <?php
705 //show tabs, see monobook/user/tabs.php to configure them
706 if (!empty($_monobook_tabs) &&
707 is_array($_monobook_tabs)){
708 _monobook_renderTabs($_monobook_tabs);
709 }
710
711 //show personal tools
712 if (!empty($conf["useacl"])){ //...makes only sense if there are users
713 echo "\n"
714 ." <div id=\"p-personal\" class=\"portlet\">\n"
715 ." <div class=\"pBody\">\n"
716 ." <ul>\n";
717 //login?
718 if ($loginname === ""){
719 echo " <li id=\"pt-login\"><a href=\"".wl(cleanID(getId()), array("do" => "login"))."\" rel=\"nofollow\">".hsc($lang["btn_login"])."</a></li>\n"; //language comes from DokuWiki core
720 }else{
721 //username and userpage
722 echo " <li id=\"pt-userpage\">".(tpl_getConf("monobook_userpage")
723 ? html_wikilink(tpl_getConf("monobook_userpage_ns").$loginname, hsc($loginname))
724 : hsc($loginname))."</li>";
725 //admin
726 if (!empty($INFO["isadmin"]) ||
727 !empty($INFO["ismanager"])){
728 echo " <li id=\"pt-admin\"><a href=\"".wl(cleanID(getId()), array("do" => "admin"))."\" rel=\"nofollow\">".hsc($lang["btn_admin"])."</a></li>\n"; //language comes from DokuWiki core
729 }
730 //personal discussion
731 if (tpl_getConf("monobook_discuss") &&
732 tpl_getConf("monobook_userpage")){
733 echo " <li id=\"pt-mytalk\">".html_wikilink(tpl_getConf("monobook_discuss_ns").ltrim(tpl_getConf("monobook_userpage_ns"), ":").$loginname, hsc($lang["monobook_tab_mytalk"]))."</li>";
734 }
735 //profile
736 echo " <li id=\"pt-preferences\"><a href=\"".wl(cleanID(getId()), array("do" => "profile"))."\" rel=\"nofollow\">".hsc($lang["btn_profile"])."</a></li>\n"; //language comes from DokuWiki core
737 //logout
738 echo " <li id=\"pt-logout\"><a href=\"".wl(cleanID(getId()), array("do" => "logout"))."\" rel=\"nofollow\">".hsc($lang["btn_logout"])."</a></li>\n"; //language comes from DokuWiki core
739 }
740 echo " </ul>\n"
741 ." </div>\n"
742 ." </div>\n";
743 }
744
745 //show boxes, see monobook/user/boxes.php to configure them
746 if (!empty($_monobook_boxes) &&
747 is_array($_monobook_boxes)){
748 _monobook_renderBoxes($_monobook_boxes);
749 }
750 ?>
751 </div> <!-- end of the left (by default at least) column -->
752
753 <div class="visualClear"></div>
754
755 <div id="footer">
756 <div id="footer-buttons" class="noprint">
757 <?php
758 //show buttons, see monobook/user/buttons.php to configure them
759 if (!empty($_monobook_btns) &&
760 is_array($_monobook_btns)){
761 _monobook_renderButtons($_monobook_btns);
762 }
763 ?>
764 </div>
765 <ul id="f-list">
766 <li id="lastmod">
767 <?php tpl_pageinfo()?><br />
768 </li>
769 <?php
770 //copyright notice
771 if (tpl_getConf("monobook_copyright")){
772 //show dokuwiki's default notice?
773 if (tpl_getConf("monobook_copyright_default")){
774 echo "<li id=\"copyright\">\n <div class=\"dokuwiki\">";
775 tpl_license(false);
776 echo "</div>\n </li>\n";
777 //show custom notice.
778 }else{
779 if (empty($conf["useacl"]) ||
780 auth_quickaclcheck(cleanID(tpl_getConf("monobook_copyright_location"))) >= AUTH_READ){ //current user got access?
781 echo "<li id=\"copyright\">\n ";
782 //get the rendered content of the defined wiki article to use as custom notice
783 $interim = tpl_include_page(tpl_getConf("monobook_copyright_location"), false);
784 if ($interim === "" ||
785 $interim === false){
786 //show creation/edit link if the defined page got no content
787 echo "[&#160;";
788 tpl_pagelink(tpl_getConf("monobook_copyright_location"), hsc($lang["monobook_fillplaceholder"]." (".tpl_getConf("monobook_copyright_location").")"));
789 echo "&#160;]<br />";
790 }else{
791 //show the rendered page content
792 echo "<div class=\"dokuwiki\">\n" //dokuwiki CSS class needed cause we are showing rendered page content
793 .$interim."\n "
794 ."</div>";
795 }
796 echo "\n </li>\n";
797 }
798 }
799 }
800 ?>
801 <li id="usermod" class="noprint">
802 <?php tpl_userinfo(); ?><br />
803 </li>
804 </ul>
805 </div>
806
807</div> <!-- end of global wrap -->
808<a href="<?php echo wl("", array("do" => "recent"));?>" accesskey="r" style="visibility:hidden;" rel="nofollow">&#160;</a>
809<?php
810//provide DokuWiki housekeeping, required in all templates
811tpl_indexerWebBug();
812
813//include web analytics software
814if (file_exists(DOKU_TPLINC."/user/tracker.php")){
815 include DOKU_TPLINC."/user/tracker.php";
816}
817?>
818</body>
819</html>
Note: See TracBrowser for help on using the repository browser.