Dotclear


Ignore:
Timestamp:
09/14/18 12:16:17 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

short notation for array (array() → [])

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/pages/_widgets.php

    r3731 r3874  
    1212if (!defined('DC_RC_PATH')) {return;} 
    1313 
    14 $core->addBehavior('initWidgets', array('pagesWidgets', 'initWidgets')); 
    15 $core->addBehavior('initDefaultWidgets', array('pagesWidgets', 'initDefaultWidgets')); 
     14$core->addBehavior('initWidgets', ['pagesWidgets', 'initWidgets']); 
     15$core->addBehavior('initDefaultWidgets', ['pagesWidgets', 'initDefaultWidgets']); 
    1616 
    1717class pagesWidgets 
     
    1919    public static function initWidgets($w) 
    2020    { 
    21         $w->create('pages', __('Pages'), array('tplPages', 'pagesWidget'), null, 'List of published pages'); 
     21        $w->create('pages', __('Pages'), ['tplPages', 'pagesWidget'], null, 'List of published pages'); 
    2222        $w->pages->setting('title', __('Title (optional)') . ' :', __('Pages')); 
    2323        $w->pages->setting('homeonly', __('Display on:'), 1, 'combo', 
    24             array( 
     24            [ 
    2525                __('All pages')           => 0, 
    2626                __('Home page only')      => 1, 
    2727                __('Except on home page') => 2 
    28             ) 
     28            ] 
    2929        ); 
    3030        $w->pages->setting('sortby', __('Order by:'), 'post_title', 'combo', 
    31             array( 
     31            [ 
    3232                __('Page title')       => 'post_title', 
    3333                __('Page position')    => 'post_position', 
    3434                __('Publication date') => 'post_dt' 
    35             ) 
     35            ] 
    3636        ); 
    3737        $w->pages->setting('orderby', __('Sort:'), 'asc', 'combo', 
    38             array(__('Ascending') => 'asc', __('Descending') => 'desc') 
     38            [__('Ascending') => 'asc', __('Descending') => 'desc'] 
    3939        ); 
    4040        $w->pages->setting('content_only', __('Content only'), 0, 'check'); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map