Dotclear

Changeset 2117 for plugins/private


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

Plugin private : update to last version

Location:
plugins/private
Files:
6 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • plugins/private/_admin.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 
     
    1718          preg_match('/plugin.php\?p=private(&.*)?$/',$_SERVER['REQUEST_URI']), 
    1819          $core->auth->check('admin',$core->blog->id)); 
     20           
     21if ($core->blog->settings->private_flag) 
     22{ 
     23     $core->addBehavior('adminPageHTMLHead','privateadminPageHTMLHead'); 
     24     $core->addBehavior('adminDashboardItems', 'privateDashboardItems');  
     25} 
     26 
     27function privateDashboardItems($core,$__dashboard_items) 
     28{ 
     29     $__dashboard_items[1][] = '<p class="private-msg">'.__('Private blog').'.</p>'; 
     30} 
     31 
     32function privateadminPageHTMLHead() 
     33{ 
     34     echo '  <style type="text/css">'."\n".'  @import "index.php?pf=private/css/admin.css";'."\n".'  </style>'."\n"; 
     35} 
    1936?> 
  • plugins/private/_define.php

    r1902 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 
     
    1718     /* Description*/    "Protect your blog with a password", 
    1819     /* Author */        "Osku and contributors", 
    19      /* Version */       '1.1', 
     20     /* Version */       '1.2.1', 
    2021     /* Permissions */   'admin' 
    2122); 
  • 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:'). 
  • plugins/private/locales/fr/main.po

    r1902 r2117  
    9292 
    9393#: index.php:111 
    94 msgid "Enable Private mode" 
    95 msgstr "Activer le mode Privé" 
     94msgid "Enable private mode" 
     95msgstr "Activer le mode privé" 
    9696 
    9797#: index.php:113 
Note: See TracChangeset for help on using the changeset viewer.

Sites map