1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
3 | # |
---|
4 | # This file is part of Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear |
---|
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 | $core->addBehavior('initWidgets',array('pagesWidgets','initWidgets')); |
---|
15 | $core->addBehavior('initDefaultWidgets',array('pagesWidgets','initDefaultWidgets')); |
---|
16 | |
---|
17 | class pagesWidgets |
---|
18 | { |
---|
19 | public static function initWidgets($w) |
---|
20 | { |
---|
21 | $w->create('pages',__('Pages'),array('tplPages','pagesWidget'),null,'List of published pages'); |
---|
22 | $w->pages->setting('title',__('Title (optional)').' :',__('Pages')); |
---|
23 | $w->pages->setting('homeonly',__('Display on:'),1,'combo', |
---|
24 | array( |
---|
25 | __('All pages') => 0, |
---|
26 | __('Home page only') => 1, |
---|
27 | __('Except on home page') => 2 |
---|
28 | ) |
---|
29 | ); |
---|
30 | $w->pages->setting('sortby',__('Order by:'),'post_title','combo', |
---|
31 | array( |
---|
32 | __('Page title') => 'post_title', |
---|
33 | __('Page position') => 'post_position', |
---|
34 | __('Publication date') => 'post_dt' |
---|
35 | ) |
---|
36 | ); |
---|
37 | $w->pages->setting('orderby',__('Sort:'),'asc','combo', |
---|
38 | array(__('Ascending') => 'asc', __('Descending') => 'desc') |
---|
39 | ); |
---|
40 | $w->pages->advanced_setting('content_only','',0,'radio', array(array(__('Content only'), '1'), array(__('Enclosing div'), '0'))); |
---|
41 | $w->pages->advanced_setting('class',__('CSS class:'),''); |
---|
42 | } |
---|
43 | |
---|
44 | public static function initDefaultWidgets($w,$d) |
---|
45 | { |
---|
46 | $d['extra']->append($w->pages); |
---|
47 | } |
---|
48 | } |
---|
49 | ?> |
---|