Changeset 904
- Timestamp:
- 09/22/07 22:15:42 (14 months ago)
- Location:
- branches/systemplugins/system
- Files:
-
- 1 added
- 1 modified
- 5 moved
-
classes/plugins.php (modified) (1 diff)
-
plugins (added)
-
plugins/index.html (moved) (moved from branches/systemplugins/user/plugins/index.html)
-
plugins/pingback (moved) (moved from branches/systemplugins/user/plugins/pingback)
-
plugins/spamchecker (moved) (moved from branches/systemplugins/user/plugins/spamchecker)
-
plugins/undelete (moved) (moved from branches/systemplugins/user/plugins/undelete)
-
plugins/wpimport (moved) (moved from branches/systemplugins/user/plugins/wpimport)
Legend:
- Unmodified
- Added
- Removed
-
branches/systemplugins/system/classes/plugins.php
r876 r904 169 169 { 170 170 $plugins= array(); 171 $files= array(); 172 $plugindir= HABARI_PATH . '/user/plugins/'; 173 $dirs= glob( $plugindir . '*', GLOB_ONLYDIR | GLOB_MARK ); 174 if ( Site::CONFIG_LOCAL != Site::$config_type ) 175 { 171 $plugindirs= array( HABARI_PATH . '/system/plugins/', HABARI_PATH . '/user/plugins/' ); 172 if ( Site::CONFIG_LOCAL != Site::$config_type ) { 176 173 // include site-specific plugins 177 $site_dirs= glob( Site::get_dir('config') . '/plugins/*', GLOB_ONLYDIR | GLOB_MARK ); 178 if ( is_array( $site_dirs ) && ! empty( $site_dirs ) ) { 179 $dirs= array_merge( $dirs, $site_dirs ); 180 } 174 $plugindirs[]= Site::get_dir('config') . '/plugins/'; 175 } 176 $dirs = array(); 177 foreach($plugindirs as $plugindir) { 178 $dirs+= glob( $plugindir . '*', GLOB_ONLYDIR | GLOB_MARK ); 181 179 } 182 180 foreach( $dirs as $dir ) { 183 181 $dirfiles = glob( $dir . '*.plugin.php' ); 184 $files = array_merge($dirfiles, $files); 185 } 186 // return $files; 187 // massage the return value so that this works on Windows 188 $plugins= array_map( create_function( '$s', 'return str_replace(\'\\\\\', \'/\', $s);' ), $files ); 182 if(count($dirfiles) > 0) { 183 $dirfiles = array_combine( 184 // Use the basename of the file as the index to use the named plugin from the last directory in $dirs 185 array_map('basename', $dirfiles), 186 // massage the filenames so that this works on Windows 187 array_map( create_function( '$s', 'return str_replace(\'\\\\\', \'/\', $s);' ), $dirfiles ) 188 ); 189 $plugins = array_merge($plugins, $dirfiles); 190 } 191 } 189 192 sort($plugins); 190 193 return $plugins;
