public static function ActionCreateQuiz() { if (ModeratorModel::isModerator() and isset($_POST['id']) and isset($_POST['number'])) { $variables = ['template' => 'panel.php', 'panel_template' => 'moderator_create_quiz.php', 'id' => $_POST['id'], 'number' => $_POST['number']]; $variables = array_merge_recursive(PageController::getMainVariables(), $variables); Template::render('template.php', $variables); } else { header('Location: ' . $_SERVER['HTTP_REFERER']); } }
public static function ActionThemes() { if (AdminModel::isAdmin()) { $variables = ['template' => 'panel.php', 'panel_template' => 'admin_themes.php', 'themes' => AdminModel::getThemes()]; $variables = array_merge_recursive(PageController::getMainVariables(), $variables); Template::render('template.php', $variables); } else { header('Location: ' . $_SERVER['HTTP_REFERER']); } }
public static function ActionProfile() { $user = UserModel::getUser(UserModel::getUserId()); if (UserModel::isUserLoggedIn()) { $variables = ['template' => 'profile.php', 'links' => ['profile.css'], 'scripts' => ['fileUploader.js'], 'themes' => AdminModel::getThemes(), 'profile' => ['id' => UserModel::getUserId(), 'email' => $user['email'], 'about' => $user['about']]]; $variables = array_replace_recursive(PageController::getMainVariables(), $variables); Template::render('template.php', $variables); } else { header("Location: " . $_SERVER['HTTP_REFERER']); } }