Exemplo n.º 1
0
 public static function ActionSaveMessage($chatId)
 {
     ChatModel::saveMessage($chatId, 1, $_POST['message']);
     exit('ok');
     if (UserModel::isUserLoggedIn() and ChatModel::isUserInChat($chatId, UserModel::getUserId())) {
     }
 }
Exemplo n.º 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']);
 }
Exemplo n.º 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']);
     }
 }
Exemplo n.º 4
0
 public static function ActionChangeLanguage()
 {
     if (UserModel::isUserLoggedIn()) {
         $lang = $_POST['lang'];
         UserModel::changeUserLanguage($lang);
     }
     header("Location: " . $_SERVER['HTTP_REFERER']);
 }