Dotclear


Ignore:
Timestamp:
03/08/18 17:58:39 (8 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Code formatting (PSR-2)

Location:
plugins/simpleMenu
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/simpleMenu/_install.php

    r3578 r3730  
    1010# 
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    12 if (!defined('DC_CONTEXT_ADMIN')) { return; } 
     12if (!defined('DC_CONTEXT_ADMIN')) {return;} 
    1313 
    14 $version = $core->plugins->moduleInfo('simpleMenu','version'); 
    15 if (version_compare($core->getVersion('simpleMenu'),$version,'>=')) { 
    16      return; 
     14$version = $core->plugins->moduleInfo('simpleMenu', 'version'); 
     15if (version_compare($core->getVersion('simpleMenu'), $version, '>=')) { 
     16    return; 
    1717} 
    1818 
    1919# Menu par défaut 
    20 $blog_url = html::stripHostURL($core->blog->url); 
     20$blog_url     = html::stripHostURL($core->blog->url); 
    2121$menu_default = array( 
    22      array('label' => 'Home', 'descr' => 'Recent posts', 'url' => $blog_url, 'targetBlank' => false), 
    23      array('label' => 'Archives', 'descr' => '', 'url' => $blog_url.$core->url->getURLFor('archive'), 'targetBlank' => false) 
     22    array('label' => 'Home', 'descr' => 'Recent posts', 'url' => $blog_url, 'targetBlank' => false), 
     23    array('label' => 'Archives', 'descr' => '', 'url' => $blog_url . $core->url->getURLFor('archive'), 'targetBlank' => false) 
    2424); 
    25 $core->blog->settings->system->put('simpleMenu',$menu_default,'array','simpleMenu default menu',false,true); 
    26 $core->blog->settings->system->put('simpleMenu_active',true,'boolean','Active',false,true); 
     25$core->blog->settings->system->put('simpleMenu', $menu_default, 'array', 'simpleMenu default menu', false, true); 
     26$core->blog->settings->system->put('simpleMenu_active', true, 'boolean', 'Active', false, true); 
    2727 
    28 $core->setVersion('simpleMenu',$version); 
     28$core->setVersion('simpleMenu', $version); 
    2929return true; 
  • plugins/simpleMenu/_widgets.php

    r2928 r3730  
    1010# 
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    12 if (!defined('DC_RC_PATH')) { return; } 
     12if (!defined('DC_RC_PATH')) {return;} 
    1313 
    14 $core->addBehavior('initWidgets',array('simpleMenuWidgets','initWidgets')); 
     14$core->addBehavior('initWidgets', array('simpleMenuWidgets', 'initWidgets')); 
    1515 
    1616class simpleMenuWidgets 
    1717{ 
    18      public static function initWidgets($w) 
    19      { 
    20           $w->create('simplemenu',__('Simple menu'),array('tplSimpleMenu','simpleMenuWidget'),null,'List of simple menu items'); 
    21           $w->simplemenu->setting('title',__('Title (optional)').' :',__('Menu')); 
    22           $w->simplemenu->setting('description',__('Item description'),0,'combo', 
    23                array( 
    24                     __('Displayed in link') => 0,                     // span 
    25                     __('Used as link title') => 1,                         // title 
    26                     __('Displayed in link and used as title') => 2,   // both 
    27                     __('Not displayed nor used') => 3                 // none 
    28                     ) 
    29                ); 
    30           $w->simplemenu->setting('homeonly',__('Display on:'),0,'combo', 
    31                array( 
    32                     __('All pages') => 0, 
    33                     __('Home page only') => 1, 
    34                     __('Except on home page') => 2 
    35                     ) 
    36                ); 
    37           $w->simplemenu->setting('content_only',__('Content only'),0,'check'); 
    38           $w->simplemenu->setting('class',__('CSS class:'),''); 
    39           $w->simplemenu->setting('offline',__('Offline'),0,'check'); 
    40      } 
     18    public static function initWidgets($w) 
     19    { 
     20        $w->create('simplemenu', __('Simple menu'), array('tplSimpleMenu', 'simpleMenuWidget'), null, 'List of simple menu items'); 
     21        $w->simplemenu->setting('title', __('Title (optional)') . ' :', __('Menu')); 
     22        $w->simplemenu->setting('description', __('Item description'), 0, 'combo', 
     23            array( 
     24                __('Displayed in link')                   => 0, // span 
     25                __('Used as link title')                  => 1, // title 
     26                __('Displayed in link and used as title') => 2, // both 
     27                __('Not displayed nor used')              => 3 // none 
     28            ) 
     29        ); 
     30        $w->simplemenu->setting('homeonly', __('Display on:'), 0, 'combo', 
     31            array( 
     32                __('All pages')          => 0, 
     33                __('Home page only')      => 1, 
     34                __('Except on home page') => 2 
     35            ) 
     36        ); 
     37        $w->simplemenu->setting('content_only', __('Content only'), 0, 'check'); 
     38        $w->simplemenu->setting('class', __('CSS class:'), ''); 
     39        $w->simplemenu->setting('offline', __('Offline'), 0, 'check'); 
     40    } 
    4141} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map