4 require_once(
"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",
false);
83 if(count($entries) > 0)
86 foreach($entries as $entry)
88 $this->tpl->setCurrentBlock(
"tbl_content");
89 $css_row = ($css_row !=
"tblrow1") ?
"tblrow1" :
"tblrow2";
90 $this->tpl->setVariable(
"CSS_ROW", $css_row);
94 $this->tpl->setVariable(
"TXT_USER",
95 $name[
"title"].
" ".
$name[
"firstname"].
" ".
$name[
"lastname"].
" [".$login.
"]");
96 $info_params = explode(
",", $entry[
"info_params"]);
99 if ($this->obj_type !=
"lm" && $this->obj_type !=
"dbk")
101 $info_text = $this->lng->txt(
"hist_".str_replace(
":",
"_", $this->obj_type).
102 "_".$entry[
"action"]);
106 $info_text = $this->lng->txt(
"hist_".str_replace(
":",
"_", $entry[
"obj_type"]).
107 "_".$entry[
"action"]);
110 foreach($info_params as $info_param)
112 $info_text = str_replace(
"%".$i, $info_param, $info_text);
115 $this->tpl->setVariable(
"TXT_ACTION", $info_text);
116 if ($this->obj_type ==
"lm" || $this->obj_type ==
"dbk")
118 $obj_arr = explode(
":", $entry[
"obj_type"]);
123 $class =
"ilstructureobjectgui";
129 $class =
"illmpageobjectgui";
134 $img_type = $obj_arr[0];
140 $this->tpl->setCurrentBlock(
"item_icon");
142 $this->tpl->parseCurrentBlock();
146 $this->tpl->setCurrentBlock(
"item_link");
147 $this->ctrl->setParameterByClass($class,
"obj_id", $entry[
"obj_id"]);
148 $this->tpl->setVariable(
"HREF_LINK",
149 $this->ctrl->getLinkTargetByClass($class,
$cmd));
150 $this->tpl->setVariable(
"TXT_LINK", $entry[
"title"]);
151 $this->tpl->parseCurrentBlock();
155 $this->tpl->setCurrentBlock(
"item_title");
156 $this->tpl->setVariable(
"TXT_TITLE",
158 $this->tpl->parseCurrentBlock();
161 if ($a_user_comment && $entry[
"user_comment"] !=
"")
163 $this->tpl->setCurrentBlock(
"user_comment");
164 $this->tpl->setVariable(
"TXT_COMMENT", $this->lng->txt(
"comment"));
165 $this->tpl->setVariable(
"TXT_USER_COMMENT", $entry[
"user_comment"]);
166 $this->tpl->parseCurrentBlock();
168 $this->tpl->setCurrentBlock(
"tbl_content");
170 $this->tpl->setCurrentBlock(
"tbl_content");
171 $this->tpl->parseCurrentBlock();
176 $this->tpl->setCurrentBlock(
"tbl_content_cell");
177 $this->tpl->setVariable(
"TBL_CONTENT_CELL", $this->lng->txt(
"hist_no_entries"));
178 $this->tpl->setVariable(
"TBL_COL_SPAN", 4);
179 $this->tpl->parseCurrentBlock();
180 $this->tpl->setCurrentBlock(
"tbl_content_row");
181 $this->tpl->setVariable(
"ROWCOLOR",
"tblrow1");
182 $this->tpl->parseCurrentBlock();
187 return $this->tpl->get();
195 $ref_id = $a_header_params[
"ref_id"];
197 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
201 $tbl->setTitle($this->lng->txt(
"versions"));
203 $tbl->setHeaderNames(array($this->lng->txt(
"date").
"/".
204 $this->lng->txt(
"user"), $this->lng->txt(
"action")));
205 $tbl->setColumnWidth(array(
"40%",
"60%"));
206 $cols = array(
"date_user",
"action");
208 if ($a_header_params ==
"")
210 $a_header_params = array();
212 $header_params = $a_header_params;
213 $tbl->setHeaderVars($cols, $header_params);
216 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
217 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
218 $tbl->setLimit(
$_GET[
"limit"]);
219 $tbl->setOffset(
$_GET[
"offset"]);
220 $tbl->setMaxCount($this->maxcount);
221 $tbl->disable(
"header");
224 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
229 $tbl->setMaxCount(count($entries));
230 $entries = array_slice($entries,
$_GET[
"offset"],
$_GET[
"limit"]);
232 $this->tpl =& $tbl->getTemplateObject();
233 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.history_row.html",
false);
235 if(count($entries) > 0)
238 foreach($entries as $entry)
240 $this->tpl->setCurrentBlock(
"tbl_content");
241 $css_row = ($css_row !=
"tblrow1") ?
"tblrow1" :
"tblrow2";
242 $this->tpl->setVariable(
"CSS_ROW", $css_row);
246 $this->tpl->setVariable(
"TXT_USER",
247 $name[
"title"].
" ".
$name[
"firstname"].
" ".
$name[
"lastname"].
" [".$entry[
"user_id"].
"]");
248 $info_params = explode(
",", $entry[
"info_params"]);
249 $info_text = $this->lng->txt(
"hist_".$this->obj_type.
250 "_".$entry[
"action"]);
252 foreach($info_params as $info_param)
254 $info_text = str_replace(
"%".$i, $info_param, $info_text);
257 $this->tpl->setVariable(
"TXT_ACTION", $info_text);
260 $this->tpl->setCurrentBlock(
"user_comment");
261 $this->tpl->setVariable(
"TXT_USER_COMMENT", $entry[
"user_comment"]);
262 $this->tpl->parseCurrentBlock();
263 $this->tpl->setCurrentBlock(
"tbl_content");
266 $this->tpl->setCurrentBlock(
"dl_link");
267 $this->tpl->setVariable(
"TXT_DL", $this->lng->txt(
"download"));
268 $this->tpl->setVariable(
"DL_LINK",
"repository.php?cmd=sendfile&hist_id=".$entry[
"hist_entry_id"].
"&ref_id=".
$ref_id);
269 $this->tpl->setCurrentBlock(
"tbl_content");
270 $this->tpl->parseCurrentBlock();
276 $this->tpl->setCurrentBlock(
"tbl_content_cell");
277 $this->tpl->setVariable(
"TBL_CONTENT_CELL", $this->lng->txt(
"hist_no_entries"));
278 $this->tpl->setVariable(
"TBL_COL_SPAN", 4);
279 $this->tpl->parseCurrentBlock();
280 $this->tpl->setCurrentBlock(
"tbl_content_row");
281 $this->tpl->setVariable(
"ROWCOLOR",
"tblrow1");
282 $this->tpl->parseCurrentBlock();
288 return $this->tpl->get();