19 declare(strict_types=1);
43 Closure $subjectFormatterCallable,
65 if ($this->actor->isAnonymous() || !($this->actor->getId() > 0)) {
69 if ($this->thread->getId() > 0 && $this->thread->isClosed()) {
79 !$this->relatedPost->isActivated() || $this->relatedPost->isCensored()
87 $relatedPostId = $this->relatedPost->getId();
90 $this->
form->checkInput();
93 if ($this->relatedDraftId > 0) {
96 $draftId = (
int) $this->
form->getInput(
'draft_id');
102 if (
'showreply' === $this->action) {
104 $draftObj->setPostSubject($subjectFormatterCallback($inputValues[
'subject']));
106 $draftObj->setPostUserAlias($inputValues[
'alias']);
107 $draftObj->setNotificationStatus((
bool) $inputValues[
'notify']);
108 $draftObj->setUpdateUserId($this->actor->getId());
109 $draftObj->setPostAuthorId($this->actor->getId());
110 $draftObj->setPostDisplayUserId(($this->forumProperties->isAnonymized() ? 0 : $this->actor->getId()));
111 $draftObj->updateDraft();
119 $draftObj->getDraftId(),
126 $draftObj->setDraftId($draftId);
127 $draftObj->setPostSubject($subjectFormatterCallback($inputValues[
'subject']));
129 $draftObj->addDraftToHistory();
137 $draftObj->getHistoryId(),
145 $draftObj->setForumId($this->relatedForumId);
146 $draftObj->setThreadId($this->thread->getId());
147 $draftObj->setPostId($relatedPostId);
148 $draftObj->setPostSubject($subjectFormatterCallback($inputValues[
'subject']));
150 $draftObj->setPostUserAlias($inputValues[
'alias']);
151 $draftObj->setNotificationStatus((
bool) $inputValues[
'notify']);
152 $draftObj->setPostAuthorId($this->actor->getId());
153 $draftObj->setPostDisplayUserId(($this->forumProperties->isAnonymized() ? 0 : $this->actor->getId()));
154 $draftObj->saveDraft();
162 $draftObj->getDraftId(),
169 $response->draft_id = $draftObj->getDraftId();
184 array $uploadedObjects,
185 array $oldMediaObjects,
186 array $curMediaObjects
188 foreach ($uploadedObjects as $mob) {
193 foreach ($oldMediaObjects as $mob) {
197 foreach ($curMediaObjects as $mob) {
206 $inputValues[
'subject'] = $this->
form->getInput(
'subject');
207 $inputValues[
'message'] = $this->
form->getInput(
'message');
208 $inputValues[
'notify'] = (
int) $this->
form->getInput(
'notify');
210 $this->
form->getInput(
'alias'),
211 $this->forumProperties->isAnonymized()
static _replaceMediaObjectImageSrc(string $a_text, int $a_direction=0, string $nic='')
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
static _getMediaObjects(string $a_text, int $a_direction=0)
Returns all media objects found in the passed string.
handleMedia(string $type, int $draftId, array $uploadedObjects, array $oldMediaObjects, array $curMediaObjects)
__construct(ilObjUser $actor, ilPropertyFormGUI $form, ilForumProperties $forumProperties, ilForumTopic $thread, ?ilForumPost $relatedPost, Closure $subjectFormatterCallable, int $relatedDraftId, int $relatedForumId, string $action)
Class ilForumSaveAsyncDraftAction.
Closure $subjectFormatterCallable
Class ilForumDraftHistory.
static getPublicUserAlias(string $user_alias, bool $is_anonymized)
static isAutoSavePostDraftAllowed()
form( $class_path, string $cmd)
ilForumProperties $forumProperties
static newInstanceByDraftId(int $draft_id)
executeAndGetResponseObject()