Changeset 3347 for plugins/dayMode
- Timestamp:
- 02/03/15 12:50:58 (9 years ago)
- Location:
- plugins/dayMode
- Files:
-
- 5 added
- 2 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dayMode/_admin.php
r946 r3347 4 4 # This file is part of dayMode, a plugin for Dotclear 2. 5 5 # 6 # Copyright (c) 2006-20 09Pep and contributors6 # Copyright (c) 2006-2010 Pep and contributors 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_CONTEXT_ADMIN')) { return; }12 if (!defined('DC_CONTEXT_ADMIN')) return; 13 13 14 14 require_once dirname(__FILE__).'/_widgets.php'; … … 16 16 $core->addBehavior('adminBlogPreferencesForm',array('dayModeBehaviors','adminBlogPreferencesForm')); 17 17 $core->addBehavior('adminBeforeBlogSettingsUpdate',array('dayModeBehaviors','adminBeforeBlogSettingsUpdate')); 18 ?> -
plugins/dayMode/_define.php
r1468 r3347 4 4 # This file is part of dayMode, a plugin for Dotclear 2. 5 5 # 6 # Copyright (c) 2006-20 09Pep and contributors6 # Copyright (c) 2006-2010 Pep and contributors 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_RC_PATH')) { return; }12 if (!defined('DC_RC_PATH')) return; 13 13 14 14 $this->registerModule( 15 15 /* Name */ "dayMode", 16 /* Description*/ "Provides daily archives and an associated calendar widget .",16 /* Description*/ "Provides daily archives and an associated calendar widget", 17 17 /* Author */ "Pep and contributors", 18 /* Version */ '1.0.1', 19 /* Permissions */ 'admin' 18 /* Version */ '1.1-RC3', 19 /* Properties */ 20 array( 21 'permissions' => 'admin', 22 'type' => 'plugin', 23 'dc_min' => '2.7', 24 'support' => 'http://lab.dotclear.org/wiki/plugin/dayMode', 25 'details' => 'http://plugins.dotaddict.org/dc2/details/dayMode' 26 ) 20 27 ); 21 ?> -
plugins/dayMode/_install.php
r940 r3347 4 4 # This file is part of dayMode, a plugin for Dotclear 2. 5 5 # 6 # Copyright (c) 2006-20 09Pep and contributors6 # Copyright (c) 2006-2010 Pep and contributors 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_CONTEXT_ADMIN')) exit;12 if (!defined('DC_CONTEXT_ADMIN')) return; 13 13 14 14 $package_version = $core->plugins->moduleInfo('dayMode','version'); … … 18 18 } 19 19 20 $core->blog->settings-> setNameSpace('daymode');21 $core->blog->settings-> put('daymode_active',false,'boolean','plugin activation',false,true);20 $core->blog->settings->addNameSpace('daymode'); 21 $core->blog->settings->daymode->put('daymode_active',false,'boolean','plugin activation',false,true); 22 22 $core->setVersion('dayMode',$package_version); 23 23 return true; 24 ?> -
plugins/dayMode/_prepend.php
r1468 r3347 4 4 # This file is part of dayMode, a plugin for Dotclear 2. 5 5 # 6 # Copyright (c) 2006-20 09Pep and contributors6 # Copyright (c) 2006-2010 Pep and contributors 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_RC_PATH')) { return; }12 if (!defined('DC_RC_PATH')) return; 13 13 14 14 $GLOBALS['__autoload']['dcCalendar'] = dirname(__FILE__).'/inc/class.dc.calendar.php'; … … 49 49 } 50 50 51 public static function addTplPath( &$core)51 public static function addTplPath($core) 52 52 { 53 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates'); 53 $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); 54 if (!empty($tplset) && is_dir(dirname(__FILE__).'/default-templates/'.$tplset)) { 55 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.$tplset); 56 } else { 57 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.DC_DEFAULT_TPLSET); 58 } 54 59 } 55 60 56 61 // Admin behaviors 57 public static function adminBlogPreferencesForm( &$core,&$settings)62 public static function adminBlogPreferencesForm($core,$settings) 58 63 { 59 64 echo 60 '< fieldset><legend>'.__('Daily Archives').'</legend>'.65 '<div class="fieldset"><h4>'.__('Daily Archives').'</h4>'. 61 66 '<p><label class="classic">'. 62 form::checkbox('daymode_active','1',$settings->daymode _active).67 form::checkbox('daymode_active','1',$settings->daymode->daymode_active). 63 68 __('Enable daily archives and calendar').'</label></p>'. 64 '</ fieldset>';69 '</div>'; 65 70 } 66 71 67 public static function adminBeforeBlogSettingsUpdate( &$settings)72 public static function adminBeforeBlogSettingsUpdate($settings) 68 73 { 69 $settings-> setNameSpace('daymode');74 $settings->addNameSpace('daymode'); 70 75 try { 71 $settings-> put('daymode_active',!empty($_POST['daymode_active']),'boolean');76 $settings->daymode->put('daymode_active',!empty($_POST['daymode_active']),'boolean'); 72 77 } 73 78 catch (Exception $e) { 74 $settings->d rop('daymode_active');75 $settings-> put('daymode_active',!empty($_POST['daymode_active']),'boolean');79 $settings->daymode->drop('daymode_active'); 80 $settings->daymode->put('daymode_active',!empty($_POST['daymode_active']),'boolean'); 76 81 } 77 $settings->setNameSpace('system');78 82 } 79 83 } 80 ?> -
plugins/dayMode/_public.php
r1468 r3347 4 4 # This file is part of dayMode, a plugin for Dotclear 2. 5 5 # 6 # Copyright (c) 2006-20 09Pep and contributors6 # Copyright (c) 2006-2010 Pep and contributors 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_RC_PATH')) { return; }12 if (!defined('DC_RC_PATH')) return; 13 13 14 14 require_once dirname(__FILE__).'/_widgets.php'; 15 15 16 if (!$core->blog->settings->daymode _active) {16 if (!$core->blog->settings->daymode->daymode_active) { 17 17 return; 18 18 } … … 59 59 if ($GLOBALS['_ctx']->exists("day")) { 60 60 $trg = 'day'; 61 $format = $GLOBALS['core']->blog->settings-> date_format;61 $format = $GLOBALS['core']->blog->settings->system->date_format; 62 62 } else { 63 63 $trg = 'archives'; … … 168 168 if ($_ctx->day->isEmpty()) { 169 169 self::p404(); 170 return;171 170 } 172 171 … … 176 175 parent::archive($args); 177 176 } 178 return;179 177 } 180 178 } 181 ?> -
plugins/dayMode/_widgets.php
r944 r3347 4 4 # This file is part of dayMode, a plugin for Dotclear 2. 5 5 # 6 # Copyright (c) 2006-20 09Pep and contributors6 # Copyright (c) 2006-2010 Pep and contributors 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_RC_PATH')) { return; }12 if (!defined('DC_RC_PATH')) return; 13 13 14 14 $core->addBehavior('initWidgets',array('widgetsDayMode','init')); … … 16 16 class widgetsDayMode 17 17 { 18 public static function calendar( &$w)18 public static function calendar($w) 19 19 { 20 20 global $core; 21 21 22 if (!$core->blog->settings->daymode _active) return;23 24 if ($w-> archiveonly && $core->url->type != 'archive') {22 if (!$core->blog->settings->daymode->daymode_active) return; 23 24 if ($w->offline) 25 25 return; 26 } 26 27 if (($w->homeonly == 1 && $core->url->type != 'default') || 28 ($w->homeonly == 2 && $core->url->type == 'default') || 29 ($w->homeonly == 3 && $core->url->type != 'archive')) 30 return; 27 31 28 32 $calendar = new dcCalendar($GLOBALS['core'], $GLOBALS['_ctx']); … … 30 34 31 35 $res = 32 '<div id="calendar">'. 33 ($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : ''). 34 $calendar->draw(). 35 '</div>'; 36 return $res; 36 ($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : ''). 37 $calendar->draw(); 38 39 return $w->renderDiv($w->content_only,'calendar '.$w->class,'',$res); 37 40 } 38 41 39 public static function init( &$w)42 public static function init($w) 40 43 { 41 $w->create('calendar',__('Calendar'),array('widgetsDayMode','calendar')); 44 $w->create('calendar',__('DayMode: calendar'),array('widgetsDayMode','calendar'), 45 null, 46 __('Tickets calendar')); 42 47 $w->calendar->setting('title',__('Title:'),__('Calendar')); 43 48 $w->calendar->setting( 44 49 'weekstart', 45 __(' Week start'),50 __('First day:'), 46 51 0, 47 52 'combo', … … 56 61 )) 57 62 ); 58 $w->calendar->setting('archiveonly',__('Archives only'),1,'check'); 63 $w->calendar->setting('homeonly',__('Display on:'),3,'combo', 64 array( 65 __('All pages') => 0, 66 __('Home page only') => 1, 67 __('Except on home page') => 2, 68 __('Archives only') => 3 69 ) 70 ); 71 $w->calendar->setting('content_only',__('Content only'),0,'check'); 72 $w->calendar->setting('class',__('CSS class:'),''); 73 $w->calendar->setting('offline',__('Offline'),0,'check'); 59 74 } 60 75 } 61 ?> -
plugins/dayMode/inc/class.dc.calendar.php
r1468 r3347 4 4 # This file is part of dayMode, a plugin for Dotclear 2. 5 5 # 6 # Copyright (c) 2006-20 09Pep and contributors6 # Copyright (c) 2006-2010 Pep and contributors 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 10 10 # 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 if (!defined('DC_RC_PATH')) {return;} 13 13 class dcCalendar 14 14 { … … 224 224 } 225 225 } 226 ?> -
plugins/dayMode/locales/fr/main.po
r953 r3347 5 5 "POT-Creation-Date: 2009-03-27 12:42+0100\n" 6 6 "PO-Revision-Date: \n" 7 "Last-Translator: Pep <pep@ callmepep.org>\n"7 "Last-Translator: Pep <pep@dotclear.net>\n" 8 8 "Language-Team: \n" 9 9 "MIME-Version: 1.0\n" … … 12 12 "X-Poedit-Language: French\n" 13 13 "X-Poedit-Country: FRANCE\n" 14 15 msgid "Provides daily archives and an associated calendar widget" 16 msgstr "Fournit des archives du jour et un widget calendrier associé" 14 17 15 18 #: _prepend.php:60 … … 20 23 msgid "Enable daily archives and calendar" 21 24 msgstr "Activer les archives journalières et le calendrier" 25 26 msgid "DayMode: calendar" 27 msgstr "DayMode : calendrier" 28 29 msgid "Tickets calendar" 30 msgstr "Calendrier des billets" 22 31 23 32 #: _widgets.php:41 … … 32 41 33 42 #: _widgets.php:45 34 msgid " Week start"35 msgstr " Début de semaine"43 msgid "First day:" 44 msgstr "Premier jour de la semaine :" 36 45 37 46 #: _widgets.php:49 38 47 msgid "Sunday" 39 msgstr " Dimanche"48 msgstr "dimanche" 40 49 41 50 #: _widgets.php:50 42 51 msgid "Monday" 43 msgstr " Lundi"52 msgstr "lundi" 44 53 45 54 #: _widgets.php:51 46 55 msgid "Tuesday" 47 msgstr " Mardi"56 msgstr "mardi" 48 57 49 58 #: _widgets.php:52 50 59 msgid "Wednesday" 51 msgstr " Mercredi"60 msgstr "mercredi" 52 61 53 62 #: _widgets.php:53 54 63 msgid "Thursday" 55 msgstr " Jeudi"64 msgstr "jeudi" 56 65 57 66 #: _widgets.php:54 58 67 msgid "Friday" 59 msgstr " Vendredi"68 msgstr "vendredi" 60 69 61 70 #: _widgets.php:55 62 71 msgid "Saturday" 63 msgstr " Samedi"72 msgstr "samedi" 64 73 65 74 #: _widgets.php:58 … … 72 81 msgid "Next day" 73 82 msgstr "Journée suivante" 74 75
Note: See TracChangeset
for help on using the changeset viewer.