Update deprecated display_*_message() calls

pull/2487/head
Yannick Warnier 8 years ago
parent 6193d198f6
commit 65188b0510
  1. 2
      main/exercise/Draggable.php
  2. 4
      main/exercise/MatchingDraggable.php
  3. 4
      main/exercise/UniqueAnswerImage.php
  4. 8
      main/exercise/admin.php
  5. 4
      main/exercise/exercise.class.php
  6. 4
      main/exercise/exercise_admin.php
  7. 2
      main/exercise/exercise_result.php
  8. 6
      main/exercise/exercise_show.php
  9. 4
      main/exercise/exercise_submit.php
  10. 2
      main/exercise/export/exercise_import.php
  11. 2
      main/exercise/global_multiple_answer.class.php
  12. 2
      main/exercise/hotpotatoes.php
  13. 2
      main/exercise/hotspot_admin.inc.php
  14. 2
      main/exercise/multiple_answer.class.php
  15. 2
      main/exercise/multiple_answer_combination.class.php
  16. 2
      main/exercise/multiple_answer_true_false.class.php
  17. 2
      main/exercise/question_admin.inc.php
  18. 4
      main/exercise/unique_answer.class.php
  19. 2
      main/exercise/unique_answer_no_option.class.php
  20. 33
      main/gradebook/gradebook.php
  21. 2
      main/gradebook/gradebook_add_eval.php
  22. 2
      main/gradebook/gradebook_flatview.php
  23. 30
      main/gradebook/index.php
  24. 4
      main/group/group_space.php
  25. 2
      main/inc/lib/course.lib.php
  26. 4
      main/inc/lib/exercise.lib.php
  27. 2
      main/inc/lib/myspace.lib.php
  28. 6
      main/inc/lib/system_announcements.lib.php
  29. 2
      main/inc/lib/usermanager.lib.php
  30. 10
      main/lp/blank.php
  31. 4
      main/lp/learnpath.class.php
  32. 4
      main/lp/lp_add.php
  33. 6
      main/lp/lp_build.php
  34. 2
      main/messages/outbox.php
  35. 2
      main/mySpace/user_edit.php
  36. 4
      main/permissions/group_permissions.inc.php
  37. 2
      main/permissions/roles.php
  38. 4
      main/permissions/user_permissions.inc.php
  39. 2
      main/session/add_courses_to_session.php
  40. 2
      main/session/add_users_to_session.php
  41. 2
      main/session/session_course_edit.php
  42. 2
      main/session/session_export.php
  43. 6
      main/session/session_import.php
  44. 2
      main/session/session_import_drh.php
  45. 2
      main/session/session_user_import.php
  46. 19
      main/survey/surveyUtil.class.php
  47. 2
      main/survey/survey_invitation.php
  48. 4
      main/survey/survey_invite.php
  49. 4
      main/tracking/course_session_report.php
  50. 5
      main/upload/form.scorm.php
  51. 11
      main/upload/upload.document.php
  52. 5
      main/user/classes.php
  53. 4
      main/webservices/cm_webservice_user.php
  54. 10
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseSelectForm.php

@ -101,7 +101,7 @@ class Draggable extends Question
if ($nb_matches < 1) {
$nb_matches = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
}
for ($i = 1; $i <= $nb_matches; ++$i) {

@ -115,7 +115,7 @@ class MatchingDraggable extends Question
if ($nb_matches < 1) {
$nb_matches = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
}
$editorConfig = array(
@ -174,7 +174,7 @@ class MatchingDraggable extends Question
if ($nb_options < 1) {
$nb_options = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
}
for ($i = 1; $i <= $nb_options; ++$i) {

@ -116,9 +116,9 @@ class UniqueAnswerImage extends UniqueAnswer
if ($numberAnswers < 1) {
$numberAnswers = 1;
Display::display_normal_message(
Display::addFlash(Display::return_message(
get_lang('YouHaveToCreateAtLeastOneAnswer')
);
));
}
for ($i = 1; $i <= $numberAnswers; ++$i) {

@ -348,9 +348,9 @@ Display::display_header($nameTools, 'Exercise');
/*
if ($objExercise->exercise_was_added_in_lp) {
if ($objExercise->force_edit_exercise_in_lp == true) {
Display::display_warning_message(get_lang('ForceEditingExerciseInLPWarning'));
Display::addFlash(Display::return_message(get_lang('ForceEditingExerciseInLPWarning'), 'warning'));
} else {
Display::display_warning_message(get_lang('EditingExerciseCauseProblemsInLP'));
Display::addFlash(Display::return_message(get_lang('EditingExerciseCauseProblemsInLP'), 'warning'));
}
}*/
@ -426,7 +426,7 @@ if ($inATest) {
if (isset($_GET['message'])) {
if (in_array($_GET['message'], array('ExerciseStored', 'ItemUpdated', 'ItemAdded'))) {
Display::display_confirmation_message(get_lang($_GET['message']));
Display::addFlash(Display::return_message(get_lang($_GET['message']), 'confirmation'));
}
}
@ -483,7 +483,7 @@ if (!$newQuestion && !$modifyQuestion && !$editQuestion && !isset($_GET['hotspot
// this test to display only message in the question authoring page and not in the question list page too
// if (is_object($objQuestion) && $objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_EXAM && ($newQuestion || $modifyQuestion || $editQuestion)) {
if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_EXAM) {
Display::display_normal_message(get_lang("TestFeedbackNotShown"));
Display::addFlash(Display::return_message(get_lang('TestFeedbackNotShown'), 'normal'));
}
Session::write('objExercise', $objExercise);

@ -6755,7 +6755,7 @@ class Exercise
if ($this->feedback_type != EXERCISE_FEEDBACK_TYPE_DIRECT) {
// if the user has already answered this question
if (isset($exerciseResult[$questionId])) {
Display::display_normal_message(get_lang('AlreadyAnswered'));
Display::addFlash(Display::return_message(get_lang('AlreadyAnswered'), 'normal'));
break;
}
}
@ -7061,7 +7061,7 @@ class Exercise
// Display text when test is finished #4074 and for LP #4227
$end_of_message = $this->selectTextWhenFinished();
if (!empty($end_of_message)) {
Display::display_normal_message($end_of_message, false);
Display::addFlash(Display::return_message($end_of_message, 'normal', false));
echo "<div class='clear'>&nbsp;</div>";
}

@ -209,9 +209,9 @@ if ($form->validate()) {
echo '</div>';
if ($objExercise->feedback_type == 1) {
Display::display_normal_message(
Display::addFlash(Display::return_message(
get_lang('DirectFeedbackCantModifyTypeQuestion')
);
));
}
if (api_get_setting('search_enabled')=='true' &&

@ -173,7 +173,7 @@ if (!empty($exercise_stat_info)) {
$max_score = $objExercise->get_max_score();
Display::display_normal_message(get_lang('Saved').'<br />', false);
Display::addFlash(Display::return_message(get_lang('Saved').'<br />', 'normal', false));
// Display and save questions
ExerciseLib::display_question_list_by_attempt(

@ -244,7 +244,7 @@ if (!empty($track_exercise_info)) {
}
}
} else {
Display::display_warning_message(get_lang('CantViewResults'));
Display::addFlash(Display::return_message(get_lang('CantViewResults'), 'warning'));
$show_results = false;
}
@ -324,7 +324,7 @@ if (!empty($track_exercise_info['data_tracking'])) {
// Display the text when finished message if we are on a LP #4227
$end_of_message = $objExercise->selectTextWhenFinished();
if (!empty($end_of_message) && ($origin == 'learnpath')) {
Display::display_normal_message($end_of_message, false);
Display::addFlash(Display::return_message($end_of_message, 'normal', false));
echo "<div class='clear'>&nbsp;</div>";
}
@ -984,7 +984,7 @@ if ($origin != 'learnpath') {
echo "<script>window.parent.API.void_save_asset('$totalScore', '$totalWeighting', 0, 'completed'); </script>";
echo '</body></html>';
} else {
Display::display_normal_message(get_lang('ExerciseFinished').' '.get_lang('ToContinueUseMenu'));
Display::addFlash(Display::return_message(get_lang('ExerciseFinished').' '.get_lang('ToContinueUseMenu'), 'normal'));
echo '<br />';
}
}

@ -736,7 +736,7 @@ $interbreadcrumb[] = array("url" => "#", "name" => $objExercise->name);
if ($origin != 'learnpath') { //so we are not in learnpath tool
Display :: display_header(null, 'Exercises');
if (!api_is_allowed_to_session_edit()) {
Display :: display_warning_message(get_lang('SessionIsReadOnly'));
Display::addFlash(Display::return_message(get_lang('SessionIsReadOnly'), 'warning'));
}
} else {
$htmlHeadXtra[] = "
@ -1202,7 +1202,7 @@ if (!empty($error)) {
$questionName = $objQuestionTmp->selectTitle();
// destruction of the Question object
unset($objQuestionTmp);
Display :: display_normal_message(get_lang('AlreadyAnswered'));
Display::addFlash(Display::return_message(get_lang('AlreadyAnswered')));
$i++;
break;
}

@ -75,7 +75,7 @@ Display::display_introduction_section(
// Display Forms or dialog box(if needed)
if (isset($dialogBox)) {
echo Display::display_normal_message($dialogBox, false);
echo Display::addFlash(Display::return_message($dialogBox, 'normal', false));
}
if (isset($display)) {

@ -72,7 +72,7 @@ class GlobalMultipleAnswer extends Question
/* V<EFBFBD>rification : Cr<EFBFBD>action d'au moins une r<EFBFBD>ponse */
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
}
//D<EFBFBD>but affichage score global dans la modification d'une question

@ -236,7 +236,7 @@ if ((api_is_allowed_to_edit(null, true)) && (($finish == 0) || ($finish == 2)))
}
if ($dialogBox) {
Display::display_normal_message($dialogBox, false);
Display::addFlash(Display::return_message($dialogBox, 'normal', false));
}
$form->display();

@ -572,7 +572,7 @@ if ($modifyAnswers) {
);
if (!empty($msgErr)) {
Display::display_normal_message($msgErr); //main API
Display::addFlash(Display::return_message($msgErr, 'normal')); //main API
}
$hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercise/admin.php?' . api_get_cidreq() . '&hotspotadmin=' . $modifyAnswers . '&exerciseId=' . $exerciseId . '&' . api_get_cidreq();

@ -75,7 +75,7 @@ class MultipleAnswer extends Question
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
}
for ($i = 1; $i <= $nb_answers; ++$i) {

@ -68,7 +68,7 @@ class MultipleAnswerCombination extends Question
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
}
for ($i = 1; $i <= $nb_answers; ++$i) {

@ -77,7 +77,7 @@ class MultipleAnswerTrueFalse extends Question
$form->addElement('hidden', 'nb_answers');
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
}
// Can be more options

@ -77,7 +77,7 @@ if (is_object($objQuestion)) {
echo '<img src="../document/download.php?doc_url=%2Fimages%2F'.$pictureName.'" border="0">';
}
if (!empty($msgErr)) {
Display::display_normal_message($msgErr);
Display::addFlash(Display::return_message($msgErr, 'normal'));
}
// display the form
$form->display();

@ -123,9 +123,9 @@ class UniqueAnswer extends Question
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(
Display::addFlash(Display::return_message(
get_lang('YouHaveToCreateAtLeastOneAnswer')
);
));
}
for ($i = 1; $i <= $nb_answers; ++$i) {

@ -87,7 +87,7 @@ class UniqueAnswerNoOption extends Question
$temp_scenario = array();
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
}
$editQuestion = isset($_GET['editQuestion']) ? $_GET['editQuestion'] : false;
if ($editQuestion) {

@ -402,46 +402,46 @@ if (!isset($_GET['exportpdf']) && !isset($_GET['export_certificate'])) {
}
if (isset($_GET['categorymoved'])) {
Display :: display_confirmation_message(get_lang('CategoryMoved'),false);
Display::addFlash(Display::return_message(get_lang('CategoryMoved'), 'confirmation', false));
}
if (isset($_GET['evaluationmoved'])) {
Display :: display_confirmation_message(get_lang('EvaluationMoved'),false);
Display::addFlash(Display::return_message(get_lang('EvaluationMoved'), 'confirmation', false));
}
if (isset($_GET['linkmoved'])) {
Display :: display_confirmation_message(get_lang('LinkMoved'),false);
Display::addFlash(Display::return_message(get_lang('LinkMoved'), 'confirmation', false));
}
if (isset ($_GET['addcat'])) {
Display :: display_confirmation_message(get_lang('CategoryAdded'),false);
Display::addFlash(Display::return_message(get_lang('CategoryAdded'), 'confirmation', false));
}
if (isset ($_GET['linkadded'])) {
Display :: display_confirmation_message(get_lang('LinkAdded'),false);
Display::addFlash(Display::return_message(get_lang('LinkAdded'), 'confirmation', false));
}
if (isset ($_GET['addresult'])) {
Display :: display_confirmation_message(get_lang('ResultAdded'),false);
Display::addFlash(Display::return_message(get_lang('ResultAdded'), 'confirmation', false));
}
if (isset ($_GET['editcat'])) {
Display :: display_confirmation_message(get_lang('CategoryEdited'),false);
Display::addFlash(Display::return_message(get_lang('CategoryEdited'), 'confirmation', false));
}
if (isset ($_GET['editeval'])) {
Display :: display_confirmation_message(get_lang('EvaluationEdited'),false);
Display::addFlash(Display::return_message(get_lang('EvaluationEdited'), 'confirmation', false));
}
if (isset ($_GET['linkedited'])) {
Display :: display_confirmation_message(get_lang('LinkEdited'),false);
Display::addFlash(Display::return_message(get_lang('LinkEdited'), 'confirmation', false));
}
if (isset ($_GET['nolinkitems'])) {
Display :: display_warning_message(get_lang('NoLinkItems'),false);
Display::addFlash(Display::return_message(get_lang('NoLinkItems'), 'warning', false));
}
if (isset ($_GET['addallcat'])) {
Display :: display_normal_message(get_lang('AddAllCat'),false);
Display::addFlash(Display::return_message(get_lang('AddAllCat'), 'normal', false));
}
if (isset ($confirmation_message)) {
Display :: display_confirmation_message($confirmation_message,$filter_confirm_msg);
Display::addFlash(Display::return_message($confirmation_message, 'confirmation', $filter_confirm_msg));
}
if (isset ($warning_message)) {
Display :: display_warning_message($warning_message,$filter_warning_msg);
Display::addFlash(Display::return_message($warning_message, 'warning', $filter_warning_msg));
}
if (isset ($move_form)) {
Display :: display_normal_message($move_form->toHtml(),false);
Display::addFlash(Display::return_message($move_form->toHtml(), 'normal', false));
}
// LOAD DATA & DISPLAY TABLE -
$is_platform_admin= api_is_platform_admin();
@ -602,13 +602,14 @@ $gradebooktable = new GradebookTable(
if (((empty($allcat)) && (empty ($alleval)) && (empty ($alllink)) && (!$is_platform_admin) && ($is_course_admin) && (!isset($_GET['selectcat']))) &&
api_is_course_tutor()
) {
Display :: display_normal_message(
Display::addFlash(Display::return_message(
get_lang('GradebookWelcomeMessage') .
'<br /><br />
<form name="createcat" method="post" action="' . api_get_self() . '?createallcategories=1">
<input type="submit" value="' . get_lang('CreateAllCat') . '"></form>',
'normal',
false
);
));
}
// Here we are in a sub category
if ($category != '0') {

@ -111,7 +111,7 @@ $(document).ready( function() {
Display :: display_header(get_lang('NewEvaluation'));
if ($evaladd->get_course_code() == null) {
Display :: display_normal_message(get_lang('CourseIndependentEvaluation'), false);
Display::addFlash(Display::return_message(get_lang('CourseIndependentEvaluation'), 'normal', false));
}
$form->display();
Display :: display_footer();

@ -60,7 +60,7 @@ if ($showlink) {
}
if (isset($export_flatview_form) && (!$file_type == 'pdf')) {
Display :: display_normal_message($export_flatview_form->toHtml(), false);
Display::addFlash(Display::return_message($export_flatview_form->toHtml(), 'normal', false));
}
if (isset($_GET['selectcat'])) {

@ -539,46 +539,46 @@ if (!isset($_GET['exportpdf'])) {
}
if (isset ($_GET['categorymoved'])) {
Display :: display_confirmation_message(get_lang('CategoryMoved'),false);
Display::addFlash(Display::return_message(get_lang('CategoryMoved'), 'confirmation', false));
}
if (isset ($_GET['evaluationmoved'])) {
Display :: display_confirmation_message(get_lang('EvaluationMoved'),false);
Display::addFlash(Display::return_message(get_lang('EvaluationMoved'), 'confirmation', false));
}
if (isset ($_GET['linkmoved'])) {
Display :: display_confirmation_message(get_lang('LinkMoved'),false);
Display::addFlash(Display::return_message(get_lang('LinkMoved'), 'confirmation', false));
}
if (isset ($_GET['addcat'])) {
Display :: display_confirmation_message(get_lang('CategoryAdded'),false);
Display::addFlash(Display::return_message(get_lang('CategoryAdded'), 'confirmation', false));
}
if (isset ($_GET['linkadded'])) {
Display :: display_confirmation_message(get_lang('LinkAdded'),false);
Display::addFlash(Display::return_message(get_lang('LinkAdded'), 'confirmation', false));
}
if (isset ($_GET['addresult'])) {
Display :: display_confirmation_message(get_lang('ResultAdded'),false);
Display::addFlash(Display::return_message(get_lang('ResultAdded'), 'confirmation', false));
}
if (isset ($_GET['editcat'])) {
Display :: display_confirmation_message(get_lang('CategoryEdited'),false);
Display::addFlash(Display::return_message(get_lang('CategoryEdited'), 'confirmation', false));
}
if (isset ($_GET['editeval'])) {
Display :: display_confirmation_message(get_lang('EvaluationEdited'),false);
Display::addFlash(Display::return_message(get_lang('EvaluationEdited'), 'confirmation', false));
}
if (isset ($_GET['linkedited'])) {
Display :: display_confirmation_message(get_lang('LinkEdited'),false);
Display::addFlash(Display::return_message(get_lang('LinkEdited'), 'confirmation', false));
}
if (isset ($_GET['nolinkitems'])){
Display :: display_warning_message(get_lang('NoLinkItems'),false);
Display::addFlash(Display::return_message(get_lang('NoLinkItems'), 'warning', false));
}
if (isset ($_GET['addallcat'])){
Display :: display_normal_message(get_lang('AddAllCat'),false);
Display::addFlash(Display::return_message(get_lang('AddAllCat'), 'normal', false));
}
if (isset ($confirmation_message)){
Display :: display_confirmation_message($confirmation_message,$filter_confirm_msg);
Display::addFlash(Display::return_message($confirmation_message, 'confirmation', $filter_confirm_msg));
}
if (isset ($warning_message)){
Display :: display_warning_message($warning_message,$filter_warning_msg);
Display::addFlash(Display::return_message($warning_message, 'warning', $filter_warning_msg));
}
if (isset ($move_form)){
Display :: display_normal_message($move_form->toHtml(),false);
Display::addFlash(Display::return_message($move_form->toHtml(), 'normal', false));
}
// LOAD DATA & DISPLAY TABLE
@ -901,7 +901,7 @@ if (isset($first_time) && $first_time == 1 && api_is_allowed_to_edit(null,true))
) {
//Showing the grading system
if (!empty($grade_models[$grade_model_id])) {
Display::display_normal_message(get_lang('GradeModel').': '.$grade_models[$grade_model_id]['name']);
Display::addFlash(Display::return_message(get_lang('GradeModel').': '.$grade_models[$grade_model_id]['name']));
}
}

@ -53,7 +53,7 @@ if (!empty($_GET['selfReg']) &&
GroupManager :: is_self_registration_allowed($user_id, $current_group)
) {
GroupManager :: subscribe_users($user_id, $current_group);
Display :: display_normal_message(get_lang('GroupNowMember'));
Display::addFlash(Display::return_message(get_lang('GroupNowMember'), 'normal'));
}
/*
@ -63,7 +63,7 @@ if (!empty($_GET['selfUnReg']) &&
GroupManager :: is_self_unregistration_allowed($user_id, $current_group)
) {
GroupManager::unsubscribe_users($user_id, $current_group);
Display::display_normal_message(get_lang('StudentDeletesHimself'));
Display::addFlash(Display::return_message(get_lang('StudentDeletesHimself'), 'normal'));
}
echo '<div class="actions">';

@ -852,7 +852,7 @@ class CourseManager
public static function check_parameter($parameter, $error_message)
{
if (empty($parameter)) {
Display::display_normal_message($error_message);
Display::addFlash(Display::return_message($error_message, 'normal'));
return false;
}
return true;

@ -3717,7 +3717,7 @@ HOTSPOT;
// Display text when test is finished #4074 and for LP #4227
$end_of_message = $objExercise->selectTextWhenFinished();
if (!empty($end_of_message)) {
Display::display_normal_message($end_of_message, false);
Display::addFlash(Display::return_message($end_of_message, 'normal', false));
echo "<div class='clear'>&nbsp;</div>";
}
@ -3921,7 +3921,7 @@ HOTSPOT;
}
if (!empty($remainingMessage)) {
Display::display_normal_message($remainingMessage, false);
Display::addFlash(Display::return_message($remainingMessage, 'normal', false));
}
if ($save_user_result) {

@ -827,7 +827,7 @@ class MySpace
$message .= '<li>'.$extrafields[$extra_field_export][3].'</li>';
}
Display::display_normal_message(get_lang('FollowingFieldsWillAlsoBeExported').': <br /><ul>'.$message.'</ul>', false);
Display::addFlash(Display::return_message(get_lang('FollowingFieldsWillAlsoBeExported').': <br /><ul>'.$message.'</ul>', 'normal', false));
}
}
}

@ -527,7 +527,7 @@ class SystemAnnouncementManager
$lang = is_null($lang) ? '' : $lang;
if (!checkdate($date_start_to_compare[1], $date_start_to_compare[2], $date_start_to_compare[0])) {
Display:: display_normal_message(get_lang('InvalidStartDate'));
Display::addFlash(Display::return_message(get_lang('InvalidStartDate'), 'normal'));
return false;
}
@ -537,13 +537,13 @@ class SystemAnnouncementManager
$date_end_to_compare[0]) &&
!checkdate($date_end_to_compare[1], $date_end_to_compare[2], $date_end_to_compare[0])
) {
Display::display_normal_message(get_lang('InvalidEndDate'));
Display::addFlash(Display::return_message(get_lang('InvalidEndDate'), 'normal'));
return false;
}
if (strlen(trim($title)) == 0) {
Display::display_normal_message(get_lang('InvalidTitle'));
Display::addFlash(Display::return_message(get_lang('InvalidTitle'), 'normal'));
return false;
}

@ -4793,7 +4793,7 @@ class UserManager
//345600 = 7 days in seconds 63072000= 2 ans
// if ($currentTimestamp - $timestamp > 184590 )
if ($currentTimestamp - $timestamp > $inactive_time && self::delete_user($student_id)) {
Display::display_normal_message(get_lang('UserDeleted'));
Display::addFlash(Display::return_message(get_lang('UserDeleted'), 'normal'));
echo '<p>', 'id', $student_id, ':', $last_login_date, '</p>';
}
}

@ -22,19 +22,19 @@ if (isset($_GET['error'])) {
switch ($_GET['error']) {
case 'document_deleted':
echo '<br /><br />';
Display::display_error_message(get_lang('DocumentHasBeenDeleted'));
Display::addFlash(Display::return_message(get_lang('DocumentHasBeenDeleted'), 'error'));
break;
case 'prerequisites':
echo '<br /><br />';
Display::display_warning_message(get_lang('LearnpathPrereqNotCompleted'));
Display::addFlash(Display::return_message(get_lang('LearnpathPrereqNotCompleted'), 'warning'));
break;
case 'document_not_found':
echo '<br /><br />';
Display::display_warning_message(get_lang('FileNotFound'));
Display::addFlash(Display::return_message(get_lang('FileNotFound'), 'warning'));
break;
case 'reached_one_attempt':
echo '<br /><br />';
Display::display_warning_message(get_lang('ReachedOneAttempt'));
Display::addFlash(Display::return_message(get_lang('ReachedOneAttempt'), 'warning'));
break;
case 'x_frames_options':
$src = Session::read('x_frame_source');
@ -54,7 +54,7 @@ if (isset($_GET['error'])) {
}
} elseif (isset($_GET['msg']) && $_GET['msg'] == 'exerciseFinished') {
echo '<br /><br />';
Display::display_normal_message(get_lang('ExerciseFinished'));
Display::addFlash(Display::return_message(get_lang('ExerciseFinished'), 'normal'));
}
?>
</body>

@ -5447,7 +5447,7 @@ class learnpath
}
$return .= '<div id="message"></div>';
if (count($this->items) == 0) {
$return .= Display::display_normal_message(get_lang('YouShouldAddItemsBeforeAttachAudio'));
$return .= Display::return_message(get_lang('YouShouldAddItemsBeforeAttachAudio'), 'normal');
} else {
$return_audio = '<table class="data_table">';
$return_audio .= '<tr>';
@ -6584,7 +6584,7 @@ class learnpath
Display::return_icon('certificate.png', get_lang('Certificate'), [], ICON_SIZE_BIG),
);
echo Display::display_normal_message(get_lang('ClickOnTheLearnerViewToSeeYourLearningPath'));
Display::addFlash(Display::return_message(get_lang('ClickOnTheLearnerViewToSeeYourLearningPath'), 'normal'));
$dir = $_SESSION['oLP']->display_item_form('dir', get_lang('EnterDataNewChapter'), 'add_item');
echo Display::tabs(
$headers,

@ -74,10 +74,10 @@ echo '<a href="lp_controller.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('ReturnToLearningPaths'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
Display::display_normal_message(get_lang('AddLpIntro'), false);
Display::addFlash(Display::return_message(get_lang('AddLpIntro'), 'normal', false));
if ($_POST && empty($_REQUEST['lp_name'])) {
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
Display::addFlash(Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error', false));
}
$form = new FormValidator(

@ -112,12 +112,12 @@ echo '</div>';
echo '<div class="col-md-8">';
if (isset($is_success) && $is_success === true) {
Display::display_confirmation_message(get_lang('ItemRemoved'));
Display::addFlash(Display::return_message(get_lang('ItemRemoved'), 'confirmation'));
} else {
if ($is_new) {
Display::display_normal_message(get_lang('LearnpathAdded'), false);
Display::addFlash(Display::return_message(get_lang('LearnpathAdded'), 'normal', zfalse));
}
// Display::display_normal_message(get_lang('LPCreatedAddChapterStep'), false);
// Display::addFlash(Display::return_message(get_lang('LPCreatedAddChapterStep'), 'normal', false));
$gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;
echo Display::page_subheader(get_lang('LearnPathAddedTitle'));

@ -90,7 +90,7 @@ if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0]) == 'delete') {
<br><a href="../social/index.php?#remote-tab-3">'.
get_lang('BackToOutbox').
'</a>';
Display::display_normal_message(api_xml_http_response_encode($message_box),false);
Display::addFlash(Display::return_message(api_xml_http_response_encode($message_box), 'normal', false));
exit;
}

@ -209,7 +209,7 @@ $interbreadcrumb[] = array(
Display::display_header($tool_name);
if (isset($_REQUEST['message'])) {
Display::display_normal_message(get_lang('Updated'));
Display::addFlash(Display::return_message(get_lang('Updated'), 'normal'));
}
$form->display();

@ -12,7 +12,7 @@ echo $group_id;
if ($_POST['StoreGroupPermissions'] and $setting_visualisation == 'checkbox') {
$result_message = store_permissions('group', $group_id);
if ($result_message) {
Display::display_normal_message($result_message);
Display::addFlash(Display::return_message($result_message, 'normal'));
}
}
if (isset($_GET['action'])) {
@ -25,7 +25,7 @@ if (isset($_GET['action'])) {
}
}
if (isset($result_message)) {
Display::display_normal_message($result_message);
Display::addFlash(Display::return_message($result_message, 'normal'));
}
// RETRIEVING THE PERMISSIONS

@ -65,7 +65,7 @@ if (isset($_GET['action']) AND isset($_GET['role_id']) AND $_GET['action'] == 'd
// displaying the return message of the actions
if (isset($result_message)) {
Display::display_normal_message($result_message);
Display::addFlash(Display::return_message($result_message, 'normal'));
}
// ADDING A NEW ROLE (FORM AND LINK)

@ -15,7 +15,7 @@ include_once (api_get_library_path()."/blog.lib.php");
if ($_POST['StoreUserPermissions'] and $setting_visualisation == 'checkbox') {
$result_message = store_permissions('user', $user_id);
if ($result_message) {
Display::display_normal_message($result_message);
Display::addFlash(Display::return_message($result_message, 'normal'));
}
}
if (isset($_GET['action'])) {
@ -30,7 +30,7 @@ if (isset($_GET['action'])) {
}
if (isset($result_message)) {
Display::display_normal_message($result_message);
Display::addFlash(Display::return_message($result_message, 'normal'));
}
// ---------------------------------------------------

@ -212,7 +212,7 @@ unset($Courses);
<?php
if (!empty($errorMsg)) {
Display::display_normal_message($errorMsg); //main API
Display::addFlash(Display::return_message($errorMsg, 'normal')); //main API
}
?>
<div id="multiple-add-session" class="row">

@ -628,7 +628,7 @@ if ($add_type=='multiple') {
<?php
if (!empty($errorMsg)) {
Display::display_normal_message($errorMsg); //main API
Display::addFlash(Display::return_message($errorMsg, 'normal')); //main API
}
?>
<div id="multiple-add-session" class="row">

@ -153,7 +153,7 @@ api_display_tool_title($tool_name);
<div class="title"></div>
<?php
if(!empty($errorMsg)) {
Display::display_normal_message($errorMsg);
Display::addFlash(Display::return_message($errorMsg, 'normal'));
}
?>
</div>

@ -298,7 +298,7 @@ echo '<a href="../session/session_list.php">'.
echo '</div>';
if (!empty($errorMsg)) {
Display::display_normal_message($errorMsg, false); //main API
Display::addFlash(Display::return_message($errorMsg, 'normal', false)); //main API
}
$form = new FormValidator('session_export', 'post', api_get_self());

@ -463,7 +463,7 @@ if (count($inserted_in_course) > 1) {
$msg .= ' '.$title.' ('.$title.'),';
}
$msg = substr($msg, 0, -1);
Display::display_warning_message($msg);
Display::addFlash(Display::return_message($msg, 'warning'));
}
echo '<div class="actions">';
@ -472,7 +472,7 @@ echo '<a href="../session/session_list.php">'.
echo '</div>';
if (!empty($error_message)) {
Display::display_normal_message($error_message, false);
Display::addFlash(Display::return_message($error_message, 'normal', false));
}
$form = new FormValidator('import_sessions', 'post', api_get_self(), null, array('enctype' => 'multipart/form-data'));
@ -517,7 +517,7 @@ $form->addButtonImport(get_lang('ImportSession'));
$defaults = array('sendMail' => 'true', 'file_type' => 'csv');
$form->setDefaults($defaults);
Display::display_normal_message(get_lang('TheXMLImportLetYouAddMoreInfoAndCreateResources'));
Display::addFlash(Display::return_message(get_lang('TheXMLImportLetYouAddMoreInfoAndCreateResources'), 'normal'));
$form->display();
?>

@ -31,7 +31,7 @@ echo '<a href="../session/session_list.php">'.
echo '</div>';
if (!empty($error_message)) {
Display::display_normal_message($error_message, false);
Display::addFlash(Display::return_message($error_message, 'normal', false));
}
$form = new FormValidator('import_sessions', 'post', api_get_self(), null, array('enctype' => 'multipart/form-data'));

@ -72,7 +72,7 @@ echo '<a href="resume_session.php?id_session='.$session_id.'">'.
echo '</div>';
if (!empty($error_message)) {
Display::display_normal_message($error_message, false);
Display::addFlash(Display::return_message($error_message, 'normal', false));
}
$form = new FormValidator(

@ -31,11 +31,11 @@ class SurveyUtil
$error = false;
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($counter == 1 && $row['type'] == 'pagebreak') {
Display::display_error_message(get_lang('PagebreakNotFirst'), false);
Display::addFlash(Display::return_message(get_lang('PagebreakNotFirst'), 'error', false));
$error = true;
}
if ($counter == $total && $row['type'] == 'pagebreak') {
Display::display_error_message(get_lang('PagebreakNotLast'), false);
Display::addFlash(Display::return_message(get_lang('PagebreakNotLast'), 'error', false));
$error = true;
}
$counter++;
@ -187,7 +187,7 @@ class SurveyUtil
if ($error) {
$tool_name = get_lang('Reporting');
Display::display_header($tool_name);
Display::display_error_message(get_lang('Error').': '.$error, false);
Display::addFlash(Display::return_message(get_lang('Error').': '.$error, 'error', false));
Display::display_footer();
exit;
} else {
@ -281,7 +281,7 @@ class SurveyUtil
$message = get_lang('SurveyUserAnswersHaveBeenRemovedSuccessfully').'<br />
<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=userreport&survey_id='.$survey_id.'">'.
get_lang('GoBack').'</a>';
Display::display_confirmation_message($message, false);
Display::addFlash(Display::return_message($message, 'confirmation', false));
}
}
@ -366,10 +366,11 @@ class SurveyUtil
$course_id = api_get_course_int_id();
// Step 2: displaying the survey and the answer of the selected users
if (isset($_GET['user'])) {
Display::display_normal_message(
Display::addFlash(Display::return_message(
get_lang('AllQuestionsOnOnePage'),
'normal',
false
);
));
// Getting all the questions and options
$sql = "SELECT
@ -1671,7 +1672,7 @@ class SurveyUtil
echo '</div>';
// Displaying an information message that only the questions with predefined answers can be used in a comparative report
Display::display_normal_message(get_lang('OnlyQuestionsWithPredefinedAnswers'), false);
Display::addFlash(Display::return_message(get_lang('OnlyQuestionsWithPredefinedAnswers'), 'normal', false));
$xAxis = isset($_GET['xaxis']) ? Security::remove_XSS($_GET['xaxis']) : '';
$yAxis = isset($_GET['yaxis']) ? Security::remove_XSS($_GET['yaxis']) : '';
@ -2527,7 +2528,7 @@ class SurveyUtil
if (isset($_GET['do_search']) && $_GET['do_search']) {
$message = get_lang('DisplaySearchResults').'<br />';
$message .= '<a href="'.api_get_self().'?'.api_get_cidreq().'">'.get_lang('DisplayAll').'</a>';
Display::display_normal_message($message, false);
Display::addFlash(Display::return_message($message, 'normal', false));
}
// Create a sortable table with survey-data
@ -2566,7 +2567,7 @@ class SurveyUtil
if (isset($_GET['do_search'])) {
$message = get_lang('DisplaySearchResults').'<br />';
$message .= '<a href="'.api_get_self().'?'.api_get_cidreq().'">'.get_lang('DisplayAll').'</a>';
Display::display_normal_message($message, false);
Display::addFlash(Display::return_message($message, 'normal', false));
}
// Create a sortable table with survey-data

@ -47,7 +47,7 @@ Display::display_header($tool_name);
// Getting all the people who have filled this survey
$answered_data = SurveyManager::get_people_who_filled_survey($survey_id);
if ($survey_data['anonymous'] == 1) {
Display::display_normal_message(get_lang('AnonymousSurveyCannotKnowWhoAnswered').' '.count($answered_data).' '.get_lang('PeopleAnswered'));
Display::addFlash(Display::return_message(get_lang('AnonymousSurveyCannotKnowWhoAnswered').' '.count($answered_data).' '.get_lang('PeopleAnswered'), 'normal'));
$answered_data = array();
}

@ -83,7 +83,7 @@ if ($survey_data['invited'] > 0 && !isset($_POST['submit'])) {
$message .= get_lang('HaveAnswered').' ';
$message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&survey_id='.$survey_data['survey_id'].'">'.$survey_data['invited'].'</a> ';
$message .= get_lang('WereInvited');
Display::display_normal_message($message, false);
Display::addFlash(Display::return_message($message, 'normal', false));
}
// Building the form for publishing the survey
@ -178,7 +178,7 @@ if ($form->validate()) {
if ($sendMail) {
if (empty($values['mail_title']) || empty($values['mail_text'])) {
Display :: display_error_message(get_lang('FormHasErrorsPleaseComplete'));
Display::addFlash(Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error'));
// Getting the invited users
$defaults = SurveyUtil::get_invited_users($survey_data['code']);

@ -84,7 +84,7 @@ if (!$export_to_xls) {
echo '<h2>'.get_lang('LPExerciseResultsBySession').'</h2>';
$form->display();
Display::display_normal_message(get_lang('StudentScoreAverageIsCalculatedBaseInAllLPsAndAllAttempts'));
Display::addFlash(Display::return_message(get_lang('StudentScoreAverageIsCalculatedBaseInAllLPsAndAllAttempts'), 'normal'));
}
$users = SessionManager::get_users_by_session($session_id);
@ -218,7 +218,7 @@ if (!empty($users) && is_array($users)) {
$html_result .= "</tr>";
$html_result .= '</table>';
} else {
Display::display_warning_message(get_lang('NoResults'));
Display::addFlash(Display::return_message(get_lang('NoResults'), 'warning'));
}
if (!$export_to_xls) {

@ -127,10 +127,11 @@ if (is_dir(api_get_path(PLUGIN_PATH)."/pens")) {
// the default values for the form
$defaults = array('index_document' => 'checked="checked"', 'use_max_score' => 1);
$form->setDefaults($defaults);
Display::display_normal_message(
Display::addFlash(Display::return_message(
Display::tag('strong', get_lang('SupportedScormContentMakers')).': '.implode(', ', $content_origins),
'normal',
false
);
));
$form->display();
Display::display_footer();

@ -80,13 +80,14 @@ if (isset($_FILES['user_upload'])) {
$missing_files = check_for_missing_files($base_work_dir.$_POST['curdirpath'].$new_path);
if ($missing_files) {
//show a form to upload the missing files
Display::display_normal_message(
Display::addFlash(Display::return_message(
build_missing_files_form(
$missing_files,
$_POST['curdirpath'],
$_FILES['user_upload']['name']
)
);
),
'normal'
));
}
}
}
@ -145,7 +146,7 @@ if (isset($_POST['create_dir']) && $_POST['dirname'] != '') {
$_POST['dirname']
);
if ($created_dir) {
Display::display_normal_message(get_lang('DirCr'));
Display::addFlash(Display::return_message(get_lang('DirCr'), 'normal'));
$path = $created_dir;
} else {
Display::addFlash(Display::return_message(get_lang('CannotCreateDir')));
@ -161,7 +162,7 @@ if (isset($_GET['createdir'])) {
$new_folder_text .= '<input type="submit" name="create_dir" value="'.get_lang('Ok').'"/>';
$new_folder_text .= '</form>';
//show the form
Display::display_normal_message($new_folder_text);
Display::addFlash(Display::return_message($new_folder_text, 'normal'));
} else { //give them a link to create a directory
?>
<p>

@ -33,13 +33,14 @@ if (!empty($usergroup_list)) {
}
} else {
if (api_is_platform_admin()) {
Display::display_normal_message(
Display::addFlash(Display::return_message(
Display::url(
get_lang('AddClasses'),
api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add'
),
'normal',
false
);
));
}
}

@ -107,9 +107,9 @@ class WSCMUser extends WSCM
$count_is_true = SocialManager::send_invitation_friend($user_id,$userfriend_id, $message_title, $content_message);
if ($count_is_true) {
return Display::display_normal_message(api_htmlentities(get_lang('InvitationHasBeenSent'), ENT_QUOTES,$charset),false);
return Display::return_message(api_htmlentities(get_lang('InvitationHasBeenSent'), ENT_QUOTES, $charset), 'normal', false);
} else {
return Display::display_error_message(api_htmlentities(get_lang('YouAlreadySentAnInvitation'), ENT_QUOTES,$charset),false);
return Display::return_message(api_htmlentities(get_lang('YouAlreadySentAnInvitation'), ENT_QUOTES, $charset), 'error', false);
}
}
return get_lang('InvalidId');

@ -178,7 +178,7 @@ class CourseSelectForm
echo get_lang('SelectResources');
echo '</p>';
Display::display_normal_message(get_lang('DontForgetToSelectTheMediaFilesIfYourResourceNeedIt'));
Display::addFlash(Display::return_message(get_lang('DontForgetToSelectTheMediaFilesIfYourResourceNeedIt'), 'normal'));
foreach ($course->resources as $type => $resources) {
if (count($resources) > 0) {
@ -215,12 +215,12 @@ class CourseSelectForm
echo '<span class="title">'.$resource_titles[$type].'</span></div>';
echo '<div class="item-content" id="div_'.$type.'">';
if ($type == RESOURCE_LEARNPATH) {
Display::display_warning_message(get_lang('ToExportLearnpathWithQuizYouHaveToSelectQuiz'));
Display::display_warning_message(get_lang('IfYourLPsHaveAudioFilesIncludedYouShouldSelectThemFromTheDocuments'));
Display::addFlash(Display::return_message(get_lang('ToExportLearnpathWithQuizYouHaveToSelectQuiz'), 'warning'));
Display::addFlash(Display::return_message(get_lang('IfYourLPsHaveAudioFilesIncludedYouShouldSelectThemFromTheDocuments'), 'warning'));
}
if ($type == RESOURCE_DOCUMENT) {
if (api_get_setting('show_glossary_in_documents') != 'none') {
Display::display_warning_message(get_lang('ToExportDocumentsWithGlossaryYouHaveToSelectGlossary'));
Display::addFlash(Display::return_message(get_lang('ToExportDocumentsWithGlossaryYouHaveToSelectGlossary'), 'warning'));
}
}
@ -321,7 +321,7 @@ class CourseSelectForm
$recycleOption = isset($_POST['recycle_option']) ? true : false;
if (empty($element_count)) {
Display::display_warning_message(get_lang('NoDataAvailable'));
Display::addFlash(Display::return_message(get_lang('NoDataAvailable'), 'warning'));
} else {
if (!empty($hidden_fields['destination_session'])) {
echo '<br /><button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;" >'.

Loading…
Cancel
Save