| [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 | $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 | { |
|---|
| [954] | 21 | $w->create('pages',__('Pages'),array('tplPages','pagesWidget'),null,'List of published pages'); |
|---|
| [0] | 22 | $w->pages->setting('title',__('Title:'),__('Pages')); |
|---|
| [945] | 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 | ); |
|---|
| [0] | 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 | ); |
|---|
| [1063] | 40 | $w->pages->setting('content_only',__('Content only'),0,'check'); |
|---|
| [904] | 41 | $w->pages->setting('class',__('CSS class:'),''); |
|---|
| [0] | 42 | } |
|---|
| 43 | |
|---|
| 44 | public static function initDefaultWidgets($w,$d) |
|---|
| 45 | { |
|---|
| 46 | $d['extra']->append($w->pages); |
|---|
| 47 | } |
|---|
| 48 | } |
|---|
| 49 | ?> |
|---|