/** * */ public function __construct($loginId) { $this->hooks = \Lib\Hooks::instance(); $this->data = array(); $this->scopes = array(); $this->registerScopes($loginId); }
/** * */ public function password() { $password = Hooks::instance()->ask('app_data/password', false); if ($password === false) { throw new \Exception('BusinessDsl: Data access password missing in DSL declaration.'); } return $password; }
/** * */ private function setupDbParams() { $hooks = \Lib\Hooks::instance(); $hooks->addAnswer('app_data/dbName', "a3gfw4AppTemplate"); $hooks->addAnswer('app_data/host', "localhost"); $hooks->addAnswer('app_data/userName', defined('DEBUG') ? "root" : 'username'); $hooks->addAnswer('app_data/password', defined('DEBUG') ? "" : "password"); }
/** * */ protected function loadAppParams($domain = 'Core') { $appParams = DF::model("AppParams.AppParams")->load($domain); $hooks = \Lib\Hooks::instance(); $params = $appParams->get('*'); foreach ($params as $param => $value) { $hooks->addAnswer($param, $value); } return $appParams; }
/** * */ public function authenticate(\Lib\Base\ControllerBase $controller) { if (method_exists($controller, 'authenticatePublic') && $controller->authenticatePublic()) { return true; } $authentication = $this->isAuthenticated(); if (!$authentication) { return false; } $this->authenticationCookieSet($authentication['token'], $authentication['timeout']); \Lib\Hooks::instance()->addAnswer('authenticated/loginId', $authentication['loginId']); return true; }
/** * */ public function waitBetweenAttempts() { return (int) \Lib\Hooks::instance()->ask('Security.WaitSecsBetweenLoginAttempts', 1); }
<?php \Lib\Hooks::instance()->doEvent('register_translations', array('app params' => 'Settings')); // EOF
/** * Build the Theme object based on the present environment. * Applications may have two sides: a front-end application and a back-end or admin area application, both * handled by the same files. */ protected function theme() { $themeName = ADMIN ? self::ADMIN_TEMPLATE_DIR : \Lib\Hooks::instance()->ask('View.ActiveTheme', 'default'); $theme = new \Lib\View\Theme($this->app->request(), $themeName); return $theme; }
<?php \Lib\Hooks::instance()->doEvent('register_translations', array('login' => 'Login', 'login failed' => "Mmmh, I can't find those credentials... Please, wait %d seconds and try again.", 'placeholder password' => "Password", 'placeholder username' => "Username", 'remember me' => 'Remember me', 'sign in' => 'Sign in', 'required email' => "Please, enter an e-mail address", 'reset password' => "Reset password", 'forgot password' => "Forgot password", 'invalid email' => "The e-mail address is invalid", 'required password' => "Please, enter the password")); // EOF
<?php \Lib\Hooks::instance()->doEvent('register_translations', array('home' => 'Dashboard')); // EOF