Changeset 2115
- Timestamp:
- 03/10/10 08:52:41 (13 years ago)
- 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 16 14 if (!defined('DC_CONTEXT_ADMIN')) { return; } 17 15 … … 20 18 preg_match('/plugin.php\?p=offline(&.*)?$/',$_SERVER['REQUEST_URI']), 21 19 $core->auth->check('admin',$core->blog->id)); 20 21 if ($core->blog->settings->blog_off_flag) 22 { 23 $core->addBehavior('adminPageHTMLHead','offlineadminPageHTMLHead'); 24 $core->addBehavior('adminDashboardItems', 'offlineDashboardItems'); 25 } 26 27 function offlineDashboardItems($core,$__dashboard_items) 28 { 29 $__dashboard_items[1][] = '<p class="offlline-msg">'.__('Offline mode active.').'</p>'; 30 } 31 32 function offlineadminPageHTMLHead() 33 { 34 echo ' <style type="text/css">'."\n".' @import "index.php?pf=offline/css/admin.css";'."\n".' </style>'."\n"; 35 } 36 22 37 ?> -
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 16 14 if (!defined('DC_RC_PATH')) { return; } 17 15 … … 19 17 /* Name */ "Offline mode", 20 18 /* Description*/ "Put your blog offline", 21 /* Author */ "Osku ",22 /* Version */ '0. 2',19 /* Author */ "Osku and contributors", 20 /* Version */ '0.5', 23 21 /* Permissions */ 'admin' 24 22 ); -
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 16 14 if (!defined('DC_RC_PATH')) { return; } 17 15 -
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 ------------------------------------ 31 13 32 14 // 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']; 46 20 47 21 if (!empty($_POST['saveconfig'])) … … 81 55 <head> 82 56 <title><?php echo __('Offline mode'); ?></title> 57 <?php echo dcPage::jsLoad('index.php?pf=offline/js/config.js'); ?> 83 58 </head> 84 59 <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); ?> › <?php echo __('Offline mode'); ?></h2> 60 <?php 61 if (!empty($msg)) echo '<p class="message">'.$msg.'</p>'; 87 62 88 <?php if (!empty($msg)) echo '<p class="message">'.$msg.'</p>'; ?> 63 echo '<h2>'.html::escapeHTML($core->blog->name).' › '.__('Offline mode').'</h2>'; 89 64 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> 65 echo '<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: ').'<strong>'.$myip.'</strong></p>'. 86 '<p><label class="classic">'. 87 __('Authorized IP: '). 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 ?> 126 98 </body> 127 99 </html> -
plugins/offline/locales/fr/main.po
r1753 r2115 1 # French translations for PACKAGE package.2 # Copyright (C) 2009 THE PACKAGE'S COPYRIGHT HOLDER3 # 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 6 6 msgid "" 7 7 msgstr "" 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: 20 09-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" 14 14 "MIME-Version: 1.0\n" 15 "Content-Type: text/plain; charset=ASCII\n"16 15 "Content-Transfer-Encoding: 8bit\n" 17 "Plural-Forms: nplurals=2; plural=(n > 1);\n"18 16 19 #: _admin.php:1 820 #: index.php: 8221 #: index.php: 8617 #: _admin.php:16 18 #: index.php:56 19 #: index.php:63 22 20 msgid "Offline mode" 23 21 msgstr "Mode hors ligne" 24 22 25 #: index.php:40 23 #: _admin.php:29 24 msgid "Offline mode active." 25 msgstr "Mode hors ligne actif." 26 27 #: _install.php:28 26 28 msgid "Maintenance" 27 29 msgstr "Maintenance" 28 30 29 #: index.php:4431 #: _install.php:29 30 32 msgid "<p class=\"message\">D'oh! The blog is offline.</p>" 31 33 msgstr "<p class=\"message\">Mince ! Le blog est hors ligne.</p>" 32 34 33 #: index.php: 5735 #: index.php:31 34 36 msgid "No page title." 35 msgstr "Aucun titre pour la page "37 msgstr "Aucun titre pour la page." 36 38 37 #: index.php: 6139 #: index.php:35 38 40 msgid "No maintenance message." 39 msgstr "Aucun message de maintenance "41 msgstr "Aucun message de maintenance." 40 42 41 #: index.php: 7243 #: index.php:46 42 44 msgid "Configuration successfully updated." 43 45 msgstr "La configuration a été correctement enregistrée." 44 46 45 #: index.php: 9347 #: index.php:68 46 48 msgid "Plugin activation" 47 49 msgstr "Activation de l'extension" 48 50 49 #: index.php: 9651 #: index.php:71 50 52 msgid "Enable Offline mode" 51 53 msgstr "Activer le mode hors ligne" 52 54 53 #: index.php: 9854 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 56 msgid "Options" 57 msgstr "Options" 56 58 57 #: index.php:101 59 #: index.php:76 60 #: index.php:80 61 msgid "Required field" 62 msgstr "Champ obligatoire" 63 64 #: index.php:77 65 msgid "Offline title:" 66 msgstr "Titre hors ligne :" 67 68 #: index.php:81 69 msgid "Offline message:" 70 msgstr "Message hors ligne :" 71 72 #: index.php:84 58 73 msgid "IP restricted access" 59 74 msgstr "Accès restreint pour une IP" 60 75 61 #: index.php: 10262 msgid "My own IP is "63 msgstr "Mon adresse IP est"76 #: index.php:85 77 msgid "My own IP is: " 78 msgstr "Mon IP est : " 64 79 65 #: index.php: 10466 msgid "Authorized IP: "67 msgstr "IP autorisée :"80 #: index.php:87 81 msgid "Authorized IP: " 82 msgstr "IP autorisée : " 68 83 69 #: index.php: 10784 #: index.php:90 70 85 msgid "With this option, a visitor having this IP can access the website." 71 86 msgstr "L'IP renseignée peut accéder au site." 72 87 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 86 89 msgid "Save configuration" 87 90 msgstr "Enregistrer la configuration" 88
Note: See TracChangeset
for help on using the changeset viewer.