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/index.php

    r3826 r3874  
    2828} 
    2929 
    30 $append_combo = array( 
     30$append_combo = [ 
    3131    '-'              => 0, 
    3232    __('navigation') => 'nav', 
    3333    __('extra')      => 'extra', 
    3434    __('custom')     => 'custom' 
    35 ); 
     35]; 
    3636 
    3737function literalNullString($v) 
     
    4646if (!empty($_POST['append']) && is_array($_POST['addw'])) { 
    4747    # Filter selection 
    48     $addw = array(); 
     48    $addw = []; 
    4949    foreach ($_POST['addw'] as $k => $v) { 
    5050        if (($v == 'extra' || $v == 'nav' || $v == 'custom') && $__widgets->{$k} !== null) { 
     
    144144if (!empty($_POST['wup']) || $removing || $move) { 
    145145    if (!isset($_POST['w']) || !is_array($_POST['w'])) { 
    146         $_POST['w'] = array(); 
     146        $_POST['w'] = []; 
    147147    } 
    148148 
     
    160160 
    161161        if (!isset($_POST['w']['nav'])) { 
    162             $_POST['w']['nav'] = array(); 
     162            $_POST['w']['nav'] = []; 
    163163        } 
    164164        if (!isset($_POST['w']['extra'])) { 
    165             $_POST['w']['extra'] = array(); 
     165            $_POST['w']['extra'] = []; 
    166166        } 
    167167        if (!isset($_POST['w']['custom'])) { 
    168             $_POST['w']['custom'] = array(); 
     168            $_POST['w']['custom'] = []; 
    169169        } 
    170170 
     
    214214    echo dcPage::jsLoad(dcPage::getPF('widgets/js/dragdrop.js')); 
    215215} 
    216 echo dcPage::jsVars(array('dotclear.msg.confirm_widgets_reset' => __('Are you sure you want to reset sidebars?'))); 
     216echo dcPage::jsVars(['dotclear.msg.confirm_widgets_reset' => __('Are you sure you want to reset sidebars?')]); 
    217217 
    218218$widget_editor = $core->auth->getOption('editor'); 
     
    223223} 
    224224if ($rte_flag) { 
    225     echo dcPage::jsVars(array('dotclear.widget_noeditor' => 0)); 
     225    echo dcPage::jsVars(['dotclear.widget_noeditor' => 0]); 
    226226    echo $core->callBehavior('adminPostEditor', $widget_editor['xhtml'], 'widget', 
    227         array('#sidebarsWidgets textarea:not(.noeditor)'), 'xhtml'); 
     227        ['#sidebarsWidgets textarea:not(.noeditor)'], 'xhtml'); 
    228228} else { 
    229     echo dcPage::jsVars(array('dotclear.widget_noeditor' => 1)); 
     229    echo dcPage::jsVars(['dotclear.widget_noeditor' => 1]); 
    230230} 
    231231echo (dcPage::jsConfirmClose('sidebarsWidgets')); 
     
    235235<?php 
    236236echo dcPage::breadcrumb( 
    237     array( 
     237    [ 
    238238        html::escapeHTML($core->blog->name) => '', 
    239239        __('Widgets')                       => '' 
    240     )) . 
     240    ]) . 
    241241dcPage::notices(); 
    242242 
     
    251251foreach ($__widgets->elements(true) as $w) { 
    252252    echo 
    253     '<li>' . form::hidden(array('w[void][0][id]'), html::escapeHTML($w->id())) . 
    254     '<p class="widget-name">' . form::number(array('w[void][0][order]'), array( 
     253    '<li>' . form::hidden(['w[void][0][id]'], html::escapeHTML($w->id())) . 
     254    '<p class="widget-name">' . form::number(['w[void][0][order]'], [ 
    255255        'default'    => 0, 
    256256        'class'      => 'hide', 
    257257        'extra_html' => 'title="' . __('order') . '"' 
    258     )) . 
     258    ]) . 
    259259    ' ' . $w->name() . 
    260260    ($w->desc() != '' ? ' <span class="form-note">' . __($w->desc()) . '</span>' : '') . '</p>' . 
    261261    '<p class="manual-move remove-if-drag"><label class="classic">' . __('Append to:') . '</label> ' . 
    262     form::combo(array('addw[' . $w->id() . ']'), $append_combo) . 
     262    form::combo(['addw[' . $w->id() . ']'], $append_combo) . 
    263263    '<input type="submit" name="append[' . $w->id() . ']" value="' . __('Add') . '" /></p>' . 
    264264    '<div class="widgetSettings hidden-if-drag">' . $w->formSettings('w[void][0]', $j) . '</div>' . 
     
    365365 
    366366        $res .= 
    367         '<li>' . form::hidden(array($iname . '[id]'), html::escapeHTML($w->id())) . 
    368         '<p class="widget-name">' . form::number(array($iname . '[order]'), array( 
     367        '<li>' . form::hidden([$iname . '[id]'], html::escapeHTML($w->id())) . 
     368        '<p class="widget-name">' . form::number([$iname . '[order]'], [ 
    369369            'default'    => $i, 
    370370            'class'      => 'hidden', 
    371371            'extra_html' => 'title="' . __('order') . '"' 
    372         )) . 
     372        ]) . 
    373373        ' ' . $w->name() . 
    374374        ($w->desc() != '' ? ' <span class="form-note">' . __($w->desc()) . '</span>' : '') . 
Note: See TracChangeset for help on using the changeset viewer.

Sites map