ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 }
setData(array $a_data)
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
static getObjectStatisticsMonthlySummary()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilLanguage $lng
setId(string $a_val)
__construct(?object $a_parent_obj, string $a_parent_cmd)
Constructor.
TableGUI class for learning progress.
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:26
setDefaultOrderDirection(string $a_defaultorderdirection)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
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)
addMultiCommand(string $a_cmd, string $a_text)
setEnableHeader(bool $a_enableheader)