本文整理匯總了PHP中DialogBox::error方法的典型用法代碼示例。如果您正苦於以下問題:PHP DialogBox::error方法的具體用法?PHP DialogBox::error怎麽用?PHP DialogBox::error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DialogBox
的用法示例。
在下文中一共展示了DialogBox::error方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
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') {
$dialogBox->error(get_lang('Start date must be before end date ...'));
}
$cmd = 'rqEdit';
}
}
if ($cmd == 'rqEdit') {
$form['title'] = $exercise->getTitle();
$form['description'] = $exercise->getDescription();
$form['displayType'] = $exercise->getDisplayType();
$form['randomize'] = (bool) $exercise->getShuffle() > 0;
$form['questionDrawn'] = $exercise->getShuffle();
$form['useSameShuffle'] = (bool) $exercise->getUseSameShuffle();
$form['showAnswers'] = $exercise->getShowAnswers();
$form['startDate'] = $exercise->getStartDate();
示例2: catch
case 'exdoNotNotify':
$topicId = $userInput->getMandatory('topic');
break;
case 'show':
$topicId = $userInput->getMandatory('topic');
break;
}
} catch (Exception $ex) {
if (claro_debug_mode()) {
pushClaroMessage('<pre>' . $ex->__toString() . '</pre>', 'error');
// claro_die( '<pre>' . $ex->__toString() . '</pre>' );
}
if ($ex instanceof Claro_Validator_Exception) {
switch ($cmd) {
case 'rqPost':
$dialogBox->error(get_lang('Unknown post or edition mode'));
$cmd = 'dialog_only';
break;
case 'exSavePost':
$dialogBox->error(get_lang('Missing information'));
$inputMode = 'missing_input';
break;
case 'exDelete':
$dialogBox->error(get_lang('Unknown post'));
break;
case 'exNotify':
$dialogBox->error(get_lang('Unknown topic'));
break;
case 'exdoNotNotify':
$dialogBox->error(get_lang('Unknown topic'));
break;
示例3: fwrite
if ($fp = @fopen($question->questionDirSys . "/question_" . $quId . ".xml", 'w')) {
fwrite($fp, $xml);
fclose($fp);
} else {
// interrupt process
}
// list of dirs to add in archive
$filePathList[] = $question->questionDirSys;
/*
* BUILD THE ZIP ARCHIVE
*/
// build and send the zip
if (sendZip($question->getTitle(), $filePathList, $question->questionDirSys)) {
exit;
} else {
$dialogBox->error(get_lang("Unable to send zip file"));
}
}
if ($cmd == 'recupMultipleQuestions' && !is_null($exId)) {
// add multiple question selection
$sql = "SELECT `id` FROM `" . $tbl_quiz_question . "` ORDER BY `id`";
$list = claro_sql_query_fetch_all_rows($sql);
$ok = true;
foreach ($list as $questionInfo) {
$quId = $questionInfo['id'];
if (isset($_REQUEST[$quId])) {
if (!$exercise->addQuestion($quId)) {
$ok = false;
}
}
}
示例4: Exception
// 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'));
}
}
示例5: DialogBox
//DECLARE NEEDED LIBRARIES
require_once get_path('incRepositorySys') . '/lib/pager.lib.php';
require_once get_path('incRepositorySys') . '/lib/module/manage.lib.php';
//SQL table name
$tbl_name = claro_sql_get_main_tbl();
$tbl_module = $tbl_name['module'];
$tbl_dock = $tbl_name['dock'];
$dialogBox = new DialogBox();
if (isset($_REQUEST['dock'])) {
$dockList = get_dock_list('applet');
$dock = $_REQUEST['dock'];
$dockName = isset($dockList[$dock]) ? $dockList[$dock] : $dock;
$nameTools = get_lang('Dock') . ' : ' . $dockName;
} else {
$dock = null;
$dialogBox->error(get_lang('No dock selected'));
$nameTools = get_lang('Dock');
}
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Module list'), get_path('rootAdminWeb') . 'module/module_list.php');
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
//CONFIG and DEVMOD vars :
$modulePerPage = get_conf('moduleDockPerPage', 10);
//----------------------------------
// EXECUTE COMMAND
//----------------------------------
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : null;
$module_id = isset($_REQUEST['module_id']) ? $_REQUEST['module_id'] : null;
if (!empty($dock)) {
switch ($cmd) {
case 'up':
move_module_in_dock($module_id, $dock, 'up');
示例6: foreach
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($coursePath)) as $file) {
try {
if ($file->getType() == 'file') {
$type = strtolower(pathinfo($file->getFilename(), PATHINFO_EXTENSION));
if (in_array($type, $extensions)) {
$courseStats[$type]['count']++;
$courseStats[$type]['size'] += $file->getSize();
} else {
$courseStats['others']['count']++;
$courseStats['others']['size'] += $file->getSize();
}
$courseStats['sum']['count']++;
$courseStats['sum']['size'] += $file->getSize();
}
} catch (Exception $ex) {
$dialogBox->error($ex->getMessage());
}
}
$stats[$course['sysCode']]['courseTitle'] = $course['title'];
$stats[$course['sysCode']]['courseTitulars'] = $course['titulars'];
$stats[$course['sysCode']]['courseStats'] = $courseStats;
// Get categories datas
$cat = array();
$sql2 = "SELECT cat.name AS categoryName\n FROM `" . $tbl_category . "` AS cat\n LEFT JOIN `" . $tbl_rel_course_category . "` AS rcc\n ON ( cat.id = rcc.categoryId )\n WHERE rcc.courseId = '" . $course['id'] . "'";
$arrayCat = Claroline::getDatabase()->query($sql2);
foreach ($arrayCat as $item) {
$cat[] .= $item['categoryName'];
}
$stats[$course['sysCode']]['courseCategory'] = $cat;
$i++;
// Courses pool's limit reached ?
示例7: catch
break;
case 'exEmptyForum':
$forumId = $userInput->getMandatory('forumId');
break;
case 'exMvUpForum':
$forumId = $userInput->getMandatory('forumId');
break;
case 'exMvDownForum':
$forumId = $userInput->getMandatory('forumId');
break;
default:
break;
}
} catch (Exception $ex) {
if (claro_debug_mode()) {
$dialogBox->error('<pre>' . $ex->__toString() . '</pre>');
}
if ($ex instanceof Claro_Validator_Exception) {
if (!isset($cmd)) {
$cmd = 'cmd';
}
switch ($cmd) {
case 'cmd':
$cmd = 'show';
break;
case 'exMkCat':
$dialogBox->error(get_lang('Category name cannot be empty'));
$cmd = 'rqMkCat';
break;
case 'exEdCat':
$dialogBox->error(get_lang('Category name cannot be empty'));
示例8: elseif
// 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');
}
} elseif ($cmd == 'exDel') {
$toolIntro = new ToolIntro($id);
if ($toolIntro->delete()) {
$dialogBox->success(get_lang('Introduction deleted'));
//TODO linker_delete_resource('CLINTRO_');
}
} elseif ($cmd == 'exMvUp') {
$toolIntro = new ToolIntro($id);
if ($toolIntro->load()) {
if ($toolIntro->moveUp()) {
$dialogBox->success(get_lang('Introduction moved up'));
} else {
$dialogBox->error(get_lang('This introduction can\'t be moved up'));
}
}
} elseif ($cmd == 'exMvDown') {
$toolIntro = new ToolIntro($id);
if ($toolIntro->load()) {
if ($toolIntro->moveDown()) {
$dialogBox->success(get_lang('Introduction moved down'));
} else {
$dialogBox->error(get_lang('This introduction can\'t be moved down'));
}
}
} elseif ($cmd == 'mkVisible') {
$toolIntro = new ToolIntro($id);
if ($toolIntro->load()) {
$toolIntro->setVisibility('SHOW');
示例9: isset
}
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') {
claro_set_display_mode_available(false);
// Manage the tips
$tips['isTitleEditable'] = isset($tipList[$category]['isEditable']) ? $tipList[$category]['isEditable'] : true;
$tips['presetTitle'] = !empty($tipList[$category]['title']) ? claro_htmlspecialchars($tipList[$category]['title']) : '';
$tips['question'] = !empty($tipList[$category]['question']) ? $tipList[$category]['question'] : '';
$tips['information'] = !empty($tipList[$category]['information']) ? $tipList[$category]['information'] : '';
示例10: isset
$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
--------------------------------------------------------------------------*/
if ('exEdit' == $cmd) {
$date_selection = $_REQUEST['fyear'] . '-' . $_REQUEST['fmonth'] . '-' . $_REQUEST['fday'];
$hour = $_REQUEST['fhour'] . ':' . $_REQUEST['fminute'] . ':00';
if (!empty($id)) {
if (agenda_update_item($id, $title, $content, $date_selection, $hour, $lasting, $speakers, $location)) {
$dialogBox->success(get_lang('Event updated into the agenda'));
$currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => (int) $id));
$resourceList = isset($_REQUEST['resourceList']) ? $_REQUEST['resourceList'] : array();
ResourceLinker::updateLinkList($currentLocator, $resourceList);
$eventNotifier->notifyCourseEvent('agenda_event_modified', claro_get_current_course_id(), claro_get_current_tool_id(), $id, claro_get_current_group_id(), '0');
示例11: DialogBox
//check if newname is not already used in another module of the same course
$sql = "SELECT `name`\n FROM `" . $TABLEMODULE . "`\n WHERE `name` = '" . claro_sql_escape($_POST['newName']) . "'\n AND `module_id` != '" . (int) $_REQUEST['module_id'] . "'";
$query = claro_sql_query($sql);
$num = mysql_num_rows($query);
if ($num == 0) {
// if no error occurred, update module's name in the database
$query = "UPDATE `" . $TABLEMODULE . "`\n SET `name`= '" . claro_sql_escape($_POST['newName']) . "'\n WHERE `module_id` = '" . (int) $_REQUEST['module_id'] . "'";
$result = claro_sql_query($query);
} else {
$dialogBox = new DialogBox();
$dialogBox->error(get_lang('Error : Name already exists in the learning path or in the module pool'));
$out .= $dialogBox->render();
}
} else {
$dialogBox = new DialogBox();
$dialogBox->error(get_lang('Name cannot be empty'));
$out .= $dialogBox->render();
}
break;
//display the form to modify the comment
//display the form to modify the comment
case "rqComment":
if (isset($_REQUEST['module_id'])) {
//get current comment from DB
$query = "SELECT `comment`\n FROM `" . $TABLEMODULE . "`\n WHERE `module_id` = '" . (int) $_REQUEST['module_id'] . "'";
$result = claro_sql_query($query);
$comment = mysql_fetch_array($result);
if (isset($comment['comment'])) {
$out .= '<form method="get" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . claro_html_textarea_editor('comment', $comment['comment'], 15, 55) . "\n" . '<br />' . "\n" . '<input type="hidden" name="cmd" value="exComment" />' . "\n" . '<input type="hidden" name="module_id" value="' . $_REQUEST['module_id'] . '" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '<br /><br />' . "\n" . '</form>' . "\n";
}
}
示例12: isset
$cidRequired = isset($_REQUEST['cidRequired']) ? $_REQUEST['cidRequired'] : false;
//TODO: possibility to continue in anonymous
$uidRequired = true;
// The script needs the user to be authentificated
if (!claro_is_user_authenticated() && $uidRequired) {
$defaultLoginValue = '';
$dialogBox = new DialogBox();
if (isset($_SESSION['lastUserName'])) {
$defaultLoginValue = strip_tags($_SESSION['lastUserName']);
unset($_SESSION['lastUserName']);
}
if (get_conf('claro_displayLocalAuthForm', true) == true) {
if ($claro_loginRequested && !$claro_loginSucceeded) {
if (AuthManager::getFailureMessage()) {
// need to use get_lang two times...
$dialogBox->error(get_lang(AuthManager::getFailureMessage()));
} else {
$dialogBox->error(get_lang('Login failed.') . ' ' . get_lang('Please try again.'));
}
if (get_conf('allowSelfReg', false)) {
$dialogBox->warning(get_lang('If you haven\'t a user account yet, use the <a href="%url">the account creation form</a>.', array('%url' => get_path('url') . '/claroline/auth/inscription.php')));
} else {
$dialogBox->error(get_lang('Contact your administrator.'));
}
$dialogBox->warning(get_lang('Warning the system distinguishes uppercase (capital) and lowercase (small) letters'));
}
if (get_conf('claro_secureLogin', false)) {
$formAction = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
} else {
$formAction = $_SERVER['PHP_SELF'];
}
示例13: list
$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));
}
break;
case 'mvUp':
if (!is_null($courseToolId)) {
示例14: foreach
} 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'];
}
$dialogBox->error(get_lang('Cannot send email to the following users:') . $failedStudents);
}
}
break;
case 'exDelete':
if (user_delete($userIdReq)) {
示例15: WikiStore
$con = Claroline::getDatabase();
// DEVEL_MODE database initialisation
if (defined('DEVEL_MODE') && DEVEL_MODE == true) {
init_wiki_tables($con, false);
}
// Objects instantiation
$wikiStore = new WikiStore($con, $config);
$wikiList = array();
// --------- Start of command processing ----------------
switch ($action) {
case 'exExport':
require_once "lib/class.wiki2xhtmlexport.php";
if (!$wikiStore->wikiIdExists($wikiId)) {
// die( get_lang("Invalid Wiki Id") );
$message = get_lang("Invalid Wiki Id");
$dialogBox->error($message);
$action = 'error';
} else {
$wiki = $wikiStore->loadWiki($wikiId);
$wikiTitle = $wiki->getTitle();
$renderer = new WikiToSingleHTMLExporter($wiki);
$contents = $renderer->export();
if (0 != $groupId) {
$groupPart = '_group' . (int) $groupId;
} else {
$groupPart = '';
}
require_once get_conf('includePath') . '/lib/fileUpload.lib.php';
// TODO : use function wich return get_conf('coursesRepositorySys') . '/' . $_course['path']
$exportDir = get_conf('coursesRepositorySys') . '/' . claro_get_course_path() . '/document';
$exportFile = replace_dangerous_char($wikiTitle, 'strict') . $groupPart;