xref: /template/wikiweko/main.php (revision 6d88514113ca5251e0a09fef31fe07dced69f2d3)
1<?php
2
3/**
4 * Main file of the "vector" 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 <development@andreas-haerter.com>
13 * @link http://andreas-haerter.com/projects/dokuwiki-template-vector
14 * @link http://www.dokuwiki.org/template:vector
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 <development@andreas-haerter.com>
40 */
41$vector_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 $vector_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["vecdo"])){
50    $vector_action = (string)$_GET["vecdo"];
51}elseif (!empty($_POST["vecdo"])){
52    $vector_action = (string)$_POST["vecdo"];
53}
54if (!empty($vector_action) &&
55    $vector_action !== "article" &&
56    $vector_action !== "print" &&
57    $vector_action !== "detail" &&
58    $vector_action !== "cite"){
59    //ignore unknown values
60    $vector_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 <development@andreas-haerter.com>
74 */
75$vector_context = "article";
76if (preg_match("/^".tpl_getConf("vector_discuss_ns")."?$|^".tpl_getConf("vector_discuss_ns").".*?$/i", ":".getNS(getID()))){
77    $vector_context = "discuss";
78}
79
80
81/**
82 * Stores the name the current client used to login
83 *
84 * @var string
85 * @author Andreas Haerter <development@andreas-haerter.com>
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"; //add 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"; //add 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"; //add user defined
134}
135
136
137/**
138 * Helper to render the tabs (like a dynamic XHTML snippet)
139 *
140 * @param array The tab data to render within the snippet. Each element
141 *        is represented through a subarray:
142 *        $array = array("tab1" => array("text"     => "hello world!",
143 *                                       "href"     => "http://www.example.com"
144 *                                       "nofollow" => true),
145 *                       "tab2" => array("text"  => "I did it again",
146 *                                       "href"  => DOKU_BASE."doku.php?id=foobar",
147 *                                       "class" => "foobar-css"),
148 *                       "tab3" => array("text"  => "I did it again and again",
149 *                                       "href"  => wl("start", false, false, "&"),
150 *                                       "class" => "foobar-css"),
151 *                       "tab4" => array("text"      => "Home",
152 *                                       "wiki"      => ":start"
153 *                                       "accesskey" => "H"));
154 *        Available keys within the subarrays:
155 *        - "text" (mandatory)
156 *          The text/label of the element.
157 *        - "href" (optional)
158 *          URL the element should point to (as link). Please submit raw,
159 *          unencoded URLs, the encoding will be done by this function for
160 *          security reasons. If the URL is not relative
161 *          (= starts with http(s)://), the URL will be treated as external
162 *          (=a special style will be used if "class" is not set).
163 *        - "wiki" (optional)
164 *          ID of a WikiPage to link (like ":start" or ":wiki:foobar").
165 *        - "class" (optional)
166 *          Name of an additional CSS class to use for the element content.
167 *          Works only in combination with "text" or "href", NOT with "wiki"
168 *          (will be ignored in this case).
169 *        - "nofollow" (optional)
170 *          If set to TRUE, rel="nofollow" will be added to the link if "href"
171 *          is set (otherwise this flag will do nothing).
172 *        - "accesskey" (optional)
173 *          accesskey="<value>" will be added to the link if "href" is set
174 *          (otherwise this option will do nothing).
175 * @author Andreas Haerter <development@andreas-haerter.com>
176 * @see _vector_renderButtons()
177 * @see _vector_renderBoxes()
178 * @link http://www.wikipedia.org/wiki/Nofollow
179 * @link http://de.selfhtml.org/html/verweise/tastatur.htm#kuerzel
180 * @link http://www.dokuwiki.org/devel:environment
181 * @link http://www.dokuwiki.org/devel:coding_style
182 */
183function _vector_renderTabs($arr)
184{
185    //is there something useful?
186    if (empty($arr) ||
187        !is_array($arr)){
188        return false; //nope, break operation
189    }
190
191    //array to store the created tabs into
192    $elements = array();
193
194    //handle the tab data
195    foreach($arr as $li_id => $element){
196        //basic check
197        if (empty($element) ||
198            !is_array($element) ||
199            !isset($element["text"]) ||
200            (empty($element["href"]) &&
201             empty($element["wiki"]))){
202            continue; //ignore invalid stuff and go on
203        }
204        $li_created = true; //flag to control if we created any list element
205        $interim = "";
206        //do we have an external link?
207        if (!empty($element["href"])){
208            //add URL
209            $interim = "<a href=\"".hsc($element["href"])."\""; //@TODO: real URL encoding
210            //add rel="nofollow" attribute to the link?
211            if (!empty($element["nofollow"])){
212                $interim .= " rel=\"nofollow\"";
213            }
214            //mark external link?
215            if (substr($element["href"], 0, 4) === "http" ||
216                substr($element["href"], 0, 3) === "ftp"){
217                $interim .= " class=\"urlextern\"";
218            }
219            //add access key?
220            if (!empty($element["accesskey"])){
221                $interim .= " accesskey=\"".hsc($element["accesskey"])."\" title=\"[ALT+".hsc(strtoupper($element["accesskey"]))."]\"";
222            }
223            $interim .= "><span>".hsc($element["text"])."</span></a>";
224        //internal wiki link
225        }else if (!empty($element["wiki"])){
226            $interim = "<a href=\"".hsc(wl(cleanID($element["wiki"])))."\"><span>".hsc($element["text"])."</span></a>";
227        }
228        //store it
229        $elements[] = "\n        <li id=\"".hsc($li_id)."\"".(!empty($element["class"])
230                                                             ? " class=\"".hsc($element["class"])."\""
231                                                             : "").">".$interim."</li>";
232    }
233
234    //show everything created
235    if (!empty($elements)){
236        foreach ($elements as $element){
237            echo $element;
238        }
239    }
240    return true;
241}
242
243
244/**
245 * Helper to render the boxes (like a dynamic XHTML snippet)
246 *
247 * @param array The box data to render within the snippet. Each box is
248 *        represented through a subarray:
249 *        $array = array("box-id1" => array("headline" => "hello world!",
250 *                                          "xhtml"    => "I am <i>here</i>."));
251 *        Available keys within the subarrays:
252 *        - "xhtml" (mandatory)
253 *          The content of the Box you want to show as XHTML. Attention: YOU
254 *          HAVE TO TAKE CARE ABOUT FILTER EVENTUALLY USED INPUT/SECURITY. Be
255 *          aware of XSS and stuff.
256 *        - "headline" (optional)
257 *          Headline to show above the box. Leave empty/do not set for none.
258 * @author Andreas Haerter <development@andreas-haerter.com>
259 * @see _vector_renderButtons()
260 * @see _vector_renderTabs()
261 * @link http://www.wikipedia.org/wiki/Nofollow
262 * @link http://www.wikipedia.org/wiki/Cross-site_scripting
263 * @link http://www.dokuwiki.org/devel:coding_style
264 */
265function _vector_renderBoxes($arr)
266{
267    //is there something useful?
268    if (empty($arr) ||
269        !is_array($arr)){
270        return false; //nope, break operation
271    }
272
273    //array to store the created boxes into
274    $boxes = array();
275
276    //handle the box data
277    foreach($arr as $div_id => $contents){
278        //basic check
279        if (empty($contents) ||
280            !is_array($contents) ||
281            !isset($contents["xhtml"])){
282            continue; //ignore invalid stuff and go on
283        }
284        $interim  = "  <div id=\"".hsc($div_id)."\" class=\"portal\">\n";
285        if (isset($contents["headline"])
286            && $contents["headline"] !== ""){
287            $interim .= "    <h5>".hsc($contents["headline"])."</h5>\n";
288        }
289        $interim .= "    <div class=\"body\">\n"
290                   ."      <div class=\"dokuwiki\">\n" //dokuwiki CSS class needed cause we might have to show rendered page content
291                   .$contents["xhtml"]."\n"
292                   ."      </div>\n"
293                   ."    </div>\n"
294                   ."  </div>\n";
295        //store it
296        $boxes[] = $interim;
297    }
298    //show everything created
299    if (!empty($boxes)){
300        echo  "\n";
301        foreach ($boxes as $box){
302            echo $box;
303        }
304        echo  "\n";
305    }
306
307    return true;
308}
309
310
311/**
312 * Helper to render the footer buttons (like a dynamic XHTML snippet)
313 *
314 * @param array The button data to render within the snippet. Each element
315 *        is represented through a subarray:
316 *        $array = array("btn1" => array("img"      => DOKU_TPL."static/img/button-vector.png",
317 *                                       "href"     => "http://andreas-haerter.com/projects/dokuwiki-template-vector",
318 *                                       "width"    => 80,
319 *                                       "height"   => 15,
320 *                                       "title"    => "vector for DokuWiki",
321 *                                       "nofollow" => false),
322 *                       "btn2" => array("img"   => DOKU_TPL."user/mybutton1.png",
323 *                                       "href"  => wl("start", false, false, "&")),
324 *                       "btn3" => array("img"   => DOKU_TPL."user/mybutton2.png",
325 *                                       "href"  => "http://www.example.com");
326 *        Available keys within the subarrays:
327 *        - "img" (mandatory)
328 *          The relative or full path of an image/button to show. Users may
329 *          place own images within the /user/ dir of this template.
330 *        - "href" (mandatory)
331 *          URL the element should point to (as link). Please submit raw,
332 *          unencoded URLs, the encoding will be done by this function for
333 *          security reasons.
334 *        - "width" (optional)
335 *          width="<value>" will be added to the image tag if both "width" and
336 *          "height" are set (otherwise, this will be ignored).
337 *        - "height" (optional)
338 *          height="<value>" will be added to the image tag if both "height" and
339 *          "width" are set (otherwise, this will be ignored).
340 *        - "nofollow" (optional)
341 *          If set to TRUE, rel="nofollow" will be added to the link.
342 *        - "title" (optional)
343 *          title="<value>"  will be added to the link and image if "title"
344 *          is set + alt="<value>".
345 * @author Andreas Haerter <development@andreas-haerter.com>
346 * @see _vector_renderButtons()
347 * @see _vector_renderBoxes()
348 * @link http://www.wikipedia.org/wiki/Nofollow
349 * @link http://www.dokuwiki.org/devel:coding_style
350 */
351function _vector_renderButtons($arr)
352{
353    //array to store the created buttons into
354    $elements = array();
355
356    //handle the button data
357    foreach($arr as $li_id => $element){
358        //basic check
359        if (empty($element) ||
360            !is_array($element) ||
361            !isset($element["img"]) ||
362            !isset($element["href"])){
363            continue; //ignore invalid stuff and go on
364        }
365        $interim = "";
366
367        //add URL
368        $interim = "<a href=\"".hsc($element["href"])."\""; //@TODO: real URL encoding
369        //add rel="nofollow" attribute to the link?
370        if (!empty($element["nofollow"])){
371            $interim .= " rel=\"nofollow\"";
372        }
373        //add title attribute to the link?
374        if (!empty($element["title"])){
375            $interim .= " title=\"".hsc($element["title"])."\"";
376        }
377        $interim .= " target=\"_blank\"><img src=\"".hsc($element["img"])."\"";
378        //add width and height attribute to the image?
379        if (!empty($element["width"]) &&
380            !empty($element["height"])){
381            $interim .= " width=\"".(int)$element["width"]."\" height=\"".(int)$element["height"]."\"";
382        }
383        //add title and alt attribute to the image?
384        if (!empty($element["title"])){
385            $interim .= " title=\"".hsc($element["title"])."\" alt=\"".hsc($element["title"])."\"";
386        } else {
387            $interim .= " alt=\"\""; //alt is a mandatory attribute for images
388        }
389        $interim .= " border=\"0\" /></a>";
390
391        //store it
392        $elements[] = "      ".$interim."\n";
393    }
394
395    //show everything created
396    if (!empty($elements)){
397        echo  "\n";
398        foreach ($elements as $element){
399            echo $element;
400        }
401    }
402    return true;
403}
404
405//workaround for the "jumping textarea" IE bug. CSS only fix not possible cause
406//some DokuWiki JavaScript is triggering this bug, too. See the following for
407//info:
408//- <http://blog.andreas-haerter.com/2010/05/28/fix-msie-8-auto-scroll-textarea-css-width-percentage-bug>
409//- <http://msdn.microsoft.com/library/cc817574.aspx>
410if ($ACT === "edit" &&
411    !headers_sent()){
412    header("X-UA-Compatible: IE=EmulateIE7");
413}
414
415?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
416  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
417<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"]); ?>">
418<head>
419<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
420<title><?php tpl_pagetitle(); echo " - ".hsc($conf["title"]); ?></title>
421<?php
422//show meta-tags
423tpl_metaheaders();
424echo "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />";
425
426//manually load needed CSS? this is a workaround for PHP Bug #49642. In some
427//version/os combinations PHP is not able to parse INI-file entries if there
428//are slashes "/" used for the keynames (see bugreport for more information:
429//<http://bugs.php.net/bug.php?id=49692>). to trigger this workaround, simply
430//delete/rename vector's style.ini.
431if (!file_exists(DOKU_TPLINC."style.ini")){
432    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
433}
434
435//include default or userdefined favicon
436//
437//note: since 2011-04-22 "Rincewind RC1", there is a core function named
438//      "tpl_getFavicon()". But its functionality is not really fitting the
439//      behaviour of this template, therefore I don't use it here.
440if (file_exists(DOKU_TPLINC."user/favicon.ico")){
441    //user defined - you might find http://tools.dynamicdrive.com/favicon/
442    //useful to generate one
443    echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."user/favicon.ico\" />\n";
444} elseif (file_exists(DOKU_TPLINC."user/favicon.png")){
445    //note: I do NOT recommend PNG for favicons (cause it is not supported by
446    //all browsers), but some users requested this feature.
447    echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."user/favicon.png\" />\n";
448}else{
449    //default
450    echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."static/3rd/dokuwiki/favicon.ico\" />\n";
451}
452
453//include default or userdefined Apple Touch Icon (see <http://j.mp/sx3NMT> for
454//details)
455if (file_exists(DOKU_TPLINC."user/apple-touch-icon.png")){
456    echo "<link rel=\"apple-touch-icon\" href=\"".DOKU_TPL."user/apple-touch-icon.png\" />\n";
457}else{
458    //default
459    echo "<link rel=\"apple-touch-icon\" href=\"".DOKU_TPL."static/3rd/dokuwiki/apple-touch-icon.png\" />\n";
460}
461
462//load userdefined js?
463if (tpl_getConf("vector_loaduserjs")){
464    echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/user.js\"></script>\n";
465}
466
467//show printable version?
468if ($vector_action === "print"){
469  //note: this is just a workaround for people searching for a print version.
470  //      don't forget to update the styles.ini, this is the really important
471  //      thing! BTW: good text about this: http://is.gd/5MyG5
472  echo  "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."static/3rd/dokuwiki/print.css\" />\n"
473       ."<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."static/css/print.css\" />\n"
474       ."<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."user/print.css\" />\n";
475}
476
477//load language specific css hacks?
478if (file_exists(DOKU_TPLINC."lang/".$conf["lang"]."/style.css")){
479  $interim = trim(file_get_contents(DOKU_TPLINC."lang/".$conf["lang"]."/style.css"));
480  if (!empty($interim)){
481      echo "<style type=\"text/css\" media=\"all\">\n".hsc($interim)."\n</style>\n";
482  }
483}
484?>
485<!--[if lt IE 7]><style type="text/css">body{behavior:url("<?php echo DOKU_TPL; ?>static/3rd/vector/csshover.htc")}</style><![endif]-->
486</head>
487<body class="<?php
488             //different styles/backgrounds for different page types
489             switch (true){
490                  //special: tech
491                  case ($vector_action === "detail"):
492                  case ($vector_action === "cite"):
493                  case ($ACT === "media"): //var comes from DokuWiki
494                  case ($ACT === "search"): //var comes from DokuWiki
495                    echo "mediawiki ltr ns-1 ns-special ";
496                    break;
497                  //special: wiki
498                  case (preg_match("/^wiki$|^wiki:.*?$/i", getNS(getID()))):
499                    case "mediawiki ltr capitalize-all-nouns ns-4 ns-subject ";
500                    break;
501                  //discussion
502                  case ($vector_context === "discuss"):
503                    echo "mediawiki ltr capitalize-all-nouns ns-1 ns-talk ";
504                    break;
505                  //"normal" content
506                  case ($ACT === "edit"): //var comes from DokuWiki
507                  case ($ACT === "draft"): //var comes from DokuWiki
508                  case ($ACT === "revisions"): //var comes from DokuWiki
509                  case ($vector_action === "print"):
510                  default:
511                    echo "mediawiki ltr capitalize-all-nouns ns-0 ns-subject ";
512                    break;
513              } ?>skin-vector">
514<div id="page-container">
515<div id="page-base" class="noprint"></div>
516<div id="head-base" class="noprint"></div>
517
518<!-- start div id=content -->
519<div id="content">
520  <a name="top" id="top"></a>
521  <a name="dokuwiki__top" id="dokuwiki__top"></a>
522
523  <!-- start main content area -->
524  <?php
525  //show messages (if there are any)
526  html_msgarea();
527  //show site notice
528  if (tpl_getConf("vector_sitenotice")){
529      //we have to show a custom sitenotice
530      if (empty($conf["useacl"]) ||
531          auth_quickaclcheck(cleanID(tpl_getConf("vector_sitenotice_location"))) >= AUTH_READ){ //current user got access?
532          echo "\n  <div id=\"siteNotice\" class=\"noprint\">\n";
533          //get the rendered content of the defined wiki article to use as
534          //custom sitenotice.
535          $interim = tpl_include_page(tpl_getConf("vector_sitenotice_location"), false);
536          if ($interim === "" ||
537              $interim === false){
538              //show creation/edit link if the defined page got no content
539              echo "[&#160;";
540              tpl_pagelink(tpl_getConf("vector_sitenotice_location"), hsc($lang["vector_fillplaceholder"]." (".tpl_getConf("vector_sitenotice_location").")"));
541              echo "&#160;]<br />";
542          }else{
543              //show the rendered page content
544              echo  "    <div class=\"dokuwiki\">\n" //dokuwiki CSS class needed cause we are showing rendered page content
545                   .$interim."\n    "
546                   ."</div>";
547          }
548          echo "\n  </div>\n";
549      }
550  }
551  //show breadcrumps if enabled and position = top
552  if ($conf["breadcrumbs"] == true &&
553      $ACT !== "media" && //var comes from DokuWiki
554      (empty($conf["useacl"]) || //are there any users?
555       $loginname !== "" || //user is logged in?
556       !tpl_getConf("vector_closedwiki")) &&
557      tpl_getConf("vector_breadcrumbs_position") === "top"){
558      echo "\n  <div class=\"catlinks noprint\"><p>\n    ";
559      tpl_breadcrumbs();
560      echo "\n  </p></div>\n";
561  }
562  //show hierarchical breadcrumps if enabled and position = top
563  if ($conf["youarehere"] == true &&
564      $ACT !== "media" && //var comes from DokuWiki
565      (empty($conf["useacl"]) || //are there any users?
566       $loginname !== "" || //user is logged in?
567       !tpl_getConf("vector_closedwiki")) &&
568      tpl_getConf("vector_youarehere_position") === "top"){
569      echo "\n  <div class=\"catlinks noprint\"><p>\n    ";
570      tpl_youarehere();
571      echo "\n  </p></div>\n";
572  }
573  ?>
574
575  <!-- start div id bodyContent -->
576  <div id="bodyContent" class="dokuwiki">
577    <!-- start rendered wiki content -->
578    <?php
579    //flush the buffer for faster page rendering, heaviest content follows
580    if (function_exists("tpl_flush")) {
581        tpl_flush(); //exists since 2010-11-07 "Anteater"...
582    } else {
583        flush(); //...but I won't loose compatibility to 2009-12-25 "Lemming" right now.
584    }
585    //decide which type of pagecontent we have to show
586    switch ($vector_action){
587        //"image details"
588        case "detail":
589            include DOKU_TPLINC."inc_detail.php";
590            break;
591        //"cite this article"
592        case "cite":
593            include DOKU_TPLINC."inc_cite.php";
594            break;
595        //show "normal" content
596        default:
597            tpl_content(((tpl_getConf("vector_toc_position") === "article") ? true : false));
598            break;
599    }
600    ?>
601    <!-- end rendered wiki content -->
602    <div class="clearer"></div>
603  </div>
604  <!-- end div id bodyContent -->
605
606  <?php
607  //show breadcrumps if enabled and position = bottom
608  if ($conf["breadcrumbs"] == true &&
609      $ACT !== "media" && //var comes from DokuWiki
610      (empty($conf["useacl"]) || //are there any users?
611       $loginname !== "" || //user is logged in?
612       !tpl_getConf("vector_closedwiki")) &&
613      tpl_getConf("vector_breadcrumbs_position") === "bottom"){
614      echo "\n  <div class=\"catlinks noprint\"><p>\n    ";
615      tpl_breadcrumbs();
616      echo "\n  </p></div>\n";
617  }
618  //show hierarchical breadcrumps if enabled and position = bottom
619  if ($conf["youarehere"] == true &&
620      $ACT !== "media" && //var comes from DokuWiki
621      (empty($conf["useacl"]) || //are there any users?
622       $loginname !== "" || //user is logged in?
623       !tpl_getConf("vector_closedwiki")) &&
624      tpl_getConf("vector_youarehere_position") === "bottom"){
625      echo "\n  <div class=\"catlinks noprint\"><p>\n    ";
626      tpl_youarehere();
627      echo "\n  </p></div>\n";
628  }
629  ?>
630
631</div>
632<!-- end div id=content -->
633
634
635<!-- start div id=head -->
636<div id="head" class="noprint">
637  <?php
638  //show personal tools
639  if (!empty($conf["useacl"])){ //...makes only sense if there are users
640      echo  "\n"
641           ."  <div id=\"p-personal\">\n"
642           ."    <ul>\n";
643      //login?
644      if ($loginname === ""){
645          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
646      }else{
647          //username and userpage
648          echo "      <li id=\"pt-userpage\">".(tpl_getConf("vector_userpage")
649                                                ? html_wikilink(tpl_getConf("vector_userpage_ns").$loginname, hsc($loginname))
650                                                : hsc($loginname))."</li>";
651          //personal discussion
652          if (tpl_getConf("vector_discuss") &&
653              tpl_getConf("vector_userpage")){
654              echo "      <li id=\"pt-mytalk\">".html_wikilink(tpl_getConf("vector_discuss_ns").ltrim(tpl_getConf("vector_userpage_ns"), ":").$loginname, hsc($lang["vector_mytalk"]))."</li>";
655          }
656          //admin
657          if (!empty($INFO["isadmin"]) ||
658              !empty($INFO["ismanager"])){
659              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
660          }
661          //profile
662          if (actionOK("profile")){ //check if action is disabled
663              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
664          }
665          //logout
666          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
667      }
668      echo  "    </ul>\n"
669           ."  </div>\n";
670  }
671  ?>
672
673  <!-- start div id=left-navigation -->
674  <div id="left-navigation">
675    <div id="p-namespaces" class="vectorTabs">
676      <ul><?php
677          //show tabs: left. see vector/user/tabs.php to configure them
678          if (!empty($_vector_tabs_left) &&
679              is_array($_vector_tabs_left)){
680              _vector_renderTabs($_vector_tabs_left);
681          }
682          ?>
683
684      </ul>
685    </div>
686  </div>
687  <!-- end div id=left-navigation -->
688
689  <!-- start div id=right-navigation -->
690  <div id="right-navigation">
691    <div id="p-views" class="vectorTabs">
692      <ul><?php
693          //show tabs: right. see vector/user/tabs.php to configure them
694          if (!empty($_vector_tabs_right) &&
695              is_array($_vector_tabs_right)){
696              _vector_renderTabs($_vector_tabs_right);
697          }
698          ?>
699
700      </ul>
701    </div>
702<?php if (actionOK("search")){ ?>
703    <div id="p-search">
704      <h5>
705        <label for="qsearch__in"><?php echo hsc($lang["vector_search"]); ?></label>
706      </h5>
707      <form action="<?php echo wl(); ?>" accept-charset="utf-8" id="dw__search" name="dw__search">
708        <input type="hidden" name="do" value="search" />
709        <div id="simpleSearch">
710          <input id="qsearch__in" name="id" type="text" accesskey="f" value="" />
711          <button id="searchButton" type="submit" name="button" title="<?php echo hsc($lang["vector_btn_search_title"]); ?>">&nbsp;</button>
712        </div>
713        <div id="qsearch__out" class="ajax_qsearch JSpopup"></div>
714      </form>
715    </div>
716<?php } ?>
717  </div>
718  <!-- end div id=right-navigation -->
719
720</div>
721<!-- end div id=head -->
722
723<!-- start panel/sidebar -->
724<div id="panel" class="noprint">
725  <!-- start logo -->
726  <div id="p-logo">
727      <?php
728      //include default or userdefined logo
729      echo "<a href=\"".wl()."\" ";
730      if (file_exists(DOKU_TPLINC."user/logo.png")){
731          //user defined PNG
732          echo "style=\"background-image:url(".DOKU_TPL."user/logo.png);\"";
733      }elseif (file_exists(DOKU_TPLINC."user/logo.gif")){
734          //user defined GIF
735          echo "style=\"background-image:url(".DOKU_TPL."user/logo.gif);\"";
736      }elseif (file_exists(DOKU_TPLINC."user/logo.jpg")){
737          //user defined JPG
738          echo "style=\"background-image:url(".DOKU_TPL."user/logo.jpg);\"";
739      }else{
740          //default
741          echo "style=\"background-image:url(".DOKU_TPL."static/3rd/dokuwiki/logo.png);\"";
742      }
743      echo " accesskey=\"h\" title=\"[ALT+H]\"></a>\n";
744      ?>
745  </div>
746  <!-- end logo -->
747
748  <?php
749  //show boxes, see vector/user/boxes.php to configure them
750  if (!empty($_vector_boxes) &&
751      is_array($_vector_boxes)){
752      _vector_renderBoxes($_vector_boxes);
753  }
754  ?>
755
756</div>
757<!-- end panel/sidebar -->
758</div>
759<!-- end page-container -->
760
761<!-- start footer -->
762<div id="footer">
763  <ul id="footer-info">
764    <li id="footer-info-lastmod">
765      <?php tpl_pageinfo()?><br />
766    </li>
767    <?php
768    //copyright notice
769    if (tpl_getConf("vector_copyright")){
770        //show dokuwiki's default notice?
771        if (tpl_getConf("vector_copyright_default")){
772            echo "<li id=\"footer-info-copyright\">\n      <div class=\"dokuwiki\">";  //dokuwiki CSS class needed cause we have to show DokuWiki content
773            tpl_license(false);
774            echo "</div>\n    </li>\n";
775        //show custom notice.
776        }else{
777            if (empty($conf["useacl"]) ||
778                auth_quickaclcheck(cleanID(tpl_getConf("vector_copyright_location"))) >= AUTH_READ){ //current user got access?
779                echo "<li id=\"footer-info-copyright\">\n        ";
780                //get the rendered content of the defined wiki article to use as custom notice
781                $interim = tpl_include_page(tpl_getConf("vector_copyright_location"), false);
782                if ($interim === "" ||
783                    $interim === false){
784                    //show creation/edit link if the defined page got no content
785                    echo "[&#160;";
786                    tpl_pagelink(tpl_getConf("vector_copyright_location"), hsc($lang["vector_fillplaceholder"]." (".tpl_getConf("vector_copyright_location").")"));
787                    echo "&#160;]<br />";
788                }else{
789                    //show the rendered page content
790                    echo  "<div class=\"dokuwiki\">\n" //dokuwiki CSS class needed cause we are showing rendered page content
791                         .$interim."\n        "
792                         ."</div>";
793                }
794                echo "\n    </li>\n";
795            }
796        }
797    }
798    ?>
799  </ul>
800  <ul id="footer-places" class="noprint">
801    <li><?php
802        //show buttons, see vector/user/buttons.php to configure them
803        if (!empty($_vector_btns) &&
804            is_array($_vector_btns)){
805            _vector_renderButtons($_vector_btns);
806        }
807        ?>
808    </li>
809  </ul>
810  <div style="clearer"></div>
811</div>
812<!-- end footer -->
813<?php
814//provide DokuWiki housekeeping, required in all templates
815tpl_indexerWebBug();
816
817//include web analytics software
818if (file_exists(DOKU_TPLINC."/user/tracker.php")){
819    include DOKU_TPLINC."/user/tracker.php";
820}
821?>
822
823</body>
824</html>
825