Revision 944,
1.5 KB
checked in by pep, 15 years ago
(diff) |
dayMode : Modification des blocs de licence (closes #118)
|
Line | |
---|
1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK ---------------------------------- |
---|
3 | # |
---|
4 | # This file is part of dayMode, a plugin for Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2006-2009 Pep and contributors |
---|
7 | # Licensed under the GPL version 2.0 license. |
---|
8 | # See LICENSE file or |
---|
9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
10 | # |
---|
11 | # -- END LICENSE BLOCK ------------------------------------ |
---|
12 | if (!defined('DC_RC_PATH')) { return; } |
---|
13 | |
---|
14 | $core->addBehavior('initWidgets',array('widgetsDayMode','init')); |
---|
15 | |
---|
16 | class widgetsDayMode |
---|
17 | { |
---|
18 | public static function calendar(&$w) |
---|
19 | { |
---|
20 | global $core; |
---|
21 | |
---|
22 | if (!$core->blog->settings->daymode_active) return; |
---|
23 | |
---|
24 | if ($w->archiveonly && $core->url->type != 'archive') { |
---|
25 | return; |
---|
26 | } |
---|
27 | |
---|
28 | $calendar = new dcCalendar($GLOBALS['core'], $GLOBALS['_ctx']); |
---|
29 | $calendar->weekstart = $w->weekstart; |
---|
30 | |
---|
31 | $res = |
---|
32 | '<div id="calendar">'. |
---|
33 | ($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : ''). |
---|
34 | $calendar->draw(). |
---|
35 | '</div>'; |
---|
36 | return $res; |
---|
37 | } |
---|
38 | |
---|
39 | public static function init(&$w) |
---|
40 | { |
---|
41 | $w->create('calendar',__('Calendar'),array('widgetsDayMode','calendar')); |
---|
42 | $w->calendar->setting('title',__('Title:'),__('Calendar')); |
---|
43 | $w->calendar->setting( |
---|
44 | 'weekstart', |
---|
45 | __('Week start'), |
---|
46 | 0, |
---|
47 | 'combo', |
---|
48 | array_flip(array( |
---|
49 | __('Sunday'), |
---|
50 | __('Monday'), |
---|
51 | __('Tuesday'), |
---|
52 | __('Wednesday'), |
---|
53 | __('Thursday'), |
---|
54 | __('Friday'), |
---|
55 | __('Saturday') |
---|
56 | )) |
---|
57 | ); |
---|
58 | $w->calendar->setting('archiveonly',__('Archives only'),1,'check'); |
---|
59 | } |
---|
60 | } |
---|
61 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.