[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)); |
---|
[904] | 24 | $__widgets->search->setting('class',__('CSS class:'),''); |
---|
[0] | 25 | |
---|
[954] | 26 | $__widgets->create('navigation',__('Navigation links'),array('defaultWidgets','navigation'),null,'List of navigation links'); |
---|
[0] | 27 | $__widgets->navigation->setting('title',__('Title:'),''); |
---|
[945] | 28 | $__widgets->navigation->setting('homeonly',__('Display on:'),0,'combo', |
---|
| 29 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[904] | 30 | $__widgets->navigation->setting('class',__('CSS class:'),''); |
---|
[0] | 31 | |
---|
[954] | 32 | $__widgets->create('bestof',__('Selected entries'),array('defaultWidgets','bestof'),null,'List of selected entries'); |
---|
[0] | 33 | $__widgets->bestof->setting('title',__('Title:'),__('Best of me')); |
---|
| 34 | $__widgets->bestof->setting('orderby',__('Sort:'),'asc','combo',array(__('Ascending') => 'asc', __('Descending') => 'desc')); |
---|
[945] | 35 | $__widgets->bestof->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 36 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[904] | 37 | $__widgets->bestof->setting('class',__('CSS class:'),''); |
---|
[0] | 38 | |
---|
[954] | 39 | $__widgets->create('langs',__('Blog languages'),array('defaultWidgets','langs'),null,'List of available languages'); |
---|
[0] | 40 | $__widgets->langs->setting('title',__('Title:'),__('Languages')); |
---|
[945] | 41 | $__widgets->langs->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 42 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[904] | 43 | $__widgets->langs->setting('class',__('CSS class:'),''); |
---|
[0] | 44 | |
---|
[954] | 45 | $__widgets->create('categories',__('Categories list'),array('defaultWidgets','categories'),null,'List of categories'); |
---|
[0] | 46 | $__widgets->categories->setting('title',__('Title:'),__('Categories')); |
---|
| 47 | $__widgets->categories->setting('postcount',__('With entries counts'),0,'check'); |
---|
[945] | 48 | $__widgets->categories->setting('homeonly',__('Display on:'),0,'combo', |
---|
| 49 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[904] | 50 | $__widgets->categories->setting('class',__('CSS class:'),''); |
---|
[0] | 51 | |
---|
[954] | 52 | $__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe'),null,'RSS or Atom feed subscription links'); |
---|
[0] | 53 | $__widgets->subscribe->setting('title',__('Title:'),__('Subscribe')); |
---|
| 54 | $__widgets->subscribe->setting('type',__('Feeds type:'),'atom','combo',array('Atom' => 'atom', 'RSS' => 'rss2')); |
---|
[945] | 55 | $__widgets->subscribe->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 56 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[904] | 57 | $__widgets->subscribe->setting('class',__('CSS class:'),''); |
---|
[0] | 58 | |
---|
[954] | 59 | $__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed'),null,'Last entries from feed'); |
---|
[0] | 60 | $__widgets->feed->setting('title',__('Title:'),__('Somewhere else')); |
---|
| 61 | $__widgets->feed->setting('url',__('Feed URL:'),''); |
---|
| 62 | $__widgets->feed->setting('limit',__('Entries limit:'),10); |
---|
[945] | 63 | $__widgets->feed->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 64 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[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)); |
---|
[904] | 72 | $__widgets->text->setting('class',__('CSS class:'),''); |
---|
[0] | 73 | |
---|
[954] | 74 | $__widgets->create('lastposts',__('Last entries'),array('defaultWidgets','lastposts'),null,'List of last entries published'); |
---|
[0] | 75 | $__widgets->lastposts->setting('title',__('Title:'),__('Last entries')); |
---|
| 76 | $rs = $core->blog->getCategories(array('post_type'=>'post')); |
---|
| 77 | $categories = array('' => '', __('Uncategorized') => 'null'); |
---|
| 78 | while ($rs->fetch()) { |
---|
[252] | 79 | $categories[str_repeat(' ',$rs->level-1).($rs->level-1 == 0 ? '' : '• ').html::escapeHTML($rs->cat_title)] = $rs->cat_id; |
---|
[0] | 80 | } |
---|
| 81 | $__widgets->lastposts->setting('category',__('Category:'),'','combo',$categories); |
---|
| 82 | unset($rs,$categories); |
---|
| 83 | if ($core->plugins->moduleExists('tags')) { |
---|
| 84 | $__widgets->lastposts->setting('tag',__('Tag:'),''); |
---|
| 85 | } |
---|
| 86 | $__widgets->lastposts->setting('limit',__('Entries limit:'),10); |
---|
[945] | 87 | $__widgets->lastposts->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 88 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[904] | 89 | $__widgets->lastposts->setting('class',__('CSS class:'),''); |
---|
[0] | 90 | |
---|
[954] | 91 | $__widgets->create('lastcomments',__('Last comments'),array('defaultWidgets','lastcomments'),null,'List of last comments posted'); |
---|
[0] | 92 | $__widgets->lastcomments->setting('title',__('Title:'),__('Last comments')); |
---|
| 93 | $__widgets->lastcomments->setting('limit',__('Comments limit:'),10); |
---|
[945] | 94 | $__widgets->lastcomments->setting('homeonly',__('Display on:'),1,'combo', |
---|
| 95 | array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); |
---|
[904] | 96 | $__widgets->lastcomments->setting('class',__('CSS class:'),''); |
---|
[0] | 97 | |
---|
| 98 | # --BEHAVIOR-- initWidgets |
---|
| 99 | $core->callBehavior('initWidgets',$__widgets); |
---|
| 100 | |
---|
| 101 | # Default widgets |
---|
| 102 | global $__default_widgets; |
---|
[665] | 103 | $__default_widgets = array('nav'=> new dcWidgets(), 'extra'=> new dcWidgets(), 'custom'=> new dcWidgets()); |
---|
[0] | 104 | |
---|
| 105 | $__default_widgets['nav']->append($__widgets->search); |
---|
| 106 | $__default_widgets['nav']->append($__widgets->navigation); |
---|
| 107 | $__default_widgets['nav']->append($__widgets->bestof); |
---|
| 108 | $__default_widgets['nav']->append($__widgets->categories); |
---|
| 109 | $__default_widgets['extra']->append($__widgets->subscribe); |
---|
| 110 | |
---|
| 111 | # --BEHAVIOR-- initDefaultWidgets |
---|
| 112 | $core->callBehavior('initDefaultWidgets',$__widgets,$__default_widgets); |
---|
| 113 | ?> |
---|