4require_once 
'Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php';
 
   60    public function __construct($a_expl_id, $a_parent_obj, $a_parent_cmd)
 
   64        parent::__construct($a_expl_id, $a_parent_obj, $a_parent_cmd);
 
   69        $this->tpl  = 
$DIC->ui()->mainTemplate();
 
   70        $this->ctrl = 
$DIC->ctrl();
 
   73        $this->max_entries = (int) $frm->getPageHits();
 
   90        $this->root_node = 
$thread->getFirstPostNode();
 
   91        $this->root_node->setIsRead($this->root_node->isRead($this->root_node->getPosAuthorId()));
 
   93        $this->ctrl->setParameter($this->parent_obj, 
'thr_pk', $this->thread->getId());
 
  101        if (
null === $this->root_node) {
 
  102            $this->root_node = $this->thread->getFirstPostNode();
 
  106            'pos_pk'              => $this->root_node->getId(),
 
  107            'pos_subject'         => $this->root_node->getSubject(),
 
  108            'pos_author_id'       => $this->root_node->getPosAuthorId(),
 
  109            'pos_display_user_id' => $this->root_node->getDisplayUserId(),
 
  110            'pos_usr_alias'       => $this->root_node->getUserAlias(),
 
  111            'pos_date'            => $this->root_node->getCreateDate(),
 
  112            'import_name'         => $this->root_node->getImportName(),
 
  113            'post_read'           => $this->root_node->isPostRead()
 
  123        return new ilTemplate(
'tpl.tree_node_content.html', 
true, 
true, 
'Modules/Forum');
 
  131        if ($this->preloaded) {
 
  132            if (isset($this->preloaded_children[$a_parent_node_id])) {
 
  133                return $this->preloaded_children[$a_parent_node_id];
 
  137        return $this->thread->getNestedSetPostChildren($a_parent_node_id, 1);
 
  145        $this->preloaded_children            = array();
 
  146        $this->node_id_to_parent_node_id_map = array();
 
  148        $children = $this->thread->getNestedSetPostChildren($this->root_node->getId());
 
  150        array_walk($children, 
function (&$a_node, 
$key) {
 
  151            $this->node_id_to_parent_node_id_map[(int) $a_node[
'pos_pk']] = (
int) $a_node[
'parent_pos'];
 
  152            $this->preloaded_children[(int) $a_node[
'parent_pos']][$a_node[
'pos_pk']] = $a_node;
 
  155        $this->preloaded = 
true;
 
  165        $tpl->setCurrentBlock(
'node-content-block');
 
  166        $tpl->setVariable(
'TITLE', $a_node[
'pos_subject']);
 
  168        $tpl->parseCurrentBlock();
 
  170        require_once 
'Modules/Forum/classes/class.ilForumAuthorInformation.php';
 
  172            $a_node[
'pos_author_id'],
 
  173            $a_node[
'pos_display_user_id'],
 
  174            $a_node[
'pos_usr_alias'],
 
  175            $a_node[
'import_name']
 
  178        $tpl->setCurrentBlock(
'unlinked-node-content-block');
 
  180        $tpl->setVariable(
'AUTHOR', $authorinfo->getAuthorShortName());
 
  182        $tpl->parseCurrentBlock();
 
  193        $node_title_classes = array(
'ilForumTreeTitle');
 
  195        if (isset($node_config[
'post_read']) && !$node_config[
'post_read']) {
 
  196            $node_title_classes[] = 
'ilForumTreeTitleUnread';
 
  199        return $node_title_classes;
 
  207        return 'ilForumTreeUnlinkedContent';
 
  215        $this->ctrl->setParameter($this->parent_obj, 
'backurl', 
null);
 
  216        $this->ctrl->setParameter($this->parent_obj, 
'pos_pk', $a_node[
'pos_pk']);
 
  218        if (isset($a_node[
'counter'])) {
 
  219            $this->ctrl->setParameter($this->parent_obj, 
'offset', floor($a_node[
'counter'] / $this->max_entries) * $this->max_entries);
 
  222        if (isset($a_node[
'post_read']) && $a_node[
'post_read']) {
 
  223            return $this->ctrl->getLinkTarget($this->parent_obj, $this->parent_cmd, $a_node[
'pos_pk']);
 
  225            return $this->ctrl->getLinkTarget($this->parent_obj, 
'markPostRead', $a_node[
'pos_pk']);
 
  234        return $a_node[
'pos_pk'];
 
  252        if (isset(
$_GET[
'post_created_below']) && (
int) 
$_GET[
'post_created_below'] > 0) {
 
  253            $parent  = (int) 
$_GET[
'post_created_below'];
 
  256            } 
while ($parent = $this->node_id_to_parent_node_id_map[$parent]);
 
  259        $html = parent::getHTML();
 
  261        $this->tpl->addOnLoadCode(
'il.ForumExplorer.init(' . json_encode(array(
 
  262            'selectors' => array(
 
  268        $this->tpl->addJavascript($this->js_explorer_frm_path);
 
An exception for terminatinating execution or to throw for unit testing.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
@classDescription Date and time handling
getContainerId()
Get container id.
setSkipRootNode($a_val)
Set skip root node.
setNodeOpen($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour)
Class ilForumExplorerGUI.
getNodeContent($a_node)
{Get content of a node.string content of the node}
getNodeHref($a_node)
{Get href for node.string href attribute}
$node_id_to_parent_node_id_map
getUnlinkedNodeContentClass()
getChildsOfNode($a_parent_node_id)
{Get childs of node.array childs}
__construct($a_expl_id, $a_parent_obj, $a_parent_cmd)
{Constructor.}
getNodeIcon($a_node)
{Get node icon path.string image file path}
getRootNode()
{Get root node.Please note that the class does not make any requirements how nodes are represented (a...
getNodeTemplateInstance()
Factory method for a new instance of a node template.
getNodeId($a_node)
{Get id of a node.string id of node}
getNodeTitleClasses(array $node_config)
Class Forum core functions for forum.
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
special template class to simplify handling of ITX/PEAR