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

    r3851 r3874  
    4848 
    4949    $action = $core->adminurl->get("admin.blog"); 
    50     $redir  = $core->adminurl->get("admin.blog", array('id' => "%s"), '&', true); 
     50    $redir  = $core->adminurl->get("admin.blog", ['id' => "%s"], '&', true); 
    5151} 
    5252 
     
    6161$date_formats       = $blog_settings->system->date_formats; 
    6262$time_formats       = $blog_settings->system->time_formats; 
    63 $date_formats_combo = array('' => ''); 
     63$date_formats_combo = ['' => '']; 
    6464foreach ($date_formats as $format) { 
    6565    $date_formats_combo[dt::str($format, $now)] = $format; 
    6666} 
    67 $time_formats_combo = array('' => ''); 
     67$time_formats_combo = ['' => '']; 
    6868foreach ($time_formats as $format) { 
    6969    $time_formats_combo[dt::str($format, $now)] = $format; 
     
    7171 
    7272# URL scan modes 
    73 $url_scan_combo = array( 
     73$url_scan_combo = [ 
    7474    'PATH_INFO'    => 'path_info', 
    7575    'QUERY_STRING' => 'query_string' 
    76 ); 
     76]; 
    7777 
    7878# Post URL combo 
    79 $post_url_combo = array( 
     79$post_url_combo = [ 
    8080    __('year/month/day/title') => '{y}/{m}/{d}/{t}', 
    8181    __('year/month/title')     => '{y}/{m}/{t}', 
     
    8484    __('post id/title')        => '{id}/{t}', 
    8585    __('post id')              => '{id}' 
    86 ); 
     86]; 
    8787if (!in_array($blog_settings->system->post_url_format, $post_url_combo)) { 
    8888    $post_url_combo[html::escapeHTML($blog_settings->system->post_url_format)] = html::escapeHTML($blog_settings->system->post_url_format); 
     
    9090 
    9191# Note title tag combo 
    92 $note_title_tag_combo = array( 
     92$note_title_tag_combo = [ 
    9393    __('H4') => 0, 
    9494    __('H3') => 1, 
    9595    __('P')  => 2 
    96 ); 
     96]; 
    9797 
    9898# Image title combo 
    99 $img_title_combo = array( 
     99$img_title_combo = [ 
    100100    __('(none)')                     => '', 
    101101    __('Title')                      => 'Title ;; separator(, )', 
     
    103103    __('Title, Country, Date')       => 'Title ;; Country ;; Date(%b %Y) ;; separator(, )', 
    104104    __('Title, City, Country, Date') => 'Title ;; City ;; Country ;; Date(%b %Y) ;; separator(, )' 
    105 ); 
     105]; 
    106106if (!in_array($blog_settings->system->media_img_title_pattern, $img_title_combo)) { 
    107107    $img_title_combo[html::escapeHTML($blog_settings->system->media_img_title_pattern)] = html::escapeHTML($blog_settings->system->media_img_title_pattern); 
     
    109109 
    110110# Image default size combo 
    111 $img_default_size_combo = array(); 
     111$img_default_size_combo = []; 
    112112try { 
    113113    $media                                  = new dcMedia($core); 
     
    121121 
    122122# Image default alignment combo 
    123 $img_default_alignment_combo = array( 
     123$img_default_alignment_combo = [ 
    124124    __('None')   => 'none', 
    125125    __('Left')   => 'left', 
    126126    __('Right')  => 'right', 
    127127    __('Center') => 'center' 
    128 ); 
     128]; 
    129129 
    130130# Image default legend and title combo 
    131 $img_default_legend_combo = array( 
     131$img_default_legend_combo = [ 
    132132    __('Legend and title') => 'legend', 
    133133    __('Title')            => 'title', 
    134134    __('None')             => 'none' 
    135 ); 
     135]; 
    136136 
    137137# Robots policy options 
    138 $robots_policy_options = array( 
     138$robots_policy_options = [ 
    139139    'INDEX,FOLLOW'               => __("I would like search engines and archivers to index and archive my blog's content."), 
    140140    'INDEX,FOLLOW,NOARCHIVE'     => __("I would like search engines and archivers to index but not archive my blog's content."), 
    141141    'NOINDEX,NOFOLLOW,NOARCHIVE' => __("I would like to prevent search engines and archivers from indexing or archiving my blog's content.") 
    142 ); 
     142]; 
    143143 
    144144# jQuery available versions 
    145145$jquery_root           = dirname(__FILE__) . '/../inc/js/jquery'; 
    146 $jquery_versions_combo = array(__('Default') . ' (' . DC_DEFAULT_JQUERY . ')' => DC_DEFAULT_JQUERY); 
     146$jquery_versions_combo = [__('Default') . ' (' . DC_DEFAULT_JQUERY . ')' => DC_DEFAULT_JQUERY]; 
    147147if (is_dir($jquery_root) && is_readable($jquery_root)) { 
    148148    if (($d = @dir($jquery_root)) !== false) { 
     
    295295if ($standalone) { 
    296296    $breadcrumb = dcPage::breadcrumb( 
    297         array( 
     297        [ 
    298298            html::escapeHTML($blog_name) => '', 
    299299            __('Blog settings')          => '' 
    300         ) 
     300        ] 
    301301    ); 
    302302} else { 
    303303    $breadcrumb = dcPage::breadcrumb( 
    304         array( 
     304        [ 
    305305            __('System')                                               => '', 
    306306            __('Blogs')                                                => $core->adminurl->get("admin.blogs"), 
    307307            __('Blog settings') . ' : ' . html::escapeHTML($blog_name) => '' 
    308         )); 
     308        ]); 
    309309} 
    310310 
     
    324324    "</script>" . 
    325325    dcPage::jsConfirmClose('blog-form') . 
    326     ($rte_flag ? $core->callBehavior('adminPostEditor', $desc_editor['xhtml'], 'blog_desc', array('#blog_desc'), 'xhtml') : '') . 
     326    ($rte_flag ? $core->callBehavior('adminPostEditor', $desc_editor['xhtml'], 'blog_desc', ['#blog_desc'], 'xhtml') : '') . 
    327327    dcPage::jsLoad('js/_blog_pref.js') . 
    328328 
     
    355355    '<p><label for="blog_name" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Blog name:') . '</label>' . 
    356356    form::field('blog_name', 30, 255, 
    357         array( 
     357        [ 
    358358            'default'    => html::escapeHTML($blog_name), 
    359359            'extra_html' => 'required placeholder="' . __('Blog name') . '"' 
    360         ) 
     360        ] 
    361361    ) . '</p>'; 
    362362 
     
    418418    __('Moderate comments') . '</label></p>' . 
    419419    '<p><label for="comments_ttl" class="classic">' . sprintf(__('Leave comments open for %s days') . '.', 
    420         form::number('comments_ttl', array( 
     420        form::number('comments_ttl', [ 
    421421            'min'     => 0, 
    422422            'max'     => 999, 
    423             'default' => $blog_settings->system->comments_ttl) 
     423            'default' => $blog_settings->system->comments_ttl] 
    424424        )) . 
    425425    '</label></p>' . 
     
    441441    __('Moderate trackbacks') . '</label></p>' . 
    442442    '<p><label for="trackbacks_ttl" class="classic">' . sprintf(__('Leave trackbacks open for %s days') . '.', 
    443         form::number('trackbacks_ttl', array( 
     443        form::number('trackbacks_ttl', [ 
    444444            'min'     => 0, 
    445445            'max'     => 999, 
    446             'default' => $blog_settings->system->trackbacks_ttl) 
     446            'default' => $blog_settings->system->trackbacks_ttl] 
    447447        )) . 
    448448    '</label></p>' . 
     
    464464    '<p><label for="date_format">' . __('Date format:') . '</label> ' . 
    465465    form::field('date_format', 30, 255, html::escapeHTML($blog_settings->system->date_format)) . 
    466     form::combo('date_format_select', $date_formats_combo, array('extra_html' => 'title="' . __('Pattern of date') . '"')) . 
     466    form::combo('date_format_select', $date_formats_combo, ['extra_html' => 'title="' . __('Pattern of date') . '"']) . 
    467467    '</p>' . 
    468468    '<p class="chosen form-note">' . __('Sample:') . ' ' . dt::str(html::escapeHTML($blog_settings->system->date_format)) . '</p>' . 
     
    470470    '<p><label for="time_format">' . __('Time format:') . '</label>' . 
    471471    form::field('time_format', 30, 255, html::escapeHTML($blog_settings->system->time_format)) . 
    472     form::combo('time_format_select', $time_formats_combo, array('extra_html' => 'title="' . __('Pattern of time') . '"')) . 
     472    form::combo('time_format_select', $time_formats_combo, ['extra_html' => 'title="' . __('Pattern of time') . '"']) . 
    473473    '</p>' . 
    474474    '<p class="chosen form-note">' . __('Sample:') . ' ' . dt::str(html::escapeHTML($blog_settings->system->time_format)) . '</p>' . 
     
    485485    '<div class="col">' . 
    486486    '<p><label for="nb_post_for_home" class="classic">' . sprintf(__('Display %s entries on home page'), 
    487         form::number('nb_post_for_home', array( 
     487        form::number('nb_post_for_home', [ 
    488488            'min'     => 1, 
    489489            'max'     => 999, 
    490             'default' => $blog_settings->system->nb_post_for_home) 
     490            'default' => $blog_settings->system->nb_post_for_home] 
    491491        )) . 
    492492    '</label></p>' . 
    493493 
    494494    '<p><label for="nb_post_per_page" class="classic">' . sprintf(__('Display %s entries per page'), 
    495         form::number('nb_post_per_page', array( 
     495        form::number('nb_post_per_page', [ 
    496496            'min'     => 1, 
    497497            'max'     => 999, 
    498             'default' => $blog_settings->system->nb_post_per_page) 
     498            'default' => $blog_settings->system->nb_post_per_page] 
    499499        )) . 
    500500    '</label></p>' . 
    501501 
    502502    '<p><label for="nb_post_per_feed" class="classic">' . sprintf(__('Display %s entries per feed'), 
    503         form::number('nb_post_per_feed', array( 
     503        form::number('nb_post_per_feed', [ 
    504504            'min'     => 1, 
    505505            'max'     => 999, 
    506             'default' => $blog_settings->system->nb_post_per_feed) 
     506            'default' => $blog_settings->system->nb_post_per_feed] 
    507507        )) . 
    508508    '</label></p>' . 
    509509 
    510510    '<p><label for="nb_comment_per_feed" class="classic">' . sprintf(__('Display %s comments per feed'), 
    511         form::number('nb_comment_per_feed', array( 
     511        form::number('nb_comment_per_feed', [ 
    512512            'min'     => 1, 
    513513            'max'     => 999, 
    514             'default' => $blog_settings->system->nb_comment_per_feed) 
     514            'default' => $blog_settings->system->nb_comment_per_feed] 
    515515        )) . 
    516516    '</label></p>' . 
     
    539539    '<h5>' . __('Generated image sizes (max dimension in pixels)') . '</h5>' . 
    540540    '<p class="field"><label for="media_img_t_size">' . __('Thumbnail') . '</label> ' . 
    541     form::number('media_img_t_size', array( 
     541    form::number('media_img_t_size', [ 
    542542        'min'     => -1, 
    543543        'max'     => 999, 
    544544        'default' => $blog_settings->system->media_img_t_size 
    545     )) . 
     545    ]) . 
    546546    '</p>' . 
    547547 
    548548    '<p class="field"><label for="media_img_s_size">' . __('Small') . '</label> ' . 
    549     form::number('media_img_s_size', array( 
     549    form::number('media_img_s_size', [ 
    550550        'min'     => -1, 
    551551        'max'     => 999, 
    552552        'default' => $blog_settings->system->media_img_s_size 
    553     )) . 
     553    ]) . 
    554554    '</p>' . 
    555555 
    556556    '<p class="field"><label for="media_img_m_size">' . __('Medium') . '</label> ' . 
    557     form::number('media_img_m_size', array( 
     557    form::number('media_img_m_size', [ 
    558558        'min'     => -1, 
    559559        'max'     => 999, 
    560560        'default' => $blog_settings->system->media_img_m_size 
    561     )) . 
     561    ]) . 
    562562    '</p>' . 
    563563 
    564564    '<h5>' . __('Default size of the inserted video (in pixels)') . '</h5>' . 
    565565    '<p class="field"><label for="media_video_width">' . __('Width') . '</label> ' . 
    566     form::number('media_video_width', array( 
     566    form::number('media_video_width', [ 
    567567        'min'     => -1, 
    568568        'max'     => 999, 
    569569        'default' => $blog_settings->system->media_video_width 
    570     )) . 
     570    ]) . 
    571571    '</p>' . 
    572572 
    573573    '<p class="field"><label for="media_video_height">' . __('Height') . '</label> ' . 
    574     form::number('media_video_height', array( 
     574    form::number('media_video_height', [ 
    575575        'min'     => -1, 
    576576        'max'     => 999, 
    577577        'default' => $blog_settings->system->media_video_height 
    578     )) . 
     578    ]) . 
    579579    '</p>' . 
    580580 
     
    630630        echo 
    631631        '<p><label for="blog_url" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Blog URL:') . '</label>' . 
    632         form::url('blog_url', array( 
     632        form::url('blog_url', [ 
    633633            'size'       => 50, 
    634634            'max'        => 255, 
    635635            'default'    => html::escapeHTML($blog_url), 
    636636            'extra_html' => 'required placeholder="' . __('Blog URL') . '"' 
    637         )) . 
     637        ]) . 
    638638        '</p>' . 
    639639 
     
    721721    foreach ($robots_policy_options as $k => $v) { 
    722722        echo '<p><label for="robots_policy-' . $i . '" class="classic">' . 
    723         form::radio(array('robots_policy', 'robots_policy-' . $i), $k, $blog_settings->system->robots_policy == $k) . ' ' . $v . '</label></p>'; 
     723        form::radio(['robots_policy', 'robots_policy-' . $i], $k, $blog_settings->system->robots_policy == $k) . ' ' . $v . '</label></p>'; 
    724724        $i++; 
    725725    } 
     
    764764        '<form action="' . $core->adminurl->get("admin.blog.del") . '" method="post">' . 
    765765        '<p><input type="submit" class="delete" value="' . __('Delete this blog') . '" />' . 
    766         form::hidden(array('blog_id'), $blog_id) . 
     766        form::hidden(['blog_id'], $blog_id) . 
    767767        $core->formNonce() . '</p>' . 
    768768            '</form>'; 
     
    791791    } else { 
    792792        if ($core->auth->isSuperAdmin()) { 
    793             $user_url_p = '<a href="' . $core->adminurl->get("admin.user", array('id' => '%1$s'), '&amp;', true) . '">%1$s</a>'; 
     793            $user_url_p = '<a href="' . $core->adminurl->get("admin.user", ['id' => '%1$s'], '&amp;', true) . '">%1$s</a>'; 
    794794        } else { 
    795795            $user_url_p = '%1$s'; 
     
    826826                    '<ul>'; 
    827827                foreach ($post_type as $type => $pt_info) { 
    828                     $params = array( 
     828                    $params = [ 
    829829                        'post_type' => $type, 
    830830                        'user_id'   => $k 
    831                     ); 
     831                    ]; 
    832832                    echo '<li>' . sprintf(__('%1$s: %2$s'), __($pt_info['label']), $core->blog->getPosts($params, true)->f(0)) . '</li>'; 
    833833                } 
     
    862862                    '<form action="' . $core->adminurl->get('admin.user.actions') . '" method="post">' . 
    863863                    '<p class="change-user-perm"><input type="submit" class="reset" value="' . __('Change permissions') . '" />' . 
    864                     form::hidden(array('redir'), $core->adminurl->get("admin.blog.pref", array('id' => $k), '&')) . 
    865                     form::hidden(array('action'), 'perms') . 
    866                     form::hidden(array('users[]'), $k) . 
    867                     form::hidden(array('blogs[]'), $blog_id) . 
     864                    form::hidden(['redir'], $core->adminurl->get("admin.blog.pref", ['id' => $k], '&')) . 
     865                    form::hidden(['action'], 'perms') . 
     866                    form::hidden(['users[]'], $k) . 
     867                    form::hidden(['blogs[]'], $blog_id) . 
    868868                    $core->formNonce() . 
    869869                        '</p>' . 
Note: See TracChangeset for help on using the changeset viewer.

Sites map