4 require_once(
"./Services/History/classes/class.ilHistory.php");
22 $this->obj_id = $a_obj_id;
24 if ($a_obj_type ==
"")
30 $this->obj_type = $a_obj_type;
43 $ref_id = $a_header_params[
"ref_id"];
45 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
49 $tbl->setTitle($this->lng->txt(
"history"));
51 $tbl->setHeaderNames(array($this->lng->txt(
"date").
"/".
52 $this->lng->txt(
"user"), $this->lng->txt(
"action")));
53 $tbl->setColumnWidth(array(
"40%",
"60%"));
54 $cols = array(
"date_user",
"action");
56 if ($a_header_params ==
"")
58 $a_header_params = array();
60 $header_params = $a_header_params;
61 $tbl->setHeaderVars($cols, $header_params);
64 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
65 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
66 $tbl->setLimit(
$_GET[
"limit"]);
67 $tbl->setOffset(
$_GET[
"offset"]);
68 $tbl->setMaxCount($this->maxcount);
69 $tbl->disable(
"header");
72 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
77 $tbl->setMaxCount(count($entries));
78 $entries = array_slice($entries,
$_GET[
"offset"],
$_GET[
"limit"]);
80 $this->tpl =& $tbl->getTemplateObject();
81 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.history_row.html",
84 if(count($entries) > 0)
87 foreach($entries as $entry)
89 $this->tpl->setCurrentBlock(
"tbl_content");
90 $css_row = ($css_row !=
"tblrow1") ?
"tblrow1" :
"tblrow2";
91 $this->tpl->setVariable(
"CSS_ROW", $css_row);
95 $this->tpl->setVariable(
"TXT_USER",
96 $name[
"title"].
" ".$name[
"firstname"].
" ".$name[
"lastname"].
" [".$login.
"]");
97 $info_params = explode(
",", $entry[
"info_params"]);
100 if ($this->obj_type !=
"lm" && $this->obj_type !=
"dbk")
102 $info_text = $this->lng->txt(
"hist_".str_replace(
":",
"_", $this->obj_type).
103 "_".$entry[
"action"]);
107 $info_text = $this->lng->txt(
"hist_".str_replace(
":",
"_", $entry[
"obj_type"]).
108 "_".$entry[
"action"]);
111 foreach($info_params as $info_param)
113 $info_text = str_replace(
"%".$i, $info_param, $info_text);
116 $this->tpl->setVariable(
"TXT_ACTION", $info_text);
117 if ($this->obj_type ==
"lm" || $this->obj_type ==
"dbk")
119 $obj_arr = explode(
":", $entry[
"obj_type"]);
124 $class =
"ilstructureobjectgui";
130 $class =
"illmpageobjectgui";
135 $img_type = $obj_arr[0];
141 $this->tpl->setCurrentBlock(
"item_icon");
143 $this->tpl->parseCurrentBlock();
147 $this->tpl->setCurrentBlock(
"item_link");
148 $this->ctrl->setParameterByClass($class,
"obj_id", $entry[
"obj_id"]);
149 $this->tpl->setVariable(
"HREF_LINK",
150 $this->ctrl->getLinkTargetByClass($class,
$cmd));
151 $this->tpl->setVariable(
"TXT_LINK", $entry[
"title"]);
152 $this->tpl->parseCurrentBlock();
156 $this->tpl->setCurrentBlock(
"item_title");
157 $this->tpl->setVariable(
"TXT_TITLE",
159 $this->tpl->parseCurrentBlock();
162 if ($a_user_comment && $entry[
"user_comment"] !=
"")
164 $this->tpl->setCurrentBlock(
"user_comment");
165 $this->tpl->setVariable(
"TXT_COMMENT", $this->lng->txt(
"comment"));
166 $this->tpl->setVariable(
"TXT_USER_COMMENT", $entry[
"user_comment"]);
167 $this->tpl->parseCurrentBlock();
169 $this->tpl->setCurrentBlock(
"tbl_content");
171 $this->tpl->setCurrentBlock(
"tbl_content");
172 $this->tpl->parseCurrentBlock();
177 $this->tpl->setCurrentBlock(
"tbl_content_cell");
178 $this->tpl->setVariable(
"TBL_CONTENT_CELL", $this->lng->txt(
"hist_no_entries"));
179 $this->tpl->setVariable(
"TBL_COL_SPAN", 4);
180 $this->tpl->parseCurrentBlock();
181 $this->tpl->setCurrentBlock(
"tbl_content_row");
182 $this->tpl->setVariable(
"ROWCOLOR",
"tblrow1");
183 $this->tpl->parseCurrentBlock();
188 return $this->tpl->get();
198 $ref_id = $a_header_params[
"ref_id"];
200 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
204 $tbl->setTitle($this->lng->txt(
"versions"));
206 $tbl->setHeaderNames(array($this->lng->txt(
"date").
"/".
207 $this->lng->txt(
"user"), $this->lng->txt(
"action")));
208 $tbl->setColumnWidth(array(
"40%",
"60%"));
209 $cols = array(
"date_user",
"action");
211 if ($a_header_params ==
"")
213 $a_header_params = array();
215 $header_params = $a_header_params;
216 $tbl->setHeaderVars($cols, $header_params);
219 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
220 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
221 $tbl->setLimit(
$_GET[
"limit"]);
222 $tbl->setOffset(
$_GET[
"offset"]);
223 $tbl->setMaxCount($this->maxcount);
224 $tbl->disable(
"header");
227 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
232 $tbl->setMaxCount(count($entries));
233 $entries = array_slice($entries,
$_GET[
"offset"],
$_GET[
"limit"]);
235 $this->tpl =& $tbl->getTemplateObject();
236 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.history_row.html",
239 if(count($entries) > 0)
242 foreach($entries as $entry)
244 $this->tpl->setCurrentBlock(
"tbl_content");
245 $css_row = ($css_row !=
"tblrow1") ?
"tblrow1" :
"tblrow2";
246 $this->tpl->setVariable(
"CSS_ROW", $css_row);
250 $this->tpl->setVariable(
"TXT_USER",
251 $name[
"title"].
" ".$name[
"firstname"].
" ".$name[
"lastname"].
" [".$entry[
"user_id"].
"]");
252 $info_params = explode(
",", $entry[
"info_params"]);
253 $info_text = $this->lng->txt(
"hist_".$this->obj_type.
254 "_".$entry[
"action"]);
256 foreach($info_params as $info_param)
258 $info_text = str_replace(
"%".$i, $info_param, $info_text);
261 $this->tpl->setVariable(
"TXT_ACTION", $info_text);
264 $this->tpl->setCurrentBlock(
"user_comment");
265 $this->tpl->setVariable(
"TXT_USER_COMMENT", $entry[
"user_comment"]);
266 $this->tpl->parseCurrentBlock();
267 $this->tpl->setCurrentBlock(
"tbl_content");
270 $this->tpl->setCurrentBlock(
"dl_link");
271 $this->tpl->setVariable(
"TXT_DL", $this->lng->txt(
"download"));
272 $ilCtrl->setParameterByClass(
"ilobjfilegui",
"hist_id", $entry[
"hist_entry_id"]);
273 $this->tpl->setVariable(
"DL_LINK",
274 $ilCtrl->getLinkTargetByClass(
"ilobjfilegui",
"sendfile"));
275 $this->tpl->setCurrentBlock(
"tbl_content");
276 $this->tpl->parseCurrentBlock();
282 $this->tpl->setCurrentBlock(
"tbl_content_cell");
283 $this->tpl->setVariable(
"TBL_CONTENT_CELL", $this->lng->txt(
"hist_no_entries"));
284 $this->tpl->setVariable(
"TBL_COL_SPAN", 4);
285 $this->tpl->parseCurrentBlock();
286 $this->tpl->setCurrentBlock(
"tbl_content_row");
287 $this->tpl->setVariable(
"ROWCOLOR",
"tblrow1");
288 $this->tpl->parseCurrentBlock();
294 return $this->tpl->get();