protected function setNotification() { global $ilUser, $ilCtrl; include_once "./Services/Notification/classes/class.ilNotification.php"; switch ($_GET["ntf"]) { case 1: ilNotification::setNotification(ilNotification::TYPE_BLOG, $ilUser->getId(), $this->obj_id, false); break; case 2: ilNotification::setNotification(ilNotification::TYPE_BLOG, $ilUser->getId(), $this->obj_id, true); break; } $ilCtrl->redirect($this, "preview"); }
protected function updateCustom(ilPropertyFormGUI $a_form) { global $ilUser; $this->object->setShowSubmissions($a_form->getInput("show_submissions")); $this->object->setPassMode($a_form->getInput("pass_mode")); if ($this->object->getPassMode() == "nr") { $this->object->setPassNr($a_form->getInput("pass_nr")); } $this->object->setCompletionBySubmission($a_form->getInput('completion_by_submission') == 1 ? true : false); include_once "./Services/Notification/classes/class.ilNotification.php"; ilNotification::setNotification(ilNotification::TYPE_EXERCISE_SUBMISSION, $ilUser->getId(), $this->object->getId(), (bool) $a_form->getInput("notification")); }
public function toggleNotification() { global $ilCtrl, $ilUser; include_once "./Services/Notification/classes/class.ilNotification.php"; switch ($_GET["ntf"]) { case 1: ilNotification::setNotification(ilNotification::TYPE_DATA_COLLECTION, $ilUser->getId(), $this->obj_id, false); break; case 2: ilNotification::setNotification(ilNotification::TYPE_DATA_COLLECTION, $ilUser->getId(), $this->obj_id, true); break; } $ilCtrl->redirectByClass("ildatacollectionrecordlistgui", "listRecords"); }
/** * execute command */ function &executeCommand() { global $ilCtrl, $ilTabs, $ilUser; $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); switch ($next_class) { case "ilnotegui": $this->getTabs(); $ilTabs->setTabActive("pg"); return $this->preview(); break; case "ilratinggui": // for rating side block include_once "./Services/Rating/classes/class.ilRatingGUI.php"; $rating_gui = new ilRatingGUI(); $rating_gui->setObject($this->getPageObject()->getParentId(), "wiki", $this->getPageObject()->getId(), "wpg"); $this->ctrl->forwardCommand($rating_gui); $ilCtrl->redirect($this, "preview"); break; case "ilpageobjectgui": die("Deprecated. Wikipage gui forwarding to ilpageobject"); return; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $gui->enableCommentsSettings(false); $gui->setRatingCallback($this, "preview"); $this->ctrl->forwardCommand($gui); break; default: if ($_GET["ntf"]) { include_once "./Services/Notification/classes/class.ilNotification.php"; switch ($_GET["ntf"]) { case 1: ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false); break; case 2: // remove all page notifications here? ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true); break; case 3: ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), false); break; case 4: ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), true); break; } $ilCtrl->redirect($this, "preview"); } $this->setPresentationTitle($this->getWikiPage()->getTitle()); return parent::executeCommand(); } }
function unsubscribe() { global $ilUser, $tree, $lng; include_once "./Services/Notification/classes/class.ilNotification.php"; ilNotification::setNotification(ilNotification::TYPE_POLL, $ilUser->getId(), $this->object->getId(), false); ilUtil::sendSuccess($lng->txt("settings_saved"), true); include_once "Services/Link/classes/class.ilLink.php"; ilUtil::redirect(ilLink::_getLink($tree->getParentId($this->ref_id))); }
/** * save properties */ function saveProperties() { global $lng, $ilUser; $valid = false; $this->initPropertiesForm(); if ($this->form->checkInput()) { include_once "./Services/Object/classes/class.ilObjectTranslation.php"; $ot = ilObjectTranslation::getInstance($this->object->getId()); if ($ot->getContentActivated()) { $ot->setDefaultTitle($_POST['title']); $ot->setDefaultDescription($_POST['description']); $ot->save(); } $this->object->setTitle($_POST['title']); $this->object->setDescription($_POST['description']); $this->object->setLayout($_POST["lm_layout"]); $this->object->setPageHeader($_POST["lm_pg_header"]); $this->object->setTOCMode($_POST["toc_mode"]); $this->object->setOnline($_POST["cobj_online"]); $this->object->setActiveNumbering($_POST["cobj_act_number"]); $this->object->setCleanFrames($_POST["cobj_clean_frames"]); if (!$this->ilias->getSetting('disable_comments')) { $this->object->setPublicNotes($_POST["cobj_pub_notes"]); } $this->object->setHistoryUserComments($_POST["cobj_user_comments"]); $this->object->setLayoutPerPage($_POST["layout_per_page"]); $this->object->setRating($_POST["rating"]); $this->object->setRatingPages($_POST["rating_pages"]); $this->object->setDisableDefaultFeedback((int) $_POST["disable_def_feedback"]); $this->object->setProgressIcons((int) $_POST["progr_icons"]); $add_info = ""; if ($_POST["restrict_forw_nav"] && !$_POST["store_tries"]) { $_POST["store_tries"] = 1; $add_info = "</br>" . $lng->txt("cont_automatically_set_store_tries"); $add_info = str_replace("\$1", $lng->txt("cont_tries_store"), $add_info); $add_info = str_replace("\$2", $lng->txt("cont_restrict_forw_nav"), $add_info); } $this->object->setStoreTries((int) $_POST["store_tries"]); $this->object->setRestrictForwardNavigation((int) $_POST["restrict_forw_nav"]); $this->object->updateProperties(); $this->object->update(); include_once "./Services/Notification/classes/class.ilNotification.php"; ilNotification::setNotification(ilNotification::TYPE_LM_BLOCKED_USERS, $ilUser->getId(), $this->object->getId(), (bool) $this->form->getInput("notification_blocked_users")); if ($this->object->getType() == 'lm') { // Update ecs export settings include_once 'Modules/LearningModule/classes/class.ilECSLearningModuleSettings.php'; $ecs = new ilECSLearningModuleSettings($this->object); if ($ecs->handleSettingsUpdate()) { $valid = true; } } else { $valid = true; } } if ($valid) { ilUtil::sendSuccess($this->lng->txt("msg_obj_modified") . $add_info, true); $this->ctrl->redirect($this, "properties"); } else { $lng->loadLanguageModule("style"); $this->setTabs("settings"); $this->setSubTabs("cont_general_properties"); $this->form->setValuesByPost(); $this->tpl->setContent($this->form->getHTML()); } }
/** * execute command */ function &executeCommand() { global $ilCtrl, $ilTabs, $ilUser, $ilAccess; $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); switch ($next_class) { case "ilnotegui": $this->getTabs(); $ilTabs->setTabActive("pg"); return $this->preview(); break; case "ilratinggui": // for rating side block include_once "./Services/Rating/classes/class.ilRatingGUI.php"; $rating_gui = new ilRatingGUI(); $rating_gui->setObject($this->getPageObject()->getParentId(), "wiki", $this->getPageObject()->getId(), "wpg"); $rating_gui->setUpdateCallback(array($this, "updateStatsRating")); $this->ctrl->forwardCommand($rating_gui); $ilCtrl->redirect($this, "preview"); break; case "ilpageobjectgui": die("Deprecated. Wikipage gui forwarding to ilpageobject"); return; case "ilcommonactiondispatchergui": include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall(); $gui->enableCommentsSettings(false); $gui->setRatingCallback($this, "preview"); $this->ctrl->forwardCommand($gui); break; case "ilwikistatgui": if ($ilAccess->checkAccess("statistics_read", "", $this->wiki_ref_id)) { $this->tabs_gui->clearTargets(); // see ilObjWikiGUI::getTabs() $this->getTabs("statistics"); include_once "Modules/Wiki/classes/class.ilWikiStatGUI.php"; $gui = new ilWikiStatGUI($this->getPageObject()->getParentId(), $this->getPageObject()->getId()); $this->ctrl->forwardCommand($gui); } break; default: if (strtolower($ilCtrl->getNextClass()) == "ilpageeditorgui") { self::initEditingJS($this->tpl); } if ($_GET["ntf"]) { include_once "./Services/Notification/classes/class.ilNotification.php"; switch ($_GET["ntf"]) { case 1: ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false); break; case 2: // remove all page notifications here? ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true); break; case 3: ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), false); break; case 4: ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), true); break; } $ilCtrl->redirect($this, "preview"); } $this->setPresentationTitle($this->getWikiPage()->getTitle()); return parent::executeCommand(); } }