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/blowupConfig
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • plugins/blowupConfig/_define.php

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

    r3731 r3874  
    1717 
    1818require dirname(__FILE__) . '/lib/class.blowup.config.php'; 
    19 $core->addBehavior('publicHeadContent', array('tplBlowupTheme', 'publicHeadContent')); 
     19$core->addBehavior('publicHeadContent', ['tplBlowupTheme', 'publicHeadContent']); 
    2020 
    2121class tplBlowUpTheme 
  • plugins/blowupConfig/index.php

    r3731 r3874  
    2222} 
    2323 
    24 $blowup_base = array( 
     24$blowup_base = [ 
    2525    'body_bg_c'           => null, 
    2626    'body_bg_g'           => 'light', 
     
    8181 
    8282    'extra_css'           => null 
    83 ); 
     83]; 
    8484 
    8585$blowup_user = $core->blog->settings->themes->blowup_style; 
     
    8787$blowup_user = @unserialize($blowup_user); 
    8888if (!is_array($blowup_user)) { 
    89     $blowup_user = array(); 
     89    $blowup_user = []; 
    9090} 
    9191 
    9292$blowup_user = array_merge($blowup_base, $blowup_user); 
    9393 
    94 $gradient_types = array( 
     94$gradient_types = [ 
    9595    __('Light linear gradient')  => 'light', 
    9696    __('Medium linear gradient') => 'medium', 
    9797    __('Dark linear gradient')   => 'dark', 
    9898    __('Solid color')            => 'solid' 
    99 ); 
    100  
    101 $top_images = array(__('Custom...') => 'custom'); 
     99]; 
     100 
     101$top_images = [__('Custom...') => 'custom']; 
    102102$top_images = array_merge($top_images, array_flip(blowupConfig::$top_images)); 
    103103 
     
    205205  <?php 
    206206echo dcPage::jsLoad(dcPage::getPF('blowupConfig/js/config.js')); 
    207 echo dcPage::jsVars(array( 
     207echo dcPage::jsVars([ 
    208208    'dotclear.blowup_public_url'          => blowupConfig::imagesURL(), 
    209209    'dotclear.msg.predefined_styles'      => __('Predefined styles'), 
    210210    'dotclear.msg.apply_code'             => __('Apply code'), 
    211211    'dotclear.msg.predefined_style_title' => __('Choose a predefined style') 
    212 )); 
     212]); 
    213213?> 
    214214</head> 
     
    217217<?php 
    218218echo dcPage::breadcrumb( 
    219     array( 
     219    [ 
    220220        html::escapeHTML($core->blog->name) => '', 
    221221        __('Blog appearance')               => $core->adminurl->get('admin.blog.theme'), 
    222222        __('Blowup configuration')          => '' 
    223     )) . dcPage::notices(); 
     223    ]) . dcPage::notices(); 
    224224 
    225225echo 
     
    239239    echo 
    240240    '<p class="field"><label for="body_bg_c">' . __('Background color:') . '</label> ' . 
    241     form::color('body_bg_c', array('default' => $blowup_user['body_bg_c'])) . '</p>' . 
     241    form::color('body_bg_c', ['default' => $blowup_user['body_bg_c']]) . '</p>' . 
    242242 
    243243    '<p class="field"><label for="body_bg_g">' . __('Background color fill:') . '</label> ' . 
     
    253253 
    254254'<p class="field"><label for="body_txt_c">' . __('Main text color:') . '</label> ' . 
    255 form::color('body_txt_c', array('default' => $blowup_user['body_txt_c'])) . '</p>' . 
     255form::color('body_txt_c', ['default' => $blowup_user['body_txt_c']]) . '</p>' . 
    256256 
    257257'<p class="field"><label for="body_line_height">' . __('Text line height:') . '</label> ' . 
     
    260260'<h4 class="border-top">' . __('Links') . '</h4>' . 
    261261'<p class="field"><label for="body_link_c">' . __('Links color:') . '</label> ' . 
    262 form::color('body_link_c', array('default' => $blowup_user['body_link_c'])) . '</p>' . 
     262form::color('body_link_c', ['default' => $blowup_user['body_link_c']]) . '</p>' . 
    263263 
    264264'<p class="field"><label for="body_link_v_c">' . __('Visited links color:') . '</label> ' . 
    265 form::color('body_link_v_c', array('default' => $blowup_user['body_link_v_c'])) . '</p>' . 
     265form::color('body_link_v_c', ['default' => $blowup_user['body_link_v_c']]) . '</p>' . 
    266266 
    267267'<p class="field"><label for="body_link_f_c">' . __('Focus links color:') . '</label> ' . 
    268 form::color('body_link_f_c', array('default' => $blowup_user['body_link_f_c'])) . '</p>' . 
     268form::color('body_link_f_c', ['default' => $blowup_user['body_link_f_c']]) . '</p>' . 
    269269 
    270270'<h4 class="border-top">' . __('Page top') . '</h4>'; 
     
    273273    echo 
    274274    '<p class="field"><label for="prelude_c">' . __('Prelude color:') . '</label> ' . 
    275     form::color('prelude_c', array('default' => $blowup_user['prelude_c'])) . '</p>'; 
     275    form::color('prelude_c', ['default' => $blowup_user['prelude_c']]) . '</p>'; 
    276276} 
    277277 
     
    287287 
    288288'<p class="field"><label for="blog_title_c">' . __('Main title color:') . '</label> ' . 
    289 form::color('blog_title_c', array('default' => $blowup_user['blog_title_c'])) . '</p>' . 
     289form::color('blog_title_c', ['default' => $blowup_user['blog_title_c']]) . '</p>' . 
    290290 
    291291'<p class="field"><label for="blog_title_a">' . __('Main title alignment:') . '</label> ' . 
    292 form::combo('blog_title_a', array(__('center') => 'center', __('left') => 'left', __('right') => 'right'), $blowup_user['blog_title_a']) . '</p>' . 
     292form::combo('blog_title_a', [__('center') => 'center', __('left') => 'left', __('right') => 'right'], $blowup_user['blog_title_a']) . '</p>' . 
    293293 
    294294'<p class="field"><label for="blog_title_p">' . __('Main title position (x:y)') . '</label> ' . 
     
    322322'<h4 class="border-top">' . __('Sidebar') . '</h4>' . 
    323323'<p class="field"><label for="sidebar_position">' . __('Sidebar position:') . '</label> ' . 
    324 form::combo('sidebar_position', array(__('right') => 'right', __('left') => 'left'), $blowup_user['sidebar_position']) . '</p>' . 
     324form::combo('sidebar_position', [__('right') => 'right', __('left') => 'left'], $blowup_user['sidebar_position']) . '</p>' . 
    325325 
    326326'<p class="field"><label for="sidebar_text_f">' . __('Sidebar text font:') . '</label> ' . 
     
    331331 
    332332'<p class="field"><label for="sidebar_text_c">' . __('Sidebar text color:') . '</label> ' . 
    333 form::color('sidebar_text_c', array('default' => $blowup_user['sidebar_text_c'])) . '</p>' . 
     333form::color('sidebar_text_c', ['default' => $blowup_user['sidebar_text_c']]) . '</p>' . 
    334334 
    335335'<p class="field"><label for="sidebar_title_f">' . __('Sidebar titles font:') . '</label> ' . 
     
    340340 
    341341'<p class="field"><label for="sidebar_title_c">' . __('Sidebar titles color:') . '</label> ' . 
    342 form::color('sidebar_title_c', array('default' => $blowup_user['sidebar_title_c'])) . '</p>' . 
     342form::color('sidebar_title_c', ['default' => $blowup_user['sidebar_title_c']]) . '</p>' . 
    343343 
    344344'<p class="field"><label for="sidebar_title2_f">' . __('Sidebar 2nd level titles font:') . '</label> ' . 
     
    349349 
    350350'<p class="field"><label for="sidebar_title2_c">' . __('Sidebar 2nd level titles color:') . '</label> ' . 
    351 form::color('sidebar_title2_c', array('default' => $blowup_user['sidebar_title2_c'])) . '</p>' . 
     351form::color('sidebar_title2_c', ['default' => $blowup_user['sidebar_title2_c']]) . '</p>' . 
    352352 
    353353'<p class="field"><label for="sidebar_line_c">' . __('Sidebar lines color:') . '</label> ' . 
    354 form::color('sidebar_line_c', array('default' => $blowup_user['sidebar_line_c'])) . '</p>' . 
     354form::color('sidebar_line_c', ['default' => $blowup_user['sidebar_line_c']]) . '</p>' . 
    355355 
    356356'<p class="field"><label for="sidebar_link_c">' . __('Sidebar links color:') . '</label> ' . 
    357 form::color('sidebar_link_c', array('default' => $blowup_user['sidebar_link_c'])) . '</p>' . 
     357form::color('sidebar_link_c', ['default' => $blowup_user['sidebar_link_c']]) . '</p>' . 
    358358 
    359359'<p class="field"><label for="sidebar_link_v_c">' . __('Sidebar visited links color:') . '</label> ' . 
    360 form::color('sidebar_link_v_c', array('default' => $blowup_user['sidebar_link_v_c'])) . '</p>' . 
     360form::color('sidebar_link_v_c', ['default' => $blowup_user['sidebar_link_v_c']]) . '</p>' . 
    361361 
    362362'<p class="field"><label for="sidebar_link_f_c">' . __('Sidebar focus links color:') . '</label> ' . 
    363 form::color('sidebar_link_f_c', array('default' => $blowup_user['sidebar_link_f_c'])) . '</p>' . 
     363form::color('sidebar_link_f_c', ['default' => $blowup_user['sidebar_link_f_c']]) . '</p>' . 
    364364 
    365365'<h4 class="border-top">' . __('Entries') . '</h4>' . 
     
    371371 
    372372'<p class="field"><label for="date_title_c">' . __('Date title color:') . '</label> ' . 
    373 form::color('date_title_c', array('default' => $blowup_user['date_title_c'])) . '</p>' . 
     373form::color('date_title_c', ['default' => $blowup_user['date_title_c']]) . '</p>' . 
    374374 
    375375'<p class="field"><label for="post_title_f">' . __('Entry title font:') . '</label> ' . 
     
    380380 
    381381'<p class="field"><label for="post_title_c">' . __('Entry title color:') . '</label> ' . 
    382 form::color('post_title_c', array('default' => $blowup_user['post_title_c'])) . '</p>'; 
     382form::color('post_title_c', ['default' => $blowup_user['post_title_c']]) . '</p>'; 
    383383 
    384384if ($can_write_images) { 
    385385    echo 
    386386    '<p class="field"><label for="post_comment_bg_c">' . __('Comment background color:') . '</label> ' . 
    387     form::color('post_comment_bg_c', array('default' => $blowup_user['post_comment_bg_c'])) . '</p>'; 
     387    form::color('post_comment_bg_c', ['default' => $blowup_user['post_comment_bg_c']]) . '</p>'; 
    388388} 
    389389 
    390390echo 
    391391'<p class="field"><label for="post_comment_c">' . __('Comment text color:') . '</label> ' . 
    392 form::color('post_comment_c', array('default' => $blowup_user['post_comment_c'])) . '</p>'; 
     392form::color('post_comment_c', ['default' => $blowup_user['post_comment_c']]) . '</p>'; 
    393393 
    394394if ($can_write_images) { 
    395395    echo 
    396396    '<p class="field"><label for="post_commentmy_bg_c">' . __('My comment background color:') . '</label> ' . 
    397     form::color('post_commentmy_bg_c', array('default' => $blowup_user['post_commentmy_bg_c'])) . '</p>'; 
     397    form::color('post_commentmy_bg_c', ['default' => $blowup_user['post_commentmy_bg_c']]) . '</p>'; 
    398398} 
    399399 
    400400echo 
    401401'<p class="field"><label for="post_commentmy_c">' . __('My comment text color:') . '</label> ' . 
    402 form::color('post_commentmy_c', array('default' => $blowup_user['post_commentmy_c'])) . '</p>' . 
     402form::color('post_commentmy_c', ['default' => $blowup_user['post_commentmy_c']]) . '</p>' . 
    403403 
    404404'<h4 class="border-top">' . __('Footer') . '</h4>' . 
     
    410410 
    411411'<p class="field"><label for="footer_c">' . __('Footer color:') . '</label> ' . 
    412 form::color('footer_c', array('default' => $blowup_user['footer_c'])) . '</p>' . 
     412form::color('footer_c', ['default' => $blowup_user['footer_c']]) . '</p>' . 
    413413 
    414414'<p class="field"><label for="footer_l_c">' . __('Footer links color:') . '</label> ' . 
    415 form::color('footer_l_c', array('default' => $blowup_user['footer_l_c'])) . '</p>' . 
     415form::color('footer_l_c', ['default' => $blowup_user['footer_l_c']]) . '</p>' . 
    416416 
    417417'<p class="field"><label for="footer_bg_c">' . __('Footer background color:') . '</label> ' . 
    418 form::color('footer_bg_c', array('default' => $blowup_user['footer_bg_c'])) . '</p>'; 
     418form::color('footer_bg_c', ['default' => $blowup_user['footer_bg_c']]) . '</p>'; 
    419419 
    420420echo 
    421421'<h4 class="border-top">' . __('Additional CSS') . '</h4>' . 
    422422'<p><label for="extra_css">' . __('Any additional CSS styles (must be written using the CSS syntax):') . '</label> ' . 
    423 form::textarea('extra_css', 72, 5, array( 
     423form::textarea('extra_css', 72, 5, [ 
    424424    'default'    => html::escapeHTML($blowup_user['extra_css']), 
    425425    'class'      => 'maximal', 
    426426    'extra_html' => 'title="' . __('Additional CSS') . '"' 
    427 )) . 
     427]) . 
    428428    '</p>' . 
    429429    '</div>'; 
    430430 
    431431// Import / Export configuration 
    432 $tmp_array   = array(); 
    433 $tmp_exclude = array('uploaded', 'top_height'); 
     432$tmp_array   = []; 
     433$tmp_exclude = ['uploaded', 'top_height']; 
    434434if ($blowup_user['top_image'] == 'custom') { 
    435435    $tmp_exclude[] = 'top_image'; 
     
    445445'<div id="bu_export_content">' . 
    446446'<p>' . __('You can share your configuration using the following code. To apply a configuration, paste the code, click on "Apply code" and save.') . '</p>' . 
    447 '<p>' . form::textarea('export_code', 72, 5, array( 
     447'<p>' . form::textarea('export_code', 72, 5, [ 
    448448    'default'    => implode('; ', $tmp_array), 
    449449    'class'      => 'maximal', 
    450450    'extra_html' => 'title="' . __('Copy this code:') . '"' 
    451 )) . '</p>' . 
     451]) . '</p>' . 
    452452    '</div>' . 
    453453    '</div>'; 
  • plugins/blowupConfig/lib/class.blowup.config.php

    r3731 r3874  
    1717    protected static $img_folder = 'blowup-images'; 
    1818 
    19     protected static $fonts = array( 
    20         'sans-serif' => array( 
     19    protected static $fonts = [ 
     20        'sans-serif' => [ 
    2121            'ss1' => 'Arial, Helvetica, sans-serif', 
    2222            'ss2' => 'Verdana,Geneva, Arial, Helvetica, sans-serif', 
     
    2424            'ss4' => '"Trebuchet MS", Helvetica, sans-serif', 
    2525            'ss5' => 'Impact, Charcoal, sans-serif' 
    26         ), 
    27  
    28         'serif'      => array( 
     26        ], 
     27 
     28        'serif'      => [ 
    2929            's1' => 'Times, "Times New Roman", serif', 
    3030            's2' => 'Georgia, serif', 
    3131            's3' => 'Baskerville, "Palatino Linotype", serif' 
    32         ), 
    33  
    34         'monospace'  => array( 
     32        ], 
     33 
     34        'monospace'  => [ 
    3535            'm1' => '"Andale Mono", "Courier New", monospace', 
    3636            'm2' => '"Courier New", Courier, mono, monospace' 
    37         ) 
    38     ); 
    39  
    40     protected static $fonts_combo = array(); 
    41     protected static $fonts_list  = array(); 
    42  
    43     public static $top_images = array( 
     37        ] 
     38    ]; 
     39 
     40    protected static $fonts_combo = []; 
     41    protected static $fonts_list  = []; 
     42 
     43    public static $top_images = [ 
    4444        'default'        => 'Default', 
    4545        'blank'          => 'Blank', 
     
    5858        'roadrunner-2'   => 'Road Runner 2', 
    5959        'typo'           => 'Typo' 
    60     ); 
     60    ]; 
    6161 
    6262    public static function fontsList() 
     
    6565            self::$fonts_combo[__('default')] = ''; 
    6666            foreach (self::$fonts as $family => $g) { 
    67                 $fonts = array(); 
     67                $fonts = []; 
    6868                foreach ($g as $code => $font) { 
    6969                    $fonts[str_replace('"', '', $font)] = $code; 
     
    157157        } 
    158158 
    159         $css = array(); 
     159        $css = []; 
    160160 
    161161        /* Sidebar position 
     
    199199            dcThemeConfig::prop($css, '#top h1 span', 'text-indent', '-5000px'); 
    200200            dcThemeConfig::prop($css, '#top h1', 'top', '0px'); 
    201             $css['#top h1 a'] = array( 
     201            $css['#top h1 a'] = [ 
    202202                'display' => 'block', 
    203203                'height'  => $s['top_height'] ? ($s['top_height'] - 10) . 'px' : '120px', 
    204204                'width'   => '800px' 
    205             ); 
     205            ]; 
    206206        } 
    207207        dcThemeConfig::prop($css, '#top', 'height', $s['top_height']); 
     
    325325        } 
    326326 
    327         $body_fill = array( 
     327        $body_fill = [ 
    328328            'light'  => dirname(__FILE__) . '/../alpha-img/gradient-l.png', 
    329329            'medium' => dirname(__FILE__) . '/../alpha-img/gradient-m.png', 
    330330            'dark'   => dirname(__FILE__) . '/../alpha-img/gradient-d.png' 
    331         ); 
     331        ]; 
    332332 
    333333        $body_g = isset($body_fill[$gradient]) ? $body_fill[$gradient] : false; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map