Dotclear

source: plugins/widgets/_default_widgets.php @ 2412:9aa048292cca

Revision 2412:9aa048292cca, 7.3 KB checked in by Lepeltier kévin <kevin@…>, 12 years ago (diff)

widgets : On enlève advanced settings

RevLine 
[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 -----------------------------------------
12if (!defined('DC_RC_PATH')) { return; }
13
14require dirname(__FILE__).'/class.widgets.php';
15
16# Available widgets
17global $__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:'),'');
[0]26
[954]27$__widgets->create('navigation',__('Navigation links'),array('defaultWidgets','navigation'),null,'List of navigation links');
[2397]28$__widgets->navigation->setting('title',__('Title (optional)').' :','');
[945]29$__widgets->navigation->setting('homeonly',__('Display on:'),0,'combo',
30     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2));
[2412]31$__widgets->navigation->setting('content_only',__('Content only'),0,'check');
32$__widgets->navigation->setting('class',__('CSS class:'),'');
[0]33
[954]34$__widgets->create('bestof',__('Selected entries'),array('defaultWidgets','bestof'),null,'List of selected entries');
[2397]35$__widgets->bestof->setting('title',__('Title (optional)').' :',__('Best of me'));
[0]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));
[2412]39$__widgets->bestof->setting('content_only',__('Content only'),0,'check');
40$__widgets->bestof->setting('class',__('CSS class:'),'');
[0]41
[954]42$__widgets->create('langs',__('Blog languages'),array('defaultWidgets','langs'),null,'List of available languages');
[2397]43$__widgets->langs->setting('title',__('Title (optional)').' :',__('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));
[2412]46$__widgets->langs->setting('content_only',__('Content only'),0,'check');
47$__widgets->langs->setting('class',__('CSS class:'),'');
[0]48
[2409]49$__widgets->create('categories',__('List of categories'),array('defaultWidgets','categories'),null,'List of categories');
[2397]50$__widgets->categories->setting('title',__('Title (optional)').' :',__('Categories'));
[0]51$__widgets->categories->setting('postcount',__('With entries counts'),0,'check');
[2198]52$__widgets->categories->setting('subcatscount', __('Include sub cats in count'), false, 'check');
[1610]53$__widgets->categories->setting('with_empty',__('Include empty categories'),0,'check');
[945]54$__widgets->categories->setting('homeonly',__('Display on:'),0,'combo',
55     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2));
[2412]56$__widgets->categories->setting('content_only',__('Content only'),0,'check');
57$__widgets->categories->setting('class',__('CSS class:'),'');
[0]58
[2402]59$__widgets->create('subscribe',__('Subscribe links'),array('defaultWidgets','subscribe'),null,'Feed subscription links (RSS or Atom)');
[2397]60$__widgets->subscribe->setting('title',__('Title (optional)').' :',__('Subscribe'));
[0]61$__widgets->subscribe->setting('type',__('Feeds type:'),'atom','combo',array('Atom' => 'atom', 'RSS' => 'rss2'));
[945]62$__widgets->subscribe->setting('homeonly',__('Display on:'),1,'combo',
63     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2));
[2412]64$__widgets->subscribe->setting('content_only',__('Content only'),0,'check');
65$__widgets->subscribe->setting('class',__('CSS class:'),'');
[0]66
[2402]67$__widgets->create('feed',__('Feed reader'),array('defaultWidgets','feed'),null,'List of last entries from feed (RSS or Atom)');
[2397]68$__widgets->feed->setting('title',__('Title (optional)').' :',__('Somewhere else'));
[0]69$__widgets->feed->setting('url',__('Feed URL:'),'');
70$__widgets->feed->setting('limit',__('Entries limit:'),10);
[945]71$__widgets->feed->setting('homeonly',__('Display on:'),1,'combo',
72     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2));
[2412]73$__widgets->feed->setting('content_only',__('Content only'),0,'check');
74$__widgets->feed->setting('class',__('CSS class:'),'');
[0]75
[954]76$__widgets->create('text',__('Text'),array('defaultWidgets','text'),null,'Simple text');
[2397]77$__widgets->text->setting('title',__('Title (optional)').' :','');
[0]78$__widgets->text->setting('text',__('Text:'),'','textarea');
[945]79$__widgets->text->setting('homeonly',__('Display on:'),0,'combo',
80     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2));
[2412]81$__widgets->text->setting('content_only',__('Content only'),0,'check');
82$__widgets->text->setting('class',__('CSS class:'),'');
[0]83
[954]84$__widgets->create('lastposts',__('Last entries'),array('defaultWidgets','lastposts'),null,'List of last entries published');
[2397]85$__widgets->lastposts->setting('title',__('Title (optional)').' :',__('Last entries'));
[0]86$rs = $core->blog->getCategories(array('post_type'=>'post'));
87$categories = array('' => '', __('Uncategorized') => 'null');
88while ($rs->fetch()) {
[252]89     $categories[str_repeat('&nbsp;&nbsp;',$rs->level-1).($rs->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($rs->cat_title)] = $rs->cat_id;
[0]90}
91$__widgets->lastposts->setting('category',__('Category:'),'','combo',$categories);
92unset($rs,$categories);
93if ($core->plugins->moduleExists('tags')) {
94     $__widgets->lastposts->setting('tag',__('Tag:'),'');
95}
96$__widgets->lastposts->setting('limit',__('Entries limit:'),10);
[945]97$__widgets->lastposts->setting('homeonly',__('Display on:'),1,'combo',
98     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2));
[2412]99$__widgets->lastposts->setting('content_only',__('Content only'),0,'check');
100$__widgets->lastposts->setting('class',__('CSS class:'),'');
[0]101
[2402]102$__widgets->create('lastcomments',__('Last comments'),array('defaultWidgets','lastcomments'),null,'List of last comments published');
[2397]103$__widgets->lastcomments->setting('title',__('Title (optional)').' :',__('Last comments'));
[0]104$__widgets->lastcomments->setting('limit',__('Comments limit:'),10);
[945]105$__widgets->lastcomments->setting('homeonly',__('Display on:'),1,'combo',
106     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2));
[2412]107$__widgets->lastcomments->setting('content_only',__('Content only'),0,'check');
108$__widgets->lastcomments->setting('class',__('CSS class:'),'');
[0]109
110# --BEHAVIOR-- initWidgets
111$core->callBehavior('initWidgets',$__widgets);
112
113# Default widgets
114global $__default_widgets;
[665]115$__default_widgets = array('nav'=> new dcWidgets(), 'extra'=> new dcWidgets(), 'custom'=> new dcWidgets());
[0]116
117$__default_widgets['nav']->append($__widgets->search);
118$__default_widgets['nav']->append($__widgets->navigation);
119$__default_widgets['nav']->append($__widgets->bestof);
120$__default_widgets['nav']->append($__widgets->categories);
121$__default_widgets['extra']->append($__widgets->subscribe);
122
123# --BEHAVIOR-- initDefaultWidgets
124$core->callBehavior('initDefaultWidgets',$__widgets,$__default_widgets);
125?>
Note: See TracBrowser for help on using the repository browser.

Sites map