ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilForumExplorer Class Reference

Class ilForumExplorer class for explorer view of forum posts. More...

+ Collaboration diagram for ilForumExplorer:

Public Member Functions

 ilForumExplorer ($tpl, $a_target, ilForumTopic $a_thread, $a_ref_id)
 Constructor public.
 renderTree ()
 setOutput ($a_parent, $a_depth=1)
 Creates output for explorer view in admin menue recursive method public.

Data Fields

 $root_id
 $target = null

Private Member Functions

 __readThreadSubject ()

Private Attributes

 $thread_id
 $thread_subject
 $forum
 $objProperties = null
 ilForumProperties object private
 $objCurrentTopic = null

Detailed Description

Class ilForumExplorer class for explorer view of forum posts.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de
Version
Id:
class.ilForumExplorer.php 29942 2011-07-19 07:58:16Z nkrzywon

Definition at line 18 of file class.ilForumExplorer.php.

Member Function Documentation

ilForumExplorer::__readThreadSubject ( )
private

Definition at line 166 of file class.ilForumExplorer.php.

Referenced by ilForumExplorer().

{
$this->thread_subject = $this->objCurrentTopic->getSubject();
}

+ Here is the caller graph for this function:

ilForumExplorer::ilForumExplorer (   $tpl,
  $a_target,
ilForumTopic  $a_thread,
  $a_ref_id 
)

Constructor public.

Parameters
stringscriptname

Definition at line 57 of file class.ilForumExplorer.php.

References $lng, $tpl, __readThreadSubject(), ilForumTopic\getId(), ilForumProperties\getInstance(), and ilObjectFactory\getInstanceByRefId().

{
global $lng;
$this->tpl = $tpl;
$this->target = $a_target;
$lng->loadLanguageModule('forum');
$this->forum = new ilForum();
$this->forum_obj = ilObjectFactory::getInstanceByRefId($a_ref_id);
$this->objProperties = ilForumProperties::getInstance($this->forum_obj->getId());
$this->objCurrentTopic = $a_thread;
$this->thread_id = $this->objCurrentTopic->getId();
$this->root_id = $this->objCurrentTopic->getFirstPostNode()->getId();
// max length of user fullname which is shown in explorer view
define(FULLNAME_MAXLENGTH, 16);
}

+ Here is the call graph for this function:

ilForumExplorer::renderTree ( )

Definition at line 81 of file class.ilForumExplorer.php.

References setOutput().

{
$this->setOutput(0);
}

+ Here is the call graph for this function:

ilForumExplorer::setOutput (   $a_parent,
  $a_depth = 1 
)

Creates output for explorer view in admin menue recursive method public.

Parameters
integerparent_node_id where to start from (default=0, 'root')
integerdepth level where to start (default=1)
Returns
string

Definition at line 94 of file class.ilForumExplorer.php.

References $_GET, $_SESSION, $ilCtrl, $lng, $title, ilForum\_isModerator(), and ilJsonUtil\encode().

Referenced by renderTree().

{
global $lng, $ilUser, $ilCtrl;
static $counter = 0;
include_once 'Services/JSON/classes/class.ilJsonUtil.php';
if (is_numeric($a_parent) && $objects = $this->objCurrentTopic->getPostChilds($a_parent, 'explorer'))
{
++$a_depth;
foreach ($objects as $key => $object)
{
if (!$object['pos_status'] && !ilForum::_isModerator($_GET['ref_id'], $ilUser->getId()))
{
continue;
}
$href_target = $this->target."&pos_pk=".$object['child'].'#'.$object['child'];
if($ilUser->getId() == ANONYMOUS_USER_ID ||
$this->forum_obj->isRead($ilUser->getId(), $object['pos_pk']))
{
$title = "<span style='white-space:wrap;' class='frmTitle' id='frm_node_".$object['pos_pk']."'><a class='small' href='".$href_target."'>".stripslashes($object['subject'])."</a></span>".
"<div style='white-space:nowrap; margin-bottom:5px;' class='small'>";
}
else
{ //bold
$mark_post_target = str_replace('viewThread', 'markPostRead', $href_target);
$href_target = $mark_post_target;
$title = "<span style='white-space:wrap;' class='frmTitleBold' id='frm_node_".$object['pos_pk']."'><a class='small' href='".$href_target."'>".stripslashes($object['subject'])."</a></span>".
"<div style='white-space:nowrap; margin-bottom:5px;' class='small'>";
}
if ($this->objProperties->isAnonymized())
{
if ($object['alias'] != '') $title .= stripslashes($object['alias']);
else $title .= $lng->txt('forums_anonymous');
}
else
{
$title .= stripslashes($object['loginname']);
}
$title .= ", ".$this->forum->convertDate($object['date'])."</div>";
$this->tpl->setVariable('OLD_THR_ID', $_SESSION['thread_control']['old']);
$this->tpl->setVariable('NEW_THR_ID', $_SESSION['thread_control']['new']);
$node = new stdClass();
$node->html = $title;
if($object['child'] == $this->root_id)
{
$this->tpl->setVariable('FRM_TREE_ROOT_NODE_VARIABLE', 'frmNode'.$object['child']);
$this->tpl->setVariable('FRM_TREE_ROOT_NODE_LINK', ilJsonUtil::encode($node));
}
else
{
$this->tpl->setCurrentBlock('frm_nodes');
$this->tpl->setVariable('FRM_NODES_VARNAME', 'frmNode'.$object['child']);
$this->tpl->setVariable('FRM_NODES_PARENT_VARNAME', 'frmNode'.$object['parent']);
$this->tpl->setVariable('FRM_NODES_LINK', ilJsonUtil::encode($node));
$this->tpl->parseCurrentBlock();
}
++$counter;
// Recursive
$this->setOutput($object['child'], $a_depth);
} //foreach
} //if
$_SESSION['thread_control']['old'] = $_SESSION['thread_control']['new'];
} //function

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilForumExplorer::$forum
private

Definition at line 41 of file class.ilForumExplorer.php.

ilForumExplorer::$objCurrentTopic = null
private

Definition at line 49 of file class.ilForumExplorer.php.

ilForumExplorer::$objProperties = null
private

ilForumProperties object private

Definition at line 47 of file class.ilForumExplorer.php.

ilForumExplorer::$root_id

Definition at line 34 of file class.ilForumExplorer.php.

ilForumExplorer::$target = null

Definition at line 50 of file class.ilForumExplorer.php.

ilForumExplorer::$thread_id
private

Definition at line 25 of file class.ilForumExplorer.php.

ilForumExplorer::$thread_subject
private

Definition at line 26 of file class.ilForumExplorer.php.


The documentation for this class was generated from the following file: