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:
commit
227d75c9f4
@ -94,8 +94,8 @@ class Sections extends Module {
|
|||||||
|
|
||||||
// Logic here, first for module sections
|
// Logic here, first for module sections
|
||||||
if ($section['module_section']) {
|
if ($section['module_section']) {
|
||||||
$this->core->loadMod($section['module_name']);
|
$mod = $this->core->loadMod($section['module_name']);
|
||||||
$event->directory = $this->mods->{$section['module_name']}->getModulePath() . "/Controller/";
|
$event->directory = $mod->getModulePath() . "/Controller/";
|
||||||
} else {
|
} else {
|
||||||
// Now for regular sections
|
// Now for regular sections
|
||||||
$event->directory = $section['controller_path'];
|
$event->directory = $section['controller_path'];
|
||||||
|
@ -65,10 +65,10 @@ class Core {
|
|||||||
|
|
||||||
## MODLOADING
|
## MODLOADING
|
||||||
public function loadMod($name, $version = null) {
|
public function loadMod($name, $version = null) {
|
||||||
if (!isset($this->mods->$name)) {
|
$CLASS = $this->loadModule($name);
|
||||||
$CLASS = $this->loadModule($name);
|
if (!isset($this->mods->{strtolower($CLASS[1])})) {
|
||||||
$this->mods->{strtolower($CLASS[1])} = &$CLASS[0];
|
return $this->mods->{strtolower($CLASS[1])} = &$CLASS[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMod($name, $version = null) {
|
public function getMod($name, $version = null) {
|
||||||
@ -98,6 +98,8 @@ class Core {
|
|||||||
// Check if the module is enabled, otherwise abort
|
// Check if the module is enabled, otherwise abort
|
||||||
if (isset($cfg->enabled)) {
|
if (isset($cfg->enabled)) {
|
||||||
if (!$cfg->enabled) {
|
if (!$cfg->enabled) {
|
||||||
|
// Module is disabled
|
||||||
|
throw new Exception("Module '".$name."' is not enabled!", 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,9 +158,10 @@ class Events extends Bus{
|
|||||||
$dir = FUZEPATH . "/Core/Mods/";
|
$dir = FUZEPATH . "/Core/Mods/";
|
||||||
$mods = $this->config->modregister->register;
|
$mods = $this->config->modregister->register;
|
||||||
foreach ($mods as $key => $value) {
|
foreach ($mods as $key => $value) {
|
||||||
$this->core->loadMod($key);
|
try {
|
||||||
|
$this->core->loadMod($key);
|
||||||
|
} catch (Exception $e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
$event = $this->fireEvent('eventRegisterBuildEvent', '');
|
$event = $this->fireEvent('eventRegisterBuildEvent', '');
|
||||||
$this->config->set('eventregister', 'register', $event->register);
|
$this->config->set('eventregister', 'register', $event->register);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user