4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
17 function __construct($a_parent_obj, $a_parent_cmd =
"", $a_perm_ref_id = 0)
21 parent::__construct($a_parent_obj, $a_parent_cmd);
23 $this->perm_ref_id = $a_perm_ref_id;
26 $this->
addColumn($lng->txt(
"news_news_item_content"));
27 $this->
addColumn($lng->txt(
"news_attached_to"));
31 $this->
addColumn($lng->txt(
"last_update"));
47 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
50 if ($a_set[
"user_id"] > 0)
52 $this->tpl->setCurrentBlock(
"user_info");
53 $user_obj =
new ilObjUser($a_set[
"user_id"]);
54 $this->tpl->setVariable(
"VAL_AUTHOR", $user_obj->getLogin());
55 $this->tpl->setVariable(
"TXT_AUTHOR", $lng->txt(
"author"));
56 $this->tpl->parseCurrentBlock();
60 if ($enable_internal_rss)
62 $this->tpl->setCurrentBlock(
"access");
63 $this->tpl->setVariable(
"TXT_ACCESS", $lng->txt(
"news_news_item_visibility"));
65 ($a_set[
"priority"] == 0 &&
67 0, $a_set[
"context_obj_id"])))
69 $this->tpl->setVariable(
"VAL_ACCESS", $lng->txt(
"news_visibility_public"));
73 $this->tpl->setVariable(
"VAL_ACCESS", $lng->txt(
"news_visibility_users"));
75 $this->tpl->parseCurrentBlock();
79 if ($a_set[
"creation_date"] != $a_set[
"update_date"])
81 $this->tpl->setCurrentBlock(
"ni_update");
82 $this->tpl->setVariable(
"TXT_LAST_UPDATE", $lng->txt(
"last_update"));
83 $this->tpl->setVariable(
"VAL_LAST_UPDATE",
85 $this->tpl->parseCurrentBlock();
89 $this->tpl->setVariable(
"VAL_CREATION_DATE",
91 $this->tpl->setVariable(
"TXT_CREATED", $lng->txt(
"created"));
94 $this->tpl->setVariable(
"VAL_TITLE", $a_set[
"title"]);
97 if ($a_set[
"content"] !=
"")
99 $this->tpl->setCurrentBlock(
"content");
100 $this->tpl->setVariable(
"VAL_CONTENT",
102 $this->tpl->parseCurrentBlock();
105 $perm_ref_id = ($this->perm_ref_id > 0)
109 if ($ilAccess->checkAccess(
"write",
"", $perm_ref_id))
111 $this->tpl->setCurrentBlock(
"edit");
112 $this->tpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
113 $ilCtrl->setParameterByClass(
"ilnewsitemgui",
"news_item_id", $a_set[
"id"]);
114 $this->tpl->setVariable(
"CMD_EDIT",
115 $ilCtrl->getLinkTargetByClass(
"ilnewsitemgui",
"editNewsItem"));
116 $this->tpl->parseCurrentBlock();
120 $this->tpl->setVariable(
"CONTEXT",
121 $lng->txt(
"obj_".$a_set[
"context_obj_type"]).
":<br />".
124 $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 _lookupTitle($a_id)
lookup object title
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
static formatDate(ilDateTime $date)
Format a date public.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
TableGUI class for table NewsForContext.
fillRow($a_set)
Standard Version of Fill Row.
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.
__construct($a_parent_obj, $a_parent_cmd="", $a_perm_ref_id=0)