summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-06-08 13:11:17 +0200
committerAndreas Gohr <andi@splitbrain.org>2008-06-08 13:11:17 +0200
commit582c5bfe90443211cbd7f8f7d23932822a5783dd (patch)
tree02fa7213d73305a72a2e0ecf46d1ebd3fa4ad4c8
parent34aeb4af497a734c76369e97747f45b938cc527e (diff)
downloadrpg-582c5bfe90443211cbd7f8f7d23932822a5783dd.tar.gz
rpg-582c5bfe90443211cbd7f8f7d23932822a5783dd.tar.bz2
single button functions for subribe and subscribens FS#1408
darcs-hash:20080608111117-7ad00-a1989e6284df2d722c5a2eea80b0d19d6d1ef7dd.gz
-rw-r--r--inc/template.php9
-rw-r--r--lib/tpl/default/main.php3
2 files changed, 11 insertions, 1 deletions
diff --git a/inc/template.php b/inc/template.php
index efd921f7d..6d057463f 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -510,6 +510,7 @@ function tpl_button($type){
return true;
}
return false;
+ case 'subscribe':
case 'subscription':
if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){
if($_SERVER['REMOTE_USER']){
@@ -518,6 +519,14 @@ function tpl_button($type){
} else {
print html_btn('subscribe',$ID,'',array('do' => 'subscribe',));
}
+ if($type == 'subscribe') return true;
+ }
+ }
+ if($type == 'subscribe') return false;
+ // fall through for backward compatibility
+ case 'subscribens':
+ if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){
+ if($_SERVER['REMOTE_USER']){
if($INFO['subscribedns']){
print html_btn('unsubscribens',$ID,'',array('do' => 'unsubscribens',));
} else {
diff --git a/lib/tpl/default/main.php b/lib/tpl/default/main.php
index bb5391f8c..7ce920b56 100644
--- a/lib/tpl/default/main.php
+++ b/lib/tpl/default/main.php
@@ -115,7 +115,8 @@ if (!defined('DOKU_INC')) die();
<?php tpl_button('history')?>
</div>
<div class="bar-right" id="bar__bottomright">
- <?php tpl_button('subscription')?>
+ <?php tpl_button('subscribe')?>
+ <?php tpl_button('subscribens')?>
<?php tpl_button('admin')?>
<?php tpl_button('profile')?>
<?php tpl_button('login')?>