[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 | |
---|
| 20 | $__widgets->create('search',__('Search engine'),array('defaultWidgets','search')); |
---|
| 21 | $__widgets->search->setting('title',__('Title:'),__('Search')); |
---|
| 22 | |
---|
| 23 | $__widgets->create('navigation',__('Navigation links'),array('defaultWidgets','navigation')); |
---|
| 24 | $__widgets->navigation->setting('title',__('Title:'),''); |
---|
| 25 | |
---|
| 26 | $__widgets->create('bestof',__('Selected entries'),array('defaultWidgets','bestof')); |
---|
| 27 | $__widgets->bestof->setting('title',__('Title:'),__('Best of me')); |
---|
| 28 | $__widgets->bestof->setting('orderby',__('Sort:'),'asc','combo',array(__('Ascending') => 'asc', __('Descending') => 'desc')); |
---|
| 29 | $__widgets->bestof->setting('homeonly',__('Home page only'),1,'check'); |
---|
| 30 | |
---|
| 31 | $__widgets->create('langs',__('Blog languages'),array('defaultWidgets','langs')); |
---|
| 32 | $__widgets->langs->setting('title',__('Title:'),__('Languages')); |
---|
| 33 | $__widgets->langs->setting('homeonly',__('Home page only'),1,'check'); |
---|
| 34 | |
---|
| 35 | $__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe')); |
---|
| 36 | $__widgets->subscribe->setting('title',__('Title:'),__('Subscribe')); |
---|
| 37 | $__widgets->subscribe->setting('type',__('Feeds type:'),'atom','combo',array('Atom' => 'atom', 'RSS' => 'rss2')); |
---|
| 38 | $__widgets->subscribe->setting('homeonly',__('Home page only'),0,'check'); |
---|
| 39 | |
---|
| 40 | $__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed')); |
---|
| 41 | $__widgets->feed->setting('title',__('Title:'),__('Somewhere else')); |
---|
| 42 | $__widgets->feed->setting('url',__('Feed URL:'),''); |
---|
| 43 | $__widgets->feed->setting('limit',__('Entries limit:'),10); |
---|
| 44 | $__widgets->feed->setting('homeonly',__('Home page only'),1,'check'); |
---|
| 45 | |
---|
| 46 | $__widgets->create('text',__('Text'),array('defaultWidgets','text')); |
---|
| 47 | $__widgets->text->setting('title',__('Title:'),''); |
---|
| 48 | $__widgets->text->setting('text',__('Text:'),'','textarea'); |
---|
| 49 | $__widgets->text->setting('homeonly',__('Home page only'),0,'check'); |
---|
| 50 | |
---|
| 51 | $__widgets->create('lastposts',__('Last entries'),array('defaultWidgets','lastposts')); |
---|
| 52 | $__widgets->lastposts->setting('title',__('Title:'),__('Last entries')); |
---|
| 53 | if ($core->plugins->moduleExists('tags')) { |
---|
| 54 | $__widgets->lastposts->setting('tag',__('Tag:'),''); |
---|
| 55 | } |
---|
| 56 | $__widgets->lastposts->setting('limit',__('Entries limit:'),10); |
---|
| 57 | $__widgets->lastposts->setting('homeonly',__('Home page only'),1,'check'); |
---|
| 58 | |
---|
| 59 | |
---|
| 60 | $__widgets->create('lastcomments',__('Last comments'),array('defaultWidgets','lastcomments')); |
---|
| 61 | $__widgets->lastcomments->setting('title',__('Title:'),__('Last comments')); |
---|
| 62 | $__widgets->lastcomments->setting('limit',__('Comments limit:'),10); |
---|
| 63 | $__widgets->lastcomments->setting('homeonly',__('Home page only'),1,'check'); |
---|
| 64 | |
---|
| 65 | # --BEHAVIOR-- initWidgets |
---|
| 66 | $core->callBehavior('initWidgets',$__widgets); |
---|
| 67 | |
---|
| 68 | # Default widgets |
---|
| 69 | global $__default_widgets; |
---|
[665] | 70 | $__default_widgets = array('nav'=> new dcWidgets(), 'extra'=> new dcWidgets(), 'custom'=> new dcWidgets()); |
---|
[0] | 71 | |
---|
| 72 | $__default_widgets['nav']->append($__widgets->search); |
---|
| 73 | $__default_widgets['nav']->append($__widgets->navigation); |
---|
| 74 | $__default_widgets['nav']->append($__widgets->bestof); |
---|
| 75 | $__default_widgets['extra']->append($__widgets->subscribe); |
---|
| 76 | |
---|
| 77 | # --BEHAVIOR-- initDefaultWidgets |
---|
| 78 | $core->callBehavior('initDefaultWidgets',$__widgets,$__default_widgets); |
---|
| 79 | ?> |
---|