Class ilObjForumListGUI. More...
Inheritance diagram for ilObjForumListGUI:
Collaboration diagram for ilObjForumListGUI:Public Member Functions | |
| ilObjForumListGUI () | |
| constructor | |
| init () | |
| initialisation | |
| initItem ($a_ref_id, $a_obj_id, $a_title="", $a_description="") | |
| inititialize new item | |
| getProperties () | |
| Get item properties. | |
Class ilObjForumListGUI.
Definition at line 37 of file class.ilObjForumListGUI.php.
| ilObjForumListGUI::getProperties | ( | ) |
Get item properties.
Overwrite this method to add properties at the bottom of the item html
Definition at line 95 of file class.ilObjForumListGUI.php.
References $ilUser, $lng, ilObject::_exists(), ilObjForum::_getCountUnread(), ilForum::_getModerators(), ilForum::_lookupForumData(), and ilObjUser::_lookupLogin().
{
global $lng, $ilUser;
$props = array();
include_once("classes/class.ilForum.php");
include_once("classes/class.ilObjForum.php");
$frm_data = ilForum::_lookupForumData($this->obj_id);
include_once("classes/class.ilObjUser.php");
$MODS = ilForum::_getModerators($this->ref_id);
$moderators = "";
for ($i = 0; $i < count($MODS); $i++)
{
if ($moderators != "")
{
$moderators .= ", ";
}
$moderators .= "<a class=\"il_ItemProperty\" href=\"forums_user_view.php?ref_id=".$this->ref_id."&user=".
$MODS[$i]."&backurl=repository&offset=".$Start."\">".ilObjUser::_lookupLogin($MODS[$i])."</a>";
}
// Moderators
$props[] = array("alert" => false, "property" => $lng->txt("forums_moderators"),
"value" => $moderators);
// Topics
$props[] = array("alert" => false, "property" => $lng->txt("forums_threads"),
"value" => $frm_data["top_num_threads"]);
// Articles (Unread)
$unread = ilObjForum::_getCountUnread($this->obj_id,$ilUser->getId());
$alert = ($unread > 0)
? true
: false;
$props[] = array("alert" => $alert, "property" => $lng->txt("forums_articles")." (".$lng->txt("unread").")",
"value" => $frm_data['top_num_posts']." (".$unread.")");
// New Articles
$new = $this->frm_obj->getCountNew($ilUser->getId());
$alert = ($new > 0)
? true
: false;
$props[] = array("alert" => $alert, "property" => $lng->txt("forums_new_articles"),
"value" => $new);
// Visits
$props[] = array("alert" => false, "property" => $lng->txt("visits"),
"value" => $frm_data["visits"]);
// Last Article
if ($frm_data["top_last_post"] != "")
{
$lastPost = $this->frm->getLastPost($frm_data["top_last_post"]);
$lastPost["pos_message"] = $this->frm->prepareText($lastPost["pos_message"]);
}
if (is_array($lastPost))
{
$last_user = $this->frm->getUserData($lastPost["pos_usr_id"],$lastPost["import_name"]);
$lpCont = "<a class=\"il_ItemProperty\" href=\"forums_frameset.php?target=true&pos_pk=".
$lastPost["pos_pk"]."&thr_pk=".$lastPost["pos_thr_fk"]."&ref_id=".
$this->ref_id."#".$lastPost["pos_pk"]."\">".$lastPost["pos_message"]."</a> ".
strtolower($lng->txt("from"))." ";
if($lastPost["pos_usr_id"] && ilObject::_exists($lastPost["pos_usr_id"]))
{
$lpCont .= "<a class=\"il_ItemProperty\" href=\"forums_user_view.php?ref_id=".$this->ref_id."&user=".
$last_user["usr_id"]."&backurl=repository&offset=".$Start."\">".$last_user["login"]."</a>, ";
$lpCont .= $lastPost["pos_date"];
}
else
{
$lpCont .= $last_user["login"];
}
}
$props[] = array("alert" => false, "newline" => true, "property" => $lng->txt("forums_last_post"),
"value" => $lpCont);
return $props;
}
Here is the call graph for this function:| ilObjForumListGUI::ilObjForumListGUI | ( | ) |
constructor
Definition at line 43 of file class.ilObjForumListGUI.php.
References ilObjectListGUI::ilObjectListGUI().
{
$this->ilObjectListGUI();
}
Here is the call graph for this function:| ilObjForumListGUI::init | ( | ) |
initialisation
Reimplemented from ilObjectListGUI.
Definition at line 51 of file class.ilObjForumListGUI.php.
References ilObjForumAccess::_getCommands().
{
$this->delete_enabled = true;
$this->cut_enabled = true;
$this->subscribe_enabled = true;
$this->link_enabled = true;
$this->payment_enabled = false;
$this->type = "frm";
$this->gui_class_name = "ilobjforumgui";
// general commands array
include_once('class.ilObjForumAccess.php');
$this->commands = ilObjForumAccess::_getCommands();
}
Here is the call graph for this function:| ilObjForumListGUI::initItem | ( | $ | a_ref_id, | |
| $ | a_obj_id, | |||
| $ | a_title = "", |
|||
| $ | a_description = "" | |||
| ) |
inititialize new item
| int | $a_ref_id reference id | |
| int | $a_obj_id object id | |
| string | $a_title title | |
| string | $a_description description |
Reimplemented from ilObjectListGUI.
Definition at line 74 of file class.ilObjForumListGUI.php.
References ilObjectFactory::getInstanceByRefId().
{
parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
$this->frm_obj =& ilObjectFactory::getInstanceByRefId($this->ref_id);
$this->frm =& new ilForum();
$this->frm->setForumRefId($a_ref_id);
$this->frm->setWhereCondition("top_frm_fk = ".$a_obj_id);
}
Here is the call graph for this function:
1.7.1