32 $this->parent_gui = $a_parent_gui;
33 $this->obj = $a_parent_gui->object;
34 $lng->loadLanguageModule(
"exp");
52 function addFormat($a_key, $a_txt =
"", $a_call_obj = null, $a_call_func =
"")
58 $a_txt = $lng->txt(
"exp_".$a_key);
60 $this->formats[] = array(
"key" => $a_key,
"txt" => $a_txt,
61 "call_obj" => $a_call_obj,
"call_func" => $a_call_func);
82 $this->custom_columns[] = array(
"txt" => $a_txt,
95 $this->custom_multi_commands[] = array(
"txt" => $a_txt,
129 $cmd = $ilCtrl->getCmd(
"listExportFiles");
133 case "listExportFiles":
138 if (substr(
$cmd, 0, 7) ==
"create_")
142 else if (substr(
$cmd, 0, 6) ==
"multi_")
165 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
171 $options[
$f[
"key"]] = $f[
"txt"];
173 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
176 $ilToolbar->addInputItem($si,
true);
177 $ilToolbar->addFormButton($lng->txt(
"exp_create_file"),
"createExportFile");
182 $format = $format[0];
183 $ilToolbar->addFormButton($lng->txt(
"exp_create_file").
" (".$format[
"txt"].
")",
"create_".$format[
"key"]);
186 include_once(
"./Services/Export/classes/class.ilExportTableGUI.php");
188 $table->setSelectAllCheckbox(
"file");
191 $table->addCustomColumn($c[
"txt"], $c[
"obj"], $c[
"func"]);
195 $table->addCustomMultiCommand($c[
"txt"],
"multi_".$c[
"func"]);
197 $tpl->setContent($table->getHTML());
211 if ($ilCtrl->getCmd() ==
"createExportFile")
217 $format = substr($ilCtrl->getCmd(), 7);
221 if (
$f[
"key"] == $format)
223 if (is_object(
$f[
"call_obj"]))
225 $f[
"call_obj"]->$f[
"call_func"]();
231 else if ($format ==
"xml")
233 include_once(
"./Services/Export/classes/class.ilExport.php");
235 $exp->exportObject($this->obj->getType(),$this->obj->getId(),
"4.1.0");
239 $ilCtrl->redirect($this,
"listExportFiles");
249 if (!is_array(
$_POST[
"file"]) || count(
$_POST[
"file"]) == 0)
252 $ilCtrl->redirect($this,
"listExportFiles");
256 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
258 $cgui->setFormAction($ilCtrl->getFormAction($this));
259 $cgui->setHeaderText($lng->txt(
"exp_really_delete"));
260 $cgui->setCancel($lng->txt(
"cancel"),
"listExportFiles");
261 $cgui->setConfirm($lng->txt(
"delete"),
"delete");
263 foreach (
$_POST[
"file"] as $i)
265 $iarr = explode(
":", $i);
266 $cgui->addItem(
"file[]", $i, $iarr[1]);
269 $tpl->setContent($cgui->getHTML());
282 $file = explode(
":", $file);
284 include_once(
"./Services/Export/classes/class.ilExport.php");
286 str_replace(
"..",
"", $file[0]), $this->obj->getType());
288 $exp_file = $export_dir.
"/".str_replace(
"..",
"", $file[1]);
289 $exp_dir = $export_dir.
"/".substr($file[1], 0, strlen($file[1]) - 4);
290 if (@is_file($exp_file))
294 if (@is_dir($exp_dir))
300 include_once
'./Services/Export/classes/class.ilExportFileInfo.php';
304 $ilCtrl->redirect($this,
"listExportFiles");
314 if(!isset(
$_POST[
"file"]))
317 $ilCtrl->redirect($this,
"listExportFiles");
320 if (count(
$_POST[
"file"]) > 1)
323 $ilCtrl->redirect($this,
"listExportFiles");
327 include_once(
"./Services/Export/classes/class.ilExport.php");
329 str_replace(
"..",
"",
$file[0]), $this->obj->getType());
344 $cmd = substr($ilCtrl->getCmd(), 6);
347 if ($c[
"func"] ==
$cmd)
349 $c[
"obj"]->$c[
"func"](
$_POST[
"file"]);
362 $tpl->addJavaScript(
'./Services/CopyWizard/js/ilContainer.js');
363 $tpl->setVariable(
'BODY_ATTRIBUTES',
'onload="ilDisableChilds(\'cmd\');"');
365 include_once
'./Services/Export/classes/class.ilExportSelectionTableGUI.php';
367 $table->parseContainer($this->
getParentGUI()->object->getRefId());
368 $this->tpl->setContent($table->getHTML());
377 global $tree,$objDefinition, $ilAccess,
$ilCtrl,
$lng;
379 include_once
'./Services/Export/classes/class.ilExportOptions.php';
383 $items_selected =
false;
384 foreach($tree->getSubTree($root = $tree->getNodeData($this->getParentGUI()->object->getRefId())) as $node)
386 if($node[
'type'] ==
'rolf')
390 if($node[
'ref_id'] == $this->
getParentGUI()->object->getRefId())
401 if(!$objDefinition->allowExport($node[
'type']) or !$ilAccess->checkAccess(
'write',
'',$node[
'ref_id']))
413 $mode = isset(
$_POST[
'cp_options'][$node[
'ref_id']][
'type']) ?
414 $_POST[
'cp_options'][$node[
'ref_id']][
'type'] :
424 $items_selected =
true;
428 include_once(
"./Services/Export/classes/class.ilExport.php");
434 foreach($eo->getSubitemsForCreation($this->obj->getRefId()) as
$ref_id)
438 $exp->exportObject(
$type,$obj_id,
'4.1.0');
443 include_once
'./Services/Export/classes/class.ilExportContainer.php';
445 $cexp->exportObject($this->obj->getType(),$this->obj->getId(),
'4.1.0');
450 $exp->exportObject($this->obj->getType(),$this->obj->getId(),
"4.1.0");
457 $ilCtrl->redirect($this,
"listExportFiles");