Dotclear

source: plugins/pages/_widgets.php @ 904:f1fd70475361

Revision 904:f1fd70475361, 1.3 KB checked in by franck <carnet.franck.paul@…>, 13 years ago (diff)

Add class attribute (applied to encapsulated div) for standard widgets - Fixes #1230

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
3#
4# This file is part of Dotclear 2.
5#
6# Copyright (c) 2003-2011 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          $w->pages->setting('class',__('CSS class:'),'');
35     }
36     
37     public static function initDefaultWidgets($w,$d)
38     {
39          $d['extra']->append($w->pages);
40     }
41}
42?>
Note: See TracBrowser for help on using the repository browser.

Sites map