Dotclear

Changeset 3874:ab8368569446 for themes


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:
themes
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • themes/berlin/_define.php

    r3731 r3874  
    1717    "Dotclear Team",               // Author 
    1818    '1.2',                         // Version 
    19     array(                         // Properties 
     19    [                              // Properties 
    2020        'type'   => 'theme', 
    2121        'tplset' => 'dotty' 
    22     ) 
     22    ] 
    2323); 
  • themes/berlin/_public.php

    r3731 r3874  
    1717//__('Show menu').__('Hide menu').__('Navigation'); 
    1818 
    19 $core->addBehavior('publicHeadContent', array(__NAMESPACE__ . '\behaviorBerlinTheme', 'publicHeadContent')); 
     19$core->addBehavior('publicHeadContent', [__NAMESPACE__ . '\behaviorBerlinTheme', 'publicHeadContent']); 
    2020 
    2121class behaviorBerlinTheme 
     
    2323    public static function publicHeadContent() 
    2424    { 
    25         echo \dcUtils::jsVars(array( 
     25        echo \dcUtils::jsVars([ 
    2626            'dotclear_berlin_show_menu'  => __('Show menu'), 
    2727            'dotclear_berlin_hide_menu'  => __('Hide menu'), 
    2828            'dotclear_berlin_navigation' => __('Navigation') 
    29         )); 
     29        ]); 
    3030    } 
    3131} 
  • themes/blueSilence/_define.php

    r3731 r3874  
    1717    "Marco / marcarea.com", // Author 
    1818    '1.0',                  // Version 
    19     array( 
     19    [ 
    2020        'type' => 'theme' 
    21     ) 
     21    ] 
    2222); 
  • themes/customCSS/_define.php

    r3731 r3874  
    1717    "Olivier",                  // Author 
    1818    '1.2',                      // Version 
    19     array( 
     19    [ 
    2020        'type' => 'theme' 
    21     ) 
     21    ] 
    2222); 
  • themes/customCSS/_public.php

    r3731 r3874  
    1414if (!defined('DC_RC_PATH')) {return;} 
    1515 
    16 $core->addBehavior('publicHeadContent', array(__NAMESPACE__ . '\tplCustomTheme', 'publicHeadContent')); 
     16$core->addBehavior('publicHeadContent', [__NAMESPACE__ . '\tplCustomTheme', 'publicHeadContent']); 
    1717 
    1818class tplCustomTheme 
  • themes/default/_define.php

    r3731 r3874  
    1717    "Marco & Olivier",                            // Author 
    1818    '1.0',                                        // Version 
    19     array( 
     19    [ 
    2020        'type' => 'theme' 
    21     ) 
     21    ] 
    2222); 
  • themes/ductile/_config.php

    r3731 r3874  
    3030} 
    3131 
    32 $list_types = array( 
     32$list_types = [ 
    3333    __('Title') => 'title', 
    3434    __('Short') => 'short', 
    3535    __('Full')  => 'full' 
    36 ); 
     36]; 
    3737// Get all _entry-*.html in tpl folder of theme 
    3838$list_types_templates = files::scandir($tpl_path); 
     
    5050} 
    5151 
    52 $contexts = array( 
     52$contexts = [ 
    5353    'default'      => __('Home (first page)'), 
    5454    'default-page' => __('Home (other pages)'), 
     
    5757    'search'       => __('Search result entries'), 
    5858    'archive'      => __('Month archive entries') 
    59 ); 
    60  
    61 $fonts = array( 
     59]; 
     60 
     61$fonts = [ 
    6262    __('Default')           => '', 
    6363    __('Ductile primary')   => 'Ductile body', 
     
    7171    __('Impact')            => 'Impact', 
    7272    __('Monospace')         => 'Monospace' 
    73 ); 
    74  
    75 $webfont_apis = array( 
     73]; 
     74 
     75$webfont_apis = [ 
    7676    __('none')                => '', 
    7777    __('javascript (Adobe)')  => 'js', 
    7878    __('stylesheet (Google)') => 'css' 
    79 ); 
    80  
    81 $font_families = array( 
     79]; 
     80 
     81$font_families = [ 
    8282    // Theme standard 
    8383    'Ductile body'      => '"Century Schoolbook", "Century Schoolbook L", Georgia, serif', 
     
    9999    // Monospace families 
    100100    'Monospace'         => 'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace' 
    101 ); 
     101]; 
    102102 
    103103function fontDef($c) 
     
    108108} 
    109109 
    110 $ductile_base = array( 
     110$ductile_base = [ 
    111111    // HTML 
    112112    'subtitle_hidden'          => null, 
     
    138138    'post_title_c_m'           => null, 
    139139    'post_simple_title_c'      => null 
    140 ); 
    141  
    142 $ductile_lists_base = array( 
     140]; 
     141 
     142$ductile_lists_base = [ 
    143143    'default'      => 'short', 
    144144    'default-page' => 'short', 
     
    147147    'search'       => 'short', 
    148148    'archive'      => 'short' 
    149 ); 
    150  
    151 $ductile_counts_base = array( 
     149]; 
     150 
     151$ductile_counts_base = [ 
    152152    'default'      => null, 
    153153    'default-page' => null, 
     
    155155    'tag'          => null, 
    156156    'search'       => null 
    157 ); 
     157]; 
    158158 
    159159$ductile_user = $core->blog->settings->themes->get($core->blog->settings->system->theme . '_style'); 
    160160$ductile_user = @unserialize($ductile_user); 
    161161if (!is_array($ductile_user)) { 
    162     $ductile_user = array(); 
     162    $ductile_user = []; 
    163163} 
    164164$ductile_user = array_merge($ductile_base, $ductile_user); 
     
    183183// If no stickers defined, add feed Atom one 
    184184if (!is_array($ductile_stickers)) { 
    185     $ductile_stickers = array(array( 
     185    $ductile_stickers = [[ 
    186186        'label' => __('Subscribe'), 
    187187        'url'   => $core->blog->url . 
    188188        $core->url->getURLFor('feed', 'atom'), 
    189189        'image' => 'sticker-feed.png' 
    190     )); 
    191 } 
    192  
    193 $ductile_stickers_full = array(); 
     190    ]]; 
     191} 
     192 
     193$ductile_stickers_full = []; 
    194194// Get all sticker images already used 
    195195if (is_array($ductile_stickers)) { 
     
    205205            if (!in_array($v, $ductile_stickers_full)) { 
    206206                // image not already used 
    207                 $ductile_stickers[] = array( 
     207                $ductile_stickers[] = [ 
    208208                    'label' => null, 
    209209                    'url'   => null, 
    210                     'image' => $v); 
     210                    'image' => $v]; 
    211211            } 
    212212        } 
     
    225225            $ductile_user['preview_not_mandatory'] = (integer) !empty($_POST['preview_not_mandatory']); 
    226226 
    227             $ductile_stickers = array(); 
     227            $ductile_stickers = []; 
    228228            for ($i = 0; $i < count($_POST['sticker_image']); $i++) { 
    229                 $ductile_stickers[] = array( 
     229                $ductile_stickers[] = [ 
    230230                    'label' => $_POST['sticker_label'][$i], 
    231231                    'url'   => $_POST['sticker_url'][$i], 
    232232                    'image' => $_POST['sticker_image'][$i] 
    233                 ); 
    234             } 
    235  
    236             $order = array(); 
     233                ]; 
     234            } 
     235 
     236            $order = []; 
    237237            if (empty($_POST['ds_order']) && !empty($_POST['order'])) { 
    238238                $order = $_POST['order']; 
     
    241241            } 
    242242            if (!empty($order)) { 
    243                 $new_ductile_stickers = array(); 
     243                $new_ductile_stickers = []; 
    244244                foreach ($order as $i => $k) { 
    245                     $new_ductile_stickers[] = array( 
     245                    $new_ductile_stickers[] = [ 
    246246                        'label' => $ductile_stickers[$k]['label'], 
    247247                        'url'   => $ductile_stickers[$k]['url'], 
    248248                        'image' => $ductile_stickers[$k]['image'] 
    249                     ); 
     249                    ]; 
    250250                } 
    251251                $ductile_stickers = $new_ductile_stickers; 
     
    325325'<h3>' . __('Content') . '</h3>'; 
    326326 
    327 echo '<form id="theme_config" action="' . $core->adminurl->get('admin.blog.theme', array('conf' => '1')) . 
     327echo '<form id="theme_config" action="' . $core->adminurl->get('admin.blog.theme', ['conf' => '1']) . 
    328328    '" method="post" enctype="multipart/form-data">'; 
    329329 
     
    357357    echo 
    358358    '<tr class="line" id="l_' . $i . '">' . 
    359     '<td class="handle minimal">' . form::number(array('order[' . $i . ']'), array( 
     359    '<td class="handle minimal">' . form::number(['order[' . $i . ']'], [ 
    360360        'min'     => 0, 
    361361        'default' => $count, 
    362362        'class'   => 'position' 
    363     )) . 
    364     form::hidden(array('dynorder[]', 'dynorder-' . $i), $i) . '</td>' . 
    365     '<td>' . form::hidden(array('sticker_image[]'), $v['image']) . '<img src="' . $img_url . $v['image'] . '" alt="' . $v['image'] . '" /> ' . '</td>' . 
    366     '<td scope="row">' . form::field(array('sticker_label[]', 'dsl-' . $i), 20, 255, $v['label']) . '</td>' . 
    367     '<td>' . form::field(array('sticker_url[]', 'dsu-' . $i), 40, 255, $v['url']) . '</td>' . 
     363    ]) . 
     364    form::hidden(['dynorder[]', 'dynorder-' . $i], $i) . '</td>' . 
     365    '<td>' . form::hidden(['sticker_image[]'], $v['image']) . '<img src="' . $img_url . $v['image'] . '" alt="' . $v['image'] . '" /> ' . '</td>' . 
     366    '<td scope="row">' . form::field(['sticker_label[]', 'dsl-' . $i], 20, 255, $v['label']) . '</td>' . 
     367    '<td>' . form::field(['sticker_url[]', 'dsu-' . $i], 40, 255, $v['url']) . '</td>' . 
    368368        '</tr>'; 
    369369} 
     
    387387    '<tr>' . 
    388388    '<td scope="row">' . $contexts[$k] . '</td>' . 
    389     '<td>' . form::hidden(array('list_ctx[]'), $k) . form::combo(array('list_type[]'), $list_types, $v) . '</td>'; 
     389    '<td>' . form::hidden(['list_ctx[]'], $k) . form::combo(['list_type[]'], $list_types, $v) . '</td>'; 
    390390    if (array_key_exists($k, $ductile_counts)) { 
    391         echo '<td>' . form::hidden(array('count_ctx[]'), $k) . form::number(array('count_nb[]'), array( 
     391        echo '<td>' . form::hidden(['count_ctx[]'], $k) . form::number(['count_nb[]'], [ 
    392392            'min'     => 0, 
    393393            'max'     => 999, 
    394394            'default' => $ductile_counts[$k] 
    395         )) . '</td>'; 
     395        ]) . '</td>'; 
    396396    } else { 
    397397        echo '<td></td>'; 
     
    418418echo '<div class="multi-part" id="themes-list' . ($conf_tab == 'css' ? '' : '-css') . '" title="' . __('Presentation') . '">'; 
    419419 
    420 echo '<form id="theme_config" action="' . $core->adminurl->get('admin.blog.theme', array('conf' => '1')) . 
     420echo '<form id="theme_config" action="' . $core->adminurl->get('admin.blog.theme', ['conf' => '1']) . 
    421421    '" method="post" enctype="multipart/form-data">'; 
    422422 
     
    469469 
    470470'<p class="field picker"><label for="blog_title_c">' . __('Color:') . '</label> ' . 
    471 form::color('blog_title_c', array('default' => $ductile_user['blog_title_c'])) . 
     471form::color('blog_title_c', ['default' => $ductile_user['blog_title_c']]) . 
    472472dcThemeConfig::contrastRatio($ductile_user['blog_title_c'], '#ffffff', 
    473473    (!empty($ductile_user['blog_title_s']) ? $ductile_user['blog_title_s'] : '2em'), 
     
    486486 
    487487'<p class="field picker"><label for="post_title_c">' . __('Color:') . '</label> ' . 
    488 form::color('post_title_c', array('default' => $ductile_user['post_title_c'])) . 
     488form::color('post_title_c', ['default' => $ductile_user['post_title_c']]) . 
    489489dcThemeConfig::contrastRatio($ductile_user['post_title_c'], '#ffffff', 
    490490    (!empty($ductile_user['post_title_s']) ? $ductile_user['post_title_s'] : '2.5em'), 
     
    498498 
    499499'<p class="field picker"><label for="post_simple_title_c">' . __('Color:') . '</label> ' . 
    500 form::color('post_simple_title_c', array('default' => $ductile_user['post_simple_title_c'])) . 
     500form::color('post_simple_title_c', ['default' => $ductile_user['post_simple_title_c']]) . 
    501501dcThemeConfig::contrastRatio($ductile_user['post_simple_title_c'], '#ffffff', 
    502502    '1.1em', // H5 minimum size 
     
    509509 
    510510'<p class="field picker"><label for="post_link_v_c">' . __('Normal and visited links color:') . '</label> ' . 
    511 form::color('post_link_v_c', array('default' => $ductile_user['post_link_v_c'])) . 
     511form::color('post_link_v_c', ['default' => $ductile_user['post_link_v_c']]) . 
    512512dcThemeConfig::contrastRatio($ductile_user['post_link_v_c'], '#ffffff', 
    513513    '1em', 
     
    516516 
    517517'<p class="field picker"><label for="post_link_f_c">' . __('Active, hover and focus links color:') . '</label> ' . 
    518 form::color('post_link_f_c', array('default' => $ductile_user['post_link_f_c'])) . 
     518form::color('post_link_f_c', ['default' => $ductile_user['post_link_f_c']]) . 
    519519dcThemeConfig::contrastRatio($ductile_user['post_link_f_c'], '#ebebee', 
    520520    '1em', 
     
    535535 
    536536'<p class="field picker"><label for="blog_title_c_m">' . __('Color:') . '</label> ' . 
    537 form::color('blog_title_c_m', array('default' => $ductile_user['blog_title_c_m'])) . 
     537form::color('blog_title_c_m', ['default' => $ductile_user['blog_title_c_m']]) . 
    538538dcThemeConfig::contrastRatio($ductile_user['blog_title_c_m'], '#d7d7dc', 
    539539    (!empty($ductile_user['blog_title_s_m']) ? $ductile_user['blog_title_s_m'] : '1.8em'), 
     
    552552 
    553553'<p class="field picker"><label for="post_title_c_m">' . __('Color:') . '</label> ' . 
    554 form::color('post_title_c_m', array('default' => $ductile_user['post_title_c_m'])) . 
     554form::color('post_title_c_m', ['default' => $ductile_user['post_title_c_m']]) . 
    555555dcThemeConfig::contrastRatio($ductile_user['post_title_c_m'], '#ffffff', 
    556556    (!empty($ductile_user['post_title_s_m']) ? $ductile_user['post_title_s_m'] : '1.5em'), 
  • themes/ductile/_define.php

    r3731 r3874  
    1717    "Dotclear Team",                        // Author 
    1818    '1.5',                                  // Version 
    19     array(                                  // Properties 
     19    [                                  // Properties 
    2020        'standalone_config' => true, 
    2121        'type'              => 'theme' 
    22     ) 
     22    ] 
    2323); 
  • themes/ductile/_prepend.php

    r3731 r3874  
    1919 
    2020# Behaviors 
    21 $GLOBALS['core']->addBehavior('adminPageHTMLHead', array(__NAMESPACE__ . '\tplDuctileThemeAdmin', 'adminPageHTMLHead')); 
     21$GLOBALS['core']->addBehavior('adminPageHTMLHead', [__NAMESPACE__ . '\tplDuctileThemeAdmin', 'adminPageHTMLHead']); 
    2222 
    2323class tplDuctileThemeAdmin 
  • themes/ductile/_public.php

    r3731 r3874  
    1717 
    1818# Behaviors 
    19 $core->addBehavior('publicHeadContent', array(__NAMESPACE__ . '\tplDuctileTheme', 'publicHeadContent')); 
    20 $core->addBehavior('publicInsideFooter', array(__NAMESPACE__ . '\tplDuctileTheme', 'publicInsideFooter')); 
     19$core->addBehavior('publicHeadContent', [__NAMESPACE__ . '\tplDuctileTheme', 'publicHeadContent']); 
     20$core->addBehavior('publicInsideFooter', [__NAMESPACE__ . '\tplDuctileTheme', 'publicInsideFooter']); 
    2121 
    2222# Templates 
    23 $core->tpl->addValue('ductileEntriesList', array(__NAMESPACE__ . '\tplDuctileTheme', 'ductileEntriesList')); 
    24 $core->tpl->addBlock('EntryIfContentIsCut', array(__NAMESPACE__ . '\tplDuctileTheme', 'EntryIfContentIsCut')); 
    25 $core->tpl->addValue('ductileNbEntryPerPage', array(__NAMESPACE__ . '\tplDuctileTheme', 'ductileNbEntryPerPage')); 
    26 $core->tpl->addValue('ductileLogoSrc', array(__NAMESPACE__ . '\tplDuctileTheme', 'ductileLogoSrc')); 
    27 $core->tpl->addBlock('IfPreviewIsNotMandatory', array(__NAMESPACE__ . '\tplDuctileTheme', 'IfPreviewIsNotMandatory')); 
     23$core->tpl->addValue('ductileEntriesList', [__NAMESPACE__ . '\tplDuctileTheme', 'ductileEntriesList']); 
     24$core->tpl->addBlock('EntryIfContentIsCut', [__NAMESPACE__ . '\tplDuctileTheme', 'EntryIfContentIsCut']); 
     25$core->tpl->addValue('ductileNbEntryPerPage', [__NAMESPACE__ . '\tplDuctileTheme', 'ductileNbEntryPerPage']); 
     26$core->tpl->addValue('ductileLogoSrc', [__NAMESPACE__ . '\tplDuctileTheme', 'ductileLogoSrc']); 
     27$core->tpl->addBlock('IfPreviewIsNotMandatory', [__NAMESPACE__ . '\tplDuctileTheme', 'IfPreviewIsNotMandatory']); 
    2828 
    2929class tplDuctileTheme 
     
    109109 
    110110        $tpl_path   = dirname(__FILE__) . '/tpl/'; 
    111         $list_types = array('title', 'short', 'full'); 
     111        $list_types = ['title', 'short', 'full']; 
    112112 
    113113        // Get all _entry-*.html in tpl folder of theme 
     
    133133            $ret .= '   case \'' . $v . '\':' . "\n" . 
    134134            '?>' . "\n" . 
    135             $core->tpl->includeFile(array('src' => '_entry-' . $v . '.html')) . "\n" . 
     135            $core->tpl->includeFile(['src' => '_entry-' . $v . '.html']) . "\n" . 
    136136                '<?php ' . "\n" . 
    137137                '       break;' . "\n"; 
     
    303303 
    304304        $ret = ''; 
    305         $css = array(); 
    306         $uri = array(); 
     305        $css = []; 
     306        $uri = []; 
    307307        if (!isset($s['body_font']) || ($s['body_font'] == '')) { 
    308308            // See if webfont defined for main font 
     
    369369        } 
    370370 
    371         $css = array(); 
     371        $css = []; 
    372372 
    373373        # Properties 
     
    420420 
    421421        # Large screens 
    422         $css_large = array(); 
     422        $css_large = []; 
    423423 
    424424        # Blog title font weight 
     
    478478 
    479479        # Small screens 
    480         $css_small = array(); 
     480        $css_small = []; 
    481481 
    482482        # Blog title font weight 
     
    532532    } 
    533533 
    534     protected static $fonts = array( 
     534    protected static $fonts = [ 
    535535        // Theme standard 
    536536        'Ductile body'      => '"Century Schoolbook", "Century Schoolbook L", Georgia, serif', 
     
    552552        // Monospace families 
    553553        'Monospace'         => 'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace' 
    554     ); 
     554    ]; 
    555555 
    556556    protected static function fontDef($c) 
Note: See TracChangeset for help on using the changeset viewer.

Sites map