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://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 <development@andreas-haerter.com> 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 <development@andreas-haerter.com> 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 <development@andreas-haerter.com> 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 <development@andreas-haerter.com> 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 <development@andreas-haerter.com> 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 <development@andreas-haerter.com> 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"]); ?>"> 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<?php 421//show meta-tags 422tpl_metaheaders(); 423echo "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />"; 424 425//manually load needed CSS? this is a workaround for PHP Bug #49642. In some 426//version/os combinations PHP is not able to parse INI-file entries if there 427//are slashes "/" used for the keynames (see bugreport for more information: 428//<http://bugs.php.net/bug.php?id=49692>). to trigger this workaround, simply 429//delete/rename vector's style.ini. 430if (!file_exists(DOKU_TPLINC."style.ini")){ 431 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 432} 433 434//include default or userdefined favicon 435// 436//note: since 2011-04-22 "Rincewind RC1", there is a core function named 437// "tpl_getFavicon()". But its functionality is not really fitting the 438// behaviour of this template, therefore I don't use it here. 439if (file_exists(DOKU_TPLINC."user/favicon.ico")){ 440 //user defined - you might find http://tools.dynamicdrive.com/favicon/ 441 //useful to generate one 442 echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."user/favicon.ico\" />\n"; 443}elseif (file_exists(DOKU_TPLINC."user/favicon.png")){ 444 //note: I do NOT recommend PNG for favicons (cause it is not supported by 445 //all browsers), but some users requested this feature. 446 echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."user/favicon.png\" />\n"; 447}else{ 448 //default 449 echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."static/3rd/dokuwiki/favicon.ico\" />\n"; 450} 451 452//include default or userdefined Apple Touch Icon (see <http://j.mp/sx3NMT> for 453//details) 454if (file_exists(DOKU_TPLINC."user/apple-touch-icon.png")){ 455 echo "<link rel=\"apple-touch-icon\" href=\"".DOKU_TPL."user/apple-touch-icon.png\" />\n"; 456}else{ 457 //default 458 echo "<link rel=\"apple-touch-icon\" href=\"".DOKU_TPL."static/3rd/dokuwiki/apple-touch-icon.png\" />\n"; 459} 460 461//load userdefined js? 462if (tpl_getConf("vector_loaduserjs")){ 463 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/user.js\"></script>\n"; 464} 465 466//show printable version? 467if ($vector_action === "print"){ 468 //note: this is just a workaround for people searching for a print version. 469 // don't forget to update the styles.ini, this is the really important 470 // thing! BTW: good text about this: http://is.gd/5MyG5 471 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."static/3rd/dokuwiki/print.css\" />\n" 472 ."<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."static/css/print.css\" />\n" 473 ."<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."user/print.css\" />\n"; 474} 475 476//load language specific css hacks? 477if (file_exists(DOKU_TPLINC."lang/".$conf["lang"]."/style.css")){ 478 $interim = trim(file_get_contents(DOKU_TPLINC."lang/".$conf["lang"]."/style.css")); 479 if (!empty($interim)){ 480 echo "<style type=\"text/css\" media=\"all\">\n".hsc($interim)."\n</style>\n"; 481 } 482} 483?> 484<!--[if lte IE 8]><link rel="stylesheet" media="all" type="text/css" href="<?php echo DOKU_TPL; ?>static/css/screen_iehacks.css" /><![endif]--> 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 //detect wiki page to load as content 530 if (!empty($transplugin) && //var comes from conf/boxes.php 531 is_object($transplugin) && 532 tpl_getConf("vector_sitenotice_translate")){ 533 //translated site notice? 534 $transplugin_langcur = $transplugin->hlp->getLangPart(cleanID(getId())); //current language part 535 $transplugin_langs = explode(" ", trim($transplugin->getConf("translations"))); //available languages 536 if (empty($transplugin_langs) || 537 empty($transplugin_langcur) || 538 !is_array($transplugin_langs) || 539 !in_array($transplugin_langcur, $transplugin_langs)) { 540 //current page is no translation or something is wrong, load default site notice 541 $sitenotice_location = tpl_getConf("vector_sitenotice_location"); 542 } else { 543 //load language specific site notice 544 $sitenotice_location = tpl_getConf("vector_sitenotice_location")."_".$transplugin_langcur; 545 } 546 }else{ 547 //default site notice, no translation 548 $sitenotice_location = tpl_getConf("vector_sitenotice_location"); 549 } 550 551 //we have to show a custom site notice 552 if (empty($conf["useacl"]) || 553 auth_quickaclcheck(cleanID($sitenotice_location)) >= AUTH_READ){ //current user got access? 554 echo "\n <div id=\"siteNotice\" class=\"noprint\">\n"; 555 //get the rendered content of the defined wiki article to use as 556 //custom site notice. 557 $interim = tpl_include_page($sitenotice_location, false); 558 if ($interim === "" || 559 $interim === false){ 560 //show creation/edit link if the defined page got no content 561 echo "[ "; 562 tpl_pagelink($sitenotice_location, hsc($lang["vector_fillplaceholder"]." (".hsc($sitenotice_location).")")); 563 echo " ]<br />"; 564 }else{ 565 //show the rendered page content 566 echo " <div class=\"dokuwiki\">\n" //dokuwiki CSS class needed cause we are showing rendered page content 567 .$interim."\n " 568 ."</div>"; 569 } 570 echo "\n </div>\n"; 571 } 572 } 573 //show breadcrumps if enabled and position = top 574 if ($conf["breadcrumbs"] == true && 575 $ACT !== "media" && //var comes from DokuWiki 576 (empty($conf["useacl"]) || //are there any users? 577 $loginname !== "" || //user is logged in? 578 !tpl_getConf("vector_closedwiki")) && 579 tpl_getConf("vector_breadcrumbs_position") === "top"){ 580 echo "\n <div class=\"catlinks noprint\"><p>\n "; 581 tpl_breadcrumbs(); 582 echo "\n </p></div>\n"; 583 } 584 //show hierarchical breadcrumps if enabled and position = top 585 if ($conf["youarehere"] == true && 586 $ACT !== "media" && //var comes from DokuWiki 587 (empty($conf["useacl"]) || //are there any users? 588 $loginname !== "" || //user is logged in? 589 !tpl_getConf("vector_closedwiki")) && 590 tpl_getConf("vector_youarehere_position") === "top"){ 591 echo "\n <div class=\"catlinks noprint\"><p>\n "; 592 tpl_youarehere(); 593 echo "\n </p></div>\n"; 594 } 595 ?> 596 597 <!-- start div id bodyContent --> 598 <div id="bodyContent" class="dokuwiki"> 599 <!-- start rendered wiki content --> 600 <?php 601 //flush the buffer for faster page rendering, heaviest content follows 602 if (function_exists("tpl_flush")) { 603 tpl_flush(); //exists since 2010-11-07 "Anteater"... 604 } else { 605 flush(); //...but I won't loose compatibility to 2009-12-25 "Lemming" right now. 606 } 607 //decide which type of pagecontent we have to show 608 switch ($vector_action){ 609 //"image details" 610 case "detail": 611 include DOKU_TPLINC."inc_detail.php"; 612 break; 613 //"cite this article" 614 case "cite": 615 include DOKU_TPLINC."inc_cite.php"; 616 break; 617 //show "normal" content 618 default: 619 tpl_content(((tpl_getConf("vector_toc_position") === "article") ? true : false)); 620 break; 621 } 622 ?> 623 <!-- end rendered wiki content --> 624 <div class="clearer"></div> 625 </div> 626 <!-- end div id bodyContent --> 627 628 <?php 629 //show breadcrumps if enabled and position = bottom 630 if ($conf["breadcrumbs"] == true && 631 $ACT !== "media" && //var comes from DokuWiki 632 (empty($conf["useacl"]) || //are there any users? 633 $loginname !== "" || //user is logged in? 634 !tpl_getConf("vector_closedwiki")) && 635 tpl_getConf("vector_breadcrumbs_position") === "bottom"){ 636 echo "\n <div class=\"catlinks noprint\"><p>\n "; 637 tpl_breadcrumbs(); 638 echo "\n </p></div>\n"; 639 } 640 //show hierarchical breadcrumps if enabled and position = bottom 641 if ($conf["youarehere"] == true && 642 $ACT !== "media" && //var comes from DokuWiki 643 (empty($conf["useacl"]) || //are there any users? 644 $loginname !== "" || //user is logged in? 645 !tpl_getConf("vector_closedwiki")) && 646 tpl_getConf("vector_youarehere_position") === "bottom"){ 647 echo "\n <div class=\"catlinks noprint\"><p>\n "; 648 tpl_youarehere(); 649 echo "\n </p></div>\n"; 650 } 651 ?> 652 653</div> 654<!-- end div id=content --> 655 656 657<!-- start div id=head --> 658<div id="head" class="noprint"> 659 <?php 660 //show personal tools 661 if (!empty($conf["useacl"])){ //...makes only sense if there are users 662 echo "\n" 663 ." <div id=\"p-personal\">\n" 664 ." <ul>\n"; 665 //login? 666 if ($loginname === ""){ 667 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 668 }else{ 669 //username and userpage 670 echo " <li id=\"pt-userpage\">".(tpl_getConf("vector_userpage") 671 ? html_wikilink(tpl_getConf("vector_userpage_ns").$loginname, hsc($loginname)) 672 : hsc($loginname))."</li>"; 673 //personal discussion 674 if (tpl_getConf("vector_discuss") && 675 tpl_getConf("vector_userpage")){ 676 echo " <li id=\"pt-mytalk\">".html_wikilink(tpl_getConf("vector_discuss_ns").ltrim(tpl_getConf("vector_userpage_ns"), ":").$loginname, hsc($lang["vector_mytalk"]))."</li>"; 677 } 678 //admin 679 if (!empty($INFO["isadmin"]) || 680 !empty($INFO["ismanager"])){ 681 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 682 } 683 //profile 684 if (actionOK("profile")){ //check if action is disabled 685 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 686 } 687 //logout 688 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 689 } 690 echo " </ul>\n" 691 ." </div>\n"; 692 } 693 ?> 694 695 <!-- start div id=left-navigation --> 696 <div id="left-navigation"> 697 <div id="p-namespaces" class="vectorTabs"> 698 <ul><?php 699 //show tabs: left. see vector/user/tabs.php to configure them 700 if (!empty($_vector_tabs_left) && 701 is_array($_vector_tabs_left)){ 702 _vector_renderTabs($_vector_tabs_left); 703 } 704 ?> 705 706 </ul> 707 </div> 708 </div> 709 <!-- end div id=left-navigation --> 710 711 <!-- start div id=right-navigation --> 712 <div id="right-navigation"> 713 <div id="p-views" class="vectorTabs"> 714 <ul><?php 715 //show tabs: right. see vector/user/tabs.php to configure them 716 if (!empty($_vector_tabs_right) && 717 is_array($_vector_tabs_right)){ 718 _vector_renderTabs($_vector_tabs_right); 719 } 720 ?> 721 722 </ul> 723 </div> 724<?php if (actionOK("search")){ ?> 725 <div id="p-search"> 726 <h5> 727 <label for="qsearch__in"><?php echo hsc($lang["vector_search"]); ?></label> 728 </h5> 729 <form action="<?php echo wl(); ?>" accept-charset="utf-8" id="dw__search" name="dw__search"> 730 <input type="hidden" name="do" value="search" /> 731 <div id="simpleSearch"> 732 <input id="qsearch__in" name="id" type="text" accesskey="f" value="" /> 733 <button id="searchButton" type="submit" name="button" title="<?php echo hsc($lang["vector_btn_search_title"]); ?>"> </button> 734 </div> 735 <div id="qsearch__out" class="ajax_qsearch JSpopup"></div> 736 </form> 737 </div> 738<?php } ?> 739 </div> 740 <!-- end div id=right-navigation --> 741 742</div> 743<!-- end div id=head --> 744 745<!-- start panel/sidebar --> 746<div id="panel" class="noprint"> 747 <!-- start logo --> 748 <div id="p-logo"> 749 <?php 750 //include default or userdefined logo 751 echo "<a href=\"".wl()."\" "; 752 if (file_exists(DOKU_TPLINC."user/logo.png")){ 753 //user defined PNG 754 echo "style=\"background-image:url(".DOKU_TPL."user/logo.png);\""; 755 }elseif (file_exists(DOKU_TPLINC."user/logo.gif")){ 756 //user defined GIF 757 echo "style=\"background-image:url(".DOKU_TPL."user/logo.gif);\""; 758 }elseif (file_exists(DOKU_TPLINC."user/logo.jpg")){ 759 //user defined JPG 760 echo "style=\"background-image:url(".DOKU_TPL."user/logo.jpg);\""; 761 }else{ 762 //default 763 echo "style=\"background-image:url(".DOKU_TPL."static/3rd/dokuwiki/logo.png);\""; 764 } 765 echo " accesskey=\"h\" title=\"[ALT+H]\"></a>\n"; 766 ?> 767 </div> 768 <!-- end logo --> 769 770 <?php 771 //show boxes, see vector/user/boxes.php to configure them 772 if (!empty($_vector_boxes) && 773 is_array($_vector_boxes)){ 774 _vector_renderBoxes($_vector_boxes); 775 } 776 ?> 777 778</div> 779<!-- end panel/sidebar --> 780</div> 781<!-- end page-container --> 782 783<!-- start footer --> 784<div id="footer" class="noprint"> 785 <ul id="footer-info"> 786 <li id="footer-info-lastmod"> 787 <?php tpl_pageinfo()?><br /> 788 </li> 789 <?php 790 //copyright notice 791 if (tpl_getConf("vector_copyright")){ 792 //show dokuwiki's default notice? 793 if (tpl_getConf("vector_copyright_default")){ 794 echo "<li id=\"footer-info-copyright\">\n <div class=\"dokuwiki\">"; //dokuwiki CSS class needed cause we have to show DokuWiki content 795 tpl_license(false); 796 echo "</div>\n </li>\n"; 797 //show custom notice. 798 }else{ 799 //detect wiki page to load as content 800 if (!empty($transplugin) && //var comes from conf/boxes.php 801 is_object($transplugin) && 802 tpl_getConf("vector_copyright_translate")){ 803 //translated copyright notice? 804 $transplugin_langcur = $transplugin->hlp->getLangPart(cleanID(getId())); //current language part 805 $transplugin_langs = explode(" ", trim($transplugin->getConf("translations"))); //available languages 806 if (empty($transplugin_langs) || 807 empty($transplugin_langcur) || 808 !is_array($transplugin_langs) || 809 !in_array($transplugin_langcur, $transplugin_langs)) { 810 //current page is no translation or something is wrong, load default copyright notice 811 $copyright_location = tpl_getConf("vector_copyright_location"); 812 } else { 813 //load language specific copyright notice 814 $copyright_location = tpl_getConf("vector_copyright_location")."_".$transplugin_langcur; 815 } 816 }else{ 817 //default copyright notice, no translation 818 $copyright_location = tpl_getConf("vector_copyright_location"); 819 } 820 821 if (empty($conf["useacl"]) || 822 auth_quickaclcheck(cleanID($copyright_location)) >= AUTH_READ){ //current user got access? 823 echo "<li id=\"footer-info-copyright\">\n "; 824 //get the rendered content of the defined wiki article to use as custom notice 825 $interim = tpl_include_page($copyright_location, false); 826 if ($interim === "" || 827 $interim === false){ 828 //show creation/edit link if the defined page got no content 829 echo "[ "; 830 tpl_pagelink($copyright_location, hsc($lang["vector_fillplaceholder"]." (".hsc($copyright_location).")")); 831 echo " ]<br />"; 832 }else{ 833 //show the rendered page content 834 echo "<div class=\"dokuwiki\">\n" //dokuwiki CSS class needed cause we are showing rendered page content 835 .$interim."\n " 836 ."</div>"; 837 } 838 echo "\n </li>\n"; 839 } 840 } 841 } 842 ?> 843 </ul> 844 <ul id="footer-places"> 845 <li><?php 846 //show buttons, see vector/user/buttons.php to configure them 847 if (!empty($_vector_btns) && 848 is_array($_vector_btns)){ 849 _vector_renderButtons($_vector_btns); 850 } 851 ?> 852 </li> 853 </ul> 854 <div style="clearer"></div> 855</div> 856<!-- end footer --> 857<?php 858//provide DokuWiki housekeeping, required in all templates 859tpl_indexerWebBug(); 860 861//include web analytics software 862if (file_exists(DOKU_TPLINC."/user/tracker.php")){ 863 include DOKU_TPLINC."/user/tracker.php"; 864} 865?> 866 867</body> 868</html> 869