Dotclear

source: plugins/pages/_widgets.php @ 0:54703be25dd6

Revision 0:54703be25dd6, 1.2 KB checked in by Dsls <dsls@…>, 14 years ago (diff)

2.3 branch (trunk) first checkin

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
3#
4# This file is part of Dotclear 2.
5#
6# Copyright (c) 2003-2010 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 -----------------------------------------
12if (!defined('DC_RC_PATH')) { return; }
13
14$core->addBehavior('initWidgets',array('pagesWidgets','initWidgets'));
15$core->addBehavior('initDefaultWidgets',array('pagesWidgets','initDefaultWidgets'));
16
17class pagesWidgets
18{
19     public static function initWidgets($w)
20     {
21          $w->create('pages',__('Pages'),array('tplPages','pagesWidget'));
22          $w->pages->setting('title',__('Title:'),__('Pages'));
23          $w->pages->setting('homeonly',__('Home page only'),1,'check');
24          $w->pages->setting('sortby',__('Order by:'),'post_title','combo',
25               array(
26                    __('Page title') => 'post_title',
27                    __('Page position') => 'post_position',
28                    __('Publication date') => 'post_dt'
29               )
30          );
31          $w->pages->setting('orderby',__('Sort:'),'asc','combo',
32               array(__('Ascending') => 'asc', __('Descending') => 'desc')
33          );
34     }
35     
36     public static function initDefaultWidgets($w,$d)
37     {
38          $d['extra']->append($w->pages);
39     }
40}
41?>
Note: See TracBrowser for help on using the repository browser.

Sites map