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/pages/page.php

    r3771 r3874  
    3434$post_selected      = false; 
    3535 
    36 $post_media = array(); 
     36$post_media = []; 
    3737 
    3838$page_title = __('New page'); 
     
    6060# Formaters combo 
    6161$core_formaters    = $core->getFormaters(); 
    62 $available_formats = array('' => ''); 
     62$available_formats = ['' => '']; 
    6363foreach ($core_formaters as $editor => $formats) { 
    6464    foreach ($formats as $format) { 
     
    6868 
    6969# Languages combo 
    70 $rs         = $core->blog->getLangs(array('order' => 'asc')); 
     70$rs         = $core->blog->getLangs(['order' => 'asc']); 
    7171$lang_combo = dcAdminCombos::getLangsCombo($rs, true); 
    7272 
     
    279279    if ($p_edit == $c_edit) { 
    280280        $admin_post_behavior .= $core->callBehavior('adminPostEditor', 
    281             $p_edit, 'page', array('#post_excerpt', '#post_content', '#comment_content'), $post_format); 
     281            $p_edit, 'page', ['#post_excerpt', '#post_content', '#comment_content'], $post_format); 
    282282    } else { 
    283283        $admin_post_behavior .= $core->callBehavior('adminPostEditor', 
    284             $p_edit, 'page', array('#post_excerpt', '#post_content'), $post_format); 
     284            $p_edit, 'page', ['#post_excerpt', '#post_content'], $post_format); 
    285285        $admin_post_behavior .= $core->callBehavior('adminPostEditor', 
    286             $c_edit, 'comment', array('#comment_content'), 'xhtml'); 
     286            $c_edit, 'comment', ['#comment_content'], 'xhtml'); 
    287287    } 
    288288} 
     
    334334} 
    335335echo dcPage::breadcrumb( 
    336     array( 
     336    [ 
    337337        html::escapeHTML($core->blog->name) => '', 
    338338        __('Pages')                         => $p_url, 
    339339        $edit_entry_title                   => '' 
    340     )); 
     340    ]); 
    341341 
    342342if (!empty($_GET['upd'])) { 
     
    386386-------------------------------------------------------- */ 
    387387if ($can_edit_page) { 
    388     $sidebar_items = new ArrayObject(array( 
    389         'status-box'  => array( 
     388    $sidebar_items = new ArrayObject([ 
     389        'status-box'  => [ 
    390390            'title' => __('Status'), 
    391             'items' => array( 
     391            'items' => [ 
    392392                'post_status' => 
    393393                '<p><label for="post_status">' . __('Page status') . '</label> ' . 
    394394                form::combo('post_status', $status_combo, 
    395                     array('default' => $post_status, 'disabled' => !$can_publish)) . 
     395                    ['default' => $post_status, 'disabled' => !$can_publish]) . 
    396396                '</p>', 
    397397                'post_dt'     => 
     
    402402                Dont forget to remove call to datepicker in post.js 
    403403 
    404                 form::datetime('post_dt', array( 
     404                form::datetime('post_dt', [ 
    405405                'default' => html::escapeHTML(dt::str('%Y-%m-%dT%H:%M', strtotime($post_dt))), 
    406406                'class' => ($bad_dt ? 'invalid' : '') 
    407                 )) . 
     407                ]) . 
    408408                 */ 
    409409                '</p>', 
     
    419419                '<a id="convert-xhtml" class="button' . ($post_id && $post_format != 'wiki' ? ' hide' : '') . 
    420420                '" href="' . html::escapeURL($redir_url) . '&amp;id=' . $post_id . '&amp;xconv=1">' . 
    421                 __('Convert to XHTML') . '</a></p></div>')), 
    422         'metas-box'   => array( 
     421                __('Convert to XHTML') . '</a></p></div>']], 
     422        'metas-box'   => [ 
    423423            'title' => __('Filing'), 
    424             'items' => array( 
     424            'items' => [ 
    425425                'post_position' => 
    426426                '<p><label for="post_position" class="classic">' . __('Page position') . '</label> ' . 
    427                 form::number('post_position', array( 
     427                form::number('post_position', [ 
    428428                    'default' => $post_position 
    429                 )) . 
    430                 '</p>')), 
    431         'options-box' => array( 
     429                ]) . 
     430                '</p>']], 
     431        'options-box' => [ 
    432432            'title' => __('Options'), 
    433             'items' => array( 
     433            'items' => [ 
    434434                'post_open_comment_tb' => 
    435435                '<div>' . 
     
    471471                __('Warning: If you set the URL manually, it may conflict with another page.') . 
    472472                '</p></div>' 
    473             )))); 
    474     $main_items = new ArrayObject(array( 
     473            ]]]); 
     474    $main_items = new ArrayObject([ 
    475475        "post_title"   => 
    476476        '<p class="col">' . 
    477477        '<label class="required no-margin bold" for="post_title"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label>' . 
    478         form::field('post_title', 20, 255, array( 
     478        form::field('post_title', 20, 255, [ 
    479479            'default'    => html::escapeHTML($post_title), 
    480480            'class'      => 'maximal', 
    481481            'extra_html' => 'required placeholder="' . __('Title') . '"' 
    482         )) . 
     482        ]) . 
    483483        '</p>', 
    484484 
     
    493493        'for="post_content"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Content:') . '</label> ' . 
    494494        form::textarea('post_content', 50, $core->auth->getOption('edit_size'), 
    495             array( 
     495            [ 
    496496                'default'    => html::escapeHTML($post_content), 
    497497                'extra_html' => 'required placeholder="' . __('Content') . '"' 
    498             )) . 
     498            ]) . 
    499499        '</p>', 
    500500 
     
    504504        form::textarea('post_notes', 50, 5, html::escapeHTML($post_notes)) . 
    505505        '</p>' 
    506     ) 
     506    ] 
    507507    ); 
    508508 
     
    577577        echo 
    578578        '<form action="' . $core->adminurl->get('admin.post.media') . '" id="attachment-remove-hide" method="post">' . 
    579         '<div>' . form::hidden(array('post_id'), $post_id) . 
    580         form::hidden(array('media_id'), '') . 
    581         form::hidden(array('remove'), 1) . 
     579        '<div>' . form::hidden(['post_id'], $post_id) . 
     580        form::hidden(['media_id'], '') . 
     581        form::hidden(['remove'], 1) . 
    582582        $core->formNonce() . '</div></form>'; 
    583583    } 
     
    587587-------------------------------------------------------- */ 
    588588if ($post_id) { 
    589     $params = array('post_id' => $post_id, 'order' => 'comment_dt ASC'); 
    590  
    591     $comments   = $core->blog->getComments(array_merge($params, array('comment_trackback' => 0))); 
    592     $trackbacks = $core->blog->getComments(array_merge($params, array('comment_trackback' => 1))); 
     589    $params = ['post_id' => $post_id, 'order' => 'comment_dt ASC']; 
     590 
     591    $comments   = $core->blog->getComments(array_merge($params, ['comment_trackback' => 0])); 
     592    $trackbacks = $core->blog->getComments(array_merge($params, ['comment_trackback' => 1])); 
    593593 
    594594    # Actions combo box 
    595     $combo_action = array(); 
     595    $combo_action = []; 
    596596    if ($can_edit_page && $core->auth->check('publish,contentadmin', $core->blog->id)) { 
    597597        $combo_action[__('Publish')]         = 'publish'; 
     
    655655    '<div class="constrained">' . 
    656656    '<p><label for="comment_author" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Name:') . '</label>' . 
    657     form::field('comment_author', 30, 255, array( 
     657    form::field('comment_author', 30, 255, [ 
    658658        'default'    => html::escapeHTML($core->auth->getInfo('user_cn')), 
    659659        'extra_html' => 'required placeholder="' . __('Author') . '"' 
    660     )) . 
     660    ]) . 
    661661    '</p>' . 
    662662 
    663663    '<p><label for="comment_email">' . __('Email:') . '</label>' . 
    664     form::email('comment_email', array( 
     664    form::email('comment_email', [ 
    665665        'size'         => 30, 
    666666        'default'      => html::escapeHTML($core->auth->getInfo('user_email')), 
    667667        'autocomplete' => 'email' 
    668     )) . 
     668    ]) . 
    669669    '</p>' . 
    670670 
    671671    '<p><label for="comment_site">' . __('Web site:') . '</label>' . 
    672     form::url('comment_site', array( 
     672    form::url('comment_site', [ 
    673673        'size'         => 30, 
    674674        'default'      => html::escapeHTML($core->auth->getInfo('user_url')), 
    675675        'autocomplete' => 'url' 
    676     )) . 
     676    ]) . 
    677677    '</p>' . 
    678678 
    679679    '<p class="area"><label for="comment_content" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . 
    680680    __('Comment:') . '</label> ' . 
    681     form::textarea('comment_content', 50, 8, array('extra_html' => 'required placeholder="' . __('Comment') . '"')) . 
     681    form::textarea('comment_content', 50, 8, ['extra_html' => 'required placeholder="' . __('Comment') . '"']) . 
    682682    '</p>' . 
    683683 
     
    729729 
    730730    while ($rs->fetch()) { 
    731         $comment_url = $core->adminurl->get('admin.comment', array('id' => $rs->comment_id)); 
     731        $comment_url = $core->adminurl->get('admin.comment', ['id' => $rs->comment_id]); 
    732732 
    733733        $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
     
    752752 
    753753        '<td class="nowrap">' . 
    754         ($has_action ? form::checkbox(array('comments[]'), $rs->comment_id, 
    755             array( 
     754        ($has_action ? form::checkbox(['comments[]'], $rs->comment_id, 
     755            [ 
    756756                'extra_html' => 'title="' . __('Select this comment') . '"' 
    757             ) 
     757            ] 
    758758        ) : '') . '</td>' . 
    759759        '<td class="maximal">' . $rs->comment_author . '</td>' . 
    760760        '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $rs->comment_dt) . '</td>' . 
    761         '<td class="nowrap"><a href="' . $core->adminurl->get('admin.comment', array('ip' => $rs->comment_ip)) . '">' . $rs->comment_ip . '</a></td>' . 
     761        '<td class="nowrap"><a href="' . $core->adminurl->get('admin.comment', ['ip' => $rs->comment_ip]) . '">' . $rs->comment_ip . '</a></td>' . 
    762762        '<td class="nowrap status">' . $img_status . '</td>' . 
    763763        '<td class="nowrap status"><a href="' . $comment_url . '">' . 
Note: See TracChangeset for help on using the changeset viewer.

Sites map