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/widgets/_default_widgets.php

    r3731 r3874  
    1818$__widgets = new dcWidgets; 
    1919 
    20 $__widgets->create('search', __('Search engine'), array('defaultWidgets', 'search'), null, 'Search engine form'); 
     20$__widgets->create('search', __('Search engine'), ['defaultWidgets', 'search'], null, 'Search engine form'); 
    2121$__widgets->search->setting('title', __('Title (optional)') . ' :', __('Search')); 
    2222$__widgets->search->setting('placeholder', __('Placeholder (HTML5 only, optional):'), ''); 
    2323$__widgets->search->setting('homeonly', __('Display on:'), 0, 'combo', 
    24     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
     24    [__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2]); 
    2525$__widgets->search->setting('content_only', __('Content only'), 0, 'check'); 
    2626$__widgets->search->setting('class', __('CSS class:'), ''); 
    2727$__widgets->search->setting('offline', __('Offline'), 0, 'check'); 
    2828 
    29 $__widgets->create('navigation', __('Navigation links'), array('defaultWidgets', 'navigation'), null, 'List of navigation links'); 
     29$__widgets->create('navigation', __('Navigation links'), ['defaultWidgets', 'navigation'], null, 'List of navigation links'); 
    3030$__widgets->navigation->setting('title', __('Title (optional)') . ' :', ''); 
    3131$__widgets->navigation->setting('homeonly', __('Display on:'), 0, 'combo', 
    32     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
     32    [__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2]); 
    3333$__widgets->navigation->setting('content_only', __('Content only'), 0, 'check'); 
    3434$__widgets->navigation->setting('class', __('CSS class:'), ''); 
    3535$__widgets->navigation->setting('offline', __('Offline'), 0, 'check'); 
    3636 
    37 $__widgets->create('bestof', __('Selected entries'), array('defaultWidgets', 'bestof'), null, 'List of selected entries'); 
     37$__widgets->create('bestof', __('Selected entries'), ['defaultWidgets', 'bestof'], null, 'List of selected entries'); 
    3838$__widgets->bestof->setting('title', __('Title (optional)') . ' :', __('Best of me')); 
    39 $__widgets->bestof->setting('orderby', __('Sort:'), 'asc', 'combo', array(__('Ascending') => 'asc', __('Descending') => 'desc')); 
     39$__widgets->bestof->setting('orderby', __('Sort:'), 'asc', 'combo', [__('Ascending') => 'asc', __('Descending') => 'desc']); 
    4040$__widgets->bestof->setting('homeonly', __('Display on:'), 1, 'combo', 
    41     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
     41    [__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2]); 
    4242$__widgets->bestof->setting('content_only', __('Content only'), 0, 'check'); 
    4343$__widgets->bestof->setting('class', __('CSS class:'), ''); 
    4444$__widgets->bestof->setting('offline', __('Offline'), 0, 'check'); 
    4545 
    46 $__widgets->create('langs', __('Blog languages'), array('defaultWidgets', 'langs'), null, 'List of available languages'); 
     46$__widgets->create('langs', __('Blog languages'), ['defaultWidgets', 'langs'], null, 'List of available languages'); 
    4747$__widgets->langs->setting('title', __('Title (optional)') . ' :', __('Languages')); 
    4848$__widgets->langs->setting('homeonly', __('Display on:'), 1, 'combo', 
    49     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
     49    [__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2]); 
    5050$__widgets->langs->setting('content_only', __('Content only'), 0, 'check'); 
    5151$__widgets->langs->setting('class', __('CSS class:'), ''); 
    5252$__widgets->langs->setting('offline', __('Offline'), 0, 'check'); 
    5353 
    54 $__widgets->create('categories', __('List of categories'), array('defaultWidgets', 'categories'), null, 'List of categories'); 
     54$__widgets->create('categories', __('List of categories'), ['defaultWidgets', 'categories'], null, 'List of categories'); 
    5555$__widgets->categories->setting('title', __('Title (optional)') . ' :', __('Categories')); 
    5656$__widgets->categories->setting('postcount', __('With entries counts'), 0, 'check'); 
     
    5858$__widgets->categories->setting('with_empty', __('Include empty categories'), 0, 'check'); 
    5959$__widgets->categories->setting('homeonly', __('Display on:'), 0, 'combo', 
    60     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
     60    [__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2]); 
    6161$__widgets->categories->setting('content_only', __('Content only'), 0, 'check'); 
    6262$__widgets->categories->setting('class', __('CSS class:'), ''); 
    6363$__widgets->categories->setting('offline', __('Offline'), 0, 'check'); 
    6464 
    65 $__widgets->create('subscribe', __('Subscribe links'), array('defaultWidgets', 'subscribe'), null, 'Feed subscription links (RSS or Atom)'); 
     65$__widgets->create('subscribe', __('Subscribe links'), ['defaultWidgets', 'subscribe'], null, 'Feed subscription links (RSS or Atom)'); 
    6666$__widgets->subscribe->setting('title', __('Title (optional)') . ' :', __('Subscribe')); 
    67 $__widgets->subscribe->setting('type', __('Feeds type:'), 'atom', 'combo', array('Atom' => 'atom', 'RSS' => 'rss2')); 
     67$__widgets->subscribe->setting('type', __('Feeds type:'), 'atom', 'combo', ['Atom' => 'atom', 'RSS' => 'rss2']); 
    6868$__widgets->subscribe->setting('homeonly', __('Display on:'), 1, 'combo', 
    69     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
     69    [__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2]); 
    7070$__widgets->subscribe->setting('content_only', __('Content only'), 0, 'check'); 
    7171$__widgets->subscribe->setting('class', __('CSS class:'), ''); 
    7272$__widgets->subscribe->setting('offline', __('Offline'), 0, 'check'); 
    7373 
    74 $__widgets->create('feed', __('Feed reader'), array('defaultWidgets', 'feed'), null, 'List of last entries from feed (RSS or Atom)'); 
     74$__widgets->create('feed', __('Feed reader'), ['defaultWidgets', 'feed'], null, 'List of last entries from feed (RSS or Atom)'); 
    7575$__widgets->feed->setting('title', __('Title (optional)') . ' :', __('Somewhere else')); 
    7676$__widgets->feed->setting('url', __('Feed URL:'), ''); 
    7777$__widgets->feed->setting('limit', __('Entries limit:'), 10); 
    7878$__widgets->feed->setting('homeonly', __('Display on:'), 1, 'combo', 
    79     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
     79    [__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2]); 
    8080$__widgets->feed->setting('content_only', __('Content only'), 0, 'check'); 
    8181$__widgets->feed->setting('class', __('CSS class:'), ''); 
    8282$__widgets->feed->setting('offline', __('Offline'), 0, 'check'); 
    8383 
    84 $__widgets->create('text', __('Text'), array('defaultWidgets', 'text'), null, 'Simple text'); 
     84$__widgets->create('text', __('Text'), ['defaultWidgets', 'text'], null, 'Simple text'); 
    8585$__widgets->text->setting('title', __('Title (optional)') . ' :', ''); 
    8686$__widgets->text->setting('text', __('Text:'), '', 'textarea'); 
    8787$__widgets->text->setting('homeonly', __('Display on:'), 0, 'combo', 
    88     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
     88    [__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2]); 
    8989$__widgets->text->setting('content_only', __('Content only'), 0, 'check'); 
    9090$__widgets->text->setting('class', __('CSS class:'), ''); 
    9191$__widgets->text->setting('offline', __('Offline'), 0, 'check'); 
    9292 
    93 $__widgets->create('lastposts', __('Last entries'), array('defaultWidgets', 'lastposts'), null, 'List of last entries published'); 
     93$__widgets->create('lastposts', __('Last entries'), ['defaultWidgets', 'lastposts'], null, 'List of last entries published'); 
    9494$__widgets->lastposts->setting('title', __('Title (optional)') . ' :', __('Last entries')); 
    95 $rs         = $core->blog->getCategories(array('post_type' => 'post')); 
    96 $categories = array('' => '', __('Uncategorized') => 'null'); 
     95$rs         = $core->blog->getCategories(['post_type' => 'post']); 
     96$categories = ['' => '', __('Uncategorized') => 'null']; 
    9797while ($rs->fetch()) { 
    9898    $categories[str_repeat('&nbsp;&nbsp;', $rs->level - 1) . ($rs->level - 1 == 0 ? '' : '&bull; ') . html::escapeHTML($rs->cat_title)] = $rs->cat_id; 
     
    105105$__widgets->lastposts->setting('limit', __('Entries limit:'), 10); 
    106106$__widgets->lastposts->setting('homeonly', __('Display on:'), 1, 'combo', 
    107     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
     107    [__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2]); 
    108108$__widgets->lastposts->setting('content_only', __('Content only'), 0, 'check'); 
    109109$__widgets->lastposts->setting('class', __('CSS class:'), ''); 
    110110$__widgets->lastposts->setting('offline', __('Offline'), 0, 'check'); 
    111111 
    112 $__widgets->create('lastcomments', __('Last comments'), array('defaultWidgets', 'lastcomments'), null, 'List of last comments published'); 
     112$__widgets->create('lastcomments', __('Last comments'), ['defaultWidgets', 'lastcomments'], null, 'List of last comments published'); 
    113113$__widgets->lastcomments->setting('title', __('Title (optional)') . ' :', __('Last comments')); 
    114114$__widgets->lastcomments->setting('limit', __('Comments limit:'), 10); 
    115115$__widgets->lastcomments->setting('homeonly', __('Display on:'), 1, 'combo', 
    116     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
     116    [__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2]); 
    117117$__widgets->lastcomments->setting('content_only', __('Content only'), 0, 'check'); 
    118118$__widgets->lastcomments->setting('class', __('CSS class:'), ''); 
     
    124124# Default widgets 
    125125global $__default_widgets; 
    126 $__default_widgets = array('nav' => new dcWidgets(), 'extra' => new dcWidgets(), 'custom' => new dcWidgets()); 
     126$__default_widgets = ['nav' => new dcWidgets(), 'extra' => new dcWidgets(), 'custom' => new dcWidgets()]; 
    127127 
    128128$__default_widgets['nav']->append($__widgets->search); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map