ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLPObjectStatisticsAdminTableGUI.php
Go to the documentation of this file.
1<?php
2
27{
31 public function __construct(?object $a_parent_obj, string $a_parent_cmd)
32 {
33 $this->setId("lpobjstattbl");
34
35 parent::__construct($a_parent_obj, $a_parent_cmd);
36
37 $this->addColumn("", "", "1", true);
38 $this->addColumn($this->lng->txt("month"), "month");
39 $this->addColumn($this->lng->txt("count"), "count");
40
41 $this->setTitle($this->lng->txt("trac_object_stat_admin"));
42
43 // $this->setSelectAllCheckbox("item_id");
44 $this->addMultiCommand(
45 "confirmDeleteData",
46 $this->lng->txt("trac_delete_data")
47 );
48
49 $this->setFormAction(
50 $this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd)
51 );
52 $this->setRowTemplate(
53 "tpl.lp_object_statistics_admin_row.html",
54 "components/ILIAS/Tracking"
55 );
56 $this->setEnableHeader(true);
57 $this->setEnableNumInfo(true);
58 $this->setEnableTitle(true);
59 $this->setDefaultOrderField("month");
60 $this->setDefaultOrderDirection("desc");
61
62 $this->getItems();
63 }
64
65 public function getItems(): void
66 {
68
69 // #11855
70 foreach ($data as $idx => $item) {
71 $data[$idx]["id"] = $item["month"];
72
73 $data[$idx]["month"] = substr($item["month"], 0, 4) .
74 "-" . str_pad(substr($item["month"], 5), 2, "0", STR_PAD_LEFT);
75 }
76
77 $this->setData($data);
78 }
79
83 protected function fillRow(array $a_set): void
84 {
85 global $DIC;
86
87 $lng = $DIC['lng'];
88
89 $caption = $this->lng->txt(
90 "month_" . substr($a_set["month"], 5, 2) . "_long"
91 ) .
92 " " . substr($a_set["month"], 0, 4);
93
94 $this->tpl->setVariable("ID", $a_set["id"]);
95 $this->tpl->setVariable("MONTH", $caption);
96 $this->tpl->setVariable("COUNT", $a_set["count"]);
97 }
98}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(?object $a_parent_obj, string $a_parent_cmd)
Constructor.
TableGUI class for learning progress.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableNumInfo(bool $a_val)
setEnableTitle(bool $a_enabletitle)
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
ilLanguage $lng
static getObjectStatisticsMonthlySummary()
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26