init(); } /** * Overwrite this function for hook initialization, e.g. loading the hook's config */ protected function init() { } /** * Shall return valid HTML to include in the detail view * * @param Event $event The event to generate HTML for * * @return string */ abstract public function getHtmlForEvent(Event $event); /** * Shall return valid HTML to include in the multi-select view for events * * @param Event[] $events The events to generate HTML for * * @return string */ public function getHtmlForEvents($events) { return ''; } /** * Get {@link view} * * @return View */ public function getView() { return $this->view; } /** * Set {@link view} * * @param View $view * * @return $this */ public function setView($view) { $this->view = $view; return $this; } /** * Get the module of the derived class * * @return Module */ public function getModule() { if ($this->module === null) { $class = get_class($this); if (ClassLoader::classBelongsToModule($class)) { $this->module = Icinga::app()->getModuleManager()->getModule(ClassLoader::extractModuleName($class)); } } return $this->module; } /** * Set the module of the derived class * * @param Module $module * * @return $this */ public function setModule(Module $module) { $this->module = $module; return $this; } }