getModuleFilePath($moduleName); if (is_file($path)) { require_once $path; $module = new $moduleName($id, $data); } else { throw new DispatcherException(sprintf(_("Unknown module '%s' with id '%s'"), $moduleName, $id), 0, null, _("Server encountered some problem, so it was not able to handle the request.")); } } return $module; } /** * Load a notifier with a specific name. * * If required, loads the source for the notifier, then instantiates a notifier of that type. * * Source is loaded from server/notifiers/class.$notifiername.php * * @param string $notifierName The name of the module which should be loaded (eg 'hierarchynotifier') * * @return object Notifier object on success, false on failed */ public function loadNotifier($notifierName) { $notifier = false; $path = BASE_PATH . 'server/includes/notifiers/class.' . $notifierName . '.php'; if (is_file($path) === true) { require_once $path; $notifier = new $notifierName(); } else { $path = $GLOBALS['PluginManager']->getNotifierFilePath($notifierName); if (is_file($path)) { require_once $path; $notifier = new $notifierName(); } else { throw new DispatcherException(sprintf(_("Unknown notifier '%s'"), $notifierName), 0, null, _("Server encountered some problem, so it was not able to handle the request.")); } } return $notifier; } }