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.
 
 
 
 
 

177 lines
7.6 KiB

  1. <?php
  2. /**
  3. * Default tab configuration of the "vector" DokuWiki template
  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:configuration
  14. */
  15. /******************************************************************************
  16. ******************************** ATTENTION *********************************
  17. DO NOT MODIFY THIS FILE, IT WILL NOT BE PRESERVED ON UPDATES!
  18. ******************************************************************************
  19. If you want to add some own tabs, have a look at the README of this template
  20. and "/user/tabs.php". You have been warned!
  21. *****************************************************************************/
  22. //check if we are running within the DokuWiki environment
  23. if (!defined("DOKU_INC")){
  24. die();
  25. }
  26. /****************************** LEFT NAVIGATION ******************************/
  27. //note: The tabs will be rendered in the order they were defined. Means: first
  28. // tab will be rendered first, last tab will be rendered at last.
  29. //article tab
  30. //ATTENTION: "ca-nstab-main" is used as css id selector!
  31. if (substr(getID(), 0, strlen("wiki:user:")) !== "wiki:user:"){
  32. $_vector_tabs_left["ca-nstab-main"]["text"] = $lang["vector_article"];
  33. }else{
  34. $_vector_tabs_left["ca-nstab-main"]["text"] = $lang["vector_userpage"];
  35. }
  36. $_vector_tabs_left["ca-nstab-main"]["accesskey"] = "V";
  37. if ($vector_context !== "discuss"){ //$vector_context was defined within main.php
  38. $_vector_tabs_left["ca-nstab-main"]["wiki"] = ":".getID();
  39. $_vector_tabs_left["ca-nstab-main"]["class"] = "selected";
  40. }else{
  41. $_vector_tabs_left["ca-nstab-main"]["wiki"] = ":".substr(getID(), strlen(tpl_getConf("vector_discuss_ns"))-1);
  42. }
  43. //hide some tabs for anonymous clients (closed wiki)?
  44. if (empty($conf["useacl"]) || //are there any users?
  45. $loginname !== "" || //user is logged in?
  46. !tpl_getConf("vector_closedwiki")){
  47. //discussion tab
  48. //ATTENTION: "ca-talk" is used as css id selector!
  49. if (tpl_getConf("vector_discuss")){
  50. $_vector_tabs_left["ca-talk"]["text"] = $lang["vector_discussion"];
  51. if ($vector_context === "discuss"){ //$vector_context was defined within main.php
  52. $_vector_tabs_left["ca-talk"]["wiki"] = ":".getID();
  53. $_vector_tabs_left["ca-talk"]["class"] = "selected";
  54. }else{
  55. $_vector_tabs_left["ca-talk"]["wiki"] = tpl_getConf("vector_discuss_ns").getID();
  56. }
  57. }
  58. }
  59. /****************************** RIGHT NAVIGATION ******************************/
  60. //note: The tabs will be rendered in the order they were defined. Means: first
  61. // tab will be rendered first, last tab will be rendered at last.
  62. //read tab
  63. if(!empty($INFO["exists"])){
  64. //ATTENTION: "ca-view" is used as css id selector!
  65. $_vector_tabs_right["ca-view"]["text"] = $lang["vector_read"];
  66. if ($vector_context !== "discuss"){ //$vector_context was defined within main.php
  67. $_vector_tabs_right["ca-view"]["wiki"] = ":".getID();
  68. if ($ACT === "show") { //$ACT comes from DokuWiki core
  69. $_vector_tabs_right["ca-view"]["class"] = "selected";
  70. }
  71. }else{
  72. $_vector_tabs_right["ca-view"]["wiki"] = ":".substr(getID(), strlen(tpl_getConf("vector_discuss_ns"))-1);
  73. }
  74. }
  75. //hide some tabs for anonymous clients (closed wiki)?
  76. if (empty($conf["useacl"]) || //are there any users?
  77. $loginname !== "" || //user is logged in?
  78. !tpl_getConf("vector_closedwiki")){
  79. //edit/create/show source tab
  80. //ATTENTION: "ca-edit" is used as css id selector!
  81. $_vector_tabs_right["ca-edit"]["href"] = wl(cleanID(getId()), array("do" => "edit", "rev" => (int)$rev), false, "&");
  82. $_vector_tabs_right["ca-edit"]["accesskey"] = "E";
  83. if (!empty($INFO["writable"])){ //$INFO comes from DokuWiki core
  84. if (!empty($INFO["draft"])){
  85. $_vector_tabs_right["ca-edit"]["href"] = wl(cleanID(getId()), array("do" => "draft", "rev" => (int)$rev), false, "&");
  86. $_vector_tabs_right["ca-edit"]["text"] = $lang["btn_draft"]; //language comes from DokuWiki core
  87. }else{
  88. if(!empty($INFO["exists"])){
  89. $_vector_tabs_right["ca-edit"]["text"] = $lang["vector_edit"];
  90. }else{
  91. $_vector_tabs_right["ca-edit"]["text"] = $lang["vector_create"];
  92. }
  93. }
  94. }elseif (actionOK("source")){ //check if action is disabled
  95. $_vector_tabs_right["ca-edit"]["text"] = $lang["btn_source"]; //language comes from DokuWiki core
  96. $_vector_tabs_right["ca-edit"]["accesskey"] = "E";
  97. }
  98. if ($ACT === "edit"){ //$ACT comes from DokuWiki core
  99. $_vector_tabs_right["ca-edit"]["class"] = "selected";
  100. }
  101. //old versions/revisions tab
  102. if (!empty($INFO["exists"]) &&
  103. actionOK("revisions")){ //check if action is disabled
  104. //ATTENTION: "ca-history" is used as css id selector!
  105. $_vector_tabs_right["ca-history"]["text"] = $lang["btn_revs"]; //language comes from DokuWiki core
  106. $_vector_tabs_right["ca-history"]["href"] = wl(cleanID(getId()), array("do" => "revisions"), false, "&");
  107. $_vector_tabs_right["ca-history"]["accesskey"] = "O";
  108. if ($ACT === "revisions"){ //$ACT comes from DokuWiki core
  109. $_vector_tabs_right["ca-history"]["class"] = "selected";
  110. }
  111. }
  112. //(un)subscribe tab
  113. //ATTENTION: "ca-watch" is used as css id selector!
  114. if (!empty($conf["useacl"]) &&
  115. !empty($conf["subscribers"]) &&
  116. !empty($loginname)){ //$loginname was defined within main.php
  117. //2010-11-07 "Anteater" and newer ones
  118. if (empty($lang["btn_unsubscribe"])) {
  119. if (actionOK("subscribe")){ //check if action is disabled
  120. $_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "subscribe"), false, "&");
  121. $_vector_tabs_right["ca-watch"]["text"] = $lang["btn_subscribe"]; //language comes from DokuWiki core
  122. }
  123. //2009-12-25 "Lemming" and older ones. See the following for information:
  124. //<http://www.freelists.org/post/dokuwiki/Question-about-tpl-buttonsubscribe>
  125. } else {
  126. if (empty($INFO["subscribed"]) && //$INFO comes from DokuWiki core
  127. actionOK("subscribe")){ //check if action is disabled
  128. $_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "subscribe"), false, "&");
  129. $_vector_tabs_right["ca-watch"]["text"] = $lang["btn_subscribe"]; //language comes from DokuWiki core
  130. }elseif (actionOK("unsubscribe")){ //check if action is disabled
  131. $_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "unsubscribe"), false, "&");
  132. $_vector_tabs_right["ca-watch"]["text"] = $lang["btn_unsubscribe"]; //language comes from DokuWiki core
  133. }
  134. }
  135. }
  136. }
  137. /******************************************************************************
  138. ******************************** ATTENTION *********************************
  139. DO NOT MODIFY THIS FILE, IT WILL NOT BE PRESERVED ON UPDATES!
  140. ******************************************************************************
  141. If you want to add some own tabs, have a look at the README of this template
  142. and "/user/tabs.php". You have been warned!
  143. *****************************************************************************/