} } break; case Article::$type: $assoc = $_POST; $assoc['author_id'] = $_POST['id']; unset($assoc['id']); $article = Article::FetchFromAssoc($assoc); if ($article === NULL) { $content = AlertMessage('alert-danger', Language::Word('error while article adding')); } else { $glob_id = 0; if (isset($_POST['glob_id'])) { $glob_id = $_POST['glob_id']; } if (Article::InsertToDB($article, $_POST['language'], $glob_id)) { $content = AlertMessage('alert-success', Language::Word('article is successfully added')); } else { $content = AlertMessage('alert-danger', Language::Word('error during article inserting')); } } break; case Report::$type: $assoc = $_POST; $assoc['author_id'] = $_POST['id']; unset($assoc['id']); $assoc['recipient_ids'] = urldecode($assoc['recipient_ids']); $ob = Report::FetchFromAssoc($assoc); if (count($ob->recipient_ids) === 0) { $content = AlertMessage('alert-danger', Language::Word('no recipients specified')); break;