Dotclear


Ignore:
Timestamp:
10/27/09 01:01:16 (14 years ago)
Author:
Osku
Message:

Private mode 1.1RC1 :

  • should fixe some tickets bugs (closes #140, #296)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/private/index.php

    r955 r1768  
    2828 
    2929// Getting current parameters 
    30 $private_flag       = (boolean)$core->blog->settings->private_flag; 
    31 $private_conauto         = (boolean)$core->blog->settings->private_conauto; 
    32 $blog_private_title = $core->blog->settings->blog_private_title; 
    33 $blog_private_msg   = $core->blog->settings->blog_private_msg; 
     30$private_flag = (boolean)$core->blog->settings->private_flag; 
     31$private_conauto = (boolean)$core->blog->settings->private_conauto; 
     32$blog_private_title = $core->blog->settings->blog_private_title; 
     33$blog_private_msg = $core->blog->settings->blog_private_msg; 
    3434 
    3535if ($blog_private_title === null) { 
     
    3939if ($blog_private_msg === null) { 
    4040     $blog_private_msg = __('<p class="message">You need the password to view this blog.</p>'); 
    41 } 
    42  
    43 if (is_null($core->blog->settings->blog_private_pwd)) 
    44 { 
    45      $err = __('No password set.'); 
    4641} 
    4742 
     
    7873 
    7974          $core->blog->triggerBlog(); 
    80  
    81           $msg = __('Configuration successfully updated.'); 
     75          http::redirect($p_url.'&config=1'); 
    8276     } 
    8377 
     
    8781     } 
    8882} 
     83if ($core->blog->settings->blog_private_pwd === null) 
     84{ 
     85     $err = __('No password set.'); 
     86} 
    8987?> 
    9088<html> 
     
    9391</head> 
    9492<body> 
    95 <h2 style="padding:8px 0 8px 34px;background:url(index.php?pf=private/icon_32.png) no-repeat;"> 
    96 <?php echo html::escapeHTML($core->blog->name); ?> &rsaquo; <?php echo __('Private mode'); ?></h2> 
     93<?php  
    9794 
    98 <?php if (!empty($msg)) echo '<p class="message">'.$msg.'</p>'; ?> 
     95if (isset($_GET['config'])) { 
     96     echo '<p class="message">'.__('Configuration successfully updated.').'</p>'; 
     97} 
    9998 
    100 <?php if (!empty($err)) echo '<p class="error">'.$err.'</p>'; ?> 
     99if (!empty($err)) echo '<p class="error">'.$err.'</p>';  
    101100 
    102 <div id="private_options"> 
    103      <form method="post" action="plugin.php"> 
    104           <fieldset> 
    105                <legend><?php echo __('Plugin activation'); ?></legend> 
    106                     <div class="two-cols"> 
    107                     <div class="col"> 
    108                     <p class="field"> 
    109                          <?php echo form::checkbox('private_flag', 1, $private_flag); ?> 
    110                          <label class=" classic" for="private_flag"> <?php echo __('Enable Private mode');?></label> 
    111                     </p> 
    112                     <p><label class="required" title="<?php echo __('Required field');?>"> 
    113                          <?php echo __('New password:'); ?> 
    114                          <?php echo form::password('blog_private_pwd',30,255); ?> 
    115                     </label></p> 
    116                     <p><label class="required" title="<?php echo __('Required field');?>"> 
    117                          <?php echo __('Confirm password:'); ?> 
    118                          <?php echo form::password('blog_private_pwd_c',30,255); ?> 
    119                     </label></p> 
    120                     </div> 
    121                     <div class="col"> 
    122                     <p> 
    123                          <?php echo form::checkbox('private_conauto', 1, $private_conauto); ?> 
    124                          <label class=" classic" for="private_conauto"> <?php echo __('Propose automatic connection to visitors');?></label> 
    125                     </p> 
    126                     <p class="form-note"> 
    127                     <?php echo __('With this option, the password could be stored in a cookie.'); ?> 
    128                     <?php echo __('But it still remains a choice for the visitor.'); ?> 
    129                     </p> 
    130                     <p><?php  echo sprintf(__('Don\'t forget to add a <a href="%s">widget</a> allowing disconnection from the blog.'),'plugin.php?p=widgets'); ?></p> 
    131                     </div> 
    132                     </div> 
    133           </fieldset> 
    134           <fieldset class="constrained"> 
    135                <legend><?php echo __('Presentation options'); ?></legend> 
    136                     <p class="col"><label class="required" title="<?php echo __('Required field');?>"> 
    137                          <?php echo __('Private page title:');?> 
    138                          <?php echo form::field('blog_private_title',20,255,html::escapeHTML($blog_private_title),'maximal'); ?> 
    139                     </label></p> 
    140                     <p class="area"><label class="required" title="<?php echo __('Required field');?>"> 
    141                          <?php echo __('Private message:');?> 
    142                          <?php echo form::textarea('blog_private_msg',30,4,html::escapeHTML($blog_private_msg)); ?> 
    143                     </label></p> 
    144           </fieldset> 
     101echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Private mode').'</h2>'; 
    145102 
    146           <p><input type="hidden" name="p" value="private" /> 
    147           <?php echo $core->formNonce(); ?> 
    148           <input type="submit" name="saveconfig" value="<?php echo __('Save configuration'); ?>" /></p> 
    149      </form> 
    150 </div> 
     103echo '<div id="private_options">'. 
     104     '<form method="post" action="'.$p_url.'">'. 
     105          '<fieldset>'. 
     106               '<legend>'. __('Plugin activation').'</legend>'. 
     107                    '<div class="two-cols">'. 
     108                    '<div class="col">'. 
     109                    '<p class="field">'. 
     110                         form::checkbox('private_flag', 1, $private_flag). 
     111                         '<label class=" classic" for="private_flag">'.__('Enable Private mode').'</label>'. 
     112                    '</p>'. 
     113                    '<p><label class="required" title="'.__('Required field').'">'. 
     114                         __('New password:'). 
     115                         form::password('blog_private_pwd',30,255). 
     116                    '</label></p>'. 
     117                    '<p><label class="required" title="'.__('Required field').'">'. 
     118                         __('Confirm password:'). 
     119                         form::password('blog_private_pwd_c',30,255). 
     120                    '</label></p>'. 
     121                    '</div>'. 
     122                    '<div class="col">'. 
     123                    '<p>'. 
     124                         form::checkbox('private_conauto', 1, $private_conauto). 
     125                         '<label class=" classic" for="private_conauto">'. __('Propose automatic connection to visitors').'</label>'. 
     126                    '</p>'. 
     127                    '<p class="form-note">'. 
     128                    __('With this option, the password could be stored in a cookie.'). 
     129                    __('But it still remains a choice for the visitor.'). 
     130                    '</p>'. 
     131                    '<p>'.sprintf(__('Don\'t forget to add a <a href="%s">widget</a> allowing disconnection from the blog.'),'plugin.php?p=widgets').'</p>'. 
     132                    '</div>'. 
     133                    '</div>'. 
     134          '</fieldset>'. 
     135          '<fieldset>'. 
     136               '<legend>'.__('Presentation options').'</legend>'. 
     137                    '<p class="col"><label class="required" title="'.__('Required field').'">'. 
     138                         __('Private page title:'). 
     139                         form::field('blog_private_title',20,255,html::escapeHTML($blog_private_title),'maximal'). 
     140                    '.</label></p>'. 
     141                    '<p class="area"><label class="required" title="'.__('Required field').'">'. 
     142                         __('Private message:'). 
     143                         form::textarea('blog_private_msg',30,4,html::escapeHTML($blog_private_msg)). 
     144                    '</label></p>'. 
     145          '</fieldset>'. 
     146 
     147          '<p>'.form::hidden(array('p'),'private'). 
     148          $core->formNonce(). 
     149          '<input type="submit" name="saveconfig" value="'.__('Save configuration').'" /></p>'. 
     150     '</form>'. 
     151'</div>'; 
     152?> 
    151153</body> 
    152154</html> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map