summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-07-02 14:16:22 +0200
committerAndreas Gohr <andi@splitbrain.org>2006-07-02 14:16:22 +0200
commit409d7af7c9c6c97c8c00cada876a2bf967fa1526 (patch)
tree19defb2c97f293d4ed6150b0f5510019f0e3592d /inc/template.php
parentfd0cab2ee2d8c831bf1c086ab4015c9e74d3fe9c (diff)
downloadrpg-409d7af7c9c6c97c8c00cada876a2bf967fa1526.tar.gz
rpg-409d7af7c9c6c97c8c00cada876a2bf967fa1526.tar.bz2
disableactions support
This patch adds a config option to disable certain internal action commands of DokuWiki's main dispatcher. The options resendpasswd and openregister were removed because they can now set through this new option. The config plugin needs to be adjusted. darcs-hash:20060702121622-7ad00-1e80e77bcfb0ae561fe7abd79cfbe1bb158be720.gz
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/inc/template.php b/inc/template.php
index 277c06d8d..f9e69d340 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -296,9 +296,29 @@ function tpl_button($type){
global $conf;
global $auth;
+ if(!actionOK($type)) return;
+
switch($type){
case 'edit':
- print html_editbutton();
+ #most complicated type - we need to decide on current action
+ if($ACT == 'show' || $ACT == 'search'){
+ if($INFO['writable']){
+ if($INFO['draft']){
+ echo html_btn('draft',$ID,'e',array('do' => 'draft'),'post');
+ }else{
+ if($INFO['exists']){
+ echo html_btn('edit',$ID,'e',array('do' => 'edit','rev' => $REV),'post');
+ }else{
+ echo html_btn('create',$ID,'e',array('do' => 'edit','rev' => $REV),'post');
+ }
+ }
+ }else{
+ if(!actionOK('source')) return false; //pseudo action
+ echo html_btn('source',$ID,'v',array('do' => 'edit','rev' => $REV),'post');
+ }
+ }else{
+ echo html_btn('show',$ID,'v',array('do' => 'show'));
+ }
break;
case 'history':
print html_btn('revs',$ID,'o',array('do' => 'revisions'));
@@ -386,6 +406,8 @@ function tpl_actionlink($type,$pre='',$suf=''){
global $lang;
global $auth;
+ if(!actionOK($type)) return;
+
switch($type){
case 'edit':
#most complicated type - we need to decide on current action
@@ -401,6 +423,7 @@ function tpl_actionlink($type,$pre='',$suf=''){
'class="action create" accesskey="e" rel="nofollow"');
}
}else{
+ if(!actionOK('source')) return false; //pseudo action
tpl_link(wl($ID,'do=edit&amp;rev='.$REV),
$pre.$lang['btn_source'].$suf,
'class="action source" accesskey="v" rel="nofollow"');