本文整理汇总了PHP中ilCtrl::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP ilCtrl::redirect方法的具体用法?PHP ilCtrl::redirect怎么用?PHP ilCtrl::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilCtrl
的用法示例。
在下文中一共展示了ilCtrl::redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
private function save()
{
global $tpl, $ilCtrl;
$form = $this->BuildForm();
// Formular bauen
// Eingaben prüfen (Abhängig von SetRequired)
if ($form->CheckInput()) {
$form->setValuesByPost();
// Lade die Benutzereingaben
$emails = $form->getInput('emails');
// Speichere die E-Mails in eine Variable
require_once "Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/UIExample/classes/class.ilEmailSubscriber.php";
$subscriber = new ilEmailSubscriber($_GET['ref_id']);
$emails = $subscriber->getEmailsFromString($emails);
foreach ($emails as $email) {
$subscriber->subscribeEmail($email);
}
//var_dump($subscriber->getEmailsFromString($emails));
//exit;
//$emails_untereinander = "";
//$eintremails_untereinander = ;
ilUtil::sendSuccess("Die Nutzer folgender E-Mail-Adressen sind jetzt Kursmitglieder: " . $this->werteuntereinander($subscriber->getEmailsFound()), true);
ilUtil::sendInfo("Die Nutzer folgender E-Mail-Adressen konnten nicht gefunden werden: " . $this->werteuntereinander($subscriber->getEmailsNotFound()), true);
$this->ctrl->redirect($this, 'show');
/*
$ausgabestr .= "Die Nutzer folgender E-Mail-Adressen sind jetzt Kursmitglieder: ".$this->werteuntereinander($subscriber->getEmailsFound());
$ausgabestr .= "<br /><br /><br />Die Nutzer folgender E-Mail-Adressen konnten nicht gefunden werden: ".$this->werteuntereinander($subscriber->getEmailsNotFound());
$this->tpl->setContent($ausgabestr); //Zeige die E-Mails im Content an
*/
} else {
$this->tpl->setContent("Nicht Speichern");
}
}
示例2: saveSkillThresholdsCmd
private function saveSkillThresholdsCmd()
{
require_once 'Modules/Test/classes/class.ilTestSkillLevelThreshold.php';
if (is_array($_POST['threshold'])) {
$threshold = $_POST['threshold'];
$assignmentList = $this->buildSkillQuestionAssignmentList();
$assignmentList->loadFromDb();
foreach ($assignmentList->getUniqueAssignedSkills() as $data) {
$skill = $data['skill'];
$skillKey = $data['skill_base_id'] . ':' . $data['skill_tref_id'];
$levels = $skill->getLevelData();
foreach ($levels as $level) {
if (isset($threshold[$skillKey]) && isset($threshold[$skillKey][$level['id']])) {
$skillLevelThreshold = new ilTestSkillLevelThreshold($this->db);
$skillLevelThreshold->setTestId($this->testOBJ->getTestId());
$skillLevelThreshold->setSkillBaseId($data['skill_base_id']);
$skillLevelThreshold->setSkillTrefId($data['skill_tref_id']);
$skillLevelThreshold->setSkillLevelId($level['id']);
$skillLevelThreshold->setThreshold($threshold[$skillKey][$level['id']]);
$skillLevelThreshold->saveToDb();
}
}
}
}
ilUtil::sendSuccess($this->lng->txt('tst_msg_skl_lvl_thresholds_saved'), true);
$this->ctrl->redirect($this, self::CMD_SHOW_SKILL_THRESHOLDS);
}
示例3: getCategoryById
/**
* @param int $id
* @param bool $for_CRUD
* @return assFormulaQuestionUnitCategory
*/
protected function getCategoryById($id, $for_CRUD = true)
{
$category = $this->repository->getUnitCategoryById($id);
if ($for_CRUD && $category->getQuestionFi() != $this->repository->getConsumerId()) {
ilUtil::sendFailure($this->lng->txt('change_adm_categories_not_allowed'), true);
$this->ctrl->redirect($this, $this->getDefaultCommand());
}
return $category;
}
示例4: save
/**
* Save config
*/
public function save()
{
$form = new ilCertificateConfigFormGUI($this);
if ($form->saveObject()) {
ilUtil::sendSuccess($this->pl->txt('msg_save_config'), true);
$this->ctrl->redirect($this, 'configure');
} else {
$form->setValuesByPost();
$this->tpl->setContent($form->getHTML());
}
}
示例5: array
function __showRolesTable($a_result_set, $a_from = "")
{
if (!$this->ilAccess->checkAccess("cat_administrate_users", "", $_GET["ref_id"])) {
ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
$this->ctrl->redirect($this, "");
}
$tbl =& $this->parent_gui->__initTableGUI();
$tpl =& $tbl->getTemplateObject();
// SET FORMAACTION
$tpl->setCurrentBlock("tbl_form_header");
$this->ctrl->setParameter($this, 'obj_id', $_GET['obj_id']);
$tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$tpl->parseCurrentBlock();
// SET FOOTER BUTTONS
$tpl->setVariable("COLUMN_COUNTS", 4);
$tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
$tpl->setCurrentBlock("tbl_action_button");
$tpl->setVariable("BTN_NAME", "assignSave");
$tpl->setVariable("BTN_VALUE", $this->lng->txt("change_assignment"));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_row");
$tpl->setVariable("TPLPATH", $this->tpl->tplPath);
$tpl->parseCurrentBlock();
$tmp_obj =& ilObjectFactory::getInstanceByObjId($_GET['obj_id']);
$title = $this->lng->txt('role_assignment') . ' (' . $tmp_obj->getFullname() . ')';
$tbl->setTitle($title, "icon_role.svg", $this->lng->txt("role_assignment"));
$tbl->setHeaderNames(array('', $this->lng->txt("title"), $this->lng->txt('description'), $this->lng->txt("type")));
$tbl->setHeaderVars(array("", "title", "description", "type"), array("ref_id" => $this->object->getRefId(), "cmd" => "assignRoles", "obj_id" => $_GET['obj_id'], "cmdClass" => "ilobjcategorygui", "cmdNode" => $_GET["cmdNode"]));
$tbl->setColumnWidth(array("4%", "35%", "45%", "16%"));
$this->set_unlimited = true;
$this->parent_gui->__setTableGUIBasicData($tbl, $a_result_set, $a_from, true);
$tbl->render();
$this->tpl->setVariable("ROLES_TABLE", $tbl->tpl->get());
return true;
}
示例6: addModerator
/**
*
*/
public function addModerator($users = array())
{
global $ilUser;
if (!$users) {
ilUtil::sendFailure($this->lng->txt('frm_moderators_select_one'));
return;
}
include_once "Modules/Forum/classes/class.ilForumNotification.php";
$isCrsGrp = ilForumNotification::_isParentNodeGrpCrs($this->ref_id);
include_once "Modules/Forum/classes/class.ilForumProperties.php";
$objFrmProps = ilForumProperties::getInstance(ilObject::_lookupObjId($this->ref_id));
$frm_noti_type = $objFrmProps->getNotificationType();
foreach ($users as $user_id) {
$this->oForumModerators->addModeratorRole((int) $user_id);
if ($isCrsGrp && $frm_noti_type != 'default') {
$tmp_frm_noti = new ilForumNotification($this->ref_id);
$tmp_frm_noti->setUserId((int) $user_id);
$tmp_frm_noti->setUserIdNoti($ilUser->getId());
$tmp_frm_noti->setUserToggle((int) $objFrmProps->getUserToggleNoti());
$tmp_frm_noti->setAdminForce((int) $objFrmProps->getAdminForceNoti());
$tmp_frm_noti->insertAdminForce();
}
}
ilUtil::sendSuccess($this->lng->txt('frm_moderator_role_added_successfully'), true);
$this->ctrl->redirect($this, 'showModerators');
}
示例7: saveFormCmd
private function saveFormCmd($isConfirmedSave = false)
{
$form = $this->buildForm();
// form validation and initialisation
$errors = !$form->checkInput();
// ALWAYS CALL BEFORE setValuesByPost()
$form->setValuesByPost();
// NEVER CALL THIS BEFORE checkInput()
// return to form when any form validation errors exist
if ($errors) {
ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
return $this->showFormCmd($form);
}
// check for required confirmation and redirect if neccessary
if (!$isConfirmedSave && $this->isScoreRecalculationRequired($form)) {
return $this->showConfirmation($form);
}
// perform save
$this->performSaveForm($form);
if ($this->isScoreRecalculationRequired($form)) {
$this->testOBJ->recalculateScores();
}
// redirect to form output
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_FORM);
}
示例8: startImport
public function startImport()
{
$form = $this->initForm("startImport");
if (!$form->checkInput()) {
$this->tpl->setContent($form->getHTML());
} else {
$file = $form->getInput("import_file");
$importer = new ilOrgUnitSimpleImport();
try {
$file_path = $file["tmp_name"];
$file_type = pathinfo($file["name"], PATHINFO_EXTENSION);
$file_name = pathinfo($file["name"], PATHINFO_FILENAME);
if ($file_type == "zip") {
$extract_path = $file_path . '_extracted/';
$extracted_file = $extract_path . $file_name . '/manifest.xml';
$zip = new ZipArchive();
$res = $zip->open($file_path);
if ($res === true) {
$zip->extractTo($extract_path);
$zip->close();
if (file_exists($extracted_file)) {
$file_path = $extracted_file;
}
}
}
$importer->simpleImport($file_path);
} catch (Exception $e) {
$this->ilLog->write($e->getMessage() . " - " . $e->getTraceAsString());
ilUtil::sendFailure($this->lng->txt("import_failed"), true);
$this->ctrl->redirect($this, "render");
}
$this->displayImportResults($importer);
}
}
示例9: confirmedResetTemplateCmd
/**
* Enable all settings - remove template
*/
private function confirmedResetTemplateCmd()
{
$this->object->setTemplate(null);
$this->object->saveToDB();
ilUtil::sendSuccess($this->lng->txt("test_template_reset"), true);
$this->ctrl->redirect($this, "properties");
}
示例10: deactivate
protected function deactivate()
{
$page = $this->getPageObject();
$page->setActive(false);
$page->update();
$this->ctrl->redirect($this, 'edit');
}
示例11: saveTranslations
/**
* Save title and translations
*/
function saveTranslations()
{
// default language set?
if (!isset($_POST["default"])) {
ilUtil::sendFailure($this->lng->txt("msg_no_default_language"));
return $this->editTranslations(true);
}
// all languages set?
if (array_key_exists("", $_POST["lang"])) {
ilUtil::sendFailure($this->lng->txt("msg_no_language_selected"));
return $this->editTranslations(true);
}
// no single language is selected more than once?
if (count(array_unique($_POST["lang"])) < count($_POST["lang"])) {
ilUtil::sendFailure($this->lng->txt("msg_multi_language_selected"));
return $this->editTranslations(true);
}
// save the stuff
$this->ilObjectOrgUnit->removeTranslations();
foreach ($_POST["title"] as $k => $v) {
// update object data if default
$is_default = $_POST["default"] == $k;
if ($is_default) {
$this->ilObjectOrgUnit->setTitle(ilUtil::stripSlashes($v));
$this->ilObjectOrgUnit->setDescription(ilUtil::stripSlashes($_POST["desc"][$k]));
$this->ilObjectOrgUnit->update();
}
$this->ilObjectOrgUnit->addTranslation(ilUtil::stripSlashes($v), ilUtil::stripSlashes($_POST["desc"][$k]), ilUtil::stripSlashes($_POST["lang"][$k]), $is_default);
}
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, "editTranslations");
}
示例12: saveSkillPointsCmd
private function saveSkillPointsCmd()
{
if (is_array($_POST['quantifiers'])) {
require_once 'Modules/Test/classes/class.ilTestSkillQuestionAssignment.php';
$success = false;
foreach ($_POST['quantifiers'] as $assignmentKey => $quantifier) {
$assignmentKey = explode(':', $assignmentKey);
$skillBaseId = (int) $assignmentKey[0];
$skillTrefId = (int) $assignmentKey[1];
$questionId = (int) $assignmentKey[2];
if ($this->isTestQuestion($questionId) && (int) $quantifier > 0) {
$assignment = new ilTestSkillQuestionAssignment($this->db);
$assignment->setTestId($this->testOBJ->getTestId());
$assignment->setQuestionId($questionId);
$assignment->setSkillBaseId($skillBaseId);
$assignment->setSkillTrefId($skillTrefId);
if ($assignment->dbRecordExists()) {
$assignment->setSkillPoints((int) $quantifier);
$assignment->saveToDb();
}
}
}
}
ilUtil::sendSuccess($this->lng->txt('tst_msg_skl_qst_assign_points_saved'), true);
$this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
}
示例13: saveEditSourcePoolDefinitionFormCmd
private function saveEditSourcePoolDefinitionFormCmd()
{
$this->questionSetConfig->loadFromDb();
$defId = $this->fetchSingleSourcePoolDefinitionIdParameter();
$sourcePoolDefinition = $this->sourcePoolDefinitionFactory->getSourcePoolDefinitionByDefinitionId($defId);
$availableTaxonomyIds = ilObjTaxonomy::getUsageOfObject($sourcePoolDefinition->getPoolId());
$form = $this->buildEditSourcePoolDefinitionFormGUI();
$form->build($sourcePoolDefinition, $availableTaxonomyIds);
$errors = !$form->checkInput();
// ALWAYS CALL BEFORE setValuesByPost()
$form->setValuesByPost();
// NEVER CALL THIS BEFORE checkInput()
if ($errors) {
return $this->showSourcePoolDefinitionListCmd($form);
}
$form->applySubmit($sourcePoolDefinition, $availableTaxonomyIds);
$sourcePoolDefinition->saveToDb();
$this->sourcePoolDefinitionList->loadDefinitions();
$this->stagingPool->rebuild($this->sourcePoolDefinitionList);
$this->questionSetConfig->setLastQuestionSyncTimestamp(time());
$this->questionSetConfig->saveToDb();
$this->sourcePoolDefinitionList->saveDefinitions();
$this->testOBJ->saveCompleteStatus($this->questionSetConfig);
ilUtil::sendSuccess($this->lng->txt("tst_msg_random_question_set_config_modified"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_SRC_POOL_DEF_LIST);
}
示例14: confirmedResetTemplateCmd
/**
* Enable all settings - remove template
*/
private function confirmedResetTemplateCmd()
{
$this->testOBJ->setTemplate(null);
$this->testOBJ->saveToDB();
ilUtil::sendSuccess($this->lng->txt("test_template_reset"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_FORM);
}
示例15: detachModeratorRole
/**
*
*/
public function detachModeratorRole()
{
if (!isset($_POST['usr_id']) || !is_array($_POST['usr_id'])) {
ilUtil::sendFailure($this->lng->txt('frm_moderators_select_at_least_one'));
return $this->showModerators();
}
$entries = $this->oForumModerators->getCurrentModerators();
if (count($_POST['usr_id']) == count($entries)) {
ilUtil::sendFailure($this->lng->txt('frm_at_least_one_moderator'));
return $this->showModerators();
}
include_once "Modules/Forum/classes/class.ilForumNotification.php";
$isCrsGrp = ilForumNotification::_isParentNodeGrpCrs($this->ref_id);
if ($isCrsGrp) {
global $tree;
$parent_ref_id = $tree->getParentId($this->ref_id);
include_once "Services/Membership/classes/class.ilParticipants.php";
}
include_once "Modules/Forum/classes/class.ilForumProperties.php";
$objFrmProps = ilForumProperties::getInstance(ilObject::_lookupObjId($this->ref_id));
$frm_noti_type = $objFrmProps->getNotificationType();
foreach ($_POST['usr_id'] as $usr_id) {
$this->oForumModerators->detachModeratorRole((int) $usr_id);
if ($isCrsGrp && $frm_noti_type != 'default') {
if (!ilParticipants::_isParticipant($this->ref_id, $usr_id)) {
$tmp_frm_noti = new ilForumNotification($this->ref_id);
$tmp_frm_noti->setUserId((int) $usr_id);
$tmp_frm_noti->setForumId(ilObject::_lookupObjId($this->ref_id));
$tmp_frm_noti->deleteAdminForce();
}
}
}
ilUtil::sendSuccess($this->lng->txt('frm_moderators_detached_role_successfully'), true);
$this->ctrl->redirect($this, 'showModerators');
}