?> <#3462> <?php $ilDB->setLimit(1); $query = "SELECT object_data.obj_id, object_reference.ref_id FROM object_data INNER JOIN object_reference on object_data.obj_id = object_reference.obj_id WHERE type = 'chta'"; $rset = $ilDB->query($query); $row = $ilDB->fetchAssoc($rset); $chatfolder_obj_id = $row['obj_id']; $chatfolder_ref_id = $row['ref_id']; $settings = new ilSetting('chatroom'); $public_room_ref_id = $settings->get('public_room_ref', 0); if ($public_room_ref_id) { $tree = new ilTree(ROOT_FOLDER_ID); $pid = $tree->getParentId($public_room_ref_id); if ($pid != $chatfolder_ref_id) { $tree->moveTree($public_room_ref_id, $chatfolder_ref_id); } } ?> <#3463> <?php $ilCtrlStructureReader->getStructure(); ?> <#3464> <?php if (!$ilDB->tableExists('note_settings')) { $fields = array('rep_obj_id' => array('type' => 'integer', 'length' => 4, 'notnull' => true, 'default' => 0), 'obj_id' => array('type' => 'integer', 'length' => 4, 'notnull' => true, 'default' => 0), 'obj_type' => array('type' => 'text', 'notnull' => true, 'length' => 10, 'default' => "-"), 'activated' => array('type' => 'integer', 'length' => 1, 'notnull' => true, 'default' => 0)); $ilDB->createTable('note_settings', $fields); $ilDB->addPrimaryKey('note_settings', array('rep_obj_id', 'obj_id', 'obj_type')); } ?>
function confirmedMove() { global $ilUser; $tgt = (int) $_REQUEST["bmfmv_id"]; $bm_ids = explode(";", $_REQUEST['bm_id_tgt']); if (!$bm_ids || !$tgt) { ilUtil::sendFailure($this->lng->txt("no_checkbox")); return $this->view(); } $tree = new ilTree($ilUser->getId()); $tree->setTableNames('bookmark_tree', 'bookmark_data'); $tgt_node = $tree->getNodeData($tgt); // sanity check foreach ($bm_ids as $node_id) { if ($tree->isGrandChild($node_id, $tgt)) { ilUtil::sendFailure($this->lng->txt("error"), true); $this->ctrl->redirect($this, "view"); } $node = $tree->getNodeData($node_id); // already at correct position if ($node["parent"] == $tgt) { continue; } $tree->moveTree($node_id, $tgt); } ilUtil::sendSuccess($this->lng->txt("bookmark_moved_ok"), true); $this->ctrl->setParameter($this, "bmf_id", $tgt); $this->ctrl->redirect($this, "view"); }