public static function ActionSaveMessage($chatId) { ChatModel::saveMessage($chatId, 1, $_POST['message']); exit('ok'); if (UserModel::isUserLoggedIn() and ChatModel::isUserInChat($chatId, UserModel::getUserId())) { } }
public static function ActionAddComment($postId) { if (UserModel::isUserLoggedIn() and isset($_POST['text'])) { $text = $_POST['text']; PostModel::addComment($postId, $text); } header("Location: " . $_SERVER['HTTP_REFERER']); }
public static function ActionAddPost() { if (UserModel::isUserLoggedIn()) { $variables = ['template' => 'postForm.php', 'scripts' => ['fileUploader.js']]; $variables = array_merge_recursive(self::getMainVariables(), $variables); Template::render('template.php', $variables); } else { header('Location: ' . $_SERVER['HTTP_REFERER']); } }
public static function ActionChangeLanguage() { if (UserModel::isUserLoggedIn()) { $lang = $_POST['lang']; UserModel::changeUserLanguage($lang); } header("Location: " . $_SERVER['HTTP_REFERER']); }