예제 #1
0
파일: page.php 프로젝트: ehsanguru/nnplus
 function Page()
 {
     parent::BasePage();
     $role = Users::ROLE_GUEST;
     if ($this->userdata != null) {
         $role = $this->userdata["role"];
     }
     $content = new Contents();
     $menu = new Menu();
     $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();
     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"]);
     }
     $header_menu = $this->smarty->fetch('headermenu.tpl');
     $this->smarty->assign('header_menu', $header_menu);
 }
예제 #2
0
 function AdminPage()
 {
     $this->template_dir = 'admin';
     parent::BasePage();
     $users = new Users();
     if (!$users->isLoggedIn() || !isset($this->userdata["role"]) || $this->userdata["role"] != Users::ROLE_ADMIN) {
         $this->show403(true);
     }
 }
예제 #3
0
 function AdminPage()
 {
     $this->template_dir = 'admin';
     parent::BasePage();
     $users = new Users();
     if (!$users->isLoggedIn() || !isset($this->userdata["role"]) || $this->userdata["role"] != Users::ROLE_ADMIN) {
         $this->show403(true);
     }
     // set site variable
     $s = new Sites();
     $this->site = $s->get();
     $this->smarty->assign('site', $this->site);
 }
 /**
  * Default constructor.
  */
 function AdminPage()
 {
     parent::BasePage();
     $tplpaths = array();
     if ($this->site->style != "default") {
         $tplpaths["style_admin"] = WWW_DIR . 'templates/' . $this->site->style . '/views/admin';
     }
     $tplpaths["admin"] = WWW_DIR . 'templates/default/views/admin';
     $tplpaths["frontend"] = WWW_DIR . 'templates/default/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);
     }
 }