public function before() { parent::before(); if (!$this->execute) { return; } $params = $this->pixie->config->get('parameters'); $this->titleBase = trim($params['page_title_base']); $this->initView($this->mainView); if (!$this->installationProcess) { $className = isset($this->modelName) && $this->modelName ? $this->modelName : $this->get_real_class($this); $category = new Category($this->pixie); $this->view->sidebar = $category->getCategoriesSidebar(); $this->view->search_category = $this->getSearchCategory($className); $this->view->search_subcategories = $this->getAllCategories($this->view->sidebar); $this->view->pages = $this->pixie->orm->get('page')->where('is_active', 1)->find_all()->as_array(); $this->view->cart = $this->getCart(); $this->view->cartItems = $this->getCart()->items->find_all()->as_array(); if ($className != "Home") { $this->view->categories = $category->getRootCategories(); } $classModel = "App\\Model\\" . $className; if (class_exists($classModel)) { $this->model = new $classModel($this->pixie); } else { $this->model = null; } } }
public function before() { parent::before(); $user = $this->pixie->auth->user(); $this->user = $user; $this->view = $this->view('main'); $config = $this->pixie->config->get('parameters'); $this->common_path = $config['common_path']; $this->view->common_path = $config['common_path']; $this->view->returnUrl = ''; $this->view->controller = $this; $this->view->adminRoot = $this->root; $className = isset($this->modelName) && $this->modelName ? $this->modelName : $this->get_real_class($this); $this->view->sidebarLinks = $this->getSidebarLinks(); $this->view->user = $user; $this->view->pageHeader = 'Dashboard'; try { /** @var Connection $pdov */ $this->pixie->db->get(); } catch (\Exception $e) { $this->redirect('/install'); return; } $classModel = "App\\Model\\" . $className; if (class_exists($classModel)) { $this->model = new $classModel($this->pixie); } else { $this->model = null; } }
public function before() { $this->secure(); parent::before(); $user = $this->pixie->auth->user(); $this->user = $user; $this->view = $this->view('main'); $config = $this->pixie->config->get('parameters'); $this->common_path = $config['common_path']; $this->view->common_path = $config['common_path']; $this->view->returnUrl = ''; $this->view->controller = $this; $this->view->adminRoot = $this->root; $className = isset($this->modelName) && $this->modelName ? $this->modelName : $this->get_real_class($this); $this->view->sidebarLinks = $this->getSidebarLinks(); $this->view->user = $user; $this->view->pageHeader = 'Dashboard'; $classModel = "App\\Model\\" . $className; if (class_exists($classModel)) { $this->model = new $classModel($this->pixie); } else { $this->model = null; } }
public function before() { parent::before(); if (!$this->execute) { return; } $this->initView('main'); if (!$this->installationProcess) { $className = $this->get_real_class($this); $category = new Category($this->pixie); $this->view->sidebar = $category->getCategoriesSidebar(); $this->view->search_category = $this->getSearchCategory($className); $this->view->search_subcategories = $this->getAllCategories($this->view->sidebar); if ($className != "Home") { $this->view->categories = $category->getRootCategories(); } $classModel = "App\\Model\\" . $className; if (class_exists($classModel)) { $this->model = new $classModel($this->pixie); } else { $this->model = null; } } }