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