Minor - Change some display_x_message() calls to return_message() calls

remotes/angel/1.11.x
Yannick Warnier 8 years ago
parent e7cc120970
commit 7e9b2556ca
  1. 14
      main/coursecopy/import_backup.php
  2. 2
      main/exercise/exercise_submit.php
  3. 24
      main/forum/forumfunction.inc.php

@ -97,21 +97,21 @@ if (Security::check_token('post') && (
$cr = new CourseRestorer($course);
$cr->set_file_option($_POST['same_file_name_option']);
$cr->restore();
Display::display_normal_message(get_lang('ImportFinished'));
Display::addFlash(Display::return_message(get_lang('ImportFinished')));
echo '<a class="btn btn-default" href="' . api_get_path(WEB_COURSE_PATH) . api_get_course_path() . '/index.php">' . get_lang('CourseHomepage') . '</a>';
} else {
if (!$error) {
Display::display_warning_message(get_lang('NoResourcesInBackupFile'));
Display::addFlash(Display::return_message(get_lang('NoResourcesInBackupFile'), 'warning'));
echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
} elseif ($filename === false) {
Display::display_error_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'));
Display::addFlash(Display::return_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'), 'error'));
echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
} else {
if ($filename == '') {
Display::display_error_message(get_lang('SelectBackupFile'));
Display::addFlash(Display::return_message(get_lang('SelectBackupFile'), 'error'));
echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
} else {
Display::display_error_message(get_lang('UploadError'));
Display::addFlash(Display::return_message(get_lang('UploadError'), 'error'));
echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
}
}
@ -141,10 +141,10 @@ if (Security::check_token('post') && (
$hiddenFields['sec_token'] = Security::get_token();
CourseSelectForm::display_form($course, $hiddenFields);
} elseif ($filename === false) {
Display::display_error_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'));
Display::addFlash(Display::return_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'), 'error'));
echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
} else {
Display::display_warning_message(get_lang('NoResourcesInBackupFile'));
Display::addFlash(Display::return_message(get_lang('NoResourcesInBackupFile'), 'warning'));
echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
}
} else {

@ -898,7 +898,7 @@ if ($objExercise->review_answers) {
}
if (!empty($error)) {
Display :: display_error_message($error, false);
Display::addFlash(Display::return_message($error, 'error', false));
} else {
if (!empty ($exercise_sound)) {
echo "<a href=\"../document/download.php?doc_url=%2Faudio%2F" . Security::remove_XSS($exercise_sound) . "\" target=\"_blank\">", "<img src=\"../img/sound.gif\" border=\"0\" align=\"absmiddle\" alt=", get_lang('Sound') . "\" /></a>";

@ -672,7 +672,7 @@ function store_forum($values, $courseInfo = array(), $returnId = false)
$_FILES['picture']['type']
);
if (!filter_extension($new_file_name)) {
//Display :: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension'));
//Display::addFlash(Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'error'));
$image_moved = false;
} else {
$file_extension = explode('.', $_FILES['picture']['name']);
@ -2462,7 +2462,7 @@ function updateThread($values)
}
$message = get_lang('EditPostStored').'<br />';
Display :: display_confirmation_message($message, false);
Display::addFlash(Display::return_message($message, 'confirmation', false));
}
/**
@ -2693,9 +2693,10 @@ function store_thread($current_forum, $values, $courseInfo = array(), $showMessa
if (!filter_extension($new_file_name)) {
if ($showMessage) {
Display:: display_error_message(
get_lang('UplUnableToSaveFileFilteredExtension')
);
Display::addFlash(Display::return_message(
get_lang('UplUnableToSaveFileFilteredExtension'),
'error'
));
}
} else {
if ($result) {
@ -2855,11 +2856,12 @@ function showUpdateThreadForm($currentForum, $forumSetting, $formValues = '')
$values['thread_qualify_gradebook'] == '1' &&
empty($values['weight_calification'])
) {
Display::display_error_message(
Display::addFlash(Display::return_message(
get_lang('YouMustAssignWeightOfQualification').'&nbsp;<a href="javascript:window.history.go(-1);">'.
get_lang('Back').'</a>',
'error',
false
);
));
return false;
}
Security::clear_token();
@ -3751,7 +3753,7 @@ function show_edit_post_form(
if (isset($values['thread_qualify_gradebook']) && $values['thread_qualify_gradebook'] == '1' &&
empty($values['weight_calification'])
) {
Display::display_error_message(get_lang('YouMustAssignWeightOfQualification').'&nbsp;<a href="javascript:window.history.go(-1);">'.get_lang('Back').'</a>', false);
Display::addFlash(Display::return_message(get_lang('YouMustAssignWeightOfQualification').'&nbsp;<a href="javascript:window.history.go(-1);">'.get_lang('Back').'</a>', 'error', false));
return false;
}
return $values;
@ -3960,7 +3962,7 @@ function updateThreadInfo($thread_id, $last_post_id, $post_date)
*/
function forum_not_allowed_here()
{
Display :: display_error_message(get_lang('NotAllowedHere'));
Display::addFlash(Display::return_message(get_lang('NotAllowedHere'), 'error'));
Display :: display_footer();
return false;
@ -4823,7 +4825,7 @@ function add_forum_attachment_file($file_comment, $last_id)
$file_name = $attachment['name'];
if (!filter_extension($new_file_name)) {
Display :: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension'));
Display::addFlash(Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'error'));
return;
}
@ -4911,7 +4913,7 @@ function edit_forum_attachment_file($file_comment, $post_id, $id_attach)
$file_name = $attachment['name'];
if (!filter_extension($new_file_name)) {
Display :: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension'));
Display::addFlash(Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'error'));
} else {
$new_file_name = uniqid('');
$new_path = $updir.'/'.$new_file_name;

Loading…
Cancel
Save