public function __construct($support) { parent::__construct($support); $this->reservations = new Reservations($this->pdo); $this->events = new Events($this->pdo); $this->gameTypes = new GameTypes($this->pdo); }
public function startUp() { parent::startUp(); $this->template['resRend'] = \model\ReservationRenderer::getInstance(); $this->addJs('moment-with-locales-min.js'); $this->addJs('bootstrap-datetimepicker.js'); $this->addCss('bootstrap-datetimepicker.min.css'); }
public function startUp() { parent::startUp(); if (!$this->user->isSupervisor()) { $this->message->warning("Do sekce Správa nemáte přístup", \libs\MessageBuffer::LVL_WAR); $this->redirectPars(Controller::DEFAULT_CONTROLLER); } }
public function __construct($support) { parent::__construct($support); $this->reservations = new Reservations($this->pdo); $this->gameTypes = new GameTypes($this->pdo); $this->twig = $support['twig']; $this->layout = "ajax.twig"; }
public function __construct() { parent::__construct(); if (!$this->isLogged()) { $this->addPopup('danger', 'Do této sekce mají přístup pouze někteří přihlášení uživatelé. Pro vstup se prosíme přihlašte.'); redirectTo('/'); } elseif (!$this->isAdmin() && !$this->isEditor()) { $this->addPopup('danger', 'Do této sekce bohužel nemáte přístup.'); redirectTo('/'); } }
public function startUp() { parent::startUp(); if (!$this->user->isLoggedIn()) { $action = $this->urlGen->getAction(); $check = strtolower(substr($action, 0, 7)); if ($check == 'prihlas') { return; } $this->message->info("Do uživatelské sekce mají přístup jen přihlášení uživatelé."); $this->redirectPars(Controller::DEFAULT_CONTROLLER); } }
public function startUp() { parent::startUp(); if (!$this->user->isLoggedIn()) { $this->message->warning('Pro psaní ohlasů musíte být přihlášeni.'); $this->redirectPars(); } if (!Config::FEEDBACK_ENABLED) { $this->message->info('Ohlasy zpětné vazby nejsou v tento moment povoleny'); $this->redirectPars(); } $this->template['pageTitle'] = 'Zpětná vazba'; }
public function __construct() { parent::__construct(); $this->template = 'Views/basic_template.phtml'; $this->data["referersURI"] = getReferersURIEnd(); $this->data['title'] = 'Starling'; $this->data['keywords'] = 'starling, code-sharer'; $this->data['description'] = 'Starling is web application to sharing code between users and the public.'; $this->addBeforeAll("prepareFlashMessages"); $this->addBeforeAll("loadUser"); $this->data["loggedUser"] = NULL; $emailConf = (require "conf/emailLocalConf.php"); $this->siteURL = $emailConf["siteURL"]; $this->emailAddress = $emailConf["emailAddress"]; $this->emailPassword = $emailConf["emailPassword"]; }
public function route($uri = false) { if (!$uri) { if (empty($_SERVER['REDIRECT_URL'])) { if (stristr($_SERVER['REQUEST_URI'], '?') !== false) { $uri = stristr($_SERVER['REQUEST_URI'], '?', true); } else { $uri = $_SERVER['REQUEST_URI']; } } else { $uri = $_SERVER['REDIRECT_URL']; } } $context = new RequestContext($uri); $locator = new FileLocator(array(dirname(__FILE__) . '/../conf')); $router = new Router(new PhpFileLoader($locator), 'routes.php', array('cache_dir' => null), $context); if (!$uri) { $uri = $this->httpRequest->getPathInfo(); } $this->route = $router->match($uri); $this->controller = new $this->route['class']($this); if (DEBUG_BAR) { $this->debugbar->addCollector(new ConfigCollector($this->config)); $debugbarRenderer = $this->debugbar->getJavascriptRenderer(); $this->debugbar["messages"]->addMessage("Debug Bar enabled"); $this->controller->setData('debugbarRenderer', $debugbarRenderer); } //set action to index is its not set if (empty($this->route['action'])) { $this->route['action'] = $this->route['_route'] == '/' ? "index" : $this->route['_route']; } $action = $this->route['action']; if (!method_exists($this->controller, $action)) { throw new Exception('Method Not found'); } $this->controller->{$action}(); }
/** * hata kaydeder to $this->_error * * @param string $error */ public function __construct($error) { parent::__construct(); $this->_error = $error; }
/** * Подключаем JS для вывода сообщений */ public function beforeroute() { parent::beforeroute(); $this->fw->set('alerts_js', true); }
<?php ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); require_once 'config.php'; include_once 'models/Data.php'; include_once 'controllers/Controller.php'; include_once 'exceptions/DbException.php'; \controllers\Controller::run();
public function __Construct() { parent::__Construct(); $this->_blogLib = new lib\Blog(); }
/** * * @param Controller $cont * @param String $controller * @param String $action */ private function addCssJs($cont, $controller, $action) { $filename = $controller . "_{$action}"; if (file_exists($this->CSS_DIR . "{$filename}.css")) { $cont->addCss("{$filename}.css"); } if (file_exists($this->JS_DIR . "{$filename}.js")) { $cont->addJs("{$filename}.js"); } }
public static function checkPasswordResetValidity() { if ($_POST['password'] != $_POST['password_again']) { $popups[] = array('type' => 'danger', 'content' => 'Hesla se neshodují.'); } if (preg_match('/[^a-zA-Z0-9]/', $_POST['password'])) { $popups[] = array('type' => 'danger', 'content' => 'Vaše heslo obsahuje nepovolené znaky nebo mezeru.'); } if (strlen(utf8_decode($_POST["password"])) < 8) { $popups[] = array('type' => 'danger', 'content' => 'Vaše heslo je příliš krátké.'); } if (strlen(utf8_decode($_POST["password"])) > 32) { $popups[] = array('type' => 'danger', 'content' => 'Vaše heslo je příliš dlouhé.'); } if (isset($popups)) { foreach ($popups as $p) { Controller::addPopup($p["type"], $p["content"]); } return false; } return true; }
public function startUp() { parent::startUp(); $this->layout = 'layout.twig'; $this->template['title'] = "CLH"; }
public function __construct($bootstrap) { parent::__construct($bootstrap); }
public function __construct($support) { parent::__construct($support); $this->layout = "letiste.twig"; }