[0] | 1 | <?php |
---|
| 2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
| 3 | # |
---|
| 4 | # This file is part of Dotclear 2. |
---|
| 5 | # |
---|
[270] | 6 | # Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear |
---|
[0] | 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 | |
---|
[954] | 20 | $__widgets->create('search',__('Search engine'),array('defaultWidgets','search'),null,'Search engine form'); |
---|
[0] | 21 | $__widgets->search->setting('title',__('Title:'),__('Search')); |
---|
[945] | 22 | $__widgets->search->setting('homeonly',__('Display on:'),0,'combo', |
---|
| 23 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[1063] | 24 | $__widgets->search->setting('content_only',__('Content only'),0,'check'); |
---|
[904] | 25 | $__widgets->search->setting('class',__('CSS class:'),''); |
---|
[0] | 26 | |
---|
[954] | 27 | $__widgets->create('navigation',__('Navigation links'),array('defaultWidgets','navigation'),null,'List of navigation links'); |
---|
[0] | 28 | $__widgets->navigation->setting('title',__('Title:'),''); |
---|
[945] | 29 | $__widgets->navigation->setting('homeonly',__('Display on:'),0,'combo', |
---|
| 30 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[1063] | 31 | $__widgets->navigation->setting('content_only',__('Content only'),0,'check'); |
---|
[904] | 32 | $__widgets->navigation->setting('class',__('CSS class:'),''); |
---|
[0] | 33 | |
---|
[954] | 34 | $__widgets->create('bestof',__('Selected entries'),array('defaultWidgets','bestof'),null,'List of selected entries'); |
---|
[0] | 35 | $__widgets->bestof->setting('title',__('Title:'),__('Best of me')); |
---|
| 36 | $__widgets->bestof->setting('orderby',__('Sort:'),'asc','combo',array(__('Ascending') => 'asc', __('Descending') => 'desc')); |
---|
[945] | 37 | $__widgets->bestof->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 38 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[1063] | 39 | $__widgets->bestof->setting('content_only',__('Content only'),0,'check'); |
---|
[904] | 40 | $__widgets->bestof->setting('class',__('CSS class:'),''); |
---|
[0] | 41 | |
---|
[954] | 42 | $__widgets->create('langs',__('Blog languages'),array('defaultWidgets','langs'),null,'List of available languages'); |
---|
[0] | 43 | $__widgets->langs->setting('title',__('Title:'),__('Languages')); |
---|
[945] | 44 | $__widgets->langs->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 45 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[1063] | 46 | $__widgets->langs->setting('content_only',__('Content only'),0,'check'); |
---|
[904] | 47 | $__widgets->langs->setting('class',__('CSS class:'),''); |
---|
[0] | 48 | |
---|
| 49 | |
---|
[954] | 50 | $__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe'),null,'RSS or Atom feed subscription links'); |
---|
[0] | 51 | $__widgets->subscribe->setting('title',__('Title:'),__('Subscribe')); |
---|
| 52 | $__widgets->subscribe->setting('type',__('Feeds type:'),'atom','combo',array('Atom' => 'atom', 'RSS' => 'rss2')); |
---|
[945] | 53 | $__widgets->subscribe->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 54 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[1063] | 55 | $__widgets->subscribe->setting('content_only',__('Content only'),0,'check'); |
---|
[904] | 56 | $__widgets->subscribe->setting('class',__('CSS class:'),''); |
---|
[0] | 57 | |
---|
[954] | 58 | $__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed'),null,'Last entries from feed'); |
---|
[0] | 59 | $__widgets->feed->setting('title',__('Title:'),__('Somewhere else')); |
---|
| 60 | $__widgets->feed->setting('url',__('Feed URL:'),''); |
---|
| 61 | $__widgets->feed->setting('limit',__('Entries limit:'),10); |
---|
[945] | 62 | $__widgets->feed->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 63 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[1063] | 64 | $__widgets->feed->setting('content_only',__('Content only'),0,'check'); |
---|
[904] | 65 | $__widgets->feed->setting('class',__('CSS class:'),''); |
---|
[0] | 66 | |
---|
[954] | 67 | $__widgets->create('text',__('Text'),array('defaultWidgets','text'),null,'Simple text'); |
---|
[0] | 68 | $__widgets->text->setting('title',__('Title:'),''); |
---|
| 69 | $__widgets->text->setting('text',__('Text:'),'','textarea'); |
---|
[945] | 70 | $__widgets->text->setting('homeonly',__('Display on:'),0,'combo', |
---|
| 71 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[1063] | 72 | $__widgets->text->setting('content_only',__('Content only'),0,'check'); |
---|
[904] | 73 | $__widgets->text->setting('class',__('CSS class:'),''); |
---|
[0] | 74 | |
---|
[954] | 75 | $__widgets->create('lastposts',__('Last entries'),array('defaultWidgets','lastposts'),null,'List of last entries published'); |
---|
[0] | 76 | $__widgets->lastposts->setting('title',__('Title:'),__('Last entries')); |
---|
| 77 | if ($core->plugins->moduleExists('tags')) { |
---|
| 78 | $__widgets->lastposts->setting('tag',__('Tag:'),''); |
---|
| 79 | } |
---|
| 80 | $__widgets->lastposts->setting('limit',__('Entries limit:'),10); |
---|
[945] | 81 | $__widgets->lastposts->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 82 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[1063] | 83 | $__widgets->lastposts->setting('content_only',__('Content only'),0,'check'); |
---|
[904] | 84 | $__widgets->lastposts->setting('class',__('CSS class:'),''); |
---|
[0] | 85 | |
---|
| 86 | |
---|
| 87 | # --BEHAVIOR-- initWidgets |
---|
| 88 | $core->callBehavior('initWidgets',$__widgets); |
---|
| 89 | |
---|
| 90 | # Default widgets |
---|
| 91 | global $__default_widgets; |
---|
[665] | 92 | $__default_widgets = array('nav'=> new dcWidgets(), 'extra'=> new dcWidgets(), 'custom'=> new dcWidgets()); |
---|
[0] | 93 | |
---|
| 94 | $__default_widgets['nav']->append($__widgets->search); |
---|
| 95 | $__default_widgets['nav']->append($__widgets->navigation); |
---|
| 96 | $__default_widgets['nav']->append($__widgets->bestof); |
---|
| 97 | $__default_widgets['extra']->append($__widgets->subscribe); |
---|
| 98 | |
---|
| 99 | # --BEHAVIOR-- initDefaultWidgets |
---|
| 100 | $core->callBehavior('initDefaultWidgets',$__widgets,$__default_widgets); |
---|
| 101 | ?> |
---|