Changeset 3730:5c45a5df9a59 for plugins/pages/_widgets.php
- Timestamp:
- 03/08/18 17:58:39 (8 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/pages/_widgets.php
r2778 r3730 10 10 # 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 if (!defined('DC_RC_PATH')) { return;}12 if (!defined('DC_RC_PATH')) {return;} 13 13 14 $core->addBehavior('initWidgets', array('pagesWidgets','initWidgets'));15 $core->addBehavior('initDefaultWidgets', array('pagesWidgets','initDefaultWidgets'));14 $core->addBehavior('initWidgets', array('pagesWidgets', 'initWidgets')); 15 $core->addBehavior('initDefaultWidgets', array('pagesWidgets', 'initDefaultWidgets')); 16 16 17 17 class pagesWidgets 18 18 { 19 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 25 __('All pages')=> 0,26 __('Home page only')=> 1,27 28 29 30 $w->pages->setting('sortby',__('Order by:'),'post_title','combo',31 32 __('Page title')=> 'post_title',33 __('Page position')=> 'post_position',34 35 36 37 $w->pages->setting('orderby',__('Sort:'),'asc','combo',38 39 40 $w->pages->setting('content_only',__('Content only'),0,'check');41 $w->pages->setting('class',__('CSS class:'),'');42 $w->pages->setting('offline',__('Offline'),0,'check');43 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->setting('content_only', __('Content only'), 0, 'check'); 41 $w->pages->setting('class', __('CSS class:'), ''); 42 $w->pages->setting('offline', __('Offline'), 0, 'check'); 43 } 44 44 45 public static function initDefaultWidgets($w,$d)46 47 48 45 public static function initDefaultWidgets($w, $d) 46 { 47 $d['nav']->append($w->pages); 48 } 49 49 }
Note: See TracChangeset
for help on using the changeset viewer.