Dotclear

Changeset 2115


Ignore:
Timestamp:
03/10/10 08:52:41 (13 years ago)
Author:
Osku
Message:

Plugin offline : update to last version

Location:
plugins/offline
Files:
6 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • plugins/offline/_admin.php

    r1753 r2115  
    1 <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ 
    2 /***************************************************************\ 
    3  *  This is 'Offline', a plugin for Dotclear 2                 * 
    4  *                                                             * 
    5  *  Copyright (c) 2008                                         * 
    6  *  Osku and contributors.                                     * 
    7  *                                                             * 
    8  *  This is an open source software, distributed under the GNU * 
    9  *  General Public License (version 2) terms and  conditions.  * 
    10  *                                                             * 
    11  *  You should have received a copy of the GNU General Public  * 
    12  *  License along with 'Offline mode' (see LICENCE);           * 
    13  *  if not, write to the Free Software Foundation, Inc.,       * 
    14  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    * 
    15 \***************************************************************/ 
     1<?php 
     2# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
     4# This file is part of Offline mode, a plugin for Dotclear 2. 
     5#  
     6# Copyright (c) 2008-2010 Osku and contributors 
     7# 
     8# Licensed under the GPL version 2.0 license. 
     9# A copy of this license is available in LICENSE file or at 
     10# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     11# 
     12# -- END LICENSE BLOCK ------------------------------------ 
     13 
    1614if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    1715 
     
    2018          preg_match('/plugin.php\?p=offline(&.*)?$/',$_SERVER['REQUEST_URI']), 
    2119          $core->auth->check('admin',$core->blog->id)); 
     20           
     21if ($core->blog->settings->blog_off_flag) 
     22{ 
     23     $core->addBehavior('adminPageHTMLHead','offlineadminPageHTMLHead'); 
     24     $core->addBehavior('adminDashboardItems', 'offlineDashboardItems');  
     25} 
     26 
     27function offlineDashboardItems($core,$__dashboard_items) 
     28{ 
     29     $__dashboard_items[1][] = '<p class="offlline-msg">'.__('Offline mode active.').'</p>'; 
     30} 
     31 
     32function offlineadminPageHTMLHead() 
     33{ 
     34     echo '  <style type="text/css">'."\n".'  @import "index.php?pf=offline/css/admin.css";'."\n".'  </style>'."\n"; 
     35} 
     36 
    2237?> 
  • plugins/offline/_define.php

    r1753 r2115  
    1 <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ 
    2 /***************************************************************\ 
    3  *  This is 'Offline', a plugin for Dotclear 2                 * 
    4  *                                                             * 
    5  *  Copyright (c) 2008                                         * 
    6  *  Osku and contributors.                                     * 
    7  *                                                             * 
    8  *  This is an open source software, distributed under the GNU * 
    9  *  General Public License (version 2) terms and  conditions.  * 
    10  *                                                             * 
    11  *  You should have received a copy of the GNU General Public  * 
    12  *  License along with 'Offline mode' (see LICENCE);           * 
    13  *  if not, write to the Free Software Foundation, Inc.,       * 
    14  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    * 
    15 \***************************************************************/ 
     1<?php 
     2# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
     4# This file is part of Offline mode, a plugin for Dotclear 2. 
     5#  
     6# Copyright (c) 2008-2010 Osku and contributors 
     7# 
     8# Licensed under the GPL version 2.0 license. 
     9# A copy of this license is available in LICENSE file or at 
     10# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     11# 
     12# -- END LICENSE BLOCK ------------------------------------ 
     13 
    1614if (!defined('DC_RC_PATH')) { return; } 
    1715 
     
    1917     /* Name */          "Offline mode", 
    2018     /* Description*/    "Put your blog offline", 
    21      /* Author */        "Osku", 
    22      /* Version */       '0.2', 
     19     /* Author */        "Osku and contributors", 
     20     /* Version */       '0.5', 
    2321     /* Permissions */   'admin' 
    2422); 
  • plugins/offline/_public.php

    r1753 r2115  
    1 <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ 
    2 /***************************************************************\ 
    3  *  This is 'Offline', a plugin for Dotclear 2                 * 
    4  *                                                             * 
    5  *  Copyright (c) 2008                                         * 
    6  *  Osku and contributors.                                     * 
    7  *                                                             * 
    8  *  This is an open source software, distributed under the GNU * 
    9  *  General Public License (version 2) terms and  conditions.  * 
    10  *                                                             * 
    11  *  You should have received a copy of the GNU General Public  * 
    12  *  License along with 'Offline mode' (see LICENCE);           * 
    13  *  if not, write to the Free Software Foundation, Inc.,       * 
    14  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    * 
    15 \***************************************************************/ 
     1<?php 
     2# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
     4# This file is part of Offline mode, a plugin for Dotclear 2. 
     5#  
     6# Copyright (c) 2008-2010 Osku and contributors 
     7# 
     8# Licensed under the GPL version 2.0 license. 
     9# A copy of this license is available in LICENSE file or at 
     10# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     11# 
     12# -- END LICENSE BLOCK ------------------------------------ 
     13 
    1614if (!defined('DC_RC_PATH')) { return; } 
    1715 
  • plugins/offline/index.php

    r1753 r2115  
    1 <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ 
    2 /***************************************************************\ 
    3  *  This is 'Offline', a plugin for Dotclear 2                 * 
    4  *                                                             * 
    5  *  Copyright (c) 2008                                         * 
    6  *  Osku and contributors.                                     * 
    7  *                                                             * 
    8  *  This is an open source software, distributed under the GNU * 
    9  *  General Public License (version 2) terms and  conditions.  * 
    10  *                                                             * 
    11  *  You should have received a copy of the GNU General Public  * 
    12  *  License along with 'Offline mode' (see LICENCE);           * 
    13  *  if not, write to the Free Software Foundation, Inc.,       * 
    14  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    * 
    15 \***************************************************************/ 
    16  
    17 // Setting default parameters if missing configuration 
    18 if (is_null($core->blog->settings->blog_off_flag)) { 
    19      try { 
    20                $core->blog->settings->setNameSpace('offline'); 
    21  
    22                // Maintenance  is not active by default 
    23                $core->blog->settings->put('blog_off_flag',false,'boolean'); 
    24                $core->blog->triggerBlog(); 
    25                http::redirect(http::getSelfURI()); 
    26           } 
    27      catch (Exception $e) { 
    28           $core->error->add($e->getMessage()); 
    29      } 
    30 } 
     1<?php 
     2# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
     4# This file is part of Offline mode, a plugin for Dotclear 2. 
     5#  
     6# Copyright (c) 2008-2010 Osku and contributors 
     7# 
     8# Licensed under the GPL version 2.0 license. 
     9# A copy of this license is available in LICENSE file or at 
     10# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     11# 
     12# -- END LICENSE BLOCK ------------------------------------ 
    3113 
    3214// Getting current parameters 
    33 $blog_off_flag           = (boolean)$core->blog->settings->blog_off_flag; 
    34 $blog_off_ip_ok          = $core->blog->settings->blog_off_ip_ok; 
    35 $blog_off_page_title     = $core->blog->settings->blog_off_page_title; 
    36 $blog_off_msg            = $core->blog->settings->blog_off_msg; 
    37 $myip                    = $_SERVER['REMOTE_ADDR']; 
    38  
    39 if ($blog_off_page_title === null) { 
    40      $blog_off_page_title = __('Maintenance'); 
    41 } 
    42  
    43 if ($blog_off_msg === null) { 
    44      $blog_off_msg = __('<p class="message">D\'oh! The blog is offline.</p>'); 
    45 } 
     15$blog_off_flag = (boolean)$core->blog->settings->blog_off_flag; 
     16$blog_off_ip_ok = $core->blog->settings->blog_off_ip_ok; 
     17$blog_off_page_title = $core->blog->settings->blog_off_page_title; 
     18$blog_off_msg = $core->blog->settings->blog_off_msg; 
     19$myip = $_SERVER['REMOTE_ADDR']; 
    4620 
    4721if (!empty($_POST['saveconfig'])) 
     
    8155<head> 
    8256     <title><?php echo __('Offline mode'); ?></title> 
     57     <?php echo dcPage::jsLoad('index.php?pf=offline/js/config.js'); ?> 
    8358</head> 
    8459<body> 
    85 <h2 style="padding:8px 0 8px 34px;background:url(index.php?pf=offline/icon_32.png) no-repeat;"> 
    86 <?php echo html::escapeHTML($core->blog->name); ?> &rsaquo; <?php echo __('Offline mode'); ?></h2> 
     60<?php  
     61if (!empty($msg)) echo '<p class="message">'.$msg.'</p>';  
    8762 
    88 <?php if (!empty($msg)) echo '<p class="message">'.$msg.'</p>'; ?> 
     63echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Offline mode').'</h2>'; 
    8964 
    90 <div id="offline_options"> 
    91      <form method="post" action="plugin.php"> 
    92           <fieldset> 
    93                <legend><?php echo __('Plugin activation'); ?></legend> 
    94                     <p class="field"> 
    95                          <?php echo form::checkbox('blog_off_flag', 1, $blog_off_flag); ?> 
    96                               <label class="classic" for="blog_off_flag"> <?php echo __('Enable Offline mode');?></label> 
    97                     </p> 
    98                     <p class="form-note"><?php echo __('Activating this plugin redirect all urls to one.'); ?></p> 
    99           </fieldset> 
    100           <fieldset> 
    101                <legend><?php echo __('IP restricted access'); ?></legend> 
    102                     <p class="classic"><?php echo __('My own IP is'); ?><strong> <?php echo $myip ;?></strong></p> 
    103                     <p><label class="classic"> 
    104                          <?php echo __('Authorized IP:');?> 
    105                          <?php echo form::field('blog_off_ip_ok',20,39,html::escapeHTML($blog_off_ip_ok)); ?> 
    106                     </label></p> 
    107                     <p class="form-note"><?php echo __('With this option, a visitor having this IP can access the website.'); ?></p> 
    108           </fieldset> 
    109           <fieldset> 
    110                <legend><?php echo __('Presentation options'); ?></legend> 
    111                     <p><label class="required" title="__('Required field')"> 
    112                          <?php echo __('Offline title:');?> 
    113                          <?php echo form::field('blog_off_page_title',30,256,html::escapeHTML($blog_off_page_title)); ?> 
    114                     </label></p> 
    115                     <p class="area"><label class="required" title="'.__('Required field').'"> 
    116                          <?php echo __('Offline message:');?> 
    117                          <?php echo form::textarea('blog_off_msg',30,2,html::escapeHTML($blog_off_msg)); ?> 
    118                     </label></p> 
    119           </fieldset> 
    120  
    121           <p><input type="hidden" name="p" value="offline" /> 
    122           <?php echo $core->formNonce(); ?> 
    123           <input type="submit" name="saveconfig" value="<?php echo __('Save configuration'); ?>" /></p> 
    124      </form> 
    125 </div> 
     65echo '<div id="offline_options">'. 
     66     '<form method="post" action="'.$p_url.'">'. 
     67          '<fieldset>'. 
     68               '<legend>'.__('Plugin activation').'</legend>'. 
     69                    '<p class="field">'. 
     70                         form::checkbox('blog_off_flag', 1, $blog_off_flag). 
     71                              '<label class="classic" for="blog_off_flag">'.__('Enable Offline mode').'</label>'. 
     72                    '</p>'. 
     73          '</fieldset>'. 
     74          '<fieldset id="misc_options">'. 
     75               '<legend>'.__('Options').'</legend>'. 
     76                    '<p><label class="required" title="'.__('Required field').'">'. 
     77                         __('Offline title:'). 
     78                         form::field('blog_off_page_title',30,256,html::escapeHTML($blog_off_page_title)). 
     79                    '</label></p>'. 
     80                    '<p class="area"><label class="required" title="'.__('Required field').'">'. 
     81                         __('Offline message:'). 
     82                         form::textarea('blog_off_msg',30,2,html::escapeHTML($blog_off_msg)). 
     83                    '</label></p>'. 
     84                    '<h3>'.__('IP restricted access').'</h3>'. 
     85                    '<p class="classic">'.__('My own IP is:&nbsp;').'<strong>'.$myip.'</strong></p>'. 
     86                    '<p><label class="classic">'. 
     87                         __('Authorized IP:&nbsp;'). 
     88                         form::field('blog_off_ip_ok',20,39,html::escapeHTML($blog_off_ip_ok)). 
     89                    '</label></p>'. 
     90                    '<p class="form-note">'.__('With this option, a visitor having this IP can access the website.').'</p>'. 
     91          '</fieldset>'. 
     92          '<p>'.form::hidden(array('p'),'offline'). 
     93          $core->formNonce(). 
     94          '<input type="submit" name="saveconfig" value="'.__('Save configuration').'" /></p>'. 
     95     '</form>'. 
     96'</div>'; 
     97?> 
    12698</body> 
    12799</html> 
  • plugins/offline/locales/fr/main.po

    r1753 r2115  
    1 # French translations for PACKAGE package. 
    2 # Copyright (C) 2009 THE PACKAGE'S COPYRIGHT HOLDER 
    3 # This file is distributed under the same license as the PACKAGE package. 
    4 # Greg <popech@gmail.com>, 2009. 
    5 # 
     1# Language: français 
     2# Module: offline - 0.4 
     3# Date: 2010-02-12 13:43:41 
     4# Translated with translater 1.3 
     5 
    66msgid "" 
    77msgstr "" 
    8 "Project-Id-Version: PACKAGE VERSION\n" 
    9 "Report-Msgid-Bugs-To: \n" 
    10 "POT-Creation-Date: 2009-01-09 01:21+0100\n" 
    11 "PO-Revision-Date: 2009-10-26 08:00+0100\n" 
    12 "Last-Translator: Kozlika <kozlika@free.fr>\n" 
    13 "Language-Team: French\n" 
     8"Content-Type: text/plain; charset=UTF-8\n" 
     9"Project-Id-Version: offline 0.4\n" 
     10"POT-Creation-Date: \n" 
     11"PO-Revision-Date: 2010-02-12T13:43:41+00:00\n" 
     12"Last-Translator: Osku\n" 
     13"Language-Team: \n" 
    1414"MIME-Version: 1.0\n" 
    15 "Content-Type: text/plain; charset=ASCII\n" 
    1615"Content-Transfer-Encoding: 8bit\n" 
    17 "Plural-Forms: nplurals=2; plural=(n > 1);\n" 
    1816 
    19 #: _admin.php:18 
    20 #: index.php:82 
    21 #: index.php:86 
     17#: _admin.php:16 
     18#: index.php:56 
     19#: index.php:63 
    2220msgid "Offline mode" 
    2321msgstr "Mode hors ligne" 
    2422 
    25 #: index.php:40 
     23#: _admin.php:29 
     24msgid "Offline mode active." 
     25msgstr "Mode hors ligne actif." 
     26 
     27#: _install.php:28 
    2628msgid "Maintenance" 
    2729msgstr "Maintenance" 
    2830 
    29 #: index.php:44 
     31#: _install.php:29 
    3032msgid "<p class=\"message\">D'oh! The blog is offline.</p>" 
    3133msgstr "<p class=\"message\">Mince ! Le blog est hors ligne.</p>" 
    3234 
    33 #: index.php:57 
     35#: index.php:31 
    3436msgid "No page title." 
    35 msgstr "Aucun titre pour la page" 
     37msgstr "Aucun titre pour la page." 
    3638 
    37 #: index.php:61 
     39#: index.php:35 
    3840msgid "No maintenance message." 
    39 msgstr "Aucun message de maintenance" 
     41msgstr "Aucun message de maintenance." 
    4042 
    41 #: index.php:72 
     43#: index.php:46 
    4244msgid "Configuration successfully updated." 
    4345msgstr "La configuration a été correctement enregistrée." 
    4446 
    45 #: index.php:93 
     47#: index.php:68 
    4648msgid "Plugin activation" 
    4749msgstr "Activation de l'extension" 
    4850 
    49 #: index.php:96 
     51#: index.php:71 
    5052msgid "Enable Offline mode" 
    5153msgstr "Activer le mode hors ligne" 
    5254 
    53 #: index.php:98 
    54 msgid "Activating this plugin redirect all urls to one." 
    55 msgstr "En activant ce plugin, toutes les urls seront redirigées vers une seule." 
     55#: index.php:75 
     56msgid "Options" 
     57msgstr "Options" 
    5658 
    57 #: index.php:101 
     59#: index.php:76 
     60#: index.php:80 
     61msgid "Required field" 
     62msgstr "Champ obligatoire" 
     63 
     64#: index.php:77 
     65msgid "Offline title:" 
     66msgstr "Titre hors ligne :" 
     67 
     68#: index.php:81 
     69msgid "Offline message:" 
     70msgstr "Message hors ligne :" 
     71 
     72#: index.php:84 
    5873msgid "IP restricted access" 
    5974msgstr "Accès restreint pour une IP" 
    6075 
    61 #: index.php:102 
    62 msgid "My own IP is" 
    63 msgstr "Mon adresse IP est" 
     76#: index.php:85 
     77msgid "My own IP is:&nbsp;" 
     78msgstr "Mon IP est :&nbsp;" 
    6479 
    65 #: index.php:104 
    66 msgid "Authorized IP:" 
    67 msgstr "IP autorisée:" 
     80#: index.php:87 
     81msgid "Authorized IP:&nbsp;" 
     82msgstr "IP autorisée :&nbsp;" 
    6883 
    69 #: index.php:107 
     84#: index.php:90 
    7085msgid "With this option, a visitor having this IP can access the website." 
    7186msgstr "L'IP renseignée peut accéder au site." 
    7287 
    73 #: index.php:110 
    74 msgid "Presentation options" 
    75 msgstr "Options d'affichage" 
    76  
    77 #: index.php:112 
    78 msgid "Offline title:" 
    79 msgstr "Titre hors ligne :" 
    80  
    81 #: index.php:116 
    82 msgid "Offline message:" 
    83 msgstr "Message hors ligne :" 
    84  
    85 #: index.php:123 
     88#: index.php:94 
    8689msgid "Save configuration" 
    8790msgstr "Enregistrer la configuration" 
    88  
Note: See TracChangeset for help on using the changeset viewer.

Sites map