Dotclear

Changeset 2954:85e45ee8f77e


Ignore:
Timestamp:
02/03/15 09:32:32 (9 years ago)
Author:
Dsls
Branch:
default
Message:

Take disabled module information into consideration, enrich plugins.php disabled plugins list. Fixes #2066

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/plugins.php

    r2566 r2954  
    181181               ->setModules($modules) 
    182182               ->displayModules( 
    183                     /* cols */          array('icon', 'name', 'distrib'), 
     183                    /* cols */          array('expander', 'icon', 'name', 'version', 'desc', 'distrib'), 
    184184                    /* actions */  array('activate', 'delete') 
    185185               ); 
  • inc/core/class.dc.modules.php

    r2945 r2954  
    2626     protected $errors = array(); 
    2727     protected $modules_names = array(); 
     28     protected $disabled_mode = false; 
     29     protected $disabled_meta = array(); 
    2830 
    2931     protected $id; 
     
    103105                         else 
    104106                         { 
    105                               $this->disabled[$entry] = array( 
    106                                    'root' => $full_entry, 
    107                                    'root_writable' => is_writable($full_entry) 
    108                               ); 
     107                              if (file_exists($full_entry.'/_define.php')) { 
     108                                   $this->disabled_mode=true; 
     109                                   require $full_entry.'/_define.php'; 
     110                                   $this->disabled_mode=false; 
     111                                   $this->disabled[$entry] =  $this->disabled_meta; 
     112                              } 
    109113                         } 
    110114                    } 
     
    177181     public function registerModule($name,$desc,$author,$version, $properties = array()) 
    178182     { 
     183          if ($this->disabled_mode) { 
     184               $this->disabled_meta = array_merge( 
     185                         $properties, 
     186                         array( 
     187                              'root' => $this->mroot, 
     188                              'name' => $name, 
     189                              'desc' => $desc, 
     190                              'author' => $author, 
     191                              'version' => $version, 
     192                              'root_writable' => is_writable($this->mroot) 
     193                         ) 
     194                    ); 
     195               return; 
     196          } 
    179197          # Fallback to legacy registerModule parameters 
    180198          if (!is_array($properties)) { 
     
    195213                    'priority' => 1000, 
    196214                    'standalone_config' => false, 
    197                     'type' => null 
     215                    'type' => null, 
     216                    'requires' => array() 
    198217               ), $properties 
    199218          ); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map