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

    r3731 r3874  
    2525# Filter form we'll put in html_block 
    2626$status_combo = array_merge( 
    27     array('-' => ''), 
     27    ['-' => ''], 
    2828    dcAdminCombos::getCommentStatusescombo() 
    2929); 
    3030 
    31 $type_combo = array( 
     31$type_combo = [ 
    3232    '-'             => '', 
    3333    __('Comment')   => 'co', 
    3434    __('Trackback') => 'tb' 
    35 ); 
    36  
    37 $sortby_combo = array( 
     35]; 
     36 
     37$sortby_combo = [ 
    3838    __('Date')        => 'comment_dt', 
    3939    __('Entry title') => 'post_title', 
     
    4141    __('Author')      => 'comment_author', 
    4242    __('Status')      => 'comment_status' 
    43 ); 
    44  
    45 $sortby_lex = array( 
     43]; 
     44 
     45$sortby_lex = [ 
    4646    // key in sorty_combo (see above) => field in SQL request 
    4747    'post_title'          => 'post_title', 
    4848    'comment_author'      => 'comment_author', 
    49     'comment_spam_filter' => 'comment_spam_filter'); 
    50  
    51 $order_combo = array( 
     49    'comment_spam_filter' => 'comment_spam_filter']; 
     50 
     51$order_combo = [ 
    5252    __('Descending') => 'desc', 
    5353    __('Ascending')  => 'asc' 
    54 ); 
     54]; 
    5555 
    5656/* Get comments 
     
    7979} 
    8080 
    81 $params['limit']      = array((($page - 1) * $nb_per_page), $nb_per_page); 
     81$params['limit']      = [(($page - 1) * $nb_per_page), $nb_per_page]; 
    8282$params['no_content'] = true; 
    8383 
     
    155155 
    156156# Actions combo box 
    157 $combo_action = array(); 
     157$combo_action = []; 
    158158$default      = ''; 
    159159if ($core->auth->check('delete,contentadmin', $core->blog->id) && $status == -2) { 
     
    183183    dcPage::jsLoad('js/_comments.js') . dcPage::jsFilterControl($show_filters), 
    184184    dcPage::breadcrumb( 
    185         array( 
     185        [ 
    186186            html::escapeHTML($core->blog->name) => '', 
    187187            __('Comments and trackbacks')       => '' 
    188         )) 
     188        ]) 
    189189); 
    190190if (!empty($_GET['upd'])) { 
     
    200200    } 
    201201 
    202     $spam_count = $core->blog->getComments(array('comment_status' => -2), true)->f(0); 
     202    $spam_count = $core->blog->getComments(['comment_status' => -2], true)->f(0); 
    203203    if ($spam_count > 0) { 
    204204 
     
    209209            if ($spam_count == 1) { 
    210210                echo '<p>' . sprintf(__('You have one spam comment.'), '<strong>' . $spam_count . '</strong>') . ' ' . 
    211                 '<a href="' . $core->adminurl->get("admin.comments", array('status' => -2)) . '">' . __('Show it.') . '</a></p>'; 
     211                '<a href="' . $core->adminurl->get("admin.comments", ['status' => -2]) . '">' . __('Show it.') . '</a></p>'; 
    212212            } elseif ($spam_count > 1) { 
    213213                echo '<p>' . sprintf(__('You have %s spam comments.'), '<strong>' . $spam_count . '</strong>') . ' ' . 
    214                 '<a href="' . $core->adminurl->get("admin.comments", array('status' => -2)) . '">' . __('Show them.') . '</a></p>'; 
     214                '<a href="' . $core->adminurl->get("admin.comments", ['status' => -2]) . '">' . __('Show them.') . '</a></p>'; 
    215215            } 
    216216        } 
     
    278278        '<p class="col right"><label for="action" class="classic">' . __('Selected comments action:') . '</label> ' . 
    279279        form::combo('action', $comments_actions_page->getCombo(), 
    280             array('default' => $default, 'extra_html' => 'title="' . __('Actions') . '"')) . 
     280            ['default' => $default, 'extra_html' => 'title="' . __('Actions') . '"']) . 
    281281        $core->formNonce() . 
    282282        '<input id="do-action" type="submit" value="' . __('ok') . '" /></p>' . 
    283         form::hidden(array('type'), $type) . 
    284         form::hidden(array('sortby'), $sortby) . 
    285         form::hidden(array('order'), $order) . 
    286         form::hidden(array('author'), html::escapeHTML(preg_replace('/%/', '%%', $author))) . 
    287         form::hidden(array('status'), $status) . 
    288         form::hidden(array('ip'), preg_replace('/%/', '%%', $ip)) . 
    289         form::hidden(array('page'), $page) . 
    290         form::hidden(array('nb'), $nb_per_page) . 
    291         form::hidden(array('email'), html::escapeHTML(preg_replace('/%/', '%%', $email))) . 
    292         form::hidden(array('site'), html::escapeHTML(preg_replace('/%/', '%%', $site))) . 
     283        form::hidden(['type'], $type) . 
     284        form::hidden(['sortby'], $sortby) . 
     285        form::hidden(['order'], $order) . 
     286        form::hidden(['author'], html::escapeHTML(preg_replace('/%/', '%%', $author))) . 
     287        form::hidden(['status'], $status) . 
     288        form::hidden(['ip'], preg_replace('/%/', '%%', $ip)) . 
     289        form::hidden(['page'], $page) . 
     290        form::hidden(['nb'], $nb_per_page) . 
     291        form::hidden(['email'], html::escapeHTML(preg_replace('/%/', '%%', $email))) . 
     292        form::hidden(['site'], html::escapeHTML(preg_replace('/%/', '%%', $site))) . 
    293293        '</div>' . 
    294294 
Note: See TracChangeset for help on using the changeset viewer.

Sites map