28 public function __construct($a_parent_gui, $a_main_obj = null)
35 $this->parent_gui = $a_parent_gui;
36 if ($a_main_obj == null) {
37 $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 public function addFormat($a_key, $a_txt =
"", $a_call_obj = null, $a_call_func =
"")
76 $a_txt =
$lng->txt(
"exp_" . $a_key);
78 $this->formats[] = array(
"key" => $a_key,
"txt" => $a_txt,
79 "call_obj" => $a_call_obj,
"call_func" => $a_call_func);
100 $this->custom_columns[] = array(
"txt" => $a_txt,
113 $this->custom_multi_commands[] = array(
"txt" => $a_txt,
148 $ilAccess = $DIC[
'ilAccess'];
153 if (method_exists($this->obj,
'getRefId')
and $this->obj->getRefId()) {
154 if (!$ilAccess->checkAccess(
'write',
'', $this->obj->getRefId())) {
159 $cmd =
$ilCtrl->getCmd(
"listExportFiles");
162 case "listExportFiles":
167 if (substr($cmd, 0, 7) ==
"create_") {
169 } elseif (substr($cmd, 0, 6) ==
"multi_") {
189 $ilToolbar = $DIC[
'ilToolbar'];
193 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
197 $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
203 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
206 $ilToolbar->addInputItem(
$si,
true);
208 $button->setCaption(
"exp_create_file");
209 $button->setCommand(
"createExportFile");
214 $button->setCaption(
$lng->txt(
"exp_create_file") .
" (" .
$format[
"txt"] .
")",
false);
215 $button->setCommand(
"create_" .
$format[
"key"]);
218 $ilToolbar->addButtonInstance($button);
221 $table->setSelectAllCheckbox(
"file");
223 $table->addCustomColumn($c[
"txt"], $c[
"obj"], $c[
"func"]);
226 $table->addCustomMultiCommand($c[
"txt"],
"multi_" . $c[
"func"]);
244 if (
$ilCtrl->getCmd() ==
"createExportFile") {
251 if (is_object(
$f[
"call_obj"])) {
252 $f[
"call_obj"]->{
$f[
"call_func"]}();
256 include_once(
"./Services/Export/classes/class.ilExport.php");
258 $exp->exportObject($this->obj->getType(), $this->obj->getId());
263 ilUtil::sendSuccess(
$lng->txt(
"exp_file_created"),
true);
264 $ilCtrl->redirect($this,
"listExportFiles");
278 if (!is_array(
$_POST[
"file"]) || count(
$_POST[
"file"]) == 0) {
280 $ilCtrl->redirect($this,
"listExportFiles");
282 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
284 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
285 $cgui->setHeaderText(
$lng->txt(
"exp_really_delete"));
286 $cgui->setCancel(
$lng->txt(
"cancel"),
"listExportFiles");
287 $cgui->setConfirm(
$lng->txt(
"delete"),
"delete");
290 if (strpos($i,
':') !==
false) {
291 $iarr = explode(
":", $i);
299 $tpl->setContent($cgui->getHTML());
306 public function delete()
312 foreach (
$_POST[
"file"] as $file) {
313 $file = explode(
":", $file);
315 $file[1] = basename($file[1]);
317 include_once(
"./Services/Export/classes/class.ilExport.php");
320 str_replace(
"..",
"", $file[0]),
321 $this->obj->getType()
324 $exp_file = $export_dir .
"/" . str_replace(
"..",
"", $file[1]);
325 $exp_dir = $export_dir .
"/" . substr($file[1], 0, strlen($file[1]) - 4);
326 if (@is_file($exp_file)) {
329 if (@is_dir($exp_dir)) {
334 include_once
'./Services/Export/classes/class.ilExportFileInfo.php';
338 $ilCtrl->redirect($this,
"listExportFiles");
351 if (!isset(
$_GET[
"file"]) ||
352 is_array(
$_GET[
"file"])) {
353 $ilCtrl->redirect($this,
"listExportFiles");
356 $file = explode(
":", trim(
$_GET[
"file"]));
357 include_once(
"./Services/Export/classes/class.ilExport.php");
360 str_replace(
"..",
"", $file[0]),
361 $this->obj->getType()
364 $file[1] = basename($file[1]);
367 $export_dir .
"/" . $file[1],
384 $cmd = substr(
$ilCtrl->getCmd(), 6);
386 if (
$c[
"func"] == $cmd) {
402 $tpl->addJavaScript(
'./Services/CopyWizard/js/ilContainer.js');
403 $tpl->setVariable(
'BODY_ATTRIBUTES',
'onload="ilDisableChilds(\'cmd\');"');
405 include_once
'./Services/Export/classes/class.ilExportSelectionTableGUI.php';
408 $this->tpl->setContent(
$table->getHTML());
419 $tree = $DIC[
'tree'];
420 $objDefinition = $DIC[
'objDefinition'];
421 $ilAccess = $DIC[
'ilAccess'];
425 include_once
'./Services/Export/classes/class.ilExportOptions.php';
429 $items_selected =
false;
430 foreach (
$tree->getSubTree(
$root =
$tree->getNodeData($this->getParentGUI()->object->getRefId())) as $node) {
431 if ($node[
'type'] ==
'rolf') {
434 if ($node[
'ref_id'] == $this->
getParentGUI()->object->getRefId()) {
444 if (!$objDefinition->allowExport($node[
'type'])
or !$ilAccess->checkAccess(
'write',
'', $node[
'ref_id'])) {
454 $mode = isset(
$_POST[
'cp_options'][$node[
'ref_id']][
'type']) ?
455 $_POST[
'cp_options'][$node[
'ref_id']][
'type'] :
464 $items_selected =
true;
468 include_once(
"./Services/Export/classes/class.ilExport.php");
469 if ($items_selected) {
473 foreach ($eo->getSubitemsForCreation($this->obj->getRefId()) as $ref_id) {
476 $exp->exportObject(
$type, $obj_id);
481 include_once
'./Services/Export/classes/class.ilExportContainer.php';
483 $cexp->exportObject($this->obj->getType(), $this->obj->getId());
486 $exp->exportObject($this->obj->getType(), $this->obj->getId());
492 ilUtil::sendSuccess(
$lng->txt(
'export_created'),
true);
493 $ilCtrl->redirect($this,
"listExportFiles");
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.
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 _lookupType($a_id, $a_reference=false)
lookup object type
listExportFiles()
List export files.
getCustomMultiCommands()
Get custom multi commands.
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(empty($password)) $table
__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
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Confirmation screen class.
createExportFile()
Create export file.