Skip to content

Commit

Permalink
Fix for "load_modules_addons"
Browse files Browse the repository at this point in the history
  • Loading branch information
trk committed Apr 7, 2012
1 parent baafd5b commit 399e053
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions application/core/MY_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -776,22 +776,24 @@ private function _load_modules_addons($data)
if (get_class($this) != 'Module')
{
$addons = array();

foreach($this->modules as $uri => $folder)
{
// Get the module Class modules/Module_Name/controllers/admin/module_name.php
if ( ! class_exists($folder) && file_exists(MODPATH.$folder.'/controllers/admin/'.$uri.EXT) )
require_once(MODPATH.$folder.'/controllers/admin/'.$uri.EXT);

if (method_exists($folder, '_addons'))
{
// Module path
$module_path = MODPATH.ucfirst($folder).'/';

// Add the module path to the finder
array_push(Finder::$paths, $module_path);

$addons[$uri] = call_user_func(array($folder, '_addons'), $data);
if(file_exists(MODPATH.$folder.'/controllers/admin/'.$uri.EXT)) {
// Get the module Class modules/Module_Name/controllers/admin/module_name.php
if ( ! class_exists($folder))
require_once(MODPATH.$folder.'/controllers/admin/'.$uri.EXT);

if (method_exists($folder, '_addons'))
{
// Module path
$module_path = MODPATH.ucfirst($folder).'/';

// Add the module path to the finder
array_push(Finder::$paths, $module_path);

$addons[$uri] = call_user_func(array($folder, '_addons'), $data);
}
}
}

Expand Down

0 comments on commit 399e053

Please sign in to comment.