isAdmin()) die("Illegal access."); switch($action) { case "setDefault": { $projects->setDefault($_GET['setDefault']); $msg = "Changed default project."; break; } case "delete": { $projects->delete($_GET['delete']); $msg = "Project deleted."; break; } case "add": { $result = $projects->add($_POST['title'], $_POST['text'], (empty($_POST['public']) ? false : true), (empty($_POST['default']) ? false : true)); if($result === true) $msg = "Project has been created."; else $msg = $result; break; } } unset($_SESSION['selectCache']); header("location: projects.php?msg=".urlencode($msg)); exit; } echo $xhtml->head("Projects","projects"); if(!empty($_GET['msg'])) echo '
'.xHTML::Protect(urldecode($_GET['msg'])).'
'; $list = $projects->getList(true); if(empty($list) || @count($list) < 1) { echo 'There is no project by now.
'; } else { echo '