Dotclear

Changeset 3347


Ignore:
Timestamp:
02/03/15 12:50:58 (9 years ago)
Author:
brol
Message:

voir changelog

Location:
plugins/dayMode
Files:
5 added
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • plugins/dayMode/_admin.php

    r946 r3347  
    44# This file is part of dayMode, a plugin for Dotclear 2. 
    55# 
    6 # Copyright (c) 2006-2009 Pep and contributors 
     6# Copyright (c) 2006-2010 Pep and contributors 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1010# 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    12 if (!defined('DC_CONTEXT_ADMIN')) { return; } 
     12if (!defined('DC_CONTEXT_ADMIN')) return; 
    1313 
    1414require_once dirname(__FILE__).'/_widgets.php'; 
     
    1616$core->addBehavior('adminBlogPreferencesForm',array('dayModeBehaviors','adminBlogPreferencesForm')); 
    1717$core->addBehavior('adminBeforeBlogSettingsUpdate',array('dayModeBehaviors','adminBeforeBlogSettingsUpdate')); 
    18 ?> 
  • plugins/dayMode/_define.php

    r1468 r3347  
    44# This file is part of dayMode, a plugin for Dotclear 2. 
    55# 
    6 # Copyright (c) 2006-2009 Pep and contributors 
     6# Copyright (c) 2006-2010 Pep and contributors 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1010# 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    12 if (!defined('DC_RC_PATH')) { return; } 
     12if (!defined('DC_RC_PATH')) return; 
    1313 
    1414$this->registerModule( 
    1515     /* Name */          "dayMode", 
    16      /* Description*/    "Provides daily archives and an associated calendar widget.", 
     16     /* Description*/    "Provides daily archives and an associated calendar widget", 
    1717     /* 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     ) 
    2027); 
    21 ?> 
  • plugins/dayMode/_install.php

    r940 r3347  
    44# This file is part of dayMode, a plugin for Dotclear 2. 
    55# 
    6 # Copyright (c) 2006-2009 Pep and contributors 
     6# Copyright (c) 2006-2010 Pep and contributors 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1010# 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    12 if (!defined('DC_CONTEXT_ADMIN')) exit; 
     12if (!defined('DC_CONTEXT_ADMIN')) return; 
    1313 
    1414$package_version = $core->plugins->moduleInfo('dayMode','version'); 
     
    1818} 
    1919 
    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); 
    2222$core->setVersion('dayMode',$package_version); 
    2323return true; 
    24 ?> 
  • plugins/dayMode/_prepend.php

    r1468 r3347  
    44# This file is part of dayMode, a plugin for Dotclear 2. 
    55# 
    6 # Copyright (c) 2006-2009 Pep and contributors 
     6# Copyright (c) 2006-2010 Pep and contributors 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1010# 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    12 if (!defined('DC_RC_PATH')) { return; } 
     12if (!defined('DC_RC_PATH')) return; 
    1313 
    1414$GLOBALS['__autoload']['dcCalendar'] = dirname(__FILE__).'/inc/class.dc.calendar.php'; 
     
    4949     } 
    5050 
    51      public static function addTplPath(&$core) 
     51     public static function addTplPath($core) 
    5252     { 
    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        } 
    5459     } 
    5560 
    5661     // Admin behaviors 
    57      public static function adminBlogPreferencesForm(&$core,&$settings) 
     62     public static function adminBlogPreferencesForm($core,$settings) 
    5863     { 
    5964          echo 
    60           '<fieldset><legend>'.__('Daily Archives').'</legend>'. 
     65          '<div class="fieldset"><h4>'.__('Daily Archives').'</h4>'. 
    6166          '<p><label class="classic">'. 
    62           form::checkbox('daymode_active','1',$settings->daymode_active). 
     67          form::checkbox('daymode_active','1',$settings->daymode->daymode_active). 
    6368          __('Enable daily archives and calendar').'</label></p>'. 
    64           '</fieldset>'; 
     69          '</div>'; 
    6570     } 
    6671      
    67      public static function adminBeforeBlogSettingsUpdate(&$settings) 
     72     public static function adminBeforeBlogSettingsUpdate($settings) 
    6873     { 
    69           $settings->setNameSpace('daymode'); 
     74          $settings->addNameSpace('daymode'); 
    7075          try { 
    71                $settings->put('daymode_active',!empty($_POST['daymode_active']),'boolean'); 
     76               $settings->daymode->put('daymode_active',!empty($_POST['daymode_active']),'boolean'); 
    7277          } 
    7378          catch (Exception $e) { 
    74                $settings->drop('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'); 
    7681          } 
    77           $settings->setNameSpace('system'); 
    7882     } 
    7983} 
    80 ?> 
  • plugins/dayMode/_public.php

    r1468 r3347  
    44# This file is part of dayMode, a plugin for Dotclear 2. 
    55# 
    6 # Copyright (c) 2006-2009 Pep and contributors 
     6# Copyright (c) 2006-2010 Pep and contributors 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1010# 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    12 if (!defined('DC_RC_PATH')) { return; } 
     12if (!defined('DC_RC_PATH')) return; 
    1313 
    1414require_once dirname(__FILE__).'/_widgets.php'; 
    1515 
    16 if (!$core->blog->settings->daymode_active) { 
     16if (!$core->blog->settings->daymode->daymode_active) { 
    1717     return; 
    1818} 
     
    5959          if ($GLOBALS['_ctx']->exists("day")) { 
    6060               $trg = 'day'; 
    61                $format = $GLOBALS['core']->blog->settings->date_format; 
     61               $format = $GLOBALS['core']->blog->settings->system->date_format; 
    6262          } else { 
    6363               $trg = 'archives'; 
     
    168168               if ($_ctx->day->isEmpty()) { 
    169169                    self::p404(); 
    170                     return; 
    171170               } 
    172171 
     
    176175               parent::archive($args); 
    177176          } 
    178           return; 
    179177     } 
    180178} 
    181 ?> 
  • plugins/dayMode/_widgets.php

    r944 r3347  
    44# This file is part of dayMode, a plugin for Dotclear 2. 
    55# 
    6 # Copyright (c) 2006-2009 Pep and contributors 
     6# Copyright (c) 2006-2010 Pep and contributors 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1010# 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    12 if (!defined('DC_RC_PATH')) { return; } 
     12if (!defined('DC_RC_PATH')) return; 
    1313 
    1414$core->addBehavior('initWidgets',array('widgetsDayMode','init')); 
     
    1616class widgetsDayMode 
    1717{ 
    18      public static function calendar(&$w) 
     18     public static function calendar($w) 
    1919     { 
    2020          global $core; 
    2121 
    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) 
    2525               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; 
    2731 
    2832          $calendar = new dcCalendar($GLOBALS['core'], $GLOBALS['_ctx']); 
     
    3034 
    3135          $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); 
    3740     } 
    3841 
    39      public static function init(&$w) 
     42     public static function init($w) 
    4043     { 
    41          $w->create('calendar',__('Calendar'),array('widgetsDayMode','calendar')); 
     44         $w->create('calendar',__('DayMode: calendar'),array('widgetsDayMode','calendar'), 
     45               null, 
     46               __('Tickets calendar')); 
    4247         $w->calendar->setting('title',__('Title:'),__('Calendar')); 
    4348         $w->calendar->setting( 
    4449          'weekstart', 
    45           __('Week start'), 
     50          __('First day:'), 
    4651          0, 
    4752          'combo', 
     
    5661          )) 
    5762         ); 
    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'); 
    5974     } 
    6075} 
    61 ?> 
  • plugins/dayMode/inc/class.dc.calendar.php

    r1468 r3347  
    44# This file is part of dayMode, a plugin for Dotclear 2. 
    55# 
    6 # Copyright (c) 2006-2009 Pep and contributors 
     6# Copyright (c) 2006-2010 Pep and contributors 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1010# 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    12  
     12if (!defined('DC_RC_PATH')) {return;} 
    1313class dcCalendar 
    1414{ 
     
    224224     } 
    225225} 
    226 ?> 
  • plugins/dayMode/locales/fr/main.po

    r953 r3347  
    55"POT-Creation-Date: 2009-03-27 12:42+0100\n" 
    66"PO-Revision-Date: \n" 
    7 "Last-Translator: Pep <pep@callmepep.org>\n" 
     7"Last-Translator: Pep <pep@dotclear.net>\n" 
    88"Language-Team: \n" 
    99"MIME-Version: 1.0\n" 
     
    1212"X-Poedit-Language: French\n" 
    1313"X-Poedit-Country: FRANCE\n" 
     14 
     15msgid "Provides daily archives and an associated calendar widget" 
     16msgstr "Fournit des archives du jour et un widget calendrier associé" 
    1417 
    1518#: _prepend.php:60 
     
    2023msgid "Enable daily archives and calendar" 
    2124msgstr "Activer les archives journalières et le calendrier" 
     25 
     26msgid "DayMode: calendar" 
     27msgstr "DayMode : calendrier" 
     28 
     29msgid "Tickets calendar" 
     30msgstr "Calendrier des billets" 
    2231 
    2332#: _widgets.php:41 
     
    3241 
    3342#: _widgets.php:45 
    34 msgid "Week start" 
    35 msgstr "Début de semaine" 
     43msgid "First day:" 
     44msgstr "Premier jour de la semaine :" 
    3645 
    3746#: _widgets.php:49 
    3847msgid "Sunday" 
    39 msgstr "Dimanche" 
     48msgstr "dimanche" 
    4049 
    4150#: _widgets.php:50 
    4251msgid "Monday" 
    43 msgstr "Lundi" 
     52msgstr "lundi" 
    4453 
    4554#: _widgets.php:51 
    4655msgid "Tuesday" 
    47 msgstr "Mardi" 
     56msgstr "mardi" 
    4857 
    4958#: _widgets.php:52 
    5059msgid "Wednesday" 
    51 msgstr "Mercredi" 
     60msgstr "mercredi" 
    5261 
    5362#: _widgets.php:53 
    5463msgid "Thursday" 
    55 msgstr "Jeudi" 
     64msgstr "jeudi" 
    5665 
    5766#: _widgets.php:54 
    5867msgid "Friday" 
    59 msgstr "Vendredi" 
     68msgstr "vendredi" 
    6069 
    6170#: _widgets.php:55 
    6271msgid "Saturday" 
    63 msgstr "Samedi" 
     72msgstr "samedi" 
    6473 
    6574#: _widgets.php:58 
     
    7281msgid "Next day" 
    7382msgstr "Journée suivante" 
    74  
    75  
Note: See TracChangeset for help on using the changeset viewer.

Sites map