4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
27 public function __construct($a_parent_obj, $a_parent_cmd =
"", $a_perm_ref_id = 0)
31 $this->ctrl = $DIC->ctrl();
32 $this->lng = $DIC->language();
33 $this->access = $DIC->access();
35 $lng = $DIC->language();
37 parent::__construct($a_parent_obj, $a_parent_cmd);
39 $this->perm_ref_id = $a_perm_ref_id;
51 "tpl.table_row_news_for_context.html",
67 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
70 if ($a_set[
"user_id"] > 0) {
71 $this->tpl->setCurrentBlock(
"user_info");
72 $user_obj =
new ilObjUser($a_set[
"user_id"]);
73 $this->tpl->setVariable(
"VAL_AUTHOR", $user_obj->getLogin());
74 $this->tpl->setVariable(
"TXT_AUTHOR",
$lng->txt(
"author"));
75 $this->tpl->parseCurrentBlock();
79 if ($enable_internal_rss) {
80 $this->tpl->setCurrentBlock(
"access");
81 $this->tpl->setVariable(
"TXT_ACCESS",
$lng->txt(
"news_news_item_visibility"));
83 ($a_set[
"priority"] == 0 &&
86 "public_notifications",
88 $a_set[
"context_obj_id"]
90 $this->tpl->setVariable(
"VAL_ACCESS",
$lng->txt(
"news_visibility_public"));
92 $this->tpl->setVariable(
"VAL_ACCESS",
$lng->txt(
"news_visibility_users"));
94 $this->tpl->parseCurrentBlock();
98 if ($a_set[
"creation_date"] != $a_set[
"update_date"]) {
99 $this->tpl->setCurrentBlock(
"ni_update");
100 $this->tpl->setVariable(
"TXT_LAST_UPDATE",
$lng->txt(
"last_update"));
101 $this->tpl->setVariable(
105 $this->tpl->parseCurrentBlock();
109 $this->tpl->setVariable(
113 $this->tpl->setVariable(
"TXT_CREATED",
$lng->txt(
"created"));
116 $this->tpl->setVariable(
"VAL_TITLE", $a_set[
"title"]);
119 if ($a_set[
"content"] !=
"") {
120 $this->tpl->setCurrentBlock(
"content");
121 $this->tpl->setVariable(
126 $this->tpl->parseCurrentBlock();
129 $perm_ref_id = ($this->perm_ref_id > 0)
133 if ($ilAccess->checkAccess(
"write",
"", $perm_ref_id)) {
134 $this->tpl->setCurrentBlock(
"edit");
135 $this->tpl->setVariable(
"TXT_EDIT",
$lng->txt(
"edit"));
136 $ilCtrl->setParameterByClass(
"ilnewsitemgui",
"news_item_id", $a_set[
"id"]);
137 $this->tpl->setVariable(
139 $ilCtrl->getLinkTargetByClass(
"ilnewsitemgui",
"editNewsItem")
141 $this->tpl->parseCurrentBlock();
145 $this->tpl->setVariable(
147 $lng->txt(
"obj_" . $a_set[
"context_obj_type"]) .
":<br />" .
151 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static _lookupTitle($a_id)
lookup object title
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
TableGUI class for table NewsForContext.
fillRow($a_set)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd="", $a_perm_ref_id=0)