コード例 #1
0
 public static function ActionSaveMessage($chatId)
 {
     ChatModel::saveMessage($chatId, 1, $_POST['message']);
     exit('ok');
     if (UserModel::isUserLoggedIn() and ChatModel::isUserInChat($chatId, UserModel::getUserId())) {
     }
 }
コード例 #2
0
 public static function ActionAddComment($postId)
 {
     if (UserModel::isUserLoggedIn() and isset($_POST['text'])) {
         $text = $_POST['text'];
         PostModel::addComment($postId, $text);
     }
     header("Location: " . $_SERVER['HTTP_REFERER']);
 }
コード例 #3
0
 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']);
     }
 }
コード例 #4
0
 public static function ActionChangeLanguage()
 {
     if (UserModel::isUserLoggedIn()) {
         $lang = $_POST['lang'];
         UserModel::changeUserLanguage($lang);
     }
     header("Location: " . $_SERVER['HTTP_REFERER']);
 }