/** * Save obligatory settings */ protected function saveObligatoryList() { $all_conditions = ilConditionHandler::_getConditionsOfTarget($this->getTargetRefId(), $this->getTargetId(), $this->getTargetType()); if ($_POST["obl"] && sizeof($_POST["obl"]) > sizeof($all_conditions) - 2) { ilUtil::sendFailure($this->lng->txt("rbac_precondition_minimum_optional"), true); $this->ctrl->redirect($this, 'listConditions'); } foreach ($all_conditions as $item) { $status = false; if ($_POST["obl"] && in_array($item["condition_id"], $_POST["obl"])) { $status = true; } ilConditionHandler::updateObligatory($item["condition_id"], $status); } // re-calculate ilConditionHandler::calculateRequiredTriggers($this->getTargetRefId(), $this->getTargetId(), $this->getTargetType(), true); ilUtil::sendSuccess($this->lng->txt('settings_saved'), true); $this->ctrl->redirect($this, 'listConditions'); }