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();
73 $t->setCurrentBlock("badge");
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 }
special template class to simplify handling of ITX/PEAR