public function generate() { $parseData = \EventController::callFilter(self::EventName, $this->data->getValue()); $view = new View($this->tpl->getValue()); $view->addHelper(new ViewHelper()); $view->set($parseData); $content = $view->render(); $writer = new Writer($this->url->getValue()); $writer->write($content); }
/** * Удаляет учетную запись * @return */ public function delete() { $data = UsersDBManager::get($this->id->getValue()); if (!empty($data['persistent'])) { return; } $granted = EventController::callFilter('users_account_before_delete', $this); // if granted then call standart removing if (!empty($granted)) { parent::delete($granted); } else { return; } EventController::callEvent('users_account_after_delete', $this); }
protected function autoloadMenuItems() { try { $menuItems = Configure::read(self::AutoloadMenuItemsConfigureKey); } catch (ConfigureException $e) { return; } $menuItems = \EventController::callFilter(self::FilterName, $menuItems); foreach ($menuItems as $item) { $this->items->add($item); } }
public function update($id) { $aData = $_POST; $user = new UserAccount(); $found = $user->get($id); if (empty($found)) { throw new \Exception("User not found"); } \CMSLog::addMessage(__CLASS__, sprintf('User account `%s` updated', $user->login->getValue())); // Вызов проверки форм $result = \EventController::callFilter('users_admin_profile_check', $aData); if ($result) { $user->updateFromPost($result); } $msg = sprintf(self::msgUpdatedSuccessfully, htmlspecialchars($user->login->getValue())); $this->goToEditPage($msg, $user->id->getValue()); }