Dotclear


Ignore:
Timestamp:
03/10/10 08:58:31 (14 years ago)
Author:
Osku
Message:

Plugin private : update to last version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/private/index.php

    r1768 r2117  
    44# This file is part of Private mode, a plugin for Dotclear 2. 
    55#  
    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. 
    89# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1011# 
    1112# -- END LICENSE BLOCK ------------------------------------ 
    12  
    13 // Setting default parameters if missing configuration 
    14 if (is_null($core->blog->settings->private_flag)) { 
    15      try { 
    16                $core->blog->settings->setNameSpace('private'); 
    17  
    18                // Private mode is not active by default 
    19                $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 } 
    2813 
    2914// Getting current parameters 
     
    3217$blog_private_title = $core->blog->settings->blog_private_title; 
    3318$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 } 
    4219 
    4320if (!empty($_POST['saveconfig'])) 
     
    8966<head> 
    9067     <title><?php echo __('Private mode'); ?></title> 
     68     <?php echo dcPage::jsLoad('index.php?pf=private/js/config.js'); ?> 
    9169</head> 
    9270<body> 
     
    10583          '<fieldset>'. 
    10684               '<legend>'. __('Plugin activation').'</legend>'. 
    107                     '<div class="two-cols">'. 
    108                     '<div class="col">'. 
    10985                    '<p class="field">'. 
    11086                         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>'. 
    11288                    '</p>'. 
     89          '</fieldset>'. 
     90          '<fieldset id="misc_options">'. 
     91               '<legend>'.__('Presentation options').'</legend>'. 
    11392                    '<p><label class="required" title="'.__('Required field').'">'. 
    11493                         __('New password:'). 
     
    11998                         form::password('blog_private_pwd_c',30,255). 
    12099                    '</label></p>'. 
    121                     '</div>'. 
    122                     '<div class="col">'. 
    123100                    '<p>'. 
    124101                         form::checkbox('private_conauto', 1, $private_conauto). 
     
    130107                    '</p>'. 
    131108                    '<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>'. 
    137109                    '<p class="col"><label class="required" title="'.__('Required field').'">'. 
    138110                         __('Private page title:'). 
    139111                         form::field('blog_private_title',20,255,html::escapeHTML($blog_private_title),'maximal'). 
    140                     '.</label></p>'. 
     112                    '</label></p>'. 
    141113                    '<p class="area"><label class="required" title="'.__('Required field').'">'. 
    142114                         __('Private message:'). 
Note: See TracChangeset for help on using the changeset viewer.

Sites map