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 <ah@bitkollektiv.org> 13 * @link http://www.dokuwiki.org/template:vector 14 * @link http://www.dokuwiki.org/devel:templates 15 * @link http://www.dokuwiki.org/devel:coding_style 16 * @link http://www.dokuwiki.org/devel:environment 17 * @link http://www.dokuwiki.org/devel:action_modes 18 */ 19 20 21//check if we are running within the DokuWiki environment 22if (!defined("DOKU_INC")){ 23 die(); 24} 25 26 27/** 28 * Stores the template wide action 29 * 30 * Different DokuWiki actions requiring some template logic. Therefore the 31 * template has to know, what we are doing right now - and that is what this 32 * var is for. 33 * 34 * Please have a look at the "detail.php" file in the same folder, it is also 35 * influencing the var's value. 36 * 37 * @var string 38 * @author Andreas Haerter <ah@bitkollektiv.org> 39 */ 40$vector_action = "article"; 41//note: I used $_REQUEST before (cause DokuWiki controls and fills it. Normally, 42// using $_REQUEST is a possible security threat. For details, see 43// <http://www.suspekt.org/2008/10/01/php-53-and-delayed-cross-site-request-forgerieshijacking/> 44// and <http://forum.dokuwiki.org/post/16524>), but it did not work as 45// expected by me (maybe it is a reference and setting $vector_action 46// also changed the contents of $_REQUEST?!). That is why I switched back, 47// checking $_GET and $_POST like I did it before. 48if (!empty($_GET["vecdo"])){ 49 $vector_action = (string)$_GET["vecdo"]; 50}elseif (!empty($_POST["vecdo"])){ 51 $vector_action = (string)$_POST["vecdo"]; 52} 53if (!empty($vector_action) && 54 $vector_action !== "article" && 55 $vector_action !== "print" && 56 $vector_action !== "detail" && 57 $vector_action !== "cite"){ 58 //ignore unknown values 59 $vector_action = "article"; 60} 61 62 63/** 64 * Stores the template wide context 65 * 66 * This template offers discussion pages via common articles, which should be 67 * marked as "special". DokuWiki does not know any "special" articles, therefore 68 * we have to take care about detecting if the current page is a discussion 69 * page or not. 70 * 71 * @var string 72 * @author Andreas Haerter <ah@bitkollektiv.org> 73 */ 74$vector_context = "article"; 75if (preg_match("/^".tpl_getConf("vector_discuss_ns")."?$|^".tpl_getConf("vector_discuss_ns").".*?$/i", ":".getNS(getID()))){ 76 $vector_context = "discuss"; 77} 78 79 80/** 81 * Stores the name the current client used to login 82 * 83 * @var string 84 * @author Andreas Haerter <ah@bitkollektiv.org> 85 */ 86$loginname = ""; 87if (!empty($conf["useacl"])){ 88 if (isset($_SERVER["REMOTE_USER"]) && //no empty() but isset(): "0" may be a valid username... 89 $_SERVER["REMOTE_USER"] !== ""){ 90 $loginname = $_SERVER["REMOTE_USER"]; //$INFO["client"] would not work here (-> e.g. if 91 //current IP differs from the one used to login) 92 } 93} 94 95 96//get needed language array 97include DOKU_TPLINC."lang/en/lang.php"; 98//overwrite English language values with available translations 99if (!empty($conf["lang"]) && 100 $conf["lang"] !== "en" && 101 file_exists(DOKU_TPLINC."/lang/".$conf["lang"]."/lang.php")){ 102 //get language file (partially translated language files are no problem 103 //cause non translated stuff is still existing as English array value) 104 include DOKU_TPLINC."/lang/".$conf["lang"]."/lang.php"; 105} 106 107 108//detect revision 109$rev = (int)$INFO["rev"]; //$INFO comes from the DokuWiki core 110if ($rev < 1){ 111 $rev = (int)$INFO["lastmod"]; 112} 113 114 115//get tab config 116include DOKU_TPLINC."/conf/tabs.php"; //default 117if (file_exists(DOKU_TPLINC."/user/tabs.php")){ 118 include DOKU_TPLINC."/user/tabs.php"; //add user defined 119} 120 121 122//get boxes config 123include DOKU_TPLINC."/conf/boxes.php"; //default 124if (file_exists(DOKU_TPLINC."/user/boxes.php")){ 125 include DOKU_TPLINC."/user/boxes.php"; //add user defined 126} 127 128 129//get button config 130include DOKU_TPLINC."/conf/buttons.php"; //default 131if (file_exists(DOKU_TPLINC."/user/buttons.php")){ 132 include DOKU_TPLINC."/user/buttons.php"; //add user defined 133} 134 135 136/** 137 * Helper to render the tabs (like a dynamic XHTML snippet) 138 * 139 * @param array The tab data to render within the snippet. Each element 140 * is represented through a subarray: 141 * $array = array("tab1" => array("text" => "hello world!", 142 * "href" => "http://www.example.com" 143 * "nofollow" => true), 144 * "tab2" => array("text" => "I did it again", 145 * "href" => DOKU_BASE."doku.php?id=foobar", 146 * "class" => "foobar-css"), 147 * "tab3" => array("text" => "I did it again and again", 148 * "href" => wl("start", false, false, "&"), 149 * "class" => "foobar-css"), 150 * "tab4" => array("text" => "Home", 151 * "wiki" => ":start" 152 * "accesskey" => "H")); 153 * Available keys within the subarrays: 154 * - "text" (mandatory) 155 * The text/label of the element. 156 * - "href" (optional) 157 * URL the element should point to (as link). Please submit raw, 158 * unencoded URLs, the encoding will be done by this function for 159 * security reasons. If the URL is not relative 160 * (= starts with http(s)://), the URL will be treated as external 161 * (=a special style will be used if "class" is not set). 162 * - "wiki" (optional) 163 * ID of a WikiPage to link (like ":start" or ":wiki:foobar"). 164 * - "class" (optional) 165 * Name of an additional CSS class to use for the element content. 166 * Works only in combination with "text" or "href", NOT with "wiki" 167 * (will be ignored in this case). 168 * - "nofollow" (optional) 169 * If set to TRUE, rel="nofollow" will be added to the link if "href" 170 * is set (otherwise this flag will do nothing). 171 * - "accesskey" (optional) 172 * accesskey="<value>" will be added to the link if "href" is set 173 * (otherwise this option will do nothing). 174 * @author Andreas Haerter <ah@bitkollektiv.org> 175 * @see _vector_renderButtons() 176 * @see _vector_renderBoxes() 177 * @link http://www.wikipedia.org/wiki/Nofollow 178 * @link http://de.selfhtml.org/html/verweise/tastatur.htm#kuerzel 179 * @link http://www.dokuwiki.org/devel:environment 180 * @link http://www.dokuwiki.org/devel:coding_style 181 */ 182function _vector_renderTabs($arr) 183{ 184 //is there something useful? 185 if (empty($arr) || 186 !is_array($arr)){ 187 return false; //nope, break operation 188 } 189 190 //array to store the created tabs into 191 $elements = array(); 192 193 //handle the tab data 194 foreach($arr as $li_id => $element){ 195 //basic check 196 if (empty($element) || 197 !is_array($element) || 198 !isset($element["text"]) || 199 (empty($element["href"]) && 200 empty($element["wiki"]))){ 201 continue; //ignore invalid stuff and go on 202 } 203 $li_created = true; //flag to control if we created any list element 204 $interim = ""; 205 //do we have an external link? 206 if (!empty($element["href"])){ 207 //add URL 208 $interim = "<a href=\"".hsc($element["href"])."\""; //@TODO: real URL encoding 209 //add rel="nofollow" attribute to the link? 210 if (!empty($element["nofollow"])){ 211 $interim .= " rel=\"nofollow\""; 212 } 213 //mark external link? 214 if (substr($element["href"], 0, 4) === "http" || 215 substr($element["href"], 0, 3) === "ftp"){ 216 $interim .= " class=\"urlextern\""; 217 } 218 //add access key? 219 if (!empty($element["accesskey"])){ 220 $interim .= " accesskey=\"".hsc($element["accesskey"])."\" title=\"[ALT+".hsc(strtoupper($element["accesskey"]))."]\""; 221 } 222 $interim .= "><span>".hsc($element["text"])."</span></a>"; 223 //internal wiki link 224 }else if (!empty($element["wiki"])){ 225 $interim = "<a href=\"".hsc(wl(cleanID($element["wiki"])))."\"><span>".hsc($element["text"])."</span></a>"; 226 } 227 //store it 228 $elements[] = "\n <li id=\"".hsc($li_id)."\"".(!empty($element["class"]) 229 ? " class=\"".hsc($element["class"])."\"" 230 : "").">".$interim."</li>"; 231 } 232 233 //show everything created 234 if (!empty($elements)){ 235 foreach ($elements as $element){ 236 echo $element; 237 } 238 } 239 return true; 240} 241 242 243/** 244 * Helper to render the boxes (like a dynamic XHTML snippet) 245 * 246 * @param array The box data to render within the snippet. Each box is 247 * represented through a subarray: 248 * $array = array("box-id1" => array("headline" => "hello world!", 249 * "xhtml" => "I am <i>here</i>.")); 250 * Available keys within the subarrays: 251 * - "xhtml" (mandatory) 252 * The content of the Box you want to show as XHTML. Attention: YOU 253 * HAVE TO TAKE CARE ABOUT FILTER EVENTUALLY USED INPUT/SECURITY. Be 254 * aware of XSS and stuff. 255 * - "headline" (optional) 256 * Headline to show above the box. Leave empty/do not set for none. 257 * @author Andreas Haerter <ah@bitkollektiv.org> 258 * @see _vector_renderButtons() 259 * @see _vector_renderTabs() 260 * @link http://www.wikipedia.org/wiki/Nofollow 261 * @link http://www.wikipedia.org/wiki/Cross-site_scripting 262 * @link http://www.dokuwiki.org/devel:coding_style 263 */ 264function _vector_renderBoxes($arr) 265{ 266 //is there something useful? 267 if (empty($arr) || 268 !is_array($arr)){ 269 return false; //nope, break operation 270 } 271 272 //array to store the created boxes into 273 $boxes = array(); 274 275 //handle the box data 276 foreach($arr as $div_id => $contents){ 277 //basic check 278 if (empty($contents) || 279 !is_array($contents) || 280 !isset($contents["xhtml"])){ 281 continue; //ignore invalid stuff and go on 282 } 283 $interim = " <div id=\"".hsc($div_id)."\" class=\"portal\">\n"; 284 if (isset($contents["headline"]) 285 && $contents["headline"] !== ""){ 286 $interim .= " <h5>".hsc($contents["headline"])."</h5>\n"; 287 } 288 $interim .= " <div class=\"body\">\n" 289 ." <div class=\"dokuwiki\">\n" //dokuwiki CSS class needed cause we might have to show rendered page content 290 .$contents["xhtml"]."\n" 291 ." </div>\n" 292 ." </div>\n" 293 ." </div>\n"; 294 //store it 295 $boxes[] = $interim; 296 } 297 //show everything created 298 if (!empty($boxes)){ 299 echo "\n"; 300 foreach ($boxes as $box){ 301 echo $box; 302 } 303 echo "\n"; 304 } 305 306 return true; 307} 308 309 310/** 311 * Helper to render the footer buttons (like a dynamic XHTML snippet) 312 * 313 * @param array The button data to render within the snippet. Each element 314 * is represented through a subarray: 315 * $array = array("btn1" => array("img" => DOKU_TPL."static/img/button-vector.png", 316 * "href" => "http://andreas-haerter.com/", 317 * "width" => 80, 318 * "height" => 15, 319 * "title" => "vector for DokuWiki", 320 * "nofollow" => false), 321 * "btn2" => array("img" => DOKU_TPL."user/mybutton1.png", 322 * "href" => wl("start", false, false, "&")), 323 * "btn3" => array("img" => DOKU_TPL."user/mybutton2.png", 324 * "href" => "http://www.example.com"); 325 * Available keys within the subarrays: 326 * - "img" (mandatory) 327 * The relative or full path of an image/button to show. Users may 328 * place own images within the /user/ dir of this template. 329 * - "href" (mandatory) 330 * URL the element should point to (as link). Please submit raw, 331 * unencoded URLs, the encoding will be done by this function for 332 * security reasons. 333 * - "width" (optional) 334 * width="<value>" will be added to the image tag if both "width" and 335 * "height" are set (otherwise, this will be ignored). 336 * - "height" (optional) 337 * height="<value>" will be added to the image tag if both "height" and 338 * "width" are set (otherwise, this will be ignored). 339 * - "nofollow" (optional) 340 * If set to TRUE, rel="nofollow" will be added to the link. 341 * - "title" (optional) 342 * title="<value>" will be added to the link and image if "title" 343 * is set + alt="<value>". 344 * @author Andreas Haerter <ah@bitkollektiv.org> 345 * @see _vector_renderButtons() 346 * @see _vector_renderBoxes() 347 * @link http://www.wikipedia.org/wiki/Nofollow 348 * @link http://www.dokuwiki.org/devel:coding_style 349 */ 350function _vector_renderButtons($arr) 351{ 352 //array to store the created buttons into 353 $elements = array(); 354 355 //handle the button data 356 foreach($arr as $li_id => $element){ 357 //basic check 358 if (empty($element) || 359 !is_array($element) || 360 !isset($element["img"]) || 361 !isset($element["href"])){ 362 continue; //ignore invalid stuff and go on 363 } 364 $interim = ""; 365 366 //add URL 367 $interim = "<a href=\"".hsc($element["href"])."\""; //@TODO: real URL encoding 368 //add rel="nofollow" attribute to the link? 369 if (!empty($element["nofollow"])){ 370 $interim .= " rel=\"nofollow\""; 371 } 372 //add title attribute to the link? 373 if (!empty($element["title"])){ 374 $interim .= " title=\"".hsc($element["title"])."\""; 375 } 376 $interim .= " target=\"_blank\"><img src=\"".hsc($element["img"])."\""; 377 //add width and height attribute to the image? 378 if (!empty($element["width"]) && 379 !empty($element["height"])){ 380 $interim .= " width=\"".(int)$element["width"]."\" height=\"".(int)$element["height"]."\""; 381 } 382 //add title and alt attribute to the image? 383 if (!empty($element["title"])){ 384 $interim .= " title=\"".hsc($element["title"])."\" alt=\"".hsc($element["title"])."\""; 385 } else { 386 $interim .= " alt=\"\""; //alt is a mandatory attribute for images 387 } 388 $interim .= " border=\"0\" /></a>"; 389 390 //store it 391 $elements[] = " ".$interim."\n"; 392 } 393 394 //show everything created 395 if (!empty($elements)){ 396 echo "\n"; 397 foreach ($elements as $element){ 398 echo $element; 399 } 400 } 401 return true; 402} 403 404//workaround for the "jumping textarea" IE bug. CSS only fix not possible cause 405//some DokuWiki JavaScript is triggering this bug, too. See the following for 406//info: 407//- <http://blog.andreas-haerter.com/2010/05/28/fix-msie-8-auto-scroll-textarea-css-width-percentage-bug> 408//- <http://msdn.microsoft.com/library/cc817574.aspx> 409if ($ACT === "edit" && 410 !headers_sent()){ 411 header("X-UA-Compatible: IE=EmulateIE7"); 412} 413 414?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 415 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 416<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"]); ?>" class="no-js"> 417<head> 418<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 419<title><?php tpl_pagetitle(); echo " - ".hsc($conf["title"]); ?></title> 420<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script> 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 "[ "; 540 tpl_pagelink(tpl_getConf("vector_sitenotice_location"), hsc($lang["vector_fillplaceholder"]." (".tpl_getConf("vector_sitenotice_location").")")); 541 echo " ]<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"]); ?>"> </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 "[ "; 786 tpl_pagelink(tpl_getConf("vector_copyright_location"), hsc($lang["vector_fillplaceholder"]." (".tpl_getConf("vector_copyright_location").")")); 787 echo " ]<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