27     protected \ILIAS\News\InternalGUIService 
$gui;
    28     protected \ILIAS\Notes\Service 
$notes;
    55         $this->like_gui = $a_like_gui;
    56         $this->
lng = $DIC->language();
    57         $this->
ctrl = $DIC->ctrl();
    59         $this->
user = $DIC->user();
    60         $this->obj_def = $DIC[
"objDefinition"];
    61         $this->news_item_ref_id = $a_news_ref_id;
    63         $this->std_request = $DIC->news()
    67         $this->ref_id = $this->std_request->getRefId();
    68         $this->gui = $DIC->news()
    71         $this->notes = $DIC->notes();
    79         return new self($a_news_item, $a_news_ref_id, $a_like_gui);
    84         $this->news_item = $a_val;
    97         $this->user_edit_all = $a_val;
   117         $tpl = 
new ilTemplate(
"tpl.timeline_item.html", 
true, 
true, 
"components/ILIAS/News");
   118         $ui_factory = $this->gui->ui()->factory();
   119         $ui_renderer = $this->gui->ui()->renderer();
   122         $news_renderer->setLanguage($this->
lng->getLangKey());
   123         $news_renderer->setNewsItem($i, $this->news_item_ref_id);
   125         $obj_id = $i->getContextObjId();
   128         if ($i->getCreationDate() !== $i->getUpdateDate()) {
   129             $tpl->setCurrentBlock(
"edited");
   131             $tpl->setVariable(
"TXT_EDITED", $this->
lng->txt(
"cont_news_edited"));
   132             if ($i->getUpdateUserId() > 0 && ($i->getUpdateUserId() !== $i->getUserId())) {
   134                     $i->getUpdateUserId(),
   137                     $this->
ctrl->getLinkTargetByClass(
"ilnewstimelinegui")
   141             $tpl->parseCurrentBlock();
   145         if ($this->news_item_ref_id > 0 && $this->ref_id !== $this->news_item_ref_id) {
   146             $tpl->setCurrentBlock(
"object");
   149             $tpl->setVariable(
"OBJ_HREF", $news_renderer->getObjectLink());
   150             $tpl->parseCurrentBlock();
   156             $tpl->setCurrentBlock(
"player");
   157             $tpl->setVariable(
"PLAYER", $media);
   158             $tpl->parseCurrentBlock();
   161         $p = $this->gui->profile();
   162         $tpl->setVariable(
"USER_AVATAR", $this->gui->ui()->renderer()->render(
   163             $p->getAvatar($i->getUserId())
   171         $tpl->setVariable(
"CONTENT", $news_renderer->getTimelineContent());
   173         $tpl->setVariable(
"TXT_USR", $p->getNamePresentation(
   176             $this->
ctrl->getLinkTargetByClass(
"ilnewstimelinegui")
   184         if ($i->getPriority() === 1 && ($i->getUserId() === $this->
user->getId() || $this->
getUserEditAll())) {
   185             if (!$news_renderer->preventEditing()) {
   186                 $actions[] = $ui_factory->button()->shy(
   187                     $this->
lng->txt(
"edit"),
   190                     return "document.getElementById('$id').addEventListener('click', () => {il.News.edit(" . $i->getId() . 
");});";
   192                 $actions[] = $ui_factory->button()->shy(
   193                     $this->
lng->txt(
"delete"),
   196                     return "document.getElementById('$id').addEventListener('click', () => {il.News.delete(" . $i->getId() . 
");});";
   200         foreach ($news_renderer->getTimelineActions() as $action) {
   201             $actions[] = $action;
   203         $dd = $ui_factory->dropdown()->standard($actions);
   204         $tpl->setVariable(
"ACTIONS", $ui_renderer->render($dd));
   214         $ui_factory = $this->gui->ui()->factory();
   215         $ui_renderer = $this->gui->ui()->renderer();
   217         if (in_array($mime, [
"image/jpeg", 
"image/svg+xml", 
"image/gif", 
"image/png"])) {
   218             if (isset($this->item_image[$i->
getId()]) && isset($this->item_modal[$i->
getId()])) {
   219                 $image = $this->item_image[$i->
getId()];
   221                 $title = basename($media_path);
   222                 $image = $ui_factory->image()->responsive($media_path, $title);
   223                 $modal_page = $ui_factory->modal()->lightboxImagePage($image, $title);
   224                 $modal = $ui_factory->modal()->lightbox($modal_page);
   225                 $image = $image->withAction($modal->getShowSignal());
   226                 $this->item_image[$i->
getId()] = $image;
   227                 $this->item_modal[$i->
getId()] = $modal;
   229             $html = $ui_renderer->render($image);
   230         } elseif (in_array($mime, [
"video/mp4", 
"video/youtube", 
"video/vimeo"])) {
   231             $video = $ui_factory->player()->video($media_path);
   232             $html = $ui_renderer->render($video);
   233         } elseif (in_array($mime, [
"audio/mpeg"])) {
   234             $audio = $ui_factory->player()->audio($media_path);
   235             $html = $ui_renderer->render($audio);
   236         } elseif (in_array($mime, [
"application/pdf"])) {
   237             $this->
ctrl->setParameterByClass(
"ilnewstimelinegui", 
"news_id", $i->
getId());
   238             $link = $ui_factory->link()->standard(
   239                 basename($media_path),
   240                 $this->
ctrl->getLinkTargetByClass(
"ilnewstimelinegui", 
"downloadMob")
   242             $html = $ui_renderer->render($link);
   243             $this->
ctrl->setParameterByClass(
"ilnewstimelinegui", 
"news_id", null);
   252         $ui_factory = $this->gui->ui()->factory();
   253         $ui_renderer = $this->gui->ui()->renderer();
   255         if (isset($this->item_image[$i->
getId()]) && isset($this->item_modal[$i->
getId()])) {
   256             $modal = $this->item_modal[$i->
getId()];
   257             return $ui_renderer->render($modal);
   265         if (in_array($mime, [
"image/jpeg", 
"image/svg+xml", 
"image/gif", 
"image/png"])) {
   266             $title = basename($media_path);
   267             $image = $ui_factory->image()->responsive($media_path, $title);
   268             $modal_page = $ui_factory->modal()->lightboxImagePage($image, $title);
   269             $modal = $ui_factory->modal()->lightbox($modal_page);
   270             $image = $image->withAction($modal->getShowSignal());
   271             $this->item_image[$i->
getId()] = $image;
   272             $this->item_modal[$i->
getId()] = $modal;
   273             $modal_html = $ui_renderer->render($modal);
   283         $this->
ctrl->setParameterByClass(
"ilnewstimelinegui", 
"news_id", $i->getId());
   284         $this->like_gui->setObject(
   285             $i->getContextObjId(),
   286             $i->getContextObjType(),
   287             $i->getContextSubObjId(),
   288             (string) $i->getContextSubObjType(),
   291         $html = $this->
ctrl->getHTML($this->like_gui);
   294         $notes_obj_type = ($i->getContextSubObjType() == 
"")
   295             ? $i->getContextObjType()
   296             : $i->getContextSubObjType();
   297         $comments_gui = $this->notes->gui()->getCommentsGUI(
   298             $i->getContextObjId(),
   299             $i->getContextSubObjId(),
   303         $comments_gui->setDefaultCommand(
"getWidget");
   304         $comments_gui->setShowEmptyListMessage(
false);
   305         $comments_gui->setShowHeader(
false);
   306         $html .= $comments_gui->getWidget();
   309         $this->
ctrl->setParameterByClass(
"ilnewstimelinegui", 
"news_id", $this->std_request->getNewsId());
 
Single news timeline item. 
 
renderMediaModal(ilNewsItem $i)
 
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
 
getUserEditAll()
Get user can edit other users postings. 
 
getDateTime()
Get datetime. 
 
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item. 
 
ILIAS Notes Service $notes
 
__construct(ilNewsItem $a_news_item, int $a_news_ref_id, ilLikeGUI $a_like_gui)
 
renderMedia(ilNewsItem $i)
 
withOnLoadCode(Closure $binder)
 
static getRenderer(string $a_context_obj_type)
 
setUserEditAll(bool $a_val)
Set user can edit other users postings. 
 
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data 
 
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: 
 
static _lookupTitle(int $obj_id)
 
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=[], ?ilLanguage $lng=null)
Determine title for news item entry. 
 
getMediaPath(ilNewsItem $i)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
ILIAS News InternalGUIService $gui
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
A news item can be created by different sources. 
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
static getInstance(ilNewsItem $a_news_item, int $a_news_ref_id, ilLikeGUI $a_like_gui)
 
User interface for like feature. 
 
setNewsItem(ilNewsItem $a_val)
 
StandardGUIRequest $std_request
 
ilObjectDefinition $obj_def