/**
  * move a single chapter  (selection)
  */
 function moveChapter($a_parent_subobj_id = 0)
 {
     if (!isset($_POST["id"])) {
         $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
     }
     //echo "Hallo::"; exit;
     if (count($_POST["id"]) > 1) {
         $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"), $this->ilias->error_obj->MESSAGE);
     }
     if (count($_POST["id"]) == 1 && $_POST["id"][0] == IL_FIRST_NODE) {
         $this->ilias->raiseError($this->lng->txt("cont_select_item"), $this->ilias->error_obj->MESSAGE);
     }
     // SAVE POST VALUES
     ilEditClipboard::storeContentObject("st", $_POST["id"][0], "move");
     ilUtil::sendInfo($this->lng->txt("cont_chap_select_target_now"), true);
     if ($a_parent_subobj_id == 0) {
         $this->ctrl->redirect($this, "chapters");
     }
 }
 /**
  * cut page
  */
 function cutPage()
 {
     $this->cutItems();
     return;
     if (!isset($_POST["id"])) {
         $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
     }
     if (count($_POST["id"]) > 1) {
         $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"), $this->ilias->error_obj->MESSAGE);
     }
     if (count($_POST["id"]) == 1 && $_POST["id"][0] == IL_FIRST_NODE) {
         $this->ilias->raiseError($this->lng->txt("cont_select_item"), $this->ilias->error_obj->MESSAGE);
     }
     // SAVE POST VALUES
     ilEditClipboard::storeContentObject("pg", $_POST["id"][0]);
     $tree = new ilTree($this->content_object->getId());
     $tree->setTableNames('lm_tree', 'lm_data');
     $tree->setTreeTablePK("lm_id");
     // cut selected object
     $cutted = 0;
     foreach ($_POST["id"] as $id) {
         if ($id == -1) {
             continue;
         }
         $obj =& ilLMObjectFactory::getInstance($this->content_object, $id);
         $obj->setLMId($this->content_object->getId());
         $node_data = $tree->getNodeData($id);
         //$obj->delete();
         if ($tree->isInTree($id)) {
             $parent_id = $tree->getParentId($id);
             $tree->deleteTree($node_data);
             // write history entry
             require_once "./Services/History/classes/class.ilHistory.php";
             ilHistory::_createEntry($id, "cut", array(ilLMObject::_lookupTitle($parent_id), $parent_id), $this->content_object->getType() . ":pg");
             ilHistory::_createEntry($parent_id, "cut_page", array(ilLMObject::_lookupTitle($id), $id), $this->content_object->getType() . ":st");
         }
         $cutted++;
     }
     // tree check
     $this->checkTree();
     if ($cutted > 0) {
         ilUtil::sendInfo($this->lng->txt("msg_cut_clipboard"), true);
     }
     $this->ctrl->redirect($this, "view");
 }