Dotclear


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

Code formatting (PSR-2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.plugins.php

    r2566 r3730  
    1010# 
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    12 if (!defined('DC_RC_PATH')) { return; } 
     12if (!defined('DC_RC_PATH')) {return;} 
    1313 
    1414/** 
     
    2121 
    2222This class extends dcModules. 
    23 */ 
     23 */ 
    2424class dcPlugins extends dcModules 
    2525{ 
    26      protected static $type = 'plugin'; 
     26    protected static $type = 'plugin'; 
    2727 
    28      /** 
    29      This method registers a plugin in modules list. You should use this to 
    30      register a new plugin. 
     28    /** 
     29    This method registers a plugin in modules list. You should use this to 
     30    register a new plugin. 
    3131 
    32      <var>$priority</var> is an integer. Modules are sorted by priority and name. 
    33      Lowest priority comes first. This property is currently ignored when dealing 
    34      with themes. 
     32    <var>$priority</var> is an integer. Modules are sorted by priority and name. 
     33    Lowest priority comes first. This property is currently ignored when dealing 
     34    with themes. 
    3535 
    36      @param    name           <b>string</b>       Module name 
    37      @param    desc           <b>string</b>       Module description 
    38      @param    author         <b>string</b>       Module author name 
    39      @param    version        <b>string</b>       Module version 
    40      @param    properties     <b>array</b>        extra properties (currently available keys : permissions, priority, standalone_config, type) 
    41      */ 
    42      public function registerModule($name,$desc,$author,$version,$properties = array()) 
    43      { 
    44           # Fallback to legacy registerModule parameters 
    45           if (!is_array($properties)) { 
    46                $args = func_get_args(); 
    47                $properties = array(); 
    48                if (isset($args[4])) { 
    49                     $properties['permissions']=$args[4]; 
    50                } 
    51                if (isset($args[5])) { 
    52                     $properties['priority']= (integer)$args[5]; 
    53                } 
    54           } 
     36    @param    name            <b>string</b>        Module name 
     37    @param    desc            <b>string</b>        Module description 
     38    @param    author        <b>string</b>        Module author name 
     39    @param    version        <b>string</b>        Module version 
     40    @param    properties    <b>array</b>        extra properties (currently available keys : permissions, priority, standalone_config, type) 
     41     */ 
     42    public function registerModule($name, $desc, $author, $version, $properties = array()) 
     43    { 
     44        # Fallback to legacy registerModule parameters 
     45        if (!is_array($properties)) { 
     46            $args      = func_get_args(); 
     47            $properties = array(); 
     48            if (isset($args[4])) { 
     49                $properties['permissions'] = $args[4]; 
     50            } 
     51            if (isset($args[5])) { 
     52                $properties['priority'] = (integer) $args[5]; 
     53            } 
     54        } 
    5555 
    56           parent::registerModule($name, $desc, $author, $version, $properties); 
    57      } 
     56        parent::registerModule($name, $desc, $author, $version, $properties); 
     57    } 
    5858} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map