ILIAS  release_8 Revision v8.24
ilTimelineGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilTimelineGUI:

Public Member Functions

 addItem (ilTimelineItemInt $a_item)
 
 render (bool $a_items_only=false)
 

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 __construct ()
 

Protected Attributes

array $items = []
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Timline (temporary implementation)

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilTimelineGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTimelineGUI::__construct ( )
protected

Definition at line 31 of file class.ilTimelineGUI.php.

32 {
33 global $DIC;
34
35 $this->lng = $DIC->language();
36 $this->tpl = $DIC->ui()->mainTemplate();
37 }
global $DIC
Definition: feed.php:28

References $DIC, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ addItem()

ilTimelineGUI::addItem ( ilTimelineItemInt  $a_item)

Definition at line 44 of file class.ilTimelineGUI.php.

44 : void
45 {
46 $this->items[] = $a_item;
47 }

◆ getInstance()

static ilTimelineGUI::getInstance ( )
static

Definition at line 39 of file class.ilTimelineGUI.php.

39 : self
40 {
41 return new self();
42 }

Referenced by ilNewsTimelineGUI\loadMore(), and ilNewsTimelineGUI\show().

+ Here is the caller graph for this function:

◆ render()

ilTimelineGUI::render ( bool  $a_items_only = false)

Definition at line 49 of file class.ilTimelineGUI.php.

51 : string {
52 $this->tpl->addJavaScript("./Services/News/Timeline/js/Timeline.js");
53 $this->tpl->addJavaScript("./Services/News/Timeline/libs/jquery-dynamic-max-height-master/src/jquery.dynamicmaxheight.js");
54
55 $t = new ilTemplate("tpl.timeline.html", true, true, "Services/News/Timeline");
56 if (!$a_items_only) {
57 $t->touchBlock("list_start");
58 $t->touchBlock("list_end");
59 }
60 $keys = array_keys($this->items);
61 foreach ($this->items as $k => $i) {
62 $next = null;
63 if (isset($keys[$k + 1], $this->items[$keys[$k + 1]])) {
64 $next = $this->items[$keys[$k + 1]];
65 }
66
67 $dt = $i->getDateTime();
68 if (is_null($next) || $dt->get(IL_CAL_FKT_DATE, "Y-m-d") !== $next->getDateTime()->get(IL_CAL_FKT_DATE, "Y-m-d")) {
69 $t->setCurrentBlock("badge");
70 $t->setVariable("DAY", $dt->get(IL_CAL_FKT_DATE, "d"));
71 $t->setVariable("MONTH", $this->lng->txt("month_" . $dt->get(IL_CAL_FKT_DATE, "m") . "_short"));
72 $t->parseCurrentBlock();
73 }
74
75 $t->setCurrentBlock("item");
76 $t->setVariable("CONTENT", $i->render());
77 $t->setVariable("FOOTER", $i->renderFooter());
78 $t->parseCurrentBlock();
79 }
80 return $t->get();
81 }
const IL_CAL_FKT_DATE
special template class to simplify handling of ITX/PEAR
$i
Definition: metadata.php:41
$keys
Definition: metadata.php:204

Field Documentation

◆ $items

array ilTimelineGUI::$items = []
protected

Definition at line 27 of file class.ilTimelineGUI.php.

◆ $lng

ilLanguage ilTimelineGUI::$lng
protected

Definition at line 28 of file class.ilTimelineGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilTimelineGUI::$tpl
protected

Definition at line 29 of file class.ilTimelineGUI.php.


The documentation for this class was generated from the following file: