Dotclear

Changeset 2475 for plugins/private


Ignore:
Timestamp:
07/10/10 19:18:49 (13 years ago)
Author:
Osku
Message:

private mode : update to last current version

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

Legend:

Unmodified
Added
Removed
  • plugins/private/_admin.php

    r2378 r2475  
    1414if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    1515 
    16 $_menu['Plugins']->addItem(__('Private mode'), 
    17      'plugin.php?p=private','index.php?pf=private/icon.png', 
    18      preg_match('/plugin.php\?p=private(&.*)?$/',$_SERVER['REQUEST_URI']), 
    19      $core->auth->check('admin',$core->blog->id) 
    20 ); 
     16$menu_class = ''; 
    2117 
    2218$s = privateSettings($core); 
     
    2521{ 
    2622     $core->addBehavior('adminPageHTMLHead','privateadminPageHTMLHead'); 
    27      $core->addBehavior('adminDashboardItems', 'privateDashboardItems');  
     23     $menu_class = 'private-blog'; 
    2824} 
    2925 
    30 function privateDashboardItems($core,$__dashboard_items) 
    31 { 
    32      $__dashboard_items[0][] = '<p class="private-msg">'.__('Password-protected blog').'.</p>'; 
    33 } 
     26$_menu['Plugins']->addItem(__('Private mode'), 
     27     'plugin.php?p=private','index.php?pf=private/icon.png', 
     28     preg_match('/plugin.php\?p=private(&.*)?$/',$_SERVER['REQUEST_URI']), 
     29     $core->auth->check('admin',$core->blog->id), 
     30     $menu_class 
     31); 
    3432 
    3533function privateadminPageHTMLHead() 
  • plugins/private/_public.php

    r2378 r2475  
    8888          $s = privateSettings($core); 
    8989          $password = $s->blog_private_pwd; 
    90  
     90          $allowed_types = array('feed','pubfeed','spamfeed','hamfeed','trackback','preview','pagespreview','contactme'); 
     91 
     92          #agora trick ? 
     93          if ($core->auth->userID())  
     94          { 
     95               return; 
     96          } 
     97           
    9198          if (!isset($session)) 
    9299          { 
     
    109116          unset($urlp); 
    110117 
    111           if ($type == 'feed' || $type == 'pubfeed' || $type == 'spamfeed' || $type == 'hamfeed' || $type == 'trackback')  
     118          if (in_array($type,$allowed_types))  
    112119          { 
    113120               return; 
     
    177184     { 
    178185          global $core; 
    179           $s = privateSettings($core); 
    180186          $f = $core->tpl->getFilters($attr); 
    181           return '<?php echo '.sprintf($f,'$s->private_page_title').'; ?>'; 
     187          return '<?php echo '.sprintf($f,'privateSettings($core)->private_page_title').'; ?>'; 
    182188     } 
    183189 
     
    185191     { 
    186192          global $core; 
    187           $s = privateSettings($core); 
    188193          $f = $core->tpl->getFilters($attr); 
    189           return '<?php echo '.sprintf($f,'$s->private_page_message').'; ?>'; 
     194          return '<?php echo '.sprintf($f,'privateSettings($core)->private_page_message').'; ?>'; 
    190195     } 
    191196 
  • plugins/private/index.php

    r2378 r2475  
    2424     { 
    2525          $private_flag = (empty($_POST['private_flag']))?false:true; 
    26           $private_conauto_flag = (empty($_POST['private_conauto']))?false:true; 
     26          $private_conauto_flag = (empty($_POST['private_conauto_flag']))?false:true; 
    2727          $private_page_title = $_POST['private_page_title']; 
    2828          $private_page_message = $_POST['private_page_message']; 
     
    3030 
    3131          $s->put('private_flag',$private_flag,'boolean','Private mode activation flag'); 
    32           $s->put('private_conauto',$private_conauto_flag,'boolean','Private mode automatic connection option'); 
     32          $s->put('private_conauto_flag',$private_conauto_flag,'boolean','Private mode automatic connection option'); 
    3333          $s->put('private_page_title',$private_page_title,'string','Private mode public page title'); 
    3434          $s->put('private_page_message',$private_page_message,'string','Private mode public welcome message'); 
     
    6868<head> 
    6969     <title><?php echo __('Private mode'); ?></title> 
    70  
     70     <?php echo  dcPage::jsToolBar(). 
     71     dcPage::jsLoad('index.php?pf=private/js/config.js'); ?> 
    7172</head> 
    7273<body> 
     
    105106'</label></p> 
    106107<p>'. 
    107 form::checkbox('private_conauto', 1, $private_conauto_flag). 
    108 '<label class="classic" for="private_conauto">'. __('Propose automatic connection to visitors').'</label>'. 
     108form::checkbox('private_conauto_flag', 1, $private_conauto_flag). 
     109'<label class="classic" for="private_conauto_flag">'. __('Propose automatic connection to visitors').'</label>'. 
    109110'</p>'. 
    110111'<p class="form-note">'. 
     
    116117'</p></div> 
    117118<div class="col"> 
    118 <h3>'.__('Home').'</h3> 
    119119<p class=""><label>'. 
    120 __('Title:'). 
     120__('Title:').'</label>'. 
    121121form::field('private_page_title',20,255,html::escapeHTML($private_page_title),'maximal'). 
    122 '</label></p> 
     122'</p> 
    123123<p class=""><label>'. 
    124 __('Message:'). 
     124__('Message:').'</label>'. 
    125125form::textarea('private_page_message',30,4,html::escapeHTML($private_page_message),'maximal'). 
    126 '</label></p> 
     126'</p> 
    127127</div></div> 
    128128</fieldset> 
  • plugins/private/locales/fr/main.po

    r2378 r2475  
    1 # Language: français 
    2 # Module: private - 1.3 
    3 # Date: 2010-06-20 21:45:46 
    4 # Translated with translater 1.3 
     1# Language: Français 
     2# Module: private - 1.4 
     3# Date: 2010-07-08 16:14:19 
     4# Translated with translater 1.4.1 
    55 
    66msgid "" 
    77msgstr "" 
    88"Content-Type: text/plain; charset=UTF-8\n" 
    9 "Project-Id-Version: private 1.3\n" 
     9"Project-Id-Version: private 1.4\n" 
    1010"POT-Creation-Date: \n" 
    11 "PO-Revision-Date: 2010-06-20T21:45:46+00:00\n" 
    12 "Last-Translator: Osku\n" 
     11"PO-Revision-Date: 2010-07-08T16:14:19+00:00\n" 
     12"Last-Translator: osku\n" 
    1313"Language-Team: \n" 
    1414"MIME-Version: 1.0\n" 
    1515"Content-Transfer-Encoding: 8bit\n" 
    1616 
    17 #: _admin.php:16 
     17#: _admin.php:26 
    1818#: index.php:69 
    19 #: index.php:79 
     19#: index.php:80 
    2020msgid "Private mode" 
    2121msgstr "Mode privé" 
    22  
    23 #: _admin.php:32 
    24 msgid "Password-protected blog" 
    25 msgstr "Blog protégé par un mot de passe" 
    2622 
    2723#: _install.php:40 
     
    3329msgstr "<p class=\"message\">Vous avez besoin du mot de passe pour visualiser le blog.</p>" 
    3430 
    35 #: _public.php:148 
    36 #: _public.php:157 
     31#: _public.php:155 
     32#: _public.php:164 
    3733msgid "Wrong password" 
    3834msgstr "Mot de passe incorrect" 
    3935 
    40 #: _public.php:165 
     36#: _public.php:172 
    4137msgid "Disconnected" 
    4238msgstr "Déconnecté(e)" 
    4339 
    44 #: _public.php:223 
     40#: _public.php:228 
    4541msgid "Enable automatic connection" 
    4642msgstr "Activer la connexion automatique" 
     
    5450#: index.php:120 
    5551msgid "Title:" 
    56 msgstr "Titre :" 
     52msgstr "Titre :" 
    5753 
    5854#: _widgets.php:24 
    5955msgid "Text:" 
    60 msgstr "Texte :" 
     56msgstr "Texte :" 
    6157 
    6258#: _widgets.php:25 
     
    7268msgstr "Page d'accueil uniquement" 
    7369 
    74 #: default-templates/private.html:46 
    75 msgid "Password:" 
    76 msgstr "Mot de passe :" 
    77  
    7870#: index.php:40 
    7971msgid "Passwords don't match" 
     
    8476msgstr "Aucun mot de passe défini." 
    8577 
    86 #: index.php:76 
     78#: index.php:77 
    8779msgid "Configuration successfully updated." 
    88 msgstr "La configuration a été correctement enregistrée" 
     80msgstr "Configuration mise à jour avec succès." 
    8981 
    90 #: index.php:85 
     82#: index.php:86 
    9183msgid "Plugin activation" 
    9284msgstr "Activation de l'extension" 
    9385 
    94 #: index.php:89 
     86#: index.php:90 
    9587msgid "Enable private mode" 
    9688msgstr "Activer le mode privé" 
    9789 
    98 #: index.php:93 
     90#: index.php:94 
    9991msgid "Presentation options" 
    10092msgstr "Options d'affichage" 
    10193 
    102 #: index.php:98 
    103 #: index.php:102 
     94#: index.php:99 
     95#: index.php:103 
    10496msgid "Required field" 
    10597msgstr "Champ obligatoire" 
    10698 
    107 #: index.php:99 
     99#: index.php:100 
    108100msgid "New password:" 
    109 msgstr "Nouveau mot de passe :" 
     101msgstr "Nouveau mot de passe :" 
    110102 
    111 #: index.php:103 
     103#: index.php:104 
    112104msgid "Confirm password:" 
    113 msgstr "Confirmez le mot de passe :" 
     105msgstr "Confirmez le mot de passe :" 
    114106 
    115 #: index.php:108 
     107#: index.php:109 
    116108msgid "Propose automatic connection to visitors" 
    117109msgstr "Proposer la connexion automatique aux visiteurs" 
    118110 
    119 #: index.php:111 
     111#: index.php:112 
    120112msgid "With this option, the password could be stored in a cookie." 
    121113msgstr "Cette option permet la mémorisation du mot de passe dans un cookie." 
    122114 
    123 #: index.php:113 
     115#: index.php:114 
    124116msgid "But it still remains a choice for the visitor." 
    125117msgstr "Mais ceci reste toutefois à la discrétion du visiteur." 
    126118 
    127 #: index.php:115 
     119#: index.php:116 
    128120msgid "Don't forget to add a <a href=\"%s\">widget</a> allowing disconnection from the blog." 
    129121msgstr "N'oubliez pas d'ajouter un <a href=\"%s\">widget</a> permettant la déconnexion du blog." 
    130  
    131 #: index.php:118 
    132 msgid "Home" 
    133 msgstr "Accueil" 
    134122 
    135123#: index.php:124 
  • plugins/private/style/admin.css

    r2378 r2475  
    1 div.private-msg, p.private-msg { 
    2      padding : 0.5em 0.5em 0.5em 40px; 
    3      margin-bottom : 1em; 
    4      -moz-border-radius : 8px; 
    5      -webkit-border-radius : 8px; 
     1#main-menu #private-blog a { 
     2     padding: 2px; 
     3     background: #161400; 
     4     color: #B9B23B; 
     5     border: 1px solid #161400; 
     6     -moz-border-radius: 3px; 
     7     -webkit-border-radius: 3px; 
    68} 
    7 p.private-msg{ 
    8      padding-top : 1em; 
    9      padding-bottom : 1em; 
    10 } 
    11 div.private-msg, p.private-msg { 
    12      background : #8a8983 url(index.php?pf=private/style/icon_32.png) no-repeat 5px 5px; 
    13      color : #fff; 
    14 } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map