aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/main.php
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2011-12-23 01:43:53 +0100
committerKevin Chabowski <kevin@kch42.de>2011-12-23 01:43:53 +0100
commitdf0658f7e10d2bf87460195f792398d16eee811e (patch)
tree1f7720ecc6c3ca5e94e84022766121f6f677c88f /ratatoeskr/main.php
parent7d6a5eca4e0a38ae615634542859d29ab79c94e8 (diff)
downloadratatoeskr-cms-df0658f7e10d2bf87460195f792398d16eee811e.tar.gz
ratatoeskr-cms-df0658f7e10d2bf87460195f792398d16eee811e.tar.bz2
ratatoeskr-cms-df0658f7e10d2bf87460195f792398d16eee811e.zip
Added plugin management to bakend and fixed db models.
Diffstat (limited to 'ratatoeskr/main.php')
-rw-r--r--ratatoeskr/main.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/ratatoeskr/main.php b/ratatoeskr/main.php
index d3be695..2a31177 100644
--- a/ratatoeskr/main.php
+++ b/ratatoeskr/main.php
@@ -18,9 +18,11 @@ require_once(dirname(__FILE__) . "/sys/plugin_api.php");
require_once(dirname(__FILE__) . "/frontend.php");
require_once(dirname(__FILE__) . "/backend.php");
+$plugin_objs = array();
+
function ratatoeskr()
{
- global $backend_subactions, $ste, $url_handlers, $ratatoeskr_settings;
+ global $backend_subactions, $ste, $url_handlers, $ratatoeskr_settings, $plugin_objs;
session_start();
if(!CONFIG_FILLED_OUT)
return setup();
@@ -30,13 +32,18 @@ function ratatoeskr()
clean_database();
$activeplugins = array_filter(Plugin::all(), function($plugin) { return $plugin->active; });
- $plugin_objs = array();
foreach($activeplugins as $plugin)
{
- eval($plugin->phpcode);
- $plugin_obj = new $plugin->class;
+ eval($plugin->code);
+ $plugin_obj = new $plugin->classname($plugin->get_id());
+ if($plugin->update)
+ {
+ $plugin_obj->update();
+ $plugin->update = False;
+ $plugin->save();
+ }
$plugin_obj->init();
- $plugin_objs[] = $plugin_obj;
+ $plugin_objs[$plugin->get_id()] = $plugin_obj;
}
/* Register URL handlers */