public function __construct() { parent::__construct(); // this is what we're using for the model section of the MVC framework. if (isset($_GET['AltView'])) { $this->__SelectAlternateView('SecondHelloWorldView'); } }
public function __construct() { parent::__construct(); $role = Users::ROLE_GUEST; if ($this->userdata != null) { $role = $this->userdata["role"]; } $content = new Contents(['Settings' => $this->settings]); $menu = new Menu($this->settings); $this->smarty->assign('menulist', $menu->get($role, $this->serverurl)); $this->smarty->assign('usefulcontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role)); $this->smarty->assign('articlecontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role)); $this->smarty->assign('main_menu', $this->smarty->fetch('mainmenu.tpl')); $this->smarty->assign('useful_menu', $this->smarty->fetch('usefullinksmenu.tpl')); $this->smarty->assign('article_menu', $this->smarty->fetch('articlesmenu.tpl')); $category = new Category(['Settings' => $content->pdo]); if ($this->userdata != null) { $parentcatlist = $category->getForMenu($this->userdata["categoryexclusions"]); } else { $parentcatlist = $category->getForMenu(); } // Add in system types to console categories to make the boot strap drop down list less long. $consoleCatList = array(); foreach ($parentcatlist as $parent) { if ($parent['title'] === 'Console') { foreach ($parent['subcatlist'] as $consoleCat) { if (preg_match('/^XBOX/i', $consoleCat['title'])) { $consoleCatList['Microsoft'][] = $consoleCat; } else { if (preg_match('/^([3N]DS|N?GC)$|^WII/i', $consoleCat['title'])) { $consoleCatList['Nintendo'][] = $consoleCat; } else { if (preg_match('/PS[\\dXP ]/i', $consoleCat['title'])) { $consoleCatList['Sony'][] = $consoleCat; } else { $consoleCatList['Other'][] = $consoleCat; } } } } break; } } $this->smarty->assign('consolecatlist', $consoleCatList); $this->smarty->assign('parentcatlist', $parentcatlist); $searchStr = ''; if ($this->page == 'search' && isset($_REQUEST["id"])) { $searchStr = (string) $_REQUEST["id"]; } $this->smarty->assign('header_menu_search', $searchStr); if (isset($_REQUEST["t"])) { $this->smarty->assign('header_menu_cat', $_REQUEST["t"]); } else { $this->smarty->assign('header_menu_cat', ''); } $header_menu = $this->smarty->fetch('headermenu.tpl'); $this->smarty->assign('header_menu', $header_menu); }
public function __construct($allowModerator = false) { parent::__construct(); if (!$this->users->isLoggedIn() || !isset($this->userdata['role'])) { $this->show403(true); } // If the user isn't an admin or mod then access is denied, OR if they're a mod and mods aren't allowed then access is denied. if ($this->userdata['role'] != Users::ROLE_ADMIN && $this->userdata['role'] != Users::ROLE_MODERATOR || $this->userdata['role'] == Users::ROLE_MODERATOR && $allowModerator === false) { $this->show403(true); } $this->smarty->setTemplateDir(array('admin' => nZEDb_WWW . 'themes_shared/templates/admin', 'frontend' => nZEDb_WWW . 'themes/Default/templates/frontend')); }
/** * Default constructor. */ public function __construct() { parent::__construct(); $tplpaths = []; if ($this->settings->getSetting('style') != "default") { $tplpaths["style_admin"] = WWW_DIR . 'templates_shared/views/admin'; } $tplpaths["admin"] = WWW_DIR . 'templates_shared/views/admin'; $tplpaths["frontend"] = WWW_DIR . 'templates/nntmux/views/frontend'; $this->smarty->setTemplateDir($tplpaths); $users = new Users(); if (!$users->isLoggedIn() || !isset($this->userdata["role"]) || $this->userdata["role"] != Users::ROLE_ADMIN) { $this->show403(true); } }
/** * Default constructor. */ public function __construct() { parent::__construct(); $role = Users::ROLE_GUEST; if ($this->userdata != null) { $role = $this->userdata["role"]; } $content = new Contents(['Settings' => $this->settings]); $f = new Forum(); $menu = new Menu($this->settings); $this->smarty->assign('menulist', $menu->get($role, $this->serverurl)); $this->smarty->assign('usefulcontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role)); $this->smarty->assign('articlecontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role)); if ($this->userdata != null) { $this->smarty->assign('recentforumpostslist', $f->getRecentPosts($this->settings->getSetting('showrecentforumposts'))); } $this->smarty->assign('main_menu', $this->smarty->fetch('mainmenu.tpl')); $this->smarty->assign('useful_menu', $this->smarty->fetch('usefullinksmenu.tpl')); $this->smarty->assign('article_menu', $this->smarty->fetch('articlesmenu.tpl')); $category = new Category(['Settings' => $content->pdo]); if ($this->userdata != null) { $parentcatlist = $category->getForMenu($this->userdata["categoryexclusions"]); } else { $parentcatlist = $category->getForMenu(); } $this->smarty->assign('parentcatlist', $parentcatlist); $searchStr = ''; if ($this->page == 'search' && isset($_REQUEST["id"])) { $searchStr = (string) $_REQUEST["id"]; } $this->smarty->assign('header_menu_search', $searchStr); if (isset($_REQUEST["t"])) { $this->smarty->assign('header_menu_cat', $_REQUEST["t"]); } else { $this->smarty->assign('header_menu_cat', ''); } $header_menu = $this->smarty->fetch('headermenu.tpl'); $this->smarty->assign('header_menu', $header_menu); }
public function __construct() { parent::__construct(); }
/** * Initializes internal state of Page object. * @see parent::__construct() */ public function __construct() { // Make sure that parent constructor is always invoked, since that // is where any default values for this object are set. parent::__construct(); }