32 $this->parent_gui = $a_parent_gui;
33 if ($a_main_obj == null)
35 $this->obj = $a_parent_gui->object;
39 $this->obj = $a_main_obj;
41 $lng->loadLanguageModule(
"exp");
50 include_once(
"./Services/Export/classes/class.ilExportTableGUI.php");
69 function addFormat($a_key, $a_txt =
"", $a_call_obj = null, $a_call_func =
"")
75 $a_txt = $lng->txt(
"exp_".$a_key);
77 $this->
formats[] =
array(
"key" => $a_key,
"txt" => $a_txt,
78 "call_obj" => $a_call_obj,
"call_func" => $a_call_func);
99 $this->custom_columns[] =
array(
"txt" => $a_txt,
112 $this->custom_multi_commands[] =
array(
"txt" => $a_txt,
147 if(method_exists($this->obj,
'getRefId')
and $this->obj->getRefId())
149 if(!$ilAccess->checkAccess(
'write',
'',$this->obj->getRefId()))
151 $ilErr->raiseError($lng->txt(
'permission_denied'),$ilErr->WARNING);
155 $cmd = $ilCtrl->getCmd(
"listExportFiles");
159 case "listExportFiles":
164 if (substr(
$cmd, 0, 7) ==
"create_")
168 else if (substr(
$cmd, 0, 6) ==
"multi_")
190 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
194 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
202 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
205 $ilToolbar->addInputItem(
$si,
true);
207 $button->setCaption(
"exp_create_file");
208 $button->setCommand(
"createExportFile");
213 $format = $format[0];
215 $button->setCaption($lng->txt(
"exp_create_file").
" (".$format[
"txt"].
")",
false);
216 $button->setCommand(
"create_".$format[
"key"]);
219 $ilToolbar->addButtonInstance($button);
222 $table->setSelectAllCheckbox(
"file");
225 $table->addCustomColumn($c[
"txt"], $c[
"obj"], $c[
"func"]);
229 $table->addCustomMultiCommand($c[
"txt"],
"multi_".$c[
"func"]);
231 $tpl->setContent($table->getHTML());
244 if ($ilCtrl->getCmd() ==
"createExportFile")
250 $format = substr($ilCtrl->getCmd(), 7);
254 if ($f[
"key"] == $format)
256 if (is_object($f[
"call_obj"]))
258 $f[
"call_obj"]->{$f[
"call_func"]}();
264 else if ($format ==
"xml")
266 include_once(
"./Services/Export/classes/class.ilExport.php");
268 $exp->exportObject($this->obj->getType(),$this->obj->getId());
274 $ilCtrl->redirect($this,
"listExportFiles");
284 if (!is_array(
$_POST[
"file"]) || count(
$_POST[
"file"]) == 0)
287 $ilCtrl->redirect($this,
"listExportFiles");
291 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
293 $cgui->setFormAction($ilCtrl->getFormAction($this));
294 $cgui->setHeaderText($lng->txt(
"exp_really_delete"));
295 $cgui->setCancel($lng->txt(
"cancel"),
"listExportFiles");
296 $cgui->setConfirm($lng->txt(
"delete"),
"delete");
298 foreach (
$_POST[
"file"] as $i)
300 if(strpos($i,
':') !==
false)
302 $iarr = explode(
":", $i);
312 $tpl->setContent($cgui->getHTML());
325 $file = explode(
":", $file);
327 $file[1] = basename($file[1]);
329 include_once(
"./Services/Export/classes/class.ilExport.php");
331 str_replace(
"..",
"", $file[0]), $this->obj->getType());
333 $exp_file = $export_dir.
"/".str_replace(
"..",
"", $file[1]);
334 $exp_dir = $export_dir.
"/".substr($file[1], 0, strlen($file[1]) - 4);
335 if (@is_file($exp_file))
339 if (@is_dir($exp_dir))
345 include_once
'./Services/Export/classes/class.ilExportFileInfo.php';
349 $ilCtrl->redirect($this,
"listExportFiles");
359 if(!isset(
$_GET[
"file"]) ||
360 is_array(
$_GET[
"file"]))
362 $ilCtrl->redirect($this,
"listExportFiles");
366 include_once(
"./Services/Export/classes/class.ilExport.php");
368 str_replace(
"..",
"",
$file[0]), $this->obj->getType());
370 $file[1] = basename($file[1]);
386 $cmd = substr($ilCtrl->getCmd(), 6);
389 if ($c[
"func"] ==
$cmd)
391 $c[
"obj"]->{$c[
"func"]}(
$_POST[
"file"]);
404 $tpl->addJavaScript(
'./Services/CopyWizard/js/ilContainer.js');
405 $tpl->setVariable(
'BODY_ATTRIBUTES',
'onload="ilDisableChilds(\'cmd\');"');
407 include_once
'./Services/Export/classes/class.ilExportSelectionTableGUI.php';
410 $this->tpl->setContent($table->getHTML());
419 global $tree,$objDefinition, $ilAccess,
$ilCtrl,
$lng;
421 include_once
'./Services/Export/classes/class.ilExportOptions.php';
425 $items_selected =
false;
426 foreach($tree->getSubTree($root = $tree->getNodeData($this->getParentGUI()->object->getRefId())) as $node)
428 if($node[
'type'] ==
'rolf')
432 if($node[
'ref_id'] == $this->
getParentGUI()->object->getRefId())
443 if(!$objDefinition->allowExport($node[
'type'])
or !$ilAccess->checkAccess(
'write',
'',$node[
'ref_id']))
455 $mode = isset(
$_POST[
'cp_options'][$node[
'ref_id']][
'type']) ?
456 $_POST[
'cp_options'][$node[
'ref_id']][
'type'] :
466 $items_selected =
true;
470 include_once(
"./Services/Export/classes/class.ilExport.php");
476 foreach($eo->getSubitemsForCreation($this->obj->getRefId()) as
$ref_id)
480 $exp->exportObject($type,$obj_id);
485 include_once
'./Services/Export/classes/class.ilExportContainer.php';
487 $cexp->exportObject($this->obj->getType(),$this->obj->getId());
492 $exp->exportObject($this->obj->getType(),$this->obj->getId());
499 $ilCtrl->redirect($this,
"listExportFiles");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
showItemSelection()
Show container item selection table.
handleCustomMultiCommand()
Handle custom multi command.
addCustomColumn($a_txt, $a_obj, $a_func)
Add custom column.
Object selection for export.
addFormat($a_key, $a_txt="", $a_call_obj=null, $a_call_func="")
Add formats.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getCustomColumns()
Get custom columns.
Export User Interface Class.
static newInstance($a_export_id)
Create new instance.
addCustomMultiCommand($a_txt, $a_obj, $a_func)
Add custom multi command.
saveItemSelection()
Save selection of subitems.
if(!is_array($argv)) $options
static _lookupObjId($a_id)
Stores information of creation date and versions of export files
executeCommand()
Execute command.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
listExportFiles()
List export files.
getCustomMultiCommands()
Get custom multi commands.
Create new PHPExcel object
obj_idprivate
confirmDeletion()
Confirm file deletion.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
__construct($a_parent_gui, $a_main_obj=null)
Constuctor.
static allocateExportId()
Allocate a new export id.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
getParentGUI()
get parent gui
Confirmation screen class.
createExportFile()
Create export file.