fixed prepare

This commit is contained in:
kremsy 2014-01-27 21:02:33 +01:00 committed by Steffen Schröder
parent 7a216c24ae
commit 92adc1f13b

View File

@ -36,8 +36,6 @@ class PluginManager {
$this->pluginMenu = new PluginMenu($maniaControl); $this->pluginMenu = new PluginMenu($maniaControl);
$this->maniaControl->configurator->addMenu($this->pluginMenu); $this->maniaControl->configurator->addMenu($this->pluginMenu);
$this->preparePlugins();
} }
/** /**
@ -198,6 +196,9 @@ class PluginManager {
$classesAfter = get_declared_classes(); $classesAfter = get_declared_classes();
$newClasses = array_diff($classesAfter, $classesBefore); $newClasses = array_diff($classesAfter, $classesBefore);
foreach($newClasses as $className) { foreach($newClasses as $className) {
//Prepare Plugin
$className::prepare($this->maniaControl);
if (!$this->isPluginClass($className)) { if (!$this->isPluginClass($className)) {
continue; continue;
} }
@ -226,15 +227,6 @@ class PluginManager {
return null; return null;
} }
/**
* Prepare all Plugins
*/
private function preparePlugins() {
foreach($this->pluginClasses as $plugin) {
$plugin::prepare($this->maniaControl);
}
}
/** /**
* Get all declared plugin class names * Get all declared plugin class names
* *