ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLPObjectStatisticsAdminTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Tracking/classes/class.ilLPTableBaseGUI.php");
5 
16 {
20  function __construct($a_parent_obj, $a_parent_cmd)
21  {
22  global $ilCtrl, $lng;
23 
24  $this->setId("lpobjstattbl");
25 
26  parent::__construct($a_parent_obj, $a_parent_cmd);
27 
28  $this->addColumn("", "", "1", true);
29  $this->addColumn($lng->txt("month"), "month");
30  $this->addColumn($lng->txt("count"), "count", "", false, "ilRight");
31 
32  $this->setTitle($this->lng->txt("trac_object_stat_admin"));
33 
34  // $this->setSelectAllCheckbox("item_id");
35  $this->addMultiCommand("confirmDeleteData", $lng->txt("trac_delete_data"));
36 
37  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
38  $this->setRowTemplate("tpl.lp_object_statistics_admin_row.html", "Services/Tracking");
39  $this->setEnableHeader(true);
40  $this->setEnableNumInfo(true);
41  $this->setEnableTitle(true);
42  $this->setDefaultOrderField("month");
43  $this->setDefaultOrderDirection("desc");
44 
45  include_once("./Services/Tracking/classes/class.ilLPObjSettings.php");
46  include_once "Services/Tracking/classes/class.ilTrQuery.php";
47 
49  $info_date = ilDatePresentation::formatDate(new ilDateTime($info["tstamp"], IL_CAL_UNIX));
50  ilUtil::sendInfo(sprintf($lng->txt("trac_log_info"), $info_date, $info["counter"]));
51 
52  $this->getItems();
53  }
54 
55  function getItems()
56  {
57  include_once "Services/Tracking/classes/class.ilTrQuery.php";
59 
60  // #11855
61  foreach($data as $idx => $item)
62  {
63  $data[$idx]["id"] = $item["month"];
64 
65  $data[$idx]["month"]= substr($item["month"], 0, 4).
66  "-".str_pad(substr($item["month"], 5), 2, "0", STR_PAD_LEFT);
67  }
68 
69  $this->setData($data);
70  }
71 
75  protected function fillRow($a_set)
76  {
77  global $lng;
78 
79  $caption = $lng->txt("month_".substr($a_set["month"], 5, 2)."_long").
80  " ".substr($a_set["month"], 0, 4);
81 
82  $this->tpl->setVariable("ID", $a_set["id"]);
83  $this->tpl->setVariable("MONTH", $caption);
84  $this->tpl->setVariable("COUNT", $a_set["count"]);
85  }
86 }
87 
88 ?>