Merge branch 'master' into 'master'

Bugfixes and such

Bugfixes for #16

Please merge without asking questions

See merge request !6
This commit is contained in:
Abel Hoogeveen 2015-03-16 10:37:46 +01:00
commit 227d75c9f4
3 changed files with 11 additions and 8 deletions

View File

@ -94,8 +94,8 @@ class Sections extends Module {
// Logic here, first for module sections
if ($section['module_section']) {
$this->core->loadMod($section['module_name']);
$event->directory = $this->mods->{$section['module_name']}->getModulePath() . "/Controller/";
$mod = $this->core->loadMod($section['module_name']);
$event->directory = $mod->getModulePath() . "/Controller/";
} else {
// Now for regular sections
$event->directory = $section['controller_path'];

View File

@ -65,9 +65,9 @@ class Core {
## MODLOADING
public function loadMod($name, $version = null) {
if (!isset($this->mods->$name)) {
$CLASS = $this->loadModule($name);
$this->mods->{strtolower($CLASS[1])} = &$CLASS[0];
if (!isset($this->mods->{strtolower($CLASS[1])})) {
return $this->mods->{strtolower($CLASS[1])} = &$CLASS[0];
}
}
@ -98,6 +98,8 @@ class Core {
// Check if the module is enabled, otherwise abort
if (isset($cfg->enabled)) {
if (!$cfg->enabled) {
// Module is disabled
throw new Exception("Module '".$name."' is not enabled!", 1);
return false;
}
}

View File

@ -158,9 +158,10 @@ class Events extends Bus{
$dir = FUZEPATH . "/Core/Mods/";
$mods = $this->config->modregister->register;
foreach ($mods as $key => $value) {
try {
$this->core->loadMod($key);
} catch (Exception $e) {}
}
$event = $this->fireEvent('eventRegisterBuildEvent', '');
$this->config->set('eventregister', 'register', $event->register);