Dotclear


Ignore:
Timestamp:
03/08/18 17:58:39 (8 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Code formatting (PSR-2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/pages/_widgets.php

    r2778 r3730  
    1010# 
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    12 if (!defined('DC_RC_PATH')) { return; } 
     12if (!defined('DC_RC_PATH')) {return;} 
    1313 
    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')); 
    1616 
    1717class pagesWidgets 
    1818{ 
    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      } 
     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    } 
    4444 
    45      public static function initDefaultWidgets($w,$d) 
    46      { 
    47           $d['nav']->append($w->pages); 
    48      } 
     45    public static function initDefaultWidgets($w, $d) 
     46    { 
     47        $d['nav']->append($w->pages); 
     48    } 
    4949} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map