1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
3 | # |
---|
4 | # This file is part of Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear |
---|
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 | require dirname(__FILE__).'/class.widgets.php'; |
---|
15 | |
---|
16 | # Available widgets |
---|
17 | global $__widgets; |
---|
18 | $__widgets = new dcWidgets; |
---|
19 | |
---|
20 | $__widgets->create('search',__('Search engine'),array('defaultWidgets','search'),null,'Search engine form'); |
---|
21 | $__widgets->search->setting('title',__('Title:'),__('Search')); |
---|
22 | $__widgets->search->setting('homeonly',__('Display on:'),0,'combo', |
---|
23 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
24 | $__widgets->search->setting('content_only',__('Content only'),0,'check'); |
---|
25 | $__widgets->search->setting('class',__('CSS class:'),''); |
---|
26 | |
---|
27 | $__widgets->create('navigation',__('Navigation links'),array('defaultWidgets','navigation'),null,'List of navigation links'); |
---|
28 | $__widgets->navigation->setting('title',__('Title:'),''); |
---|
29 | $__widgets->navigation->setting('homeonly',__('Display on:'),0,'combo', |
---|
30 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
31 | $__widgets->navigation->setting('content_only',__('Content only'),0,'check'); |
---|
32 | $__widgets->navigation->setting('class',__('CSS class:'),''); |
---|
33 | |
---|
34 | $__widgets->create('bestof',__('Selected entries'),array('defaultWidgets','bestof'),null,'List of selected entries'); |
---|
35 | $__widgets->bestof->setting('title',__('Title:'),__('Best of me')); |
---|
36 | $__widgets->bestof->setting('orderby',__('Sort:'),'asc','combo',array(__('Ascending') => 'asc', __('Descending') => 'desc')); |
---|
37 | $__widgets->bestof->setting('homeonly',__('Display on:'),1,'combo', |
---|
38 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
39 | $__widgets->bestof->setting('content_only',__('Content only'),0,'check'); |
---|
40 | $__widgets->bestof->setting('class',__('CSS class:'),''); |
---|
41 | |
---|
42 | $__widgets->create('langs',__('Blog languages'),array('defaultWidgets','langs'),null,'List of available languages'); |
---|
43 | $__widgets->langs->setting('title',__('Title:'),__('Languages')); |
---|
44 | $__widgets->langs->setting('homeonly',__('Display on:'),1,'combo', |
---|
45 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
46 | $__widgets->langs->setting('content_only',__('Content only'),0,'check'); |
---|
47 | $__widgets->langs->setting('class',__('CSS class:'),''); |
---|
48 | |
---|
49 | $__widgets->create('categories',__('Categories list'),array('defaultWidgets','categories'),null,'List of categories'); |
---|
50 | $__widgets->categories->setting('title',__('Title:'),__('Categories')); |
---|
51 | $__widgets->categories->setting('postcount',__('With entries counts'),0,'check'); |
---|
52 | $__widgets->categories->setting('homeonly',__('Display on:'),0,'combo', |
---|
53 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
54 | $__widgets->categories->setting('content_only',__('Content only'),0,'check'); |
---|
55 | $__widgets->categories->setting('class',__('CSS class:'),''); |
---|
56 | |
---|
57 | $__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe'),null,'RSS or Atom feed subscription links'); |
---|
58 | $__widgets->subscribe->setting('title',__('Title:'),__('Subscribe')); |
---|
59 | $__widgets->subscribe->setting('type',__('Feeds type:'),'atom','combo',array('Atom' => 'atom', 'RSS' => 'rss2')); |
---|
60 | $__widgets->subscribe->setting('homeonly',__('Display on:'),1,'combo', |
---|
61 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
62 | $__widgets->subscribe->setting('content_only',__('Content only'),0,'check'); |
---|
63 | $__widgets->subscribe->setting('class',__('CSS class:'),''); |
---|
64 | |
---|
65 | $__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed'),null,'Last entries from feed'); |
---|
66 | $__widgets->feed->setting('title',__('Title:'),__('Somewhere else')); |
---|
67 | $__widgets->feed->setting('url',__('Feed URL:'),''); |
---|
68 | $__widgets->feed->setting('limit',__('Entries limit:'),10); |
---|
69 | $__widgets->feed->setting('homeonly',__('Display on:'),1,'combo', |
---|
70 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
71 | $__widgets->feed->setting('content_only',__('Content only'),0,'check'); |
---|
72 | $__widgets->feed->setting('class',__('CSS class:'),''); |
---|
73 | |
---|
74 | $__widgets->create('text',__('Text'),array('defaultWidgets','text'),null,'Simple text'); |
---|
75 | $__widgets->text->setting('title',__('Title:'),''); |
---|
76 | $__widgets->text->setting('text',__('Text:'),'','textarea'); |
---|
77 | $__widgets->text->setting('homeonly',__('Display on:'),0,'combo', |
---|
78 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
79 | $__widgets->text->setting('content_only',__('Content only'),0,'check'); |
---|
80 | $__widgets->text->setting('class',__('CSS class:'),''); |
---|
81 | |
---|
82 | $__widgets->create('lastposts',__('Last entries'),array('defaultWidgets','lastposts'),null,'List of last entries published'); |
---|
83 | $__widgets->lastposts->setting('title',__('Title:'),__('Last entries')); |
---|
84 | $rs = $core->blog->getCategories(array('post_type'=>'post')); |
---|
85 | $categories = array('' => '', __('Uncategorized') => 'null'); |
---|
86 | while ($rs->fetch()) { |
---|
87 | $categories[str_repeat(' ',$rs->level-1).($rs->level-1 == 0 ? '' : '• ').html::escapeHTML($rs->cat_title)] = $rs->cat_id; |
---|
88 | } |
---|
89 | $__widgets->lastposts->setting('category',__('Category:'),'','combo',$categories); |
---|
90 | unset($rs,$categories); |
---|
91 | if ($core->plugins->moduleExists('tags')) { |
---|
92 | $__widgets->lastposts->setting('tag',__('Tag:'),''); |
---|
93 | } |
---|
94 | $__widgets->lastposts->setting('limit',__('Entries limit:'),10); |
---|
95 | $__widgets->lastposts->setting('homeonly',__('Display on:'),1,'combo', |
---|
96 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
97 | $__widgets->lastposts->setting('content_only',__('Content only'),0,'check'); |
---|
98 | $__widgets->lastposts->setting('class',__('CSS class:'),''); |
---|
99 | |
---|
100 | $__widgets->create('lastcomments',__('Last comments'),array('defaultWidgets','lastcomments'),null,'List of last comments posted'); |
---|
101 | $__widgets->lastcomments->setting('title',__('Title:'),__('Last comments')); |
---|
102 | $__widgets->lastcomments->setting('limit',__('Comments limit:'),10); |
---|
103 | $__widgets->lastcomments->setting('homeonly',__('Display on:'),1,'combo', |
---|
104 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
105 | $__widgets->lastcomments->setting('content_only',__('Content only'),0,'check'); |
---|
106 | $__widgets->lastcomments->setting('class',__('CSS class:'),''); |
---|
107 | |
---|
108 | # --BEHAVIOR-- initWidgets |
---|
109 | $core->callBehavior('initWidgets',$__widgets); |
---|
110 | |
---|
111 | # Default widgets |
---|
112 | global $__default_widgets; |
---|
113 | $__default_widgets = array('nav'=> new dcWidgets(), 'extra'=> new dcWidgets(), 'custom'=> new dcWidgets()); |
---|
114 | |
---|
115 | $__default_widgets['nav']->append($__widgets->search); |
---|
116 | $__default_widgets['nav']->append($__widgets->navigation); |
---|
117 | $__default_widgets['nav']->append($__widgets->bestof); |
---|
118 | $__default_widgets['nav']->append($__widgets->categories); |
---|
119 | $__default_widgets['extra']->append($__widgets->subscribe); |
---|
120 | |
---|
121 | # --BEHAVIOR-- initDefaultWidgets |
---|
122 | $core->callBehavior('initDefaultWidgets',$__widgets,$__default_widgets); |
---|
123 | ?> |
---|