Render item.
100 : string
101 {
103 $tpl =
new ilTemplate(
"tpl.timeline_item.html",
true,
true,
"Services/News");
104
106 $news_renderer->setLanguage($this->
lng->getLangKey());
107 $news_renderer->setNewsItem(
$i, $this->news_item_ref_id);
108
109 $obj_id =
$i->getContextObjId();
110
111
112 if (
$i->getCreationDate() !==
$i->getUpdateDate()) {
113 $tpl->setCurrentBlock(
"edited");
115 $tpl->setVariable(
"TXT_EDITED", $this->
lng->txt(
"cont_news_edited"));
116 if (
$i->getUpdateUserId() > 0 && (
$i->getUpdateUserId() !==
$i->getUserId())) {
118 $i->getUpdateUserId(),
119 false,
120 true,
121 $this->ctrl->getLinkTargetByClass("ilnewstimelinegui")
122 ) . " - ");
123 }
125 $tpl->parseCurrentBlock();
126 }
127
128
129 if ($this->news_item_ref_id > 0 && $this->ref_id !== $this->news_item_ref_id) {
130 $tpl->setCurrentBlock(
"object");
133 $tpl->setVariable(
"OBJ_HREF", $news_renderer->getObjectLink());
134 $tpl->parseCurrentBlock();
135 }
136
137
140 $tpl->setCurrentBlock(
"player");
141 $tpl->setVariable(
"PLAYER", $media);
142 $tpl->parseCurrentBlock();
143 }
144
147 "TITLE",
149 );
150
151
152 $tpl->setVariable(
"CONTENT", $news_renderer->getTimelineContent());
153
156 false,
157 true,
158 $this->ctrl->getLinkTargetByClass("ilnewstimelinegui")
159 ));
160
162
163
165 $list->setListTitle("");
166 $list->setId(
"news_tl_act_" .
$i->getId());
168 $list->setUseImages(false);
169
170 if (
$i->getPriority() === 1 && (
$i->getUserId() === $this->user->getId() || $this->getUserEditAll())) {
171 if (!$news_renderer->preventEditing()) {
172 $list->addItem(
173 $this->
lng->txt(
"edit"),
174 "",
175 "",
176 "",
177 "",
178 "",
179 "",
180 false,
181 "il.News.edit(" .
$i->getId() .
");"
182 );
183 $list->addItem(
184 $this->
lng->txt(
"delete"),
185 "",
186 "",
187 "",
188 "",
189 "",
190 "",
191 false,
192 "il.News.delete(" .
$i->getId() .
");"
193 );
194 }
195 }
196
197 $news_renderer->addTimelineActions($list);
198
199 $tpl->setVariable(
"ACTIONS", $list->getHTML());
200
202 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static determineNewsTitle(string $a_context_obj_type, string $a_title, bool $a_content_is_lang_var, int $a_agg_ref_id=0, array $a_aggregation=[])
Determine title for news item entry.
static getRenderer(string $a_context_obj_type)
renderMedia(ilNewsItem $i)
getDateTime()
Get datetime.
static _getPersonalPicturePath(int $a_usr_id, string $a_size="small", bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static _lookupTitle(int $obj_id)
special template class to simplify handling of ITX/PEAR
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl