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