1 | <?php
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * User defined tab configuration of the "monobook" DokuWiki template
|
---|
5 | *
|
---|
6 | * If you want to add/remove some tabs, have a look at the comments/examples
|
---|
7 | * and the DocBlock of {@link _monobook_renderTabs()}, main.php
|
---|
8 | *
|
---|
9 | * To change the non-tab related config, use the admin webinterface of DokuWiki.
|
---|
10 | *
|
---|
11 | *
|
---|
12 | * LICENSE: This file is open source software (OSS) and may be copied under
|
---|
13 | * certain conditions. See COPYING file for details or try to contact
|
---|
14 | * the author(s) of this file in doubt.
|
---|
15 | *
|
---|
16 | * @license GPLv2 (http://www.gnu.org/licenses/gpl2.html)
|
---|
17 | * @author Andreas Haerter <[email protected]>
|
---|
18 | * @link http://andreas-haerter.com/projects/dokuwiki-template-monobook
|
---|
19 | * @link http://www.dokuwiki.org/template:monobook
|
---|
20 | * @link http://www.dokuwiki.org/devel:configuration
|
---|
21 | */
|
---|
22 |
|
---|
23 |
|
---|
24 | //check if we are running within the DokuWiki environment
|
---|
25 | if (!defined("DOKU_INC")){
|
---|
26 | die();
|
---|
27 | }
|
---|
28 |
|
---|
29 |
|
---|
30 | //note: The tabs will be rendered in the order they were defined. Means: first
|
---|
31 | // tab will be rendered first, last tab will be rendered at last.
|
---|
32 |
|
---|
33 |
|
---|
34 | //ODT plugin: export tab
|
---|
35 | //see <http://www.dokuwiki.org/plugin:odt> for info
|
---|
36 | if (file_exists(DOKU_PLUGIN."odt/syntax.php") &&
|
---|
37 | !plugin_isdisabled("odt")){
|
---|
38 | $_monobook_tabs["tab-export-odt"]["text"] = $lang["monobook_tab_exportodt"];
|
---|
39 | $_monobook_tabs["tab-export-odt"]["href"] = wl(cleanID(getId()), array("do" => "export_odt"), false, "&");
|
---|
40 | $_monobook_tabs["tab-export-odt"]["nofollow"] = true;
|
---|
41 | }
|
---|
42 |
|
---|
43 |
|
---|
44 | //html2pdf plugin: export tab (thanks to Luigi Micco <[email protected]>)
|
---|
45 | //see <http://www.dokuwiki.org/plugin:html2pdf> for info
|
---|
46 | if (file_exists(DOKU_PLUGIN."html2pdf/action.php") &&
|
---|
47 | !plugin_isdisabled("html2pdf")){
|
---|
48 | $_monobook_tabs["tab-export-pdf"]["text"] = $lang["monobook_tab_exportpdf"];
|
---|
49 | $_monobook_tabs["tab-export-pdf"]["href"] = wl(cleanID(getId()), array("do" => "export_pdf"), false, "&");
|
---|
50 | $_monobook_tabs["tab-export-pdf"]["nofollow"] = true;
|
---|
51 | }
|
---|
52 |
|
---|
53 | //(un)subscribe namespace tab
|
---|
54 | if (!empty($conf["useacl"]) &&
|
---|
55 | !empty($conf["subscribers"]) &&
|
---|
56 | !empty($loginname)){ //$loginname was defined within main.php
|
---|
57 | if (empty($INFO["subscribedns"])){ //$INFO comes from DokuWiki core
|
---|
58 | $_monobook_tabs["ca-watchns"]["href"] = wl(cleanID(getId()), array("do" => "subscribens"), false, "&");
|
---|
59 | $_monobook_tabs["ca-watchns"]["text"] = $lang["btn_subscribens"]; //language comes from DokuWiki core
|
---|
60 | }else{
|
---|
61 | $_monobook_tabs["ca-watchns"]["href"] = wl(cleanID(getId()), array("do" => "unsubscribens"), false, "&");
|
---|
62 | $_monobook_tabs["ca-watchns"]["text"] = $lang["btn_unsubscribens"]; //language comes from DokuWiki core
|
---|
63 | }
|
---|
64 | }
|
---|
65 |
|
---|
66 |
|
---|
67 | //examples: uncomment to see what is happening
|
---|
68 | /*
|
---|
69 | //text
|
---|
70 | $_monobook_tabs["tab-textexample"]["text"] = "Example";
|
---|
71 | */
|
---|
72 |
|
---|
73 |
|
---|
74 | /*
|
---|
75 | //Recent Changes (thanks to Stefan Riemer for this)
|
---|
76 | //To get some space between this and the other tabs, you may add the following
|
---|
77 | //additional CSS to /monobook/user/screen.css:
|
---|
78 | // li#tab-recent {
|
---|
79 | // margin-left: 1.6em;
|
---|
80 | // }
|
---|
81 | if (!empty($conf["recent_days"])){
|
---|
82 | $_monobook_tabs["tab-recent"]["text"] = $lang["btn_recent"]; //language comes from DokuWiki core
|
---|
83 | $_monobook_tabs["tab-recent"]["href"] = wl("", array("do" => "recent"), false, "&");
|
---|
84 | $_monobook_tabs["tab-recent"]["nofollow"] = true;
|
---|
85 | }
|
---|
86 | */
|
---|
87 |
|
---|
88 |
|
---|
89 | /*
|
---|
90 | //(un)subscribe namespace tab
|
---|
91 | if (!empty($conf["useacl"]) &&
|
---|
92 | !empty($conf["subscribers"]) &&
|
---|
93 | !empty($loginname)){ //$loginname was defined within main.php
|
---|
94 | if (empty($INFO["subscribedns"])){ //$INFO comes from DokuWiki core
|
---|
95 | $_monobook_tabs["ca-watchns"]["href"] = wl(cleanID(getId()), array("do" => "subscribens"), false, "&");
|
---|
96 | $_monobook_tabs["ca-watchns"]["text"] = $lang["btn_subscribens"]; //language comes from DokuWiki core
|
---|
97 | }else{
|
---|
98 | $_monobook_tabs["ca-watchns"]["href"] = wl(cleanID(getId()), array("do" => "unsubscribens"), false, "&");
|
---|
99 | $_monobook_tabs["ca-watchns"]["text"] = $lang["btn_unsubscribens"]; //language comes from DokuWiki core
|
---|
100 | }
|
---|
101 | }
|
---|
102 | */
|
---|
103 |
|
---|
104 |
|
---|
105 | /*
|
---|
106 | //link
|
---|
107 | $_monobook_tabs["tab-urlexample"]["text"] = "Creator";
|
---|
108 | $_monobook_tabs["tab-urlexample"]["href"] = "http://andreas-haerter.com";
|
---|
109 | */
|
---|
110 |
|
---|
111 |
|
---|
112 | /*
|
---|
113 | //link with rel="nofollow", see http://www.wikipedia.org/wiki/Nofollow for info
|
---|
114 | $_monobook_tabs["tab-urlexample2"]["text"] = "Search the web";
|
---|
115 | $_monobook_tabs["tab-urlexample2"]["href"] = "http://www.google.com/search?q=dokuwiki";
|
---|
116 | $_monobook_tabs["tab-urlexample2"]["nofollow"] = true;
|
---|
117 | */
|
---|
118 |
|
---|
119 |
|
---|
120 | /*
|
---|
121 | //internal wiki link
|
---|
122 | $_monobook_tabs["tab-wikilinkexample"]["text"] = "Home";
|
---|
123 | $_monobook_tabs["tab-wikilinkexample"]["wiki"] = ":start";
|
---|
124 | $_monobook_tabs["tab-wikilinkexample"]["accesskey"] = "H"; //accesskey is optional
|
---|
125 | */
|
---|
126 |
|
---|