TableGUI class for table NewsForContext. More...
Inheritance diagram for ilNewsForContextTableGUI:
Collaboration diagram for ilNewsForContextTableGUI:Public Member Functions | |
| ilNewsForContextTableGUI ($a_parent_obj, $a_parent_cmd="") | |
Protected Member Functions | |
| fillRow ($a_set) | |
| Standard Version of Fill Row. | |
TableGUI class for table NewsForContext.
Definition at line 34 of file class.ilNewsForContextTableGUI.php.
| ilNewsForContextTableGUI::fillRow | ( | $ | a_set | ) | [protected] |
Standard Version of Fill Row.
Most likely to be overwritten by derived class.
Reimplemented from ilTable2GUI.
Definition at line 55 of file class.ilNewsForContextTableGUI.php.
References $ilCtrl, $lng, ilBlockSetting::_lookup(), ilFormat::formatDate(), and ilUtil::makeClickable().
{
global $lng, $ilCtrl;
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
// user
if ($a_set["user_id"] > 0)
{
$this->tpl->setCurrentBlock("user_info");
$user_obj = new ilObjUser($a_set["user_id"]);
$this->tpl->setVariable("VAL_AUTHOR", $user_obj->getLogin());
$this->tpl->setVariable("TXT_AUTHOR", $lng->txt("author"));
$this->tpl->parseCurrentBlock();
}
// access
if ($enable_internal_rss)
{
$this->tpl->setCurrentBlock("access");
$this->tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility"));
if ($a_set["visibility"] == NEWS_PUBLIC ||
($a_set["priority"] == 0 &&
ilBlockSetting::_lookup("news", "public_notifications",
0, $a_set["context_obj_id"])))
{
$this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public"));
}
else
{
$this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users"));
}
$this->tpl->parseCurrentBlock();
}
// last update
if ($a_set["creation_date"] != $a_set["update_date"])
{
$this->tpl->setCurrentBlock("ni_update");
$this->tpl->setVariable("TXT_LAST_UPDATE", $lng->txt("last_update"));
$this->tpl->setVariable("VAL_LAST_UPDATE",
ilFormat::formatDate($a_set["update_date"], "datetime", true));
$this->tpl->parseCurrentBlock();
}
// creation date
$this->tpl->setVariable("VAL_CREATION_DATE",
ilFormat::formatDate($a_set["creation_date"], "datetime", true));
$this->tpl->setVariable("TXT_CREATED", $lng->txt("created"));
// title
$this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
// content
if ($a_set["content"] != "")
{
$this->tpl->setCurrentBlock("content");
$this->tpl->setVariable("VAL_CONTENT", ilUtil::makeClickable( $a_set["content"], true));
$this->tpl->parseCurrentBlock();
}
if ($a_set["content_long"] != "")
{
$this->tpl->setCurrentBlock("long");
$this->tpl->setVariable("VAL_LONG_CONTENT", ilUtil::makeClickable($a_set["content_long"], true));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("VAL_ID", $a_set["id"]);
$this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
$ilCtrl->setParameterByClass("ilnewsitemgui", "news_item_id", $a_set["id"]);
$this->tpl->setVariable("CMD_EDIT",
$ilCtrl->getLinkTargetByClass("ilnewsitemgui", "editNewsItem"));
}
Here is the call graph for this function:| ilNewsForContextTableGUI::ilNewsForContextTableGUI | ( | $ | a_parent_obj, | |
| $ | a_parent_cmd = "" | |||
| ) |
Definition at line 37 of file class.ilNewsForContextTableGUI.php.
References $ilCtrl, $lng, ilTable2GUI::__construct(), ilTable2GUI::addColumn(), ilTable2GUI::setCloseCommand(), ilTable2GUI::setFormAction(), and ilTable2GUI::setRowTemplate().
{
global $ilCtrl, $lng;
parent::__construct($a_parent_obj, $a_parent_cmd);
$this->addColumn("", "f", "1");
$this->addColumn($lng->txt("news_news_item_content"), "");
$this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
$this->setRowTemplate("tpl.table_row_news_for_context.html",
"Services/News");
$this->setCloseCommand($ilCtrl->getParentReturnByClass("ilnewsitemgui"));
}
Here is the call graph for this function:
1.7.1