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

    r3731 r3874  
    4141 
    4242    # Allowed parents list 
    43     $children        = $core->blog->getCategories(array('start' => $cat_id)); 
    44     $allowed_parents = array(__('Top level') => 0); 
    45  
    46     $p = array(); 
     43    $children        = $core->blog->getCategories(['start' => $cat_id]); 
     44    $allowed_parents = [__('Top level') => 0]; 
     45 
     46    $p = []; 
    4747    while ($children->fetch()) { 
    4848        $p[$children->cat_id] = 1; 
     
    6161 
    6262    # Allowed siblings list 
    63     $siblings = array(); 
     63    $siblings = []; 
    6464    $rs       = $core->blog->getCategoryFirstChildren($cat_parent); 
    6565    while ($rs->fetch()) { 
     
    126126            dcPage::addSuccessNotice(__('The category has been successfully updated.')); 
    127127 
    128             $core->adminurl->redirect("admin.category", array('id' => $_POST['id'])); 
     128            $core->adminurl->redirect("admin.category", ['id' => $_POST['id']]); 
    129129        } 
    130130        # Create category 
     
    149149$title = $cat_id ? html::escapeHTML($cat_title) : __('New category'); 
    150150 
    151 $elements = array( 
     151$elements = [ 
    152152    html::escapeHTML($core->blog->name) => '', 
    153153    __('Categories')                    => $core->adminurl->get("admin.categories") 
    154 ); 
     154]; 
    155155if ($cat_id) { 
    156156    while ($parents->fetch()) { 
    157         $elements[html::escapeHTML($parents->cat_title)] = $core->adminurl->get("admin.category", array('id' => $parents->cat_id)); 
     157        $elements[html::escapeHTML($parents->cat_title)] = $core->adminurl->get("admin.category", ['id' => $parents->cat_id]); 
    158158    } 
    159159} 
     
    170170    dcPage::jsConfirmClose('category-form') . 
    171171    dcPage::jsLoad('js/_category.js') . 
    172     ($rte_flag ? $core->callBehavior('adminPostEditor', $category_editor['xhtml'], 'category', array('#cat_desc'), 'xhtml') : ''), 
     172    ($rte_flag ? $core->callBehavior('adminPostEditor', $category_editor['xhtml'], 'category', ['#cat_desc'], 'xhtml') : ''), 
    173173    dcPage::breadcrumb($elements) 
    174174); 
     
    182182'<h3>' . __('Category information') . '</h3>' . 
    183183'<p><label class="required" for="cat_title"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Name:') . '</label> ' . 
    184 form::field('cat_title', 40, 255, array( 
     184form::field('cat_title', 40, 255, [ 
    185185    'default'    => html::escapeHTML($cat_title), 
    186186    'extra_html' => 'required placeholder="' . __('Name') . '"' 
    187 )) . 
     187]) . 
    188188    '</p>'; 
    189189if (!$cat_id) { 
     
    231231    form::combo('cat_parent', $allowed_parents, $cat_parent) . '</p>' . 
    232232    '<p><input type="submit" accesskey="s" value="' . __('Save') . '" />' . 
    233     form::hidden(array('id'), $cat_id) . $core->formNonce() . '</p>' . 
     233    form::hidden(['id'], $cat_id) . $core->formNonce() . '</p>' . 
    234234        '</form>' . 
    235235        '</div>'; 
     
    241241        '<h4>' . __('Category sibling') . '</h4>' . 
    242242        '<p><label class="classic" for="cat_sibling">' . __('Move current category') . '</label> ' . 
    243         form::combo('cat_move', array(__('before') => 'before', __('after') => 'after'), 
    244             array('extra_html' => 'title="' . __('position: ') . '"')) . ' ' . 
     243        form::combo('cat_move', [__('before') => 'before', __('after') => 'after'], 
     244            ['extra_html' => 'title="' . __('position: ') . '"']) . ' ' . 
    245245        form::combo('cat_sibling', $siblings) . '</p>' . 
    246246        '<p><input type="submit" accesskey="s" value="' . __('Save') . '" />' . 
    247         form::hidden(array('id'), $cat_id) . $core->formNonce() . '</p>' . 
     247        form::hidden(['id'], $cat_id) . $core->formNonce() . '</p>' . 
    248248            '</form>' . 
    249249            '</div>'; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map