/** * Constructor for theme * * If no parameter is supplied, then the constructor * Loads the active theme from the database. * * If no theme option is set, a fatal error is thrown * * @param name ( optional ) override the default theme lookup * @param template_engine ( optional ) specify a template engine * @param theme_dir ( optional ) specify a theme directory */ public function __construct($themedata) { $this->name = $themedata->name; $this->version = $themedata->version; $theme_dir = Utils::single_array($themedata->theme_dir); // Set up the corresponding engine to handle the templating $engine = $themedata->template_engine; // @todo Big namespace Kludge. Prefixes the template engine with a namespace if not provided if (strpos($engine, '\\') == false) { $engine = 'Habari\\' . $engine; } $this->template_engine = new $engine(); $this->theme_dir = $theme_dir; $this->template_engine->queue_dirs($theme_dir); $this->plugin_id = $this->plugin_id(); $this->load(); }