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() → [])

Location:
plugins/userPref
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/userPref/_define.php

    r3731 r3874  
    1717    "Franck Paul",                            // Author 
    1818    '0.3',                                    // Version 
    19     array( 
     19    [ 
    2020        'type' => 'plugin' 
    21     ) 
     21    ] 
    2222); 
  • plugins/userPref/index.php

    r3813 r3874  
    6969{ 
    7070    if ($s['type'] == 'boolean') { 
    71         $field = form::combo(array($field_name . '[' . $ws . '][' . $id . ']', $field_name . '_' . $ws . '_' . $id), 
    72             array(__('yes') => 1, __('no') => 0), $s['value'] ? 1 : 0); 
     71        $field = form::combo([$field_name . '[' . $ws . '][' . $id . ']', $field_name . '_' . $ws . '_' . $id], 
     72            [__('yes') => 1, __('no') => 0], $s['value'] ? 1 : 0); 
    7373    } else { 
    7474        if ($s['type'] == 'array') { 
    75             $field = form::field(array($field_name . '[' . $ws . '][' . $id . ']', $field_name . '_' . $ws . '_' . $id), 40, null, 
     75            $field = form::field([$field_name . '[' . $ws . '][' . $id . ']', $field_name . '_' . $ws . '_' . $id], 40, null, 
    7676                html::escapeHTML(json_encode($s['value']))); 
    7777        } else { 
    78             $field = form::field(array($field_name . '[' . $ws . '][' . $id . ']', $field_name . '_' . $ws . '_' . $id), 40, null, 
     78            $field = form::field([$field_name . '[' . $ws . '][' . $id . ']', $field_name . '_' . $ws . '_' . $id], 40, null, 
    7979                html::escapeHTML($s['value'])); 
    8080        } 
    8181    } 
    82     $type = form::hidden(array($field_name . '_type' . '[' . $ws . '][' . $id . ']', $field_name . '_' . $ws . '_' . $id . '_type'), 
     82    $type = form::hidden([$field_name . '_type' . '[' . $ws . '][' . $id . ']', $field_name . '_' . $ws . '_' . $id . '_type'], 
    8383        html::escapeHTML($s['type'])); 
    8484 
     
    103103<?php 
    104104echo dcPage::breadcrumb( 
    105     array( 
     105    [ 
    106106        __('System')                            => '', 
    107107        html::escapeHTML($core->auth->userID()) => '', 
    108108        __('user:preferences')                  => '' 
    109     )) . 
     109    ]) . 
    110110dcPage::notices(); 
    111111 
     
    128128$table_footer = '</tbody></table></div>'; 
    129129 
    130 $prefs = array(); 
     130$prefs = []; 
    131131foreach ($core->auth->user_prefs->dumpWorkspaces() as $ws => $workspace) { 
    132132    foreach ($workspace->dumpPrefs() as $k => $v) { 
     
    136136ksort($prefs); 
    137137if (count($prefs) > 0) { 
    138     $ws_combo = array(); 
     138    $ws_combo = []; 
    139139    foreach ($prefs as $ws => $s) { 
    140140        $ws_combo[$ws] = '#l_' . $ws; 
     
    144144    '<p class="anchor-nav">' . 
    145145    '<label for="lp_nav" class="classic">' . __('Goto:') . '</label> ' . 
    146     form::combo('lp_nav', $ws_combo, array('class' => 'navigation')) . 
     146    form::combo('lp_nav', $ws_combo, ['class' => 'navigation']) . 
    147147    ' <input type="submit" value="' . __('Ok') . '" id="lp_submit" />' . 
    148148    '<input type="hidden" name="p" value="userPref" />' . 
     
    174174 
    175175<?php 
    176 $prefs = array(); 
     176$prefs = []; 
    177177 
    178178foreach ($core->auth->user_prefs->dumpWorkspaces() as $ws => $workspace) { 
     
    185185 
    186186if (count($prefs) > 0) { 
    187     $ws_combo = array(); 
     187    $ws_combo = []; 
    188188    foreach ($prefs as $ws => $s) { 
    189189        $ws_combo[$ws] = '#g_' . $ws; 
     
    193193    '<p class="anchor-nav">' . 
    194194    '<label for="gp_nav" class="classic">' . __('Goto:') . '</label> ' . 
    195     form::combo('gp_nav', $ws_combo, array('class' => 'navigation')) . 
     195    form::combo('gp_nav', $ws_combo, ['class' => 'navigation']) . 
    196196    ' <input type="submit" value="' . __('Ok') . '" id="gp_submit" />' . 
    197197    '<input type="hidden" name="p" value="userPref" />' . 
Note: See TracChangeset for help on using the changeset viewer.

Sites map