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/blogroll
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • plugins/blogroll/_admin.php

    r3731 r3874  
    1818function blogroll_dashboard($core, $icons) 
    1919{ 
    20     $icons['blogroll'] = new ArrayObject(array( 
     20    $icons['blogroll'] = new ArrayObject([ 
    2121        __('Blogroll'), 
    2222        $core->adminurl->get('admin.plugin.blogroll'), 
    2323        dcPage::getPF('blogroll/icon.png') 
    24     )); 
     24    ]); 
    2525} 
    2626function blogroll_dashboard_favorites($core, $favs) 
    2727{ 
    28     $favs->register('blogroll', array( 
     28    $favs->register('blogroll', [ 
    2929        'title'       => __('Blogroll'), 
    3030        'url'         => $core->adminurl->get('admin.plugin.blogroll'), 
     
    3232        'large-icon'  => dcPage::getPF('blogroll/icon.png'), 
    3333        'permissions' => 'usage,contentadmin' 
    34     )); 
     34    ]); 
    3535} 
    3636function blogroll_users_actions_headers() 
  • plugins/blogroll/_define.php

    r3731 r3874  
    1717    "Olivier Meunier",      // Author 
    1818    '1.4',                  // Version 
    19     array( 
     19    [ 
    2020        'permissions' => 'blogroll', 
    2121        'type'        => 'plugin' 
    22     ) 
     22    ] 
    2323); 
  • plugins/blogroll/_public.php

    r3731 r3874  
    1515 
    1616# Blogroll template functions 
    17 $core->tpl->addValue('Blogroll', array('tplBlogroll', 'blogroll')); 
    18 $core->tpl->addValue('BlogrollXbelLink', array('tplBlogroll', 'blogrollXbelLink')); 
    19  
    20 $core->url->register('xbel', 'xbel', '^xbel(?:/?)$', array('urlBlogroll', 'xbel')); 
     17$core->tpl->addValue('Blogroll', ['tplBlogroll', 'blogroll']); 
     18$core->tpl->addValue('BlogrollXbelLink', ['tplBlogroll', 'blogrollXbelLink']); 
     19 
     20$core->url->register('xbel', 'xbel', '^xbel(?:/?)$', ['urlBlogroll', 'xbel']); 
    2121 
    2222class tplBlogroll 
     
    7575                return ''; 
    7676            } 
    77             $hierarchy = array($hierarchy[$category]); 
     77            $hierarchy = [$hierarchy[$category]]; 
    7878        } 
    7979 
  • plugins/blogroll/_widgets.php

    r3731 r3874  
    1212if (!defined('DC_RC_PATH')) {return;} 
    1313 
    14 $core->addBehavior('initWidgets', array('blogrollWidgets', 'initWidgets')); 
    15 $core->addBehavior('initDefaultWidgets', array('blogrollWidgets', 'initDefaultWidgets')); 
     14$core->addBehavior('initWidgets', ['blogrollWidgets', 'initWidgets']); 
     15$core->addBehavior('initDefaultWidgets', ['blogrollWidgets', 'initDefaultWidgets']); 
    1616 
    1717class blogrollWidgets 
     
    1919    public static function initWidgets($w) 
    2020    { 
    21         $w->create('links', __('Blogroll'), array('tplBlogroll', 'linksWidget'), null, 'Blogroll list'); 
     21        $w->create('links', __('Blogroll'), ['tplBlogroll', 'linksWidget'], null, 'Blogroll list'); 
    2222        $w->links->setting('title', __('Title (optional)') . ' :', __('Links')); 
    2323 
     
    2525        $h          = $br->getLinksHierarchy($br->getLinks()); 
    2626        $h          = array_keys($h); 
    27         $categories = array(__('All categories') => ''); 
     27        $categories = [__('All categories') => '']; 
    2828        foreach ($h as $v) { 
    2929            if ($v) { 
     
    3535 
    3636        $w->links->setting('homeonly', __('Display on:'), 1, 'combo', 
    37             array( 
     37            [ 
    3838                __('All pages')           => 0, 
    3939                __('Home page only')      => 1, 
    4040                __('Except on home page') => 2 
    41             ) 
     41            ] 
    4242        ); 
    4343        $w->links->setting('content_only', __('Content only'), 0, 'check'); 
  • plugins/blogroll/class.dc.blogroll.php

    r3817 r3874  
    2525    } 
    2626 
    27     public function getLinks($params = array()) 
     27    public function getLinks($params = []) 
    2828    { 
    2929        $strReq = 'SELECT link_id, link_title, link_desc, link_href, ' . 
     
    4646    } 
    4747 
    48     public function getLangs($params = array()) 
     48    public function getLangs($params = []) 
    4949    { 
    5050        // Use post_lang as an alias of link_lang to be able to use the dcAdminCombos::getLangsCombo() function 
     
    207207    public function getLinksHierarchy($rs) 
    208208    { 
    209         $res = array(); 
     209        $res = []; 
    210210 
    211211        foreach ($rs->rows() as $k => $v) { 
  • plugins/blogroll/class.dc.importblogroll.php

    r3731 r3874  
    3636        $outlines = $xml->xpath("//outline"); 
    3737 
    38         $this->entries = array(); 
     38        $this->entries = []; 
    3939        foreach ($outlines as $outline) { 
    4040            if (isset($outline['htmlUrl'])) { 
     
    6666        $outlines = $xml->xpath("//bookmark"); 
    6767 
    68         $this->entries = array(); 
     68        $this->entries = []; 
    6969        foreach ($outlines as $outline) { 
    7070            if (!isset($outline['href'])) { 
  • plugins/blogroll/edit.php

    r3817 r3874  
    8585 
    8686# Languages combo 
    87 $links      = $blogroll->getLangs(array('order' => 'asc')); 
     87$links      = $blogroll->getLangs(['order' => 'asc']); 
    8888$lang_combo = dcAdminCombos::getLangsCombo($links, true); 
    8989 
     
    9797<?php 
    9898echo dcPage::breadcrumb( 
    99     array( 
     99    [ 
    100100        html::escapeHTML($core->blog->name) => '', 
    101101        __('Blogroll')                      => $p_url 
    102     )) . 
     102    ]) . 
    103103dcPage::notices(); 
    104104?> 
     
    113113 
    114114    '<p><label for="link_desc" class="required classic"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label> ' . 
    115     form::field('link_desc', 30, 255, array( 
     115    form::field('link_desc', 30, 255, [ 
    116116        'default'    => html::escapeHTML($link_desc), 
    117117        'extra_html' => 'required placeholder="' . __('Title') . '"' 
    118     )) . 
     118    ]) . 
    119119 
    120120    form::hidden('edit', 1) . 
     
    133133 
    134134    '<p><label for="link_title" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label> ' . 
    135     form::field('link_title', 30, 255, array( 
     135    form::field('link_title', 30, 255, [ 
    136136        'default'    => html::escapeHTML($link_title), 
    137137        'extra_html' => 'required placeholder="' . __('Title') . '"' 
    138     )) . 
     138    ]) . 
    139139    '</p>' . 
    140140 
    141141    '<p><label for="link_href" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('URL:') . '</label> ' . 
    142     form::url('link_href', array( 
     142    form::url('link_href', [ 
    143143        'size'       => 30, 
    144144        'default'    => html::escapeHTML($link_href), 
    145145        'extra_html' => 'required placeholder="' . __('URL') . '"' 
    146     )) . 
     146    ]) . 
    147147    '</p>' . 
    148148 
     
    167167    '<th>' . __('_xfn_Me') . '</th>' . 
    168168    '<td><p>' . '<label class="classic">' . 
    169     form::checkbox(array('identity'), 'me', ($link_xfn == 'me')) . ' ' . 
     169    form::checkbox(['identity'], 'me', ($link_xfn == 'me')) . ' ' . 
    170170    __('_xfn_Another link for myself') . '</label></p></td>' . 
    171171    '</tr>' . 
     
    174174    '<th>' . __('_xfn_Friendship') . '</th>' . 
    175175    '<td><p>' . 
    176     '<label class="classic">' . form::radio(array('friendship'), 'contact', 
     176    '<label class="classic">' . form::radio(['friendship'], 'contact', 
    177177        strpos($link_xfn, 'contact') !== false) . __('_xfn_Contact') . '</label> ' . 
    178     '<label class="classic">' . form::radio(array('friendship'), 'acquaintance', 
     178    '<label class="classic">' . form::radio(['friendship'], 'acquaintance', 
    179179        strpos($link_xfn, 'acquaintance') !== false) . __('_xfn_Acquaintance') . '</label> ' . 
    180     '<label class="classic">' . form::radio(array('friendship'), 'friend', 
     180    '<label class="classic">' . form::radio(['friendship'], 'friend', 
    181181        strpos($link_xfn, 'friend') !== false) . __('_xfn_Friend') . '</label> ' . 
    182     '<label class="classic">' . form::radio(array('friendship'), '') . __('None') . '</label>' . 
     182    '<label class="classic">' . form::radio(['friendship'], '') . __('None') . '</label>' . 
    183183    '</p></td>' . 
    184184    '</tr>' . 
     
    187187    '<th>' . __('_xfn_Physical') . '</th>' . 
    188188    '<td><p>' . 
    189     '<label class="classic">' . form::checkbox(array('physical'), 'met', 
     189    '<label class="classic">' . form::checkbox(['physical'], 'met', 
    190190        strpos($link_xfn, 'met') !== false) . __('_xfn_Met') . '</label>' . 
    191191    '</p></td>' . 
     
    195195    '<th>' . __('_xfn_Professional') . '</th>' . 
    196196    '<td><p>' . 
    197     '<label class="classic">' . form::checkbox(array('professional[]'), 'co-worker', 
     197    '<label class="classic">' . form::checkbox(['professional[]'], 'co-worker', 
    198198        strpos($link_xfn, 'co-worker') !== false) . __('_xfn_Co-worker') . '</label> ' . 
    199     '<label class="classic">' . form::checkbox(array('professional[]'), 'colleague', 
     199    '<label class="classic">' . form::checkbox(['professional[]'], 'colleague', 
    200200        strpos($link_xfn, 'colleague') !== false) . __('_xfn_Colleague') . '</label>' . 
    201201    '</p></td>' . 
     
    205205    '<th>' . __('_xfn_Geographical') . '</th>' . 
    206206    '<td><p>' . 
    207     '<label class="classic">' . form::radio(array('geographical'), 'co-resident', 
     207    '<label class="classic">' . form::radio(['geographical'], 'co-resident', 
    208208        strpos($link_xfn, 'co-resident') !== false) . __('_xfn_Co-resident') . '</label> ' . 
    209     '<label class="classic">' . form::radio(array('geographical'), 'neighbor', 
     209    '<label class="classic">' . form::radio(['geographical'], 'neighbor', 
    210210        strpos($link_xfn, 'neighbor') !== false) . __('_xfn_Neighbor') . '</label> ' . 
    211     '<label class="classic">' . form::radio(array('geographical'), '') . __('None') . '</label>' . 
     211    '<label class="classic">' . form::radio(['geographical'], '') . __('None') . '</label>' . 
    212212    '</p></td>' . 
    213213    '</tr>' . 
     
    216216    '<th>' . __('_xfn_Family') . '</th>' . 
    217217    '<td><p>' . 
    218     '<label class="classic">' . form::radio(array('family'), 'child', 
     218    '<label class="classic">' . form::radio(['family'], 'child', 
    219219        strpos($link_xfn, 'child') !== false) . __('_xfn_Child') . '</label> ' . 
    220     '<label class="classic">' . form::radio(array('family'), 'parent', 
     220    '<label class="classic">' . form::radio(['family'], 'parent', 
    221221        strpos($link_xfn, 'parent') !== false) . __('_xfn_Parent') . '</label> ' . 
    222     '<label class="classic">' . form::radio(array('family'), 'sibling', 
     222    '<label class="classic">' . form::radio(['family'], 'sibling', 
    223223        strpos($link_xfn, 'sibling') !== false) . __('_xfn_Sibling') . '</label> ' . 
    224     '<label class="classic">' . form::radio(array('family'), 'spouse', 
     224    '<label class="classic">' . form::radio(['family'], 'spouse', 
    225225        strpos($link_xfn, 'spouse') !== false) . __('_xfn_Spouse') . '</label> ' . 
    226     '<label class="classic">' . form::radio(array('family'), 'kin', 
     226    '<label class="classic">' . form::radio(['family'], 'kin', 
    227227        strpos($link_xfn, 'kin') !== false) . __('_xfn_Kin') . '</label> ' . 
    228     '<label class="classic">' . form::radio(array('family'), '') . __('None') . '</label>' . 
     228    '<label class="classic">' . form::radio(['family'], '') . __('None') . '</label>' . 
    229229    '</p></td>' . 
    230230    '</tr>' . 
     
    233233    '<th>' . __('_xfn_Romantic') . '</th>' . 
    234234    '<td><p>' . 
    235     '<label class="classic">' . form::checkbox(array('romantic[]'), 'muse', 
     235    '<label class="classic">' . form::checkbox(['romantic[]'], 'muse', 
    236236        strpos($link_xfn, 'muse') !== false) . __('_xfn_Muse') . '</label> ' . 
    237     '<label class="classic">' . form::checkbox(array('romantic[]'), 'crush', 
     237    '<label class="classic">' . form::checkbox(['romantic[]'], 'crush', 
    238238        strpos($link_xfn, 'crush') !== false) . __('_xfn_Crush') . '</label> ' . 
    239     '<label class="classic">' . form::checkbox(array('romantic[]'), 'date', 
     239    '<label class="classic">' . form::checkbox(['romantic[]'], 'date', 
    240240        strpos($link_xfn, 'date') !== false) . __('_xfn_Date') . '</label> ' . 
    241     '<label class="classic">' . form::checkbox(array('romantic[]'), 'sweetheart', 
     241    '<label class="classic">' . form::checkbox(['romantic[]'], 'sweetheart', 
    242242        strpos($link_xfn, 'sweetheart') !== false) . __('_xfn_Sweetheart') . '</label> ' . 
    243243    '</p></td>' . 
  • plugins/blogroll/index.php

    r3731 r3874  
    125125 
    126126# Order links 
    127 $order = array(); 
     127$order = []; 
    128128if (empty($_POST['links_order']) && !empty($_POST['order'])) { 
    129129    $order = $_POST['order']; 
     
    178178<?php 
    179179echo dcPage::breadcrumb( 
    180     array( 
     180    [ 
    181181        html::escapeHTML($core->blog->name) => '', 
    182182        __('Blogroll')                      => '' 
    183     )) . 
     183    ]) . 
    184184dcPage::notices(); 
    185185?> 
     
    208208        echo 
    209209        '<tr class="line" id="l_' . $rs->link_id . '">' . 
    210         '<td class="handle minimal">' . form::field(array('order[' . $rs->link_id . ']'), 2, 5, array( 
     210        '<td class="handle minimal">' . form::field(['order[' . $rs->link_id . ']'], 2, 5, [ 
    211211            'default'    => $position, 
    212212            'class'      => 'position', 
    213213            'extra_html' => 'title="' . __('position') . '"' 
    214         )) . 
     214        ]) . 
    215215        '</td>' . 
    216         '<td class="minimal">' . form::checkbox(array('remove[]'), $rs->link_id, 
    217             array( 
     216        '<td class="minimal">' . form::checkbox(['remove[]'], $rs->link_id, 
     217            [ 
    218218                'extra_html' => 'title="' . __('select this link') . '"' 
    219             ) 
     219            ] 
    220220        ) . '</td>'; 
    221221 
     
    244244echo 
    245245    form::hidden('links_order', '') . 
    246     form::hidden(array('p'), 'blogroll') . 
     246    form::hidden(['p'], 'blogroll') . 
    247247    $core->formNonce(); 
    248248    ?> 
     
    268268'<h3>' . __('Add a new link') . '</h3>' . 
    269269'<p class="col"><label for="link_title" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label> ' . 
    270 form::field('link_title', 30, 255, array( 
     270form::field('link_title', 30, 255, [ 
    271271    'default'    => $link_title, 
    272272    'extra_html' => 'required placeholder="' . __('Title') . '"' 
    273 )) . 
     273]) . 
    274274'</p>' . 
    275275 
    276276'<p class="col"><label for="link_href" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('URL:') . '</label> ' . 
    277 form::field('link_href', 30, 255, array( 
     277form::field('link_href', 30, 255, [ 
    278278    'default'    => $link_href, 
    279279    'extra_html' => 'required placeholder="' . __('URL') . '"' 
    280 )) . 
     280]) . 
    281281'</p>' . 
    282282 
     
    288288form::field('link_lang', 5, 5, $link_lang) . 
    289289'</p>' . 
    290 '<p>' . form::hidden(array('p'), 'blogroll') . 
     290'<p>' . form::hidden(['p'], 'blogroll') . 
    291291$core->formNonce() . 
    292292'<input type="submit" name="add_link" value="' . __('Save') . '" /></p>' . 
     
    299299'<h3>' . __('Add a new category') . '</h3>' . 
    300300'<p><label for="cat_title" class=" classic required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label> ' . 
    301 form::field('cat_title', 30, 255, array( 
     301form::field('cat_title', 30, 255, [ 
    302302    'default'    => $cat_title, 
    303303    'extra_html' => 'required placeholder="' . __('Title') . '"' 
    304 )) . 
     304]) . 
    305305' ' . 
    306 form::hidden(array('p'), 'blogroll') . 
     306form::hidden(['p'], 'blogroll') . 
    307307$core->formNonce() . 
    308308'<input type="submit" name="add_cat" value="' . __('Save') . '" /></p>' . 
     
    318318    '<p><label for="links_file" class=" classic required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('OPML or XBEL File:') . '</label> ' . 
    319319    '<input type="file" id="links_file" name="links_file" required /></p>' . 
    320     '<p>' . form::hidden(array('p'), 'blogroll') . 
     320    '<p>' . form::hidden(['p'], 'blogroll') . 
    321321    $core->formNonce() . 
    322322    '<input type="submit" name="import_links" value="' . __('Import') . '" /></p>' . 
     
    342342 
    343343            echo 
    344             '<tr><td>' . form::checkbox(array('entries[]'), $i) . '</td>' . 
     344            '<tr><td>' . form::checkbox(['entries[]'], $i) . '</td>' . 
    345345                '<td nowrap><a href="' . $url . '">' . $title . '</a>' . 
    346346                '<input type="hidden" name="url[' . $i . ']" value="' . $url . '" />' . 
     
    358358 
    359359        '<p class="col right">' . 
    360         form::hidden(array('p'), 'blogroll') . 
     360        form::hidden(['p'], 'blogroll') . 
    361361        $core->formNonce() . 
    362362        '<input type="submit" name="cancel_import" value="' . __('Cancel') . '" />&nbsp;' . 
Note: See TracChangeset for help on using the changeset viewer.

Sites map