function &executeCommand() { global $rbacsystem; $this->prepareOutput(); $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); switch ($next_class) { case 'ilrepositorysearchgui': include_once './Services/Search/classes/class.ilRepositorySearchGUI.php'; $rep_search =& new ilRepositorySearchGUI(); $rep_search->setTitle($this->lng->txt('role_add_user')); $rep_search->setCallback($this, 'addUserObject'); // Set tabs $this->tabs_gui->setTabActive('user_assignment'); $this->ctrl->setReturn($this, 'userassignment'); $ret =& $this->ctrl->forwardCommand($rep_search); break; case 'ilexportgui': $this->tabs_gui->setTabActive('export'); include_once './Services/Export/classes/class.ilExportOptions.php'; $eo = ilExportOptions::newInstance(ilExportOptions::allocateExportId()); $eo->addOption(ilExportOptions::KEY_ROOT, 0, $this->object->getId(), $this->obj_ref_id); include_once './Services/Export/classes/class.ilExportGUI.php'; $exp = new ilExportGUI($this, new ilObjRole($this->object->getId())); $exp->addFormat('xml'); $this->ctrl->forwardCommand($exp); break; default: if (!$cmd) { if ($this->showDefaultPermissionSettings()) { $cmd = "perm"; } else { $cmd = 'userassignment'; } } $cmd .= "Object"; $this->{$cmd}(); break; } return true; }
/** * Save selection of subitems * @return */ protected function saveItemSelection() { global $tree, $objDefinition, $ilAccess, $ilCtrl, $lng; include_once './Services/Export/classes/class.ilExportOptions.php'; $eo = ilExportOptions::newInstance(ilExportOptions::allocateExportId()); $eo->addOption(ilExportOptions::KEY_ROOT, 0, 0, $this->obj->getId()); $items_selected = false; foreach ($tree->getSubTree($root = $tree->getNodeData($this->getParentGUI()->object->getRefId())) as $node) { if ($node['type'] == 'rolf') { continue; } if ($node['ref_id'] == $this->getParentGUI()->object->getRefId()) { $eo->addOption(ilExportOptions::KEY_ITEM_MODE, $node['ref_id'], $node['obj_id'], ilExportOptions::EXPORT_BUILD); continue; } // no export available or no access if (!$objDefinition->allowExport($node['type']) or !$ilAccess->checkAccess('write', '', $node['ref_id'])) { $eo->addOption(ilExportOptions::KEY_ITEM_MODE, $node['ref_id'], $node['obj_id'], ilExportOptions::EXPORT_OMIT); continue; } $mode = isset($_POST['cp_options'][$node['ref_id']]['type']) ? $_POST['cp_options'][$node['ref_id']]['type'] : ilExportOptions::EXPORT_OMIT; $eo->addOption(ilExportOptions::KEY_ITEM_MODE, $node['ref_id'], $node['obj_id'], $mode); if ($mode != ilExportOptions::EXPORT_OMIT) { $items_selected = true; } } include_once "./Services/Export/classes/class.ilExport.php"; if ($items_selected) { // TODO: move this to background soap $eo->read(); $exp = new ilExport(); foreach ($eo->getSubitemsForCreation($this->obj->getRefId()) as $ref_id) { $obj_id = ilObject::_lookupObjId($ref_id); $type = ilObject::_lookupType($obj_id); $exp->exportObject($type, $obj_id, '4.1.0'); } // Fixme: there is a naming conflict between the container settings xml and the container subitem xml. sleep(1); // Export container include_once './Services/Export/classes/class.ilExportContainer.php'; $cexp = new ilExportContainer($eo); $cexp->exportObject($this->obj->getType(), $this->obj->getId(), '4.1.0'); } else { $exp = new ilExport(); $exp->exportObject($this->obj->getType(), $this->obj->getId(), "4.1.0"); } // Delete export options $eo->delete(); ilUtil::sendSuccess($lng->txt('export_created'), true); $ilCtrl->redirect($this, "listExportFiles"); }