summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2009-09-11 10:18:33 +0200
committerAndreas Gohr <andi@splitbrain.org>2009-09-11 10:18:33 +0200
commit1246e01639ddb1343de1532a6a46182c4137ca7a (patch)
treed7d67d3bfb6cdca3e3102b65d501ebd402c64e1c /inc/template.php
parenta29759c7b5b6da57539d8b25d25cbd43c68ad917 (diff)
downloadrpg-1246e01639ddb1343de1532a6a46182c4137ca7a.tar.gz
rpg-1246e01639ddb1343de1532a6a46182c4137ca7a.tar.bz2
One click revert for managers
Ignore-this: e3c9b5f941b2f1aa83ca375861203a2f This patch adds another button for users with the $conf['manager'] role when viewing an old revision. It allows them to revert to this revision with a single click. darcs-hash:20090911081833-7ad00-5a64feb7e3e1b37178295c290a6c97c3923e82e3.gz
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/inc/template.php b/inc/template.php
index ea35f4526..e1b253f96 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -528,6 +528,11 @@ function tpl_button($type,$return=false){
$out .= html_btn('admin',$ID,'',array('do' => 'admin'));
}
break;
+ case 'revert':
+ if($INFO['ismanager'] && $REV && $INFO['writable'] && actionOK('revert')){
+ $out .= html_btn('revert',$ID,'',array('do' => 'revert', 'rev' => $REV, 'sectok' => getSecurityToken()));
+ }
+ break;
case 'subscribe':
case 'subscription':
if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){
@@ -692,6 +697,13 @@ function tpl_actionlink($type,$pre='',$suf='',$inner='',$return=false){
'class="action admin" rel="nofollow"',1);
}
break;
+ case 'revert':
+ if($INFO['ismanager'] && $REV && $INFO['writable'] && actionOK('revert')){
+ $out .= tpl_link(wl($ID,array('do' => 'revert', 'rev' => $REV, 'sectok' => getSecurityToken())),
+ $pre.(($inner)?$inner:$lang['btn_revert']).$suf,
+ 'class="action revert" rel="nofollow"',1);
+ }
+ break;
case 'subscribe':
case 'subscription':
if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){
@@ -1279,6 +1291,9 @@ function tpl_actiondropdown($empty='',$button='&gt;'){
}
echo '<option value="revisions">'.$lang['btn_revs'].'</option>';
+ if($INFO['ismanager'] && $REV && $INFO['writable'] && actionOK('revert')){
+ echo '<option value="revert">'.$lang['btn_revert'].'</option>';
+ }
echo '<option value="backlink">'.$lang['btn_backlink'].'</option>';
echo '</optgroup>';