summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2009-11-23 16:18:13 +0100
committerAdrian Lang <lang@cosmocode.de>2010-01-20 10:53:22 +0100
commit15741132b4a2b6f006441f4c11e021062c168af8 (patch)
tree83a02ab25426a1fb3184ec6f39566a21d73cb3b3 /inc/template.php
parent8881fcc99a05f20da8fdd0f1c52f801fd84a8bb7 (diff)
downloadrpg-15741132b4a2b6f006441f4c11e021062c168af8.tar.gz
rpg-15741132b4a2b6f006441f4c11e021062c168af8.tar.bz2
Some language changes in subscription management
Ignore-this: 9d6c368419814c7b8cb94f778377ede7 A few language strings were dropped, others updated or added darcs-hash:20091123151813-6e07b-4d01fe03fa2c3bd5944bc05abdd05a24fb79c186.gz
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php40
1 files changed, 24 insertions, 16 deletions
diff --git a/inc/template.php b/inc/template.php
index 9b738bf8f..3aff96a46 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -1354,7 +1354,6 @@ function tpl_include_page($pageid,$print=true){
*
* @author Adrian Lang <lang@cosmocode.de>
*/
-
function tpl_subscribe() {
global $INFO;
global $ID;
@@ -1368,22 +1367,24 @@ function tpl_subscribe() {
echo p_locale_xhtml('subscr_form');
echo '<h2>' . $lang['subscr_m_current_header'] . '</h2>';
+ echo '<div class="level2">';
if ($INFO['subscribed'] === false) {
echo '<p>' . $lang['subscr_m_not_subscribed'] . '</p>';
} else {
- echo '<p>' . $lang['subscr_m_current'] . '</p>';
echo '<ul>';
+
foreach($INFO['subscribed'] as $sub) {
$form = new Doku_Form(array('class' => 'unsubscribe'));
if ($sub['target'] !== $ID) {
- $str = sprintf($targets['namespace'], prettyprint_id($sub['target']));
+ $stgt = '<code class="ns">'.hsc(prettyprint_id($sub['target'])).'</code>';
} else {
- $str = $targets[$ID];
+ $stgt = '<code class="ns">'.hsc(prettyprint_id($sub['target'])).'</code>';
}
- $form->addElement('<li><div class="li">' .
- sprintf($lang['subscr_m_entry'], $str,
- $styles[$sub['style']]));
- $form->addElement(form_makeButton('submit', 'subscribe', $lang['subscr_m_delete']));
+ $sstl = $lang['subscr_style_'.$sub['style']];
+ if(!$sstl) $sstl = hsc($sub['style']);
+
+ $form->addElement('<li><div class="li">'.$stgt.' ('.$sstl.') ');
+ $form->addElement(form_makeButton('submit', 'subscribe', $lang['subscr_m_unsubscribe']));
$form->addHidden('subscribe_target', $sub['target']);
$form->addHidden('subscribe_style', $sub['style']);
$form->addHidden('subscribe_action', 'unsubscribe');
@@ -1392,17 +1393,23 @@ function tpl_subscribe() {
}
echo '</ul>';
}
+ echo '</div>';
+ // Add new subscription form
echo '<h2>' . $lang['subscr_m_new_header'] . '</h2>';
- if ($INFO['userinfo']['mail'] === '') {
- echo $lang['subscr_m_noemail'];
- return;
- }
- $styles['list'] = $styles['list'] . ' (Not allowed for single pages)';
+ echo '<div class="level2">';
+ $ns = getNS($ID).':';
+ $targets = array(
+ $ID => '<code class="page">'.prettyprint_id($ID).'</code>',
+ $ns => '<code class="ns">'.prettyprint_id($ns).'</code>',
+ );
+ $styles = array(
+ 'every' => $lang['subscr_style_every'],
+ 'digest' => $lang['subscr_style_digest'],
+ 'list' => $lang['subscr_style_list'],
+ );
+
$form = new Doku_Form(array('id' => 'subscribe'));
- $ns = getNS($ID). ':';
- $targets[$ns] = sprintf($targets['namespace'], prettyprint_id($ns));
- unset($targets['namespace']);
$form->addElement('<p>' . 'Subscribe to' . '</p>');
$form->addRadioSet('subscribe_target', $targets);
$form->addElement('<p>' . 'Receive' . '</p>');
@@ -1410,6 +1417,7 @@ function tpl_subscribe() {
$form->addHidden('subscribe_action', 'subscribe');
$form->addElement(form_makeButton('submit', 'subscribe', $lang['subscr_m_subscribe']));
html_form('SUBSCRIBE', $form);
+ echo '</div>';
}
//Setup VIM: ex: et ts=4 enc=utf-8 :