Changeset 1768 for plugins/private/index.php
- Timestamp:
- 10/27/09 01:01:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/private/index.php
r955 r1768 28 28 29 29 // Getting current parameters 30 $private_flag 31 $private_conauto 32 $blog_private_title 33 $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; 34 34 35 35 if ($blog_private_title === null) { … … 39 39 if ($blog_private_msg === null) { 40 40 $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.');46 41 } 47 42 … … 78 73 79 74 $core->blog->triggerBlog(); 80 81 $msg = __('Configuration successfully updated.'); 75 http::redirect($p_url.'&config=1'); 82 76 } 83 77 … … 87 81 } 88 82 } 83 if ($core->blog->settings->blog_private_pwd === null) 84 { 85 $err = __('No password set.'); 86 } 89 87 ?> 90 88 <html> … … 93 91 </head> 94 92 <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); ?> › <?php echo __('Private mode'); ?></h2> 93 <?php 97 94 98 <?php if (!empty($msg)) echo '<p class="message">'.$msg.'</p>'; ?> 95 if (isset($_GET['config'])) { 96 echo '<p class="message">'.__('Configuration successfully updated.').'</p>'; 97 } 99 98 100 <?php if (!empty($err)) echo '<p class="error">'.$err.'</p>'; ?> 99 if (!empty($err)) echo '<p class="error">'.$err.'</p>'; 101 100 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> 101 echo '<h2>'.html::escapeHTML($core->blog->name).' › '.__('Private mode').'</h2>'; 145 102 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> 103 echo '<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 ?> 151 153 </body> 152 154 </html>
Note: See TracChangeset
for help on using the changeset viewer.