assign('content_template', 'news_item.tpl'); $smarty->assign('news', $news->getNewsItem($_GET['news_id'])); } else { // get all news $smarty->assign('content_template', 'news_overview.tpl'); $smarty->assign('news', $news->getAllNews()); } break; case 'agenda': $agenda = new _Agenda(); $menu_item = 0; if(isset($_GET['ag_id'])) { // get agenda item $smarty->assign('content_template', 'agenda_item.tpl'); $smarty->assign('agenda', $agenda->getAgendaItem($_GET['ag_id'])); } else { // get all agenda items $smarty->assign('content_template', 'agenda_overview.tpl'); $smarty->assign('agenda', $agenda->getAllItems()); } break; case 'pub': $pub = new _Publicaties(); $menu_item = $_GET['cat']; if(isset($_GET['pub_id'])) { // get publicatie $smarty->assign('content_template', 'publicatie_item.tpl'); $smarty->assign('pub', $pub->getPublicatie($_GET['pub_id'])); } elseif( isset($_GET['cat'])) { // get all publicaties in category $smarty->assign('content_template', 'publicatie_overview.tpl'); $smarty->assign('cat', $pub->getCategory($_GET['cat'])); $smarty->assign('pub', $pub->getPublicatiesByCategory($_GET['cat'])); } else { // get first 10 publicaties (most recent first) $smarty->assign('content_template', 'publicatie_overview.tpl'); $smarty->assign('pub', $pub->getRecentPublicaties()); } break; case 'pages': if(isset($_GET['page'])) { $menu_item = $_GET['page']; // get page content $smarty->assign('content_template', 'dynamic_page.tpl'); $smarty->assign('page', $menu->getPage($_GET['page'])); } else { // show frontpage $isFrontPage = true; $smarty->assign('content_template', 'frontpage.tpl'); $menu_item = 0; } break; default: // show frontpage $isFrontPage = true; $smarty->assign('content_template', 'frontpage.tpl'); $menu_item = 0; break; } //assign menu $smarty->assign('menu', $menu->getMenu($_GET['mod'], $menu_item)); if($isFrontPage) { $news = new _News(); // get frontpage items $smarty->assign('news', $news->getNewsForFrontpage()); } //show site $smarty->display('page.tpl'); ?>