ILIAS  trunk Revision v11.0_alpha-1862-g4e205cb56d4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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

32  {
33  global $DIC;
34 
35  $this->lng = $DIC->language();
36  $this->tpl = $DIC->ui()->mainTemplate();
37  }
global $DIC
Definition: shib_login.php:22
+ 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.

Referenced by ilLearningHistoryGUI\getHistoryHtml(), ilNewsTimelineGUI\getHTML(), and ilNewsTimelineGUI\loadMore().

39  : self
40  {
41  return new self();
42  }
+ 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.

References IL_CAL_FKT_DATE, ILIAS\Repository\lng(), and null.

51  : string {
52  $debug = false;
53  if ($debug) {
54  $this->tpl->addJavaScript("../components/ILIAS/News/resources/Timeline.js");
55  } else {
56  $this->tpl->addJavaScript("assets/js/Timeline.js");
57  }
58 
59  $t = new ilTemplate("tpl.timeline.html", true, true, "components/ILIAS/News/Timeline");
60  if (!$a_items_only) {
61  $t->touchBlock("list_start");
62  $t->touchBlock("list_end");
63  }
64  $keys = array_keys($this->items);
65  foreach ($this->items as $k => $i) {
66  $next = null;
67  if (isset($keys[$k + 1], $this->items[$keys[$k + 1]])) {
68  $next = $this->items[$keys[$k + 1]];
69  }
70 
71  $dt = $i->getDateTime();
72  if (is_null($next) || $dt->get(IL_CAL_FKT_DATE, "Y-m-d") !== $next->getDateTime()->get(IL_CAL_FKT_DATE, "Y-m-d")) {
73  $t->setCurrentBlock("badge");
74  $t->setVariable("DAY", $dt->get(IL_CAL_FKT_DATE, "d"));
75  $t->setVariable("MONTH", $this->lng->txt("month_" . $dt->get(IL_CAL_FKT_DATE, "m") . "_short"));
76  $t->parseCurrentBlock();
77  }
78 
79  $t->setCurrentBlock("item");
80  $t->setVariable("CONTENT", $i->render());
81  $t->setVariable("FOOTER", $i->renderFooter());
82  $t->parseCurrentBlock();
83  }
84  return $t->get();
85  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const IL_CAL_FKT_DATE
+ Here is the call graph for this function:

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: