You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

865 lines
34 KiB

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