Skip to content

Commit

Permalink
Merge pull request #4 from mjansenDatabay/nm_feature_frm_root_nodes
Browse files Browse the repository at this point in the history
Nm feature frm root nodes
  • Loading branch information
mjansenDatabay authored Feb 12, 2019
2 parents 25efd37 + 092f5e4 commit 93e7ec5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Modules/Forum/classes/class.ilObjForumGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ protected function renderDraftContent($render_drafts, $node, $edit_draft_id = NU
$this->tpl->setVariable('FORM', $this->getDeleteDraftFormHTML());
}
}
else if($_GET['action'] == 'editdraft' && $draft->getDraftId() == (int)$_GET['draft_id'])
else if($_GET['action'] == 'editdraft' && (int)$draft->getDraftId() == (int)$_GET['draft_id'])
{
$oEditReplyForm = $this->getReplyEditForm();
$this->tpl->setVariable('EDIT_DRAFT_ANCHOR', 'draft_edit_' . $draft->getDraftId());
Expand Down Expand Up @@ -2592,6 +2592,8 @@ public function viewThreadObject()
*/
$file_obj = $oForumObjects['file_obj'];

$selected_draft_id = (int)$_GET['draft_id'] ?? 0;

// download file
if(isset($_GET['file']))
{
Expand Down Expand Up @@ -2807,7 +2809,8 @@ public function viewThreadObject()
$first_node = $this->objCurrentTopic->getFirstPostNode();
$this->objCurrentTopic->setOrderField($orderField);
$subtree_nodes = $this->objCurrentTopic->getPostTree($first_node);

$subtree_nodes[] = $first_node;

if( !$this->isTopLevelReplyCommand() &&
$first_node instanceof ilForumPost &&
!$this->objCurrentTopic->isClosed() &&
Expand Down Expand Up @@ -3089,7 +3092,7 @@ public function viewThreadObject()
}
}
$this->renderPostContent($node, $Start, $z);
$this->renderDraftContent($render_drafts, $node, $edit_draft_id);
$this->renderDraftContent($render_drafts, $node, $selected_draft_id);
}
$z++;
}
Expand Down

0 comments on commit 93e7ec5

Please sign in to comment.