/**
  * Copy items to clipboard
  */
 function copyItems()
 {
     global $ilCtrl, $lng;
     $items = ilUtil::stripSlashesArray($_POST["id"]);
     if (!is_array($items)) {
         ilUtil::sendFailure($lng->txt("no_checkbox"), true);
         $ilCtrl->redirect($this, "chapters");
     }
     $todel = array();
     // delete IDs < 0 (needed for non-js editing)
     foreach ($items as $k => $item) {
         if ($item < 0) {
             $todel[] = $k;
         }
     }
     foreach ($todel as $k) {
         unset($items[$k]);
     }
     ilLMObject::clipboardCopy($this->object->getId(), $items);
     ilEditClipboard::setAction("copy");
     ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_copied"), true);
     $ilCtrl->redirect($this, "chapters");
 }
예제 #2
0
 /**
  * Upload multi feedback file
  */
 function uploadMultiFeedbackObject()
 {
     $ass_id = (int) $_GET["ass_id"];
     // #11983
     $form = $this->initMultiFeedbackForm($ass_id);
     if ($form->checkInput()) {
         try {
             $ass = new ilExAssignment($ass_id);
             $ass->uploadMultiFeedbackFile(ilUtil::stripSlashesArray($_FILES["mfzip"]));
             $this->ctrl->redirect($this, "showMultiFeedbackConfirmationTable");
         } catch (ilExerciseException $e) {
             ilUtil::sendFailure($e->getMessage(), true);
             $this->ctrl->redirect($this, "showMultiFeedback");
         }
     }
     $form->setValuesByPost();
     $this->showMultiFeedbackObject($form);
 }
 /**
  * Save all titles of chapters/pages
  */
 function saveAllTitles()
 {
     global $ilCtrl;
     ilLMObject::saveTitles($this->content_object, ilUtil::stripSlashesArray($_POST["title"]), $_GET["transl"]);
     $ilCtrl->redirect($this, "showHierarchy");
 }
 /**
  * Save material assignment
  */
 public function saveItemAssignment()
 {
     global $ilCtrl;
     $this->checkPermission("write");
     include_once './Modules/ItemGroup/classes/class.ilItemGroupItems.php';
     $item_group_items = new ilItemGroupItems($this->object->getRefId());
     $items = is_array($_POST['items']) ? $_POST['items'] : array();
     $items = ilUtil::stripSlashesArray($items);
     $item_group_items->setItems($items);
     $item_group_items->update();
     ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
     $ilCtrl->redirect($this, "listMaterials");
 }
 /**
  * Copy items to clipboard
  */
 function copyItems()
 {
     global $ilCtrl, $lng;
     if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
         $this->redirectToParent();
     }
     include_once "./Services/Skill/classes/class.ilSkillTreeNode.php";
     $items = ilUtil::stripSlashesArray($_POST["id"]);
     $todel = array();
     // delete IDs < 0 (needed for non-js editing)
     foreach ($items as $k => $item) {
         if ($item < 0) {
             $todel[] = $k;
         }
     }
     foreach ($todel as $k) {
         unset($items[$k]);
     }
     if (!ilSkillTreeNode::uniqueTypesCheck($items)) {
         ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
         $this->redirectToParent();
     }
     ilSkillTreeNode::clipboardCopy(1, $items);
     // @todo: move this to a service since it can be used here, too
     include_once "./Modules/LearningModule/classes/class.ilEditClipboard.php";
     ilEditClipboard::setAction("copy");
     ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_copied"), true);
     $this->redirectToParent();
 }
 /**
  * Copy items to clipboard, then cut them from the current tree
  */
 function cutItems($a_return = "showOrganization")
 {
     global $ilCtrl, $lng;
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Node.php";
     $items = ilUtil::stripSlashesArray($_POST["id"]);
     $todel = array();
     // delete IDs < 0 (needed for non-js editing)
     foreach ($items as $k => $item) {
         if ($item < 0) {
             $todel[] = $k;
         }
     }
     foreach ($todel as $k) {
         unset($items[$k]);
     }
     if (!ilSCORM2004Node::uniqueTypesCheck($items)) {
         ilUtil::sendFailure($lng->txt("sahs_choose_pages_chap_scos_ass_only"), true);
         $ilCtrl->redirect($this, $a_return);
     }
     ilSCORM2004Node::clipboardCut($this->object->getId(), $items);
     include_once "./Modules/LearningModule/classes/class.ilEditClipboard.php";
     ilEditClipboard::setAction("cut");
     ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_cut"), true);
     $ilCtrl->redirect($this, $a_return);
 }
예제 #7
0
 /**
  * Save tabs properties in db and return to page edit screen
  */
 function saveTabs()
 {
     global $ilCtrl, $lng;
     if (is_array($_POST["caption"])) {
         $captions = ilUtil::stripSlashesArray($_POST["caption"]);
         $this->content_obj->saveCaptions($captions);
     }
     if (is_array($_POST["position"])) {
         $positions = ilUtil::stripSlashesArray($_POST["position"]);
         $this->content_obj->savePositions($positions);
     }
     $this->updated = $this->pg_obj->update();
     ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
     $ilCtrl->redirect($this, "edit");
 }
 /**
  * Save selection per object
  *
  * @param
  * @return
  */
 function saveSelection()
 {
     $sel = ilUtil::stripSlashesArray($_POST["amet_use_rec"]);
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
     ilAdvancedMDRecord::saveObjRecSelection($this->obj_id, $this->sub_type, $sel);
 }
 /**
  * Save popups
  */
 function savePopups()
 {
     global $ilCtrl, $lng;
     if (is_array($_POST["title"])) {
         $titles = ilUtil::stripSlashesArray($_POST["title"]);
         $this->content_obj->savePopUps($titles);
         $this->pg_obj->update();
         ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
     }
     $ilCtrl->redirect($this, "listContentPopups");
 }
예제 #10
0
 /**
  * Update level order
  */
 function updateLevelOrder()
 {
     global $lng, $ilCtrl;
     $order = ilUtil::stripSlashesArray($_POST["order"]);
     $this->node_object->updateLevelOrder($order);
     ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
     $ilCtrl->redirect($this, "edit");
 }
 /**
  * Save access keys
  */
 function saveAccessKeys()
 {
     global $ilCtrl, $lng, $ilAccess;
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         include_once "./Services/Accessibility/classes/class.ilAccessKey.php";
         ilAccessKey::writeKeys(ilUtil::stripSlashesArray($_POST["acckey"]));
         ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
     }
     $ilCtrl->redirect($this, "editAccessKeys");
 }