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
  • inc/admin/lib.admincombos.php

    r3731 r3874  
    2929    public static function getCategoriesCombo($categories, $include_empty = true, $use_url = false) 
    3030    { 
    31         $categories_combo = array(); 
     31        $categories_combo = []; 
    3232        if ($include_empty) { 
    33             $categories_combo = array(new formSelectOption(__('(No cat)'), '')); 
     33            $categories_combo = [new formSelectOption(__('(No cat)'), '')]; 
    3434        } 
    3535        while ($categories->fetch()) { 
     
    5151    public static function getPostStatusesCombo() 
    5252    { 
    53         $status_combo = array(); 
     53        $status_combo = []; 
    5454        foreach (self::$core->blog->getAllPostStatus() as $k => $v) { 
    5555            $status_combo[$v] = (string) $k; 
     
    6666    public static function getUsersCombo($users) 
    6767    { 
    68         $users_combo = array(); 
     68        $users_combo = []; 
    6969        while ($users->fetch()) { 
    7070            $user_cn = dcUtils::getUserCN($users->user_id, $users->user_name, 
     
    8888    public static function getDatesCombo($dates) 
    8989    { 
    90         $dt_m_combo = array(); 
     90        $dt_m_combo = []; 
    9191        while ($dates->fetch()) { 
    9292            $dt_m_combo[dt::str('%B %Y', $dates->ts())] = $dates->year() . $dates->month(); 
     
    107107        $all_langs = l10n::getISOcodes(0, 1); 
    108108        if ($with_available) { 
    109             $langs_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1, 1)); 
     109            $langs_combo = ['' => '', __('Most used') => [], __('Available') => l10n::getISOcodes(1, 1)]; 
    110110            while ($langs->fetch()) { 
    111111                if (isset($all_langs[$langs->post_lang])) { 
     
    117117            } 
    118118        } else { 
    119             $langs_combo = array(); 
     119            $langs_combo = []; 
    120120            while ($langs->fetch()) { 
    121121                $lang_name               = isset($all_langs[$langs->post_lang]) ? $all_langs[$langs->post_lang] : $langs->post_lang; 
     
    134134    public static function getAdminLangsCombo() 
    135135    { 
    136         $lang_combo = array(); 
     136        $lang_combo = []; 
    137137        $langs      = l10n::getISOcodes(1, 1); 
    138138        foreach ($langs as $k => $v) { 
     
    150150    public static function getEditorsCombo() 
    151151    { 
    152         $editors_combo = array(); 
     152        $editors_combo = []; 
    153153 
    154154        foreach (self::$core->getEditors() as $v) { 
     
    167167    public static function getFormatersCombo($editor_id = '') 
    168168    { 
    169         $formaters_combo = array(); 
     169        $formaters_combo = []; 
    170170 
    171171        if (!empty($editor_id)) { 
     
    191191    public static function getBlogStatusesCombo() 
    192192    { 
    193         $status_combo = array(); 
     193        $status_combo = []; 
    194194        foreach (self::$core->getAllBlogStatus() as $k => $v) { 
    195195            $status_combo[$v] = (string) $k; 
     
    205205    public static function getCommentStatusescombo() 
    206206    { 
    207         $status_combo = array(); 
     207        $status_combo = []; 
    208208        foreach (self::$core->blog->getAllCommentStatus() as $k => $v) { 
    209209            $status_combo[$v] = (string) $k; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map