本文整理汇总了PHP中DialogBox::success方法的典型用法代码示例。如果您正苦于以下问题:PHP DialogBox::success方法的具体用法?PHP DialogBox::success怎么用?PHP DialogBox::success使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DialogBox
的用法示例。
在下文中一共展示了DialogBox::success方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lp_display_scorm
/**
* CLAROLINE
*
* @version $Revision: 14314 $
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @author Piraux Sebastien <pir@cerdecam.be>
* @author Lederer Guillaume <led@cerdecam.be>
* @package CLLNP
* @since 1.8
*/
function lp_display_scorm($TABLELEARNPATHMODULE)
{
$out = '';
// change raw if value is a number between 0 and 100
if (isset($_POST['newRaw']) && is_num($_POST['newRaw']) && $_POST['newRaw'] <= 100 && $_POST['newRaw'] >= 0) {
$sql = "UPDATE `" . $TABLELEARNPATHMODULE . "`\n SET `raw_to_pass` = " . (int) $_POST['newRaw'] . "\n WHERE `module_id` = " . (int) $_SESSION['module_id'] . "\n AND `learnPath_id` = " . (int) $_SESSION['path_id'];
claro_sql_query($sql);
$dialogBoxContent = get_lang('Minimum raw to pass has been changed');
}
$out .= '<hr noshade="noshade" size="1" />';
//####################################################################################\\
//############################### DIALOG BOX SECTION #################################\\
//####################################################################################\\
if (!empty($dialogBoxContent)) {
$dialogBox = new DialogBox();
$dialogBox->success($dialogBoxContent);
$out .= $dialogBox->render();
}
// form to change raw needed to pass the exercise
$sql = "SELECT `lock`, `raw_to_pass`\n FROM `" . $TABLELEARNPATHMODULE . "` AS LPM\n WHERE LPM.`module_id` = " . (int) $_SESSION['module_id'] . "\n AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'];
$learningPath_module = claro_sql_query_fetch_all($sql);
if (isset($learningPath_module[0]['lock']) && $learningPath_module[0]['lock'] == 'CLOSE' && isset($learningPath_module[0]['raw_to_pass'])) {
$out .= "\n\n" . '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . '<label for="newRaw">' . get_lang('Change minimum raw mark to pass this module (percentage) : ') . '</label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($learningPath_module[0]['raw_to_pass']) . '" name="newRaw" id="newRaw" size="3" maxlength="3" /> % ' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n\n";
}
return $out;
}
示例2: lp_display_exercise
/**
* CLAROLINE
*
* @version $Revision: 14314 $
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @author Piraux Sebastien <pir@cerdecam.be>
* @author Lederer Guillaume <led@cerdecam.be>
* @package CLLNP
* @since 1.8
*/
function lp_display_exercise($cmd, $TABLELEARNPATHMODULE, $TABLEMODULE, $TABLEASSET, $tbl_quiz_exercise)
{
$out = '';
if (isset($cmd) && ($cmd = "raw")) {
// change raw if value is a number between 0 and 100
if (isset($_POST['newRaw']) && is_num($_POST['newRaw']) && $_POST['newRaw'] <= 100 && $_POST['newRaw'] >= 0) {
$sql = "UPDATE `" . $TABLELEARNPATHMODULE . "`\n SET `raw_to_pass` = " . (int) $_POST['newRaw'] . "\n WHERE `module_id` = " . (int) $_SESSION['module_id'] . "\n AND `learnPath_id` = " . (int) $_SESSION['path_id'];
claro_sql_query($sql);
$dialogBoxContent = get_lang('Minimum raw to pass has been changed');
}
}
$out .= '<hr noshade="noshade" size="1" />';
//####################################################################################\\
//############################### DIALOG BOX SECTION #################################\\
//####################################################################################\\
if (!empty($dialogBoxContent)) {
$dialogBox = new DialogBox();
$dialogBox->success($dialogBoxContent);
$out .= $dialogBox->render();
}
// form to change raw needed to pass the exercise
$sql = "SELECT `lock`, `raw_to_pass`\n FROM `" . $TABLELEARNPATHMODULE . "` AS LPM\n WHERE LPM.`module_id` = " . (int) $_SESSION['module_id'] . "\n AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'];
$learningPath_module = claro_sql_query_get_single_row($sql);
// if this module blocks the user if he doesn't complete
if (isset($learningPath_module['lock']) && $learningPath_module['lock'] == 'CLOSE' && isset($learningPath_module['raw_to_pass'])) {
$out .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . '<label for="newRaw">' . get_lang('Change minimum raw mark to pass this module (percentage) :') . ' </label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($learningPath_module['raw_to_pass']) . '" name="newRaw" id="newRaw" size="3" maxlength="3" /> % ' . "\n" . '<input type="hidden" name="cmd" value="raw" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n\n";
}
// display current exercise info and change comment link
$sql = "SELECT `E`.`id` AS `exerciseId`, `M`.`name`\n FROM `" . $TABLEMODULE . "` AS `M`,\n `" . $TABLEASSET . "` AS `A`,\n `" . $tbl_quiz_exercise . "` AS `E`\n WHERE `A`.`module_id` = M.`module_id`\n AND `M`.`module_id` = " . (int) $_SESSION['module_id'] . "\n AND `E`.`id` = `A`.`path`";
$module = claro_sql_query_get_single_row($sql);
if ($module) {
$out .= "\n\n" . '<h4>' . get_lang('Exercise in module') . ' :</h4>' . "\n" . '<p>' . "\n" . claro_htmlspecialchars($module['name']) . '<a href="../exercise/admin/edit_exercise.php?exId=' . $module['exerciseId'] . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" />' . '</a>' . "\n" . '</p>' . "\n";
}
// else sql error, do nothing except in debug mode, where claro_sql_query_fetch_all will show the error
return $out;
}
示例3:
if ($_REQUEST['vis'] == 'v') {
$eventNotifier->notifyCourseEvent('work_visible', claro_get_current_course_id(), claro_get_current_tool_id(), $assigId, claro_get_current_group_id(), '0');
} else {
$eventNotifier->notifyCourseEvent('work_invisible', claro_get_current_course_id(), claro_get_current_tool_id(), $assigId, claro_get_current_group_id(), '0');
}
}
}
/*--------------------------------------------------------------------
DELETE AN ASSIGNMENT
--------------------------------------------------------------------*/
// delete/remove an assignment
if ($cmd == 'exRmAssig') {
$assignment->delete();
//notify eventmanager
$eventNotifier->notifyCourseEvent('work_deleted', claro_get_current_course_id(), claro_get_current_tool_id(), $assigId, claro_get_current_group_id(), '0');
$dialogBox->success(get_lang('Assignment deleted'));
}
/*--------------------------------------------------------------------
MODIFY AN ASSIGNMENT
--------------------------------------------------------------------*/
/*-----------------------------------
STEP 2 : check & query
-------------------------------------*/
// edit an assignment / form has been sent
if ($cmd == 'exEditAssig') {
// check validity of the data
if (!is_null($assigId) && $assignment->validate()) {
$assignment->save();
$eventNotifier->notifyCourseEvent('work_updated', claro_get_current_course_id(), claro_get_current_tool_id(), $assigId, claro_get_current_group_id(), '0');
$dialogBox->success(get_lang('Assignment modified'));
} else {
示例4: unset
switch ($cmd) {
case 'sub':
//execute subscription command...
$done = user_add_to_course($user_id, $cidToEdit, false, false, null);
// Set status requested
if ($_REQUEST['isCourseManager']) {
$properties['isCourseManager'] = 1;
$properties['tutor'] = 1;
} else {
$properties['isCourseManager'] = 0;
$properties['tutor'] = 0;
}
user_set_course_properties($user_id, $cidToEdit, $properties);
//set dialogbox message
if ($done) {
$dialogBox->success(get_lang('The user has been enroled to the course'));
}
break;
}
//build and call DB to get info about current course (for title) if needed :
$courseData = claro_get_course_data($cidToEdit);
if (!$courseData) {
unset($_REQUEST['cidToEdit']);
claro_die('ERROR : COURSE NOT FOUND!!!');
}
//----------------------------------
// Build query and find info in db
//----------------------------------
$sql = "\nSELECT\n U.nom, U.prenom, U.`user_id` AS ID,\n CU.*,\n CU.`user_id` AS Register\nFROM `" . $tbl_user . "` AS U";
$toAdd = "\nLEFT JOIN `" . $tbl_course_user . "` AS CU\n ON CU.`user_id`=U.`user_id`\n AND CU.`code_cours` = '" . claro_sql_escape($cidToEdit) . "'\n ";
$sql .= $toAdd;
示例5: DialogBox
$copyError = false;
//we could simply copy the requested module progression...
//but since we can navigate between modules while completing a module,
//we have to copy the whole learning path progression.
if (!copyLearnPathProgression((int) $_SESSION['returnToTrackingUserId'], (int) claro_get_current_user_id(), (int) $_SESSION['path_id'])) {
$copyError = true;
}
$dialogBox = new DialogBox();
if ($copyError) {
$dialogBox->error(get_lang('An error occured while accessing student module'));
$claroline->display->body->appendContent($dialogBox->render());
echo $claroline->display->render();
exit;
} else {
$user_data = user_get_properties((int) $_SESSION['returnToTrackingUserId']);
$dialogBox->success(get_lang('Currently viewing module of ') . $user_data['firstname'] . ' ' . $user_data['lastname']);
unset($user_data);
}
unset($copyError);
} else {
unset($_SESSION['returnToTrackingUserId']);
}
// main page
// FIRST WE SEE IF USER MUST SKIP THE PRESENTATION PAGE OR NOT
// triggers are : if there is no introdution text or no user module progression statistics yet and user is not admin,
// then there is nothing to show and we must enter in the module without displaying this page.
/*
* GET INFOS ABOUT MODULE and LEARNPATH_MODULE
*/
// check in the DB if there is a comment set for this module in general
$sql = "SELECT `comment`, `startAsset_id`, `contentType`\n FROM `" . $TABLEMODULE . "`\n WHERE `module_id` = " . (int) $_SESSION['module_id'];
示例6: trim
$properties['profileId'] = $_REQUEST['profileId'];
}
if (isset($_REQUEST['isTutor'])) {
$properties['tutor'] = (int) $_REQUEST['isTutor'];
} else {
$properties['tutor'] = 0;
}
if (isset($_REQUEST['role'])) {
$properties['role'] = trim($_REQUEST['role']);
}
$done = user_set_course_properties($uidToEdit, $cidToEdit, $properties);
if (!$done) {
$dialogBox->warning(get_lang('No change applied'));
} elseif (!empty($properties['profileId'])) {
if (claro_get_profile_label($properties['profileId']) == 'manager') {
$dialogBox->success(get_lang('User is now course manager'));
} else {
$dialogBox->success(get_lang('User is now student for this course'));
}
}
break;
}
//------------------------------------
// FIND GLOBAL INFO SECTION
//------------------------------------
if (isset($uidToEdit)) {
// get course user info
$courseUserProperties = course_user_get_properties($uidToEdit, $cidToEdit);
}
//------------------------------------
// PREPARE DISPLAY
示例7: Exception
$toolRepository = get_path('clarolineRepositoryWeb');
claro_set_display_mode_available(true);
// Manage portlets
if (claro_is_course_manager() && !empty($portletClass)) {
// Require the right class
$portletPath = get_module_path($portletLabel) . '/connector/coursehomepage.cnr.php';
if (file_exists($portletPath)) {
require_once $portletPath;
} else {
throw new Exception(get_lang('Cannot find this portlet'));
}
if ($portletCmd == 'exAdd') {
$portlet = new $portletClass();
$portlet->handleForm();
if ($portlet->save()) {
$dialogBox->success(get_lang('Portlet created'));
} else {
$dialogBox->error(get_lang('Can\'t create this portlet (%portlet)', array('%portlet' => $portlet->getLabel())));
}
} elseif ($portletCmd == 'delete' && !empty($portletId) && class_exists($portletClass)) {
$portlet = new $portletClass();
$portlet->load($portletId);
if ($portlet->delete()) {
$dialogBox->success(get_lang('Portlet deleted'));
}
} elseif ($portletCmd == 'makeVisible' && !empty($portletId) && class_exists($portletClass)) {
$portlet = new $portletClass();
if ($portlet->load($portletId)) {
$portlet->makeVisible();
if ($portlet->save()) {
$dialogBox->success(get_lang('Portlet visibility modified'));
示例8: trim
if (isset($_REQUEST['uncompress']) && $_REQUEST['uncompress'] == 1 && $is_allowedToUnzip && preg_match('/.zip$/i', $_FILES['userFile']['name'])) {
$unzip = 'unzip';
} else {
$unzip = '';
}
if (isset($_REQUEST['comment']) && trim($_REQUEST['comment']) != '') {
$comment = trim($_REQUEST['comment']);
} else {
$comment = '';
}
$cwd = secure_file_path($cwd);
$uploadedFileName = treat_uploaded_file($_FILES['userFile'], $baseWorkDir, $cwd, $maxFilledSpace, $unzip);
$uploadedFileNameList = array();
if ($uploadedFileName !== false) {
if (isset($_REQUEST['uncompress']) && $_REQUEST['uncompress'] == 1 && $unzip == 'unzip') {
$dialogBox->success(get_lang('Zip file uploaded and uncompressed'));
foreach ($uploadedFileName as $uploadedFile) {
$uploadedFileNameList[] = $cwd . '/' . $uploadedFile['stored_filename'];
}
} else {
$dialogBox->success(get_lang('The upload is finished'));
$uploadedFileNameList[] = $cwd . '/' . $uploadedFileName;
}
if (!empty($comment)) {
$cur_dir = $cwd;
// add comment to each file
foreach ($uploadedFileNameList as $fileName) {
$fileName = secure_file_path($fileName);
if (dirname($fileName) != $cwd) {
// put a comment on the folder
update_db_info('update', dirname($fileName), array('comment' => $comment));
示例9:
if ($cmd == 'exEdit') {
if (isset($_REQUEST['descTitle'])) {
$description->setTitle($_REQUEST['descTitle']);
}
if (isset($_REQUEST['descContent'])) {
$description->setContent($_REQUEST['descContent']);
}
if (isset($_REQUEST['descCategory'])) {
$description->setCategory($_REQUEST['descCategory']);
}
if ($description->validate()) {
// Update description
if ($description->save()) {
if ($descId) {
$eventNotifier->notifyCourseEvent('course_description_modified', claro_get_current_course_id(), claro_get_current_tool_id(), $descId, claro_get_current_group_id(), '0');
$dialogBox->success(get_lang('Description updated'));
} else {
$eventNotifier->notifyCourseEvent('course_description_added', claro_get_current_course_id(), claro_get_current_tool_id(), $descId, claro_get_current_group_id(), '0');
$dialogBox->success(get_lang('Description added'));
}
} else {
$dialogBox->error(get_lang('Unable to update'));
}
} else {
$cmd = 'rqEdit';
}
}
/*-------------------------------------------------------------------------
REQUEST DESCRIPTION ITEM EDITION
-------------------------------------------------------------------------*/
if ($cmd == 'rqEdit') {
示例10: elseif
} elseif ($cmd == 'rqEd') {
ResourceLinker::setCurrentLocator($currentLocator);
$toolIntro = new ToolIntro($id);
if ($toolIntro->load()) {
$toolIntroForm = $toolIntro->renderForm();
}
} elseif ($cmd == 'exAdd') {
$toolIntro = new ToolIntro();
$toolIntro->handleForm();
//TODO inputs validation
// Manage ressources
if ($toolIntro->save()) {
$currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => (int) $toolIntro->getId()));
$resourceList = isset($_REQUEST['resourceList']) ? $_REQUEST['resourceList'] : array();
ResourceLinker::updateLinkList($currentLocator, $resourceList);
$dialogBox->success(get_lang('Introduction added'));
// Notify that the introsection has been created
$claroline->notifier->notifyCourseEvent('introsection_created', claro_get_current_course_id(), claro_get_current_tool_id(), $toolIntro->getId(), claro_get_current_group_id(), '0');
}
} elseif ($cmd == 'exEd') {
$toolIntro = new ToolIntro($id);
$toolIntro->handleForm();
//TODO inputs validation
if ($toolIntro->save()) {
$currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => (int) $toolIntro->getId()));
$resourceList = isset($_REQUEST['resourceList']) ? $_REQUEST['resourceList'] : array();
ResourceLinker::updateLinkList($currentLocator, $resourceList);
$dialogBox->success(get_lang('Introduction modified'));
// Notify that the introsection has been modified
$claroline->notifier->notifyCourseEvent('introsection_modified', claro_get_current_course_id(), claro_get_current_tool_id(), $toolIntro->getId(), claro_get_current_group_id(), '0');
}
示例11: isset
*/
$display_form = false;
if ($is_allowedToEdit) {
$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
$title = isset($_REQUEST['title']) ? trim($_REQUEST['title']) : '';
$content = isset($_REQUEST['content']) ? trim($_REQUEST['content']) : '';
$lasting = isset($_REQUEST['lasting']) ? trim($_REQUEST['lasting']) : '';
$speakers = isset($_REQUEST['speakers']) ? trim($_REQUEST['speakers']) : '';
$location = isset($_REQUEST['location']) ? trim($_REQUEST['location']) : '';
$autoExportRefresh = false;
if ('exAdd' == $cmd) {
$date_selection = $_REQUEST['fyear'] . '-' . $_REQUEST['fmonth'] . '-' . $_REQUEST['fday'];
$hour = $_REQUEST['fhour'] . ':' . $_REQUEST['fminute'] . ':00';
$entryId = agenda_add_item($title, $content, $date_selection, $hour, $lasting, $speakers, $location);
if ($entryId != false) {
$dialogBox->success(get_lang('Event added to the agenda'));
$currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => (int) $entryId));
$resourceList = isset($_REQUEST['resourceList']) ? $_REQUEST['resourceList'] : array();
ResourceLinker::updateLinkList($currentLocator, $resourceList);
if (CONFVAL_LOG_CALENDAR_INSERT) {
$claroline->log('CALENDAR', array('ADD_ENTRY' => $entryId));
}
// notify that a new agenda event has been posted
$eventNotifier->notifyCourseEvent('agenda_event_added', claro_get_current_course_id(), claro_get_current_tool_id(), $entryId, claro_get_current_group_id(), '0');
$autoExportRefresh = true;
} else {
$dialogBox->error(get_lang('Unable to add the event to the agenda'));
}
}
/*------------------------------------------------------------------------
EDIT EVENT COMMAND
示例12: list
$notAutoActivateInCourses = array_key_exists('notAutoActivateInCourses', $_REQUEST) && $_REQUEST['notAutoActivateInCourses'] == 'on' ? true : false;
$activableOnlyByPlatformAdmin = array_key_exists('activableOnlyByPlatformAdmin', $_REQUEST) && $_REQUEST['activableOnlyByPlatformAdmin'] == 'on' ? true : false;
$activateOnInstall = array_key_exists('activateOnInstall', $_REQUEST) && $_REQUEST['activateOnInstall'] == 'on' ? true : false;
$visibleOnInstall = array_key_exists('visibleOnInstall', $_REQUEST) && $_REQUEST['visibleOnInstall'] == 'on' ? true : false;
$deleteModuleDatabase = array_key_exists('deleteModuleDatabase', $_REQUEST) && $_REQUEST['deleteModuleDatabase'] == 'on' ? true : false;
//----------------------------------
// EXECUTE COMMAND
//----------------------------------
// TODO improve status message and backlog display
switch ($cmd) {
case 'activ':
list($backlog, $success) = activate_module($module_id);
$details = $backlog->output();
if ($success) {
$summary = get_lang('Module activation succeeded');
$dialogBox->success(Backlog_Reporter::report($summary, $details));
} else {
$summary = get_lang('Module activation failed');
$dialogBox->error(Backlog_Reporter::report($summary, $details));
}
break;
case 'desactiv':
list($backlog, $success) = deactivate_module($module_id);
$details = $backlog->output();
if ($success) {
$summary = get_lang('Module desactivation succeeded');
$dialogBox->success(Backlog_Reporter::report($summary, $details));
} else {
$summary = get_lang('Module desactivation failed');
$dialogBox->error(Backlog_Reporter::report($summary, $details));
}
示例13: foreach
if (!$userInfo['isPlatformAdmin'] && !$userInfo['isCourseCreator']) {
$userInfo['password'] = mk_password(8);
if (user_set_properties($user['id'], array('password' => $userInfo['password']))) {
if ($sendEmail && user_send_registration_mail($user['id'], $userInfo)) {
$mailSent = TRUE;
}
} else {
$failedList[] = $userInfo;
}
}
if ($sendEmail && !$mailSent) {
$failedMailList[] = $userInfo;
}
}
if (empty($failedList)) {
$dialogBox->success(get_lang('Password changed successfully for all concerned users'));
} else {
$failedStudents = '';
foreach ($failedList as $failed) {
$failedStudents .= '<br />' . $failed['firstname'] . ' ' . $failed['lastname'];
}
$dialogBox->error(get_lang('Cannot change password for the following users:') . $failedStudents);
}
if ($sendEmail) {
if (empty($failedMailList)) {
$dialogBox->success(get_lang('Email sent successfully to all users'));
} else {
$failedStudents = '';
foreach ($failedMailList as $failed) {
$failedStudents .= '<br />' . $failed['firstname'] . ' ' . $failed['lastname'];
}
示例14: array
$exercise->setEndDate(mktime($_REQUEST['endHour'], $_REQUEST['endMinute'], 0, $_REQUEST['endMonth'], $_REQUEST['endDay'], $_REQUEST['endYear']));
} else {
$exercise->setEndDate(null);
}
if (isset($_REQUEST['useTimeLimit']) && $_REQUEST['useTimeLimit']) {
$exercise->setTimeLimit($_REQUEST['timeLimitMin'] * 60 + $_REQUEST['timeLimitSec']);
} else {
$exercise->setTimeLimit(0);
}
$exercise->setAttempts($_REQUEST['attempts']);
$exercise->setAnonymousAttempts($_REQUEST['anonymousAttempts']);
$exercise->setQuizEndMessage($_REQUEST['quizEndMessage']);
if ($exercise->validate()) {
if ($insertedId = $exercise->save()) {
if (is_null($exId)) {
$dialogBox->success(get_lang('Exercise added'));
$eventNotifier->notifyCourseEvent("exercise_added", claro_get_current_course_id(), claro_get_current_tool_id(), $insertedId, claro_get_current_group_id(), "0");
$exId = $insertedId;
} else {
$dialogBox->success(get_lang('Exercise modified'));
$eventNotifier->notifyCourseEvent("exercise_updated", claro_get_current_course_id(), claro_get_current_tool_id(), $insertedId, claro_get_current_group_id(), "0");
}
$displaySettings = true;
} else {
// sql error in save() ?
$cmd = 'rqEdit';
}
} else {
if (claro_failure::get_last_failure() == 'exercise_no_title') {
$dialogBox->error(get_lang('Field \'%name\' is required', array('%name' => get_lang('Title'))));
} elseif (claro_failure::get_last_failure() == 'exercise_incorrect_dates') {
示例15: DialogBox
}
if (!claro_is_platform_admin()) {
claro_die(get_lang('Not allowed'));
}
$nameTools = get_lang('User settings');
$dialogBox = new DialogBox();
// BC
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$user_id = $_REQUEST['uidToEdit'];
//------------------------------------
// Execute COMMAND section
//------------------------------------
if (isset($_REQUEST['cmd']) && claro_is_platform_admin()) {
if ($_REQUEST['cmd'] == 'UnReg') {
if (user_remove_from_course($user_id, $_REQUEST['cidToEdit'], true, false)) {
$dialogBox->success(get_lang('The user has been successfully unregistered'));
} else {
switch (claro_failure::get_last_failure()) {
case 'cannot_unsubscribe_the_last_course_manager':
$dialogBox->error(get_lang('You cannot unsubscribe the last course manager of the course'));
break;
case 'course_manager_cannot_unsubscribe_himself':
$dialogBox->error(get_lang('Course manager cannot unsubscribe himself'));
break;
default:
}
}
}
}
/**
* PREPARE DISPLAY