4require_once 
'Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php';
 
   60        public function __construct($a_expl_id, $a_parent_obj, $a_parent_cmd)
 
   68                parent::__construct($a_expl_id, $a_parent_obj, $a_parent_cmd);
 
   77                $this->max_entries = (int)$frm->getPageHits();
 
   94                $this->root_node = 
$thread->getFirstPostNode();
 
   95                $this->root_node->setIsRead($this->root_node->isRead($this->root_node->getPosAuthorId()));
 
   97                $this->ctrl->setParameter($this->parent_obj, 
'thr_pk', $this->thread->getId());
 
  105                if(
null === $this->root_node)
 
  107                        $this->root_node = $this->thread->getFirstPostNode();
 
  111                        'pos_pk'              => $this->root_node->getId(),
 
  112                        'pos_subject'         => $this->root_node->getSubject(),
 
  113                        'pos_author_id'       => $this->root_node->getPosAuthorId(),
 
  114                        'pos_display_user_id' => $this->root_node->getDisplayUserId(),
 
  115                        'pos_usr_alias'       => $this->root_node->getUserAlias(),
 
  116                        'pos_date'            => $this->root_node->getCreateDate(),
 
  117                        'import_name'         => $this->root_node->getImportName(),
 
  118                        'post_read'           => $this->root_node->isPostRead()
 
  127                return new ilTemplate(
'tpl.tree_node_content.html', 
true, 
true, 
'Modules/Forum');
 
  137                        if(isset($this->preloaded_children[$a_parent_node_id]))
 
  139                                return $this->preloaded_children[$a_parent_node_id];
 
  143                return $this->thread->getNestedSetPostChildren($a_parent_node_id, 1);
 
  151                $this->preloaded_children            = array();
 
  152                $this->node_id_to_parent_node_id_map = array();
 
  154                $children = $this->thread->getNestedSetPostChildren($this->root_node->getId());
 
  156                array_walk($children, 
function(&$a_node, $key) {
 
  157                        $this->node_id_to_parent_node_id_map[(int)$a_node[
'pos_pk']] = (
int)$a_node[
'parent_pos'];
 
  158                        $this->preloaded_children[(int)$a_node[
'parent_pos']][$a_node[
'pos_pk']] = $a_node;
 
  161                $this->preloaded = 
true;
 
  171                $tpl->setCurrentBlock(
'node-content-block');
 
  172                $tpl->setVariable(
'TITLE', $a_node[
'pos_subject']);
 
  174                $tpl->parseCurrentBlock();
 
  176                require_once 
'Modules/Forum/classes/class.ilForumAuthorInformation.php';
 
  178                        $a_node[
'pos_author_id'],
 
  179                        $a_node[
'pos_display_user_id'],
 
  180                        $a_node[
'pos_usr_alias'],
 
  181                        $a_node[
'import_name']
 
  184                $tpl->setCurrentBlock(
'unlinked-node-content-block');
 
  186                $tpl->setVariable(
'AUTHOR', $authorinfo->getAuthorShortName());
 
  188                $tpl->parseCurrentBlock();
 
  199                $node_title_classes = array(
'ilForumTreeTitle');
 
  201                if(isset($node_config[
'post_read']) && !$node_config[
'post_read'])
 
  203                        $node_title_classes[] = 
'ilForumTreeTitleUnread';
 
  206                return $node_title_classes;
 
  214                return 'ilForumTreeUnlinkedContent';
 
  222                $this->ctrl->setParameter($this->parent_obj, 
'backurl', 
null);
 
  223                $this->ctrl->setParameter($this->parent_obj, 
'pos_pk', $a_node[
'pos_pk']);
 
  225                if(isset($a_node[
'counter']))
 
  227                        $this->ctrl->setParameter($this->parent_obj, 
'offset', floor($a_node[
'counter'] / $this->max_entries) * $this->max_entries);
 
  230                if(isset($a_node[
'post_read']) && $a_node[
'post_read'])
 
  232                        return $this->ctrl->getLinkTarget($this->parent_obj, $this->parent_cmd, $a_node[
'pos_pk']);
 
  236                        return $this->ctrl->getLinkTarget($this->parent_obj, 
'markPostRead', $a_node[
'pos_pk']);
 
  245                return $a_node[
'pos_pk'];
 
  263                if(isset(
$_GET[
'post_created_below']) && (
int)
$_GET[
'post_created_below'] > 0)
 
  265                        $parent  = (int)
$_GET[
'post_created_below'];
 
  270                        while($parent = $this->node_id_to_parent_node_id_map[$parent]);
 
  273                $html = parent::getHTML();
 
  275                $this->tpl->addOnLoadCode(
'il.ForumExplorer.init(' . json_encode(array(
 
  276                        'selectors' => array(
 
  282                $this->tpl->addJavascript($this->js_explorer_frm_path);
 
An exception for terminatinating execution or to throw for unit testing.
static formatDate(ilDateTime $date)
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)
__construct($a_expl_id, $a_parent_obj, $a_parent_cmd)
Constructor.
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}
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