/** * displays confirmation formular with users that shall be removed from group * @access public */ function removeMemberObject() { global $ilUser, $rbacreview; $this->__setSubTabs('members'); $user_ids = array(); if (isset($_POST['user_id'])) { $user_ids = $_POST['user_id']; } else { if (isset($_GET['mem_id'])) { $user_ids[] = $_GET['mem_id']; } else { if (isset($_GET['mem_id_arr'])) { $user_ids = explode(',', $_GET['mem_id_arr']); } } } if (empty($user_ids[0])) { $this->ilErr->raiseError($this->lng->txt("no_checkbox"), $this->ilErr->MESSAGE); } if (count($user_ids) == 1 && $ilUser->getId() != $user_ids[0]) { if (!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) && !in_array($ilUser->getId(), $this->object->getAdminIds())) { $this->ilErr->raiseError($this->lng->txt("ilinc_err_no_permission"), $this->ilErr->MESSAGE); } } //bool value: says if $users_ids contains current user id $is_dismiss_me = array_search($this->ilias->account->getId(), $user_ids); $confirm = "confirmedRemoveMember"; $cancel = "canceled"; $info = $is_dismiss_me !== false ? "ilinc_dismiss_myself" : "ilinc_dismiss_member"; $status = ""; $return = "members"; ilUtil::sendQuestion($this->lng->txt($info)); $data = array(); if (is_array($user_ids)) { foreach ($user_ids as $id) { $obj_data = ilObjectFactory::getInstanceByObjId($id); $data[$id] = array('type' => ilUtil::getImageTagByType($obj_data->getType(), $this->tpl->tplPath), 'title' => $obj_data->getTitle(), 'desc' => $obj_data->getDescription(), 'last_update' => $obj_data->getLastUpdateDate()); } } else { $obj_data = ilObjectFactory::getInstanceByObjId($user_ids); $data[$user_ids] = array('type' => ilUtil::getImageTagByType($obj_data->getType(), $this->tpl->tplPath), 'title' => $obj_data->getTitle(), 'desc' => $obj_data->getDescription(), 'last_update' => $obj_data->getLastUpdateDate()); } //write in sessionvariables if (is_array($user_ids)) { $_SESSION['saved_post']['user_id'] = $user_ids; } else { $_SESSION['saved_post']['user_id'][0] = $user_ids; } if (isset($status)) { $_SESSION['saved_post']['status'] = $status; } include_once 'Modules/ILinc/classes/class.iliLinkConfirmationTableGUI.php'; $this->ctrl->setParameter($this, 'cmd_return_location', $a_cmd_return_location); $this->ctrl->setParameter($this, 'mem_id_arr', implode(',', $user_ids)); $oTable = new iliLinkConfirmationTableGUI($this, $data, 'removeMember', $return); $oTable->addCommandButton($cancel, $this->lng->txt('cancel')); $oTable->addCommandButton($confirm, $this->lng->txt('confirm')); return $this->tpl->setContent($oTable->getHTML()); }
/** * confirm deletion screen for page object and structure object deletion * * @param int $a_parent_subobj_id id of parent object (structure object) * of the objects, that should be deleted * (or no parent object id for top level) */ function delete($a_parent_subobj_id = 0) { if (!isset($_POST["id"])) { $this->ilias->raiseError($this->lng->txt("no_checkbox"), $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); } if ($a_parent_subobj_id == 0) { $this->setTabs(); } if ($a_parent_subobj_id != 0) { $this->ctrl->setParameterByClass("ilStructureObjectGUI", "backcmd", $_GET["backcmd"]); $this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $a_parent_subobj_id); $form_action = $this->ctrl->getFormActionByClass("ilStructureObjectGUI"); } else { $this->ctrl->setParameter($this, "backcmd", $_GET["backcmd"]); $form_action = $this->ctrl->getFormAction($this); } // display confirmation message include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setFormAction($form_action); $cgui->setHeaderText($this->lng->txt("info_delete_sure")); $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete"); $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete"); foreach ($_POST["id"] as $id) { if ($id != IL_FIRST_NODE) { $obj = new ilLMObject($this->object, $id); $caption = ilUtil::getImageTagByType($obj->getType(), $this->tpl->tplPath) . " " . $obj->getTitle(); $cgui->addItem("id[]", $id, $caption); } } $this->tpl->setContent($cgui->getHTML()); }
/** * display deletion confirmation screen */ function deletePglObject() { global $ilTabs; if (!isset($_POST["pglayout"])) { $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE); } $ilTabs->setTabActive('page_layouts'); unset($this->data); // display confirmation message include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setFormAction($this->ctrl->getFormAction($this)); $cgui->setHeaderText($this->lng->txt("info_delete_sure")); $cgui->setCancel($this->lng->txt("cancel"), "cancelDeletePg"); $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeletePg"); foreach ($_POST["pglayout"] as $id) { $pg_obj = new ilPageLayout($id); $pg_obj->readObject(); $caption = ilUtil::getImageTagByType("stys", $this->tpl->tplPath) . " " . $pg_obj->getTitle(); $cgui->addItem("pglayout[]", $id, $caption); } $this->tpl->setContent($cgui->getHTML()); }
/** * confirmation screen for export file deletion */ function confirmDeleteExportFileObject() { if (!isset($_POST["file"])) { $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE); } // display confirmation message include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setFormAction($this->ctrl->getFormAction($this)); $cgui->setHeaderText($this->lng->txt("info_delete_sure")); $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteExportFile"); $cgui->setConfirm($this->lng->txt("confirm"), "deleteExportFile"); // BEGIN TABLE DATA $counter = 0; foreach ($_POST["file"] as $file) { $caption = ilUtil::getImageTagByType("usrf", $this->tpl->tplPath) . " " . $file; $cgui->addItem("file[]", $file, $caption); } $this->tpl->setContent($cgui->getHTML()); }
/** * display deletion confirmation screen * only for referenced objects. For user,role & rolt overwrite this function in the appropriate * Object folders classes (ilObjUserFolderGUI,ilObjRoleFolderGUI) * * @access public */ function removeClassroom($a_error = false) { // display confirmation message $obj_str = "&class_id=" . $this->object->id; include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setFormAction($this->getFormAction("delete", $this->ctrl->getFormAction($this) . $obj_str)); $cgui->setHeaderText($this->lng->txt("info_delete_sure")); $cgui->setCancel($this->lng->txt("cancelDeleteClassroom"), "cancel"); $cgui->setConfirm($this->lng->txt("confirmedDeleteClassroom"), "confirm"); $caption = ilUtil::getImageTagByType($this->object->getType(), $this->tpl->tplPath) . " " . $this->object->getTitle() . " " . $this->object->getDescription(); $cgui->addItem("id[]", $this->object->getId(), $caption); }
/** * display edit form * * @access public */ function editObject() { global $rbacsystem, $rbacreview; if (!$rbacsystem->checkAccess("edit_permission", $_GET["ref_id"])) { $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE); } //prepare objectlist $this->data = array(); $this->data["data"] = array(); $this->data["ctrl"] = array(); $this->data["cols"] = array("type", "operation", "description", "status"); $ops_valid = $rbacreview->getOperationsOnType($this->obj_id); if ($ops_arr = ilRbacReview::_getOperationList('', $a_order, $a_direction)) { $options = array("e" => "enabled", "d" => "disabled"); foreach ($ops_arr as $key => $ops) { // BEGIN ROW if (in_array($ops["ops_id"], $ops_valid)) { $ops_status = 'e'; } else { $ops_status = 'd'; } $obj = $ops["ops_id"]; $ops_options = ilUtil::formSelect($ops_status, "id[{$obj}]", $options); //visible data part $this->data["data"][] = array("type" => "perm", "operation" => $ops["operation"], "description" => $ops["desc"], "status" => $ops_status, "status_html" => $ops_options, "obj_id" => $val["ops_id"]); } } //if typedata $this->maxcount = count($this->data["data"]); // sorting array $this->data["data"] = ilUtil::sortArray($this->data["data"], $_GET["sort_by"], $_GET["sort_order"]); // now compute control information foreach ($this->data["data"] as $key => $val) { $this->data["ctrl"][$key] = array("obj_id" => $val["obj_id"], "type" => $val["type"]); unset($this->data["data"][$key]["obj_id"]); $this->data["data"][$key]["status"] = $this->data["data"][$key]["status_html"]; unset($this->data["data"][$key]["status_html"]); } // build table include_once "./Services/Table/classes/class.ilTableGUI.php"; // load template for table $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html"); // load template for table content data $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html"); $num = 0; $obj_str = $this->call_by_reference ? "" : "&obj_id=" . $this->obj_id; $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=" . $this->ref_id . "{$obj_str}&cmd=save"); // create table $tbl = new ilTableGUI(); // title & header columns $tbl->setTitle($this->lng->txt("edit_operations") . " " . strtolower($this->lng->txt("of")) . " '" . $this->object->getTitle() . "'", "icon_" . $this->object->getType() . "_b.png", $this->lng->txt("obj_" . $this->object->getType())); $tbl->setHelp("tbl_help.php", "icon_help.png", $this->lng->txt("help")); foreach ($this->data["cols"] as $val) { $header_names[] = $this->lng->txt($val); } $tbl->setHeaderNames($header_names); $header_params = array("ref_id" => $this->ref_id, "obj_id" => $this->id, "cmd" => "edit"); $tbl->setHeaderVars($this->data["cols"], $header_params); // control $tbl->setOrderColumn($_GET["sort_by"]); $tbl->setOrderDirection($_GET["sort_order"]); $tbl->setLimit(0); $tbl->setOffset(0); $tbl->setMaxCount($this->maxcount); // SHOW VALID ACTIONS $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.png")); $this->tpl->setVariable("COLUMN_COUNTS", count($this->data["cols"])); // footer $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next")); //$tbl->disable("footer"); // render table $tbl->render(); if (is_array($this->data["data"][0])) { //table cell for ($i = 0; $i < count($this->data["data"]); $i++) { $data = $this->data["data"][$i]; $ctrl = $this->data["ctrl"][$i]; // color changing $css_row = ilUtil::switchColor($i + 1, "tblrow1", "tblrow2"); $this->tpl->setCurrentBlock("table_cell"); $this->tpl->setVariable("CELLSTYLE", "tblrow1"); $this->tpl->parseCurrentBlock(); foreach ($data as $key => $val) { $this->tpl->setCurrentBlock("text"); if ($key == "type") { $val = ilUtil::getImageTagByType($val, $this->tpl->tplPath); } $this->tpl->setVariable("TEXT_CONTENT", $val); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("table_cell"); $this->tpl->parseCurrentBlock(); } //foreach $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("save")); $this->tpl->setCurrentBlock("tbl_content"); $this->tpl->setVariable("CSS_ROW", $css_row); $this->tpl->parseCurrentBlock(); } //for } //if is_array }
/** * display deletion confirmation screen * * @access public */ function deleteObject($a_error = false) { //$this->setTabs(); // display confirmation message include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setFormAction($this->ctrl->getFormAction($this)); $cgui->setHeaderText($this->lng->txt("info_delete_sure")); $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete"); $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete"); $caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath) . " " . ilObject::_lookupTitle($this->object->getId()); $cgui->addItem("id[]", "", $caption); $this->tpl->setContent($cgui->getHTML()); }
/** * display deletion confirmation screen */ function deleteTrackingForUser() { if (!isset($_POST["user"])) { $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE); } // display confirmation message include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setFormAction($this->ctrl->getFormAction($this)); $cgui->setHeaderText($this->lng->txt("info_delete_sure")); $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteTracking"); $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeleteTracking"); foreach ($_POST["user"] as $id) { if (ilObject::_exists($id) && ilObject::_lookUpType($id) == "usr") { $user = new ilObjUser($id); $caption = ilUtil::getImageTagByType("sahs", $this->tpl->tplPath) . " " . $this->lng->txt("cont_tracking_data") . ": " . $user->getLastname() . ", " . $user->getFirstname(); $cgui->addItem("user[]", $id, $caption); } } $this->tpl->setContent($cgui->getHTML()); }
/** * Stop offline mode for selected users */ protected function stopUserOfflineMode() { if (!count((array) $_POST['user'])) { ilUtil::sendFailure($this->lng->txt('select_one'), true); $this->ctrl->redirect($this, 'offlineModeManager'); } // display confirmation message include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setFormAction($this->ctrl->getFormAction($this)); $cgui->setHeaderText($this->lng->txt("info_stop_offline_mode_sure")); $cgui->setCancel($this->lng->txt("cancel"), "cancelStopUserOfflineMode"); $cgui->setConfirm($this->lng->txt("confirm"), "confirmedStopUserOfflineMode"); foreach ($_POST["user"] as $id) { if (ilObject::_exists($id) && ilObject::_lookUpType($id) == "usr") { $user = new ilObjUser($id); $caption = ilUtil::getImageTagByType("sahs_offline", $this->tpl->tplPath) . " " . $this->lng->txt("stop_user_offline_mode_for_user") . ": " . $user->getLastname() . ", " . $user->getFirstname(); $cgui->addItem("user[]", $id, $caption); } } $this->tpl->setContent($cgui->getHTML()); }
/** * confirm remove of mobs */ function confirmRemove() { global $ilAccess, $ilCtrl, $lng; if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) { $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE); } if (!isset($_POST["id"])) { $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE); } // display confirmation message include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setFormAction($this->ctrl->getFormAction($this)); $cgui->setHeaderText($this->lng->txt("info_delete_sure")); $cgui->setCancel($this->lng->txt("cancel"), "cancelRemove"); $cgui->setConfirm($this->lng->txt("confirm"), "remove"); foreach ($_POST["id"] as $obj_id) { $type = ilMediaPoolItem::lookupType($obj_id); $title = ilMediaPoolItem::lookupTitle($obj_id); // check whether page can be removed $add = ""; if ($type == "pg") { include_once "./Services/COPage/classes/class.ilPageContentUsage.php"; $usages = ilPageContentUsage::getUsages("incl", $obj_id, false); if (count($usages) > 0) { ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true); $ilCtrl->redirect($this, "listMedia"); } else { // check whether the snippet is used in older versions of pages $usages = ilPageContentUsage::getUsages("incl", $obj_id, true); if (count($usages) > 0) { $add = "<div class='small'>" . $lng->txt("mep_content_snippet_used_in_older_versions") . "</div>"; } } } $caption = ilUtil::getImageTagByType($type, $this->tpl->tplPath) . " " . $title . $add; $cgui->addItem("id[]", $obj_id, $caption); } $this->tpl->setContent($cgui->getHTML()); }
/** * display deletion conformation screen */ function delete() { $bm_ids = $_GET['bm_id'] ? array($_GET['bm_id']) : $_POST['bm_id']; if (!$bm_ids) { $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE); } $this->ctrl->setParameter($this, "bmf_id", $this->id); // display confirmation message include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setFormAction($this->ctrl->getFormAction($this)); $cgui->setHeaderText($this->lng->txt("info_delete_sure")); $cgui->setCancel($this->lng->txt("cancel"), "cancel"); $cgui->setConfirm($this->lng->txt("confirm"), "confirm"); foreach ($bm_ids as $obj_id) { $type = ilBookmark::_getTypeOfId($obj_id); if (!$this->tree->isInTree($obj_id)) { continue; } switch ($type) { case "bmf": $BookmarkFolder = new ilBookmarkFolder($obj_id); $title = $BookmarkFolder->getTitle(); $target = ""; unset($BookmarkFolder); break; case "bm": $Bookmark = new ilBookmark($obj_id); $title = $Bookmark->getTitle(); $target = $Bookmark->getTarget(); unset($Bookmark); break; } $caption = ilUtil::getImageTagByType($type, $this->tpl->tplPath) . " " . $title; if ($target) { $caption .= " (" . ilUtil::shortenText($target, $this->textwidth, true) . ")"; } $cgui->addItem("id[]", $obj_id, $caption); } $this->tpl->setContent($cgui->getHTML()); }