private function makeMenu() { $tmp = new PageCat(); $cats = $tmp->findAll('active', 1); $this->smarty->assign('uriHead', $this->getURIHead()); $this->smarty->assign('pageCats', $cats); if (!isset($this->isStart) && isset($this->cat) && $this->cat->uri() == "beispiele") { $werke = $tmp->find('uri', "werke"); $this->smarty->assign('activeId', $werke->tblid); } else { $this->smarty->assign('activeId', $this->cat->tblid); } $this->passLogin(); return $this->smarty->fetch('menu.tpl'); }
$GLOBALS['domain_sub'] = "domain"; $requestURI = explode('/', $_SERVER['REQUEST_URI']); unset($requestURI[0]); if ($requestURI[1] == $GLOBALS['domain_sub']) { unset($requestURI[1]); } $req = array_values($requestURI); $tmp = new PageCat(); $cats = $tmp->findAll(1, 1, false, true); // parse routing for ($i = 0; $i < count($cats); $i++) { if ($req[0] == $cats[$i]->uri()) { $conString = $cats[$i]->controller(); $controller = new $conString(); $tmp = new PageCat(); $controller->cat = $tmp->find('uri', $req[0]); $controller->pageTitle = $controller->cat->title_de(); break; } } // standard start page? if ($req[0] == "") { $controller = new NormPage(); $controller->isStart = true; } // admin login? if ($req[0] == "admin") { $controller = new AdminPage(); $controller->pageTitle = "Administration"; } // everything else
public function editItem() { if (!$this->isLoggedIn() || $this->req[2] == "") { $this->redirect = $this->getURIHead(); return; } else { $itemVals = $_REQUEST['item']; $tmp = new PageCat(); $item = $tmp->find('id', $this->req[2]); foreach ($itemVals as $k => $v) { $item->{$k}($v); } $item->save(); $this->redirect = $this->getURIHead(); return; } }