Changeset 2117 for plugins/private/index.php
- Timestamp:
- 03/10/10 08:58:31 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/private/index.php
r1768 r2117 4 4 # This file is part of Private mode, a plugin for Dotclear 2. 5 5 # 6 # Copyright (c) 2008-2009 Osku and contributors 7 ## Licensed under the GPL version 2.0 license. 6 # Copyright (c) 2008-2010 Osku and contributors 7 # 8 # Licensed under the GPL version 2.0 license. 8 9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 11 # 11 12 # -- END LICENSE BLOCK ------------------------------------ 12 13 // Setting default parameters if missing configuration14 if (is_null($core->blog->settings->private_flag)) {15 try {16 $core->blog->settings->setNameSpace('private');17 18 // Private mode is not active by default19 $core->blog->settings->put('private_flag',false,'boolean');20 $core->blog->settings->put('private_conauto',false,'boolean');21 $core->blog->triggerBlog();22 http::redirect(http::getSelfURI());23 }24 catch (Exception $e) {25 $core->error->add($e->getMessage());26 }27 }28 13 29 14 // Getting current parameters … … 32 17 $blog_private_title = $core->blog->settings->blog_private_title; 33 18 $blog_private_msg = $core->blog->settings->blog_private_msg; 34 35 if ($blog_private_title === null) {36 $blog_private_title = __('Private blog');37 }38 39 if ($blog_private_msg === null) {40 $blog_private_msg = __('<p class="message">You need the password to view this blog.</p>');41 }42 19 43 20 if (!empty($_POST['saveconfig'])) … … 89 66 <head> 90 67 <title><?php echo __('Private mode'); ?></title> 68 <?php echo dcPage::jsLoad('index.php?pf=private/js/config.js'); ?> 91 69 </head> 92 70 <body> … … 105 83 '<fieldset>'. 106 84 '<legend>'. __('Plugin activation').'</legend>'. 107 '<div class="two-cols">'.108 '<div class="col">'.109 85 '<p class="field">'. 110 86 form::checkbox('private_flag', 1, $private_flag). 111 '<label class=" classic" for="private_flag">'.__('Enable Private mode').'</label>'.87 '<label class=" classic" for="private_flag">'.__('Enable private mode').'</label>'. 112 88 '</p>'. 89 '</fieldset>'. 90 '<fieldset id="misc_options">'. 91 '<legend>'.__('Presentation options').'</legend>'. 113 92 '<p><label class="required" title="'.__('Required field').'">'. 114 93 __('New password:'). … … 119 98 form::password('blog_private_pwd_c',30,255). 120 99 '</label></p>'. 121 '</div>'.122 '<div class="col">'.123 100 '<p>'. 124 101 form::checkbox('private_conauto', 1, $private_conauto). … … 130 107 '</p>'. 131 108 '<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 109 '<p class="col"><label class="required" title="'.__('Required field').'">'. 138 110 __('Private page title:'). 139 111 form::field('blog_private_title',20,255,html::escapeHTML($blog_private_title),'maximal'). 140 ' .</label></p>'.112 '</label></p>'. 141 113 '<p class="area"><label class="required" title="'.__('Required field').'">'. 142 114 __('Private message:').
Note: See TracChangeset
for help on using the changeset viewer.