basePath. DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'email.php'); $this->config = array_merge($this->config, $email); // Now initialize the plugin manager $this->initPluginManager(); } /** * Get the Api object. */ public function getApi() { if (!isset($this->api)) { $this->api = new LimesurveyApi(); } return $this->api; } /** * This function is implemented since em_core_manager incorrectly requires * it to create urls. */ public function getController() { return $this; } /** * Returns a config variable from the config * * @access public * @param string $name * @return mixed */ public function getConfig($name = null) { if (isset($this->$name)) { return $this->name; } elseif (isset($this->config[$name])) { return $this->config[$name]; } else { return false; } } /** * Get the pluginManager * * @return PluginManager */ public function getPluginManager() { return $this->pluginManager; } /** * This method handles initialization of the plugin manager * * When you want to insert your own plugin manager, or experiment with different settings * then this is where you should do that. */ public function initPluginManager() { Yii::import('application.libraries.PluginManager.*'); Yii::import('application.libraries.PluginManager.Storage.*'); Yii::import('application.libraries.PluginManager.Question.*'); $this->pluginManager = new PluginManager($this->getApi()); // And load the active plugins $this->pluginManager->loadPlugins(); } /** * Loads a helper * * @access public * @param string $helper * @return void */ public function loadHelper($helper) { Yii::import('application.helpers.' . $helper . '_helper', true); } /** * Sets a configuration variable into the config * * @access public * @param string $name * @param mixed $value * @return void */ public function setConfig($name, $value) { $this->config[$name] = $value; } } ?>