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

    r3833 r3874  
    3131dcPage::check('usage,contentadmin'); 
    3232 
    33 if ($core->plugins->disableDepModules($core->adminurl->get('admin.home', array()))) { 
     33if ($core->plugins->disableDepModules($core->adminurl->get('admin.home', []))) { 
    3434    exit; 
    3535} 
     
    108108 
    109109# Latest news for dashboard 
    110 $__dashboard_items = new ArrayObject(array(new ArrayObject(), new ArrayObject())); 
     110$__dashboard_items = new ArrayObject([new ArrayObject(), new ArrayObject()]); 
    111111 
    112112$dashboardItem = 0; 
     
    131131 
    132132# Dashboard content 
    133 $__dashboard_contents = new ArrayObject(array(new ArrayObject, new ArrayObject)); 
     133$__dashboard_contents = new ArrayObject([new ArrayObject, new ArrayObject]); 
    134134$core->callBehavior('adminDashboardContents', $core, $__dashboard_contents); 
    135135 
     
    142142        if ($post_editor && !empty($post_editor[$post_format])) { 
    143143            // context is not post because of tags not available 
    144             $admin_post_behavior = $core->callBehavior('adminPostEditor', $post_editor[$post_format], 'quickentry', array('#post_content'), $post_format); 
     144            $admin_post_behavior = $core->callBehavior('adminPostEditor', $post_editor[$post_format], 'quickentry', ['#post_content'], $post_format); 
    145145        } 
    146146    } 
     
    157157    $core->callBehavior('adminDashboardHeaders'), 
    158158    dcPage::breadcrumb( 
    159         array( 
     159        [ 
    160160            __('Dashboard') . ' : ' . html::escapeHTML($core->blog->name) => '' 
    161         ), 
    162         array('home_link' => false) 
     161        ], 
     162        ['home_link' => false] 
    163163    ) 
    164164); 
     
    166166if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->getBlogCount() > 1) { 
    167167    echo 
    168     '<p><a href="' . $core->adminurl->get("admin.home", array('default_blog' => 1)) . '" class="button">' . __('Make this blog my default blog') . '</a></p>'; 
     168    '<p><a href="' . $core->adminurl->get("admin.home", ['default_blog' => 1]) . '" class="button">' . __('Make this blog my default blog') . '</a></p>'; 
    169169} 
    170170 
     
    191191} 
    192192 
    193 $err = array(); 
     193$err = []; 
    194194 
    195195# Check cache directory 
     
    248248# Get current main orders 
    249249$main_order = $core->auth->user_prefs->dashboard->main_order; 
    250 $main_order = ($main_order != '' ? explode(',', $main_order) : array()); 
     250$main_order = ($main_order != '' ? explode(',', $main_order) : []); 
    251251 
    252252# Get current boxes orders 
    253253$boxes_order = $core->auth->user_prefs->dashboard->boxes_order; 
    254 $boxes_order = ($boxes_order != '' ? explode(',', $boxes_order) : array()); 
     254$boxes_order = ($boxes_order != '' ? explode(',', $boxes_order) : []); 
    255255 
    256256# Get current boxes items orders 
    257257$boxes_items_order = $core->auth->user_prefs->dashboard->boxes_items_order; 
    258 $boxes_items_order = ($boxes_items_order != '' ? explode(',', $boxes_items_order) : array()); 
     258$boxes_items_order = ($boxes_items_order != '' ? explode(',', $boxes_items_order) : []); 
    259259 
    260260# Get current boxes contents orders 
    261261$boxes_contents_order = $core->auth->user_prefs->dashboard->boxes_contents_order; 
    262 $boxes_contents_order = ($boxes_contents_order != '' ? explode(',', $boxes_contents_order) : array()); 
     262$boxes_contents_order = ($boxes_contents_order != '' ? explode(',', $boxes_contents_order) : []); 
    263263 
    264264$composeItems = function ($list, $blocks, $flat = false) { 
    265265 
    266     $ret   = array(); 
    267     $items = array(); 
     266    $ret   = []; 
     267    $items = []; 
    268268 
    269269    if ($flat) { 
     
    278278 
    279279    # First loop to find ordered indexes 
    280     $order = array(); 
     280    $order = []; 
    281281    $index = 0; 
    282282    foreach ($items as $v) { 
     
    321321$dashboardContents = $composeItems($boxes_contents_order, $__dashboard_contents); 
    322322 
    323 $__dashboard_boxes = array(); 
     323$__dashboard_boxes = []; 
    324324if ($dashboardItems != '') { 
    325325    $__dashboard_boxes[] = '<div class="db-items" id="db-items">' . $dashboardItems . '</div>'; 
     
    331331 
    332332# Compose main area 
    333 $__dashboard_main = array(); 
     333$__dashboard_main = []; 
    334334if (!$core->auth->user_prefs->dashboard->nofavicons) { 
    335335    # Dashboard icons 
     
    346346        # Getting categories 
    347347        $categories_combo = dcAdminCombos::getCategoriesCombo( 
    348             $core->blog->getCategories(array()) 
     348            $core->blog->getCategories([]) 
    349349        ); 
    350350 
     
    355355        '<h4>' . __('New entry') . '</h4>' . 
    356356        '<p class="col"><label for="post_title" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label>' . 
    357         form::field('post_title', 20, 255, array( 
     357        form::field('post_title', 20, 255, [ 
    358358            'class'      => 'maximal', 
    359359            'extra_html' => 'required placeholder="' . __('Title') . '"' 
    360         )) . 
     360        ]) . 
    361361        '</p>' . 
    362362        '<p class="area"><label class="required" ' . 
    363363        'for="post_content"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Content:') . '</label> ' . 
    364         form::textarea('post_content', 50, 10, array('extra_html' => 'required placeholder="' . __('Content') . '"')) . 
     364        form::textarea('post_content', 50, 10, ['extra_html' => 'required placeholder="' . __('Content') . '"']) . 
    365365        '</p>' . 
    366366        '<p><label for="cat_id" class="classic">' . __('Category:') . '</label> ' . 
Note: See TracChangeset for help on using the changeset viewer.

Sites map