Minor - Replace deprecated display_x_message() by return_message(..., 'x')

pull/2487/head
Yannick Warnier 8 years ago
parent 95dcb23620
commit afc337386e
  1. 4
      main/admin/access_url_add_usergroup_to_url.php
  2. 7
      main/admin/access_url_add_users_to_url.php
  3. 2
      main/admin/course_user_import.php
  4. 6
      main/admin/grade_models.php
  5. 2
      main/admin/promotions.php
  6. 2
      main/admin/skills_gradebook.php
  7. 2
      main/admin/special_exports.php
  8. 6
      main/admin/subscribe_user2course.php
  9. 2
      main/admin/user_update_import.php
  10. 2
      main/admin/usergroup_user_import.php
  11. 2
      main/attendance/attendance_add.php
  12. 2
      main/attendance/attendance_edit.php
  13. 2
      main/auth/courses_list.php
  14. 4
      main/auth/ldap/authldap.php
  15. 2
      main/auth/set_temp_password.php
  16. 8
      main/auth/shibboleth/app/view/shibboleth_display.class.php
  17. 2
      main/auth/shibboleth/app/view/shibboleth_status_request_form.class.php
  18. 11
      main/coursecopy/copy_course_session.php
  19. 2
      main/coursecopy/create_backup.php
  20. 2
      main/coursecopy/recycle_course.php
  21. 2
      main/dashboard/dashboard.php
  22. 4
      main/document/create_audio.php
  23. 2
      main/document/create_draw.php
  24. 2
      main/document/download.php
  25. 2
      main/document/edit_draw.php
  26. 2
      main/dropbox/recover_dropbox_files.php
  27. 5
      main/exercise/exercise.php
  28. 2
      main/exercise/exercise_history.php
  29. 2
      main/exercise/exercise_report.php
  30. 2
      main/exercise/question_pool.php
  31. 4
      main/exercise/savescores.php
  32. 2
      main/forum/forumqualify.php
  33. 2
      main/forum/index.php
  34. 4
      main/forum/viewforum.php
  35. 2
      main/forum/viewforumcategory.php
  36. 2
      main/forum/viewpost.php
  37. 2
      main/forum/viewthread.php
  38. 4
      main/gradebook/gradebook_scoring_system.php
  39. 2
      main/gradebook/gradebook_statistics.php
  40. 3
      main/group/group_creation.php
  41. 2
      main/group/member_settings.php
  42. 2
      main/inc/ajax/lp.ajax.php
  43. 6
      main/inc/lib/AnnouncementManager.php
  44. 5
      main/inc/lib/TicketManager.php
  45. 2
      main/inc/lib/display.lib.php
  46. 3
      main/inc/lib/document.lib.php
  47. 8
      main/inc/lib/fileUpload.lib.php
  48. 2
      main/inc/lib/link.lib.php
  49. 2
      main/inc/lib/message.lib.php
  50. 4
      main/inc/lib/myspace.lib.php
  51. 2
      main/inc/lib/search/xapian/XapianQuery.php
  52. 2
      main/lp/download.php
  53. 6
      main/lp/lp_admin_view.php
  54. 2
      main/lp/lp_list_search.php
  55. 2
      main/lp/openoffice_text.class.php
  56. 2
      main/lp/openoffice_text_document.class.php
  57. 2
      main/mySpace/progression.php
  58. 4
      main/mySpace/user_import.php
  59. 2
      main/search/NOTES
  60. 2
      main/search/index.php
  61. 4
      main/session/add_many_session_to_category.php
  62. 2
      main/session/session_add.php
  63. 2
      main/session/session_category_add.php
  64. 2
      main/session/session_category_edit.php
  65. 6
      main/survey/copy_survey.php
  66. 2
      main/survey/fillsurvey.php
  67. 4
      main/survey/preview.php
  68. 2
      main/survey/question.php
  69. 4
      main/ticket/update_report.php
  70. 4
      main/user/user_import.php

@ -51,10 +51,10 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
if ($form_sent == 1) { if ($form_sent == 1) {
if (count($userGroups) == 0 || count($urlList) == 0) { if (count($userGroups) == 0 || count($urlList) == 0) {
Display :: display_error_message(get_lang('AtLeastOneUserGroupAndOneURL')); echo Display::return_message(get_lang('AtLeastOneUserGroupAndOneURL'), 'error');
} else { } else {
UrlManager::addUserGroupListToUrl($userGroups, $urlList); UrlManager::addUserGroupListToUrl($userGroups, $urlList);
Display::display_confirmation_message(get_lang('UserGroupBelongURL')); echo Display::return_message(get_lang('UserGroupBelongURL'), 'confirm');
} }
} }
} }

@ -55,12 +55,13 @@ if ($_POST['form_sent']) {
if ($form_sent == 1) { if ($form_sent == 1) {
if (count($users) == 0 || count($url_list) == 0) { if (count($users) == 0 || count($url_list) == 0) {
Display:: display_error_message( echo Display::return_message(
get_lang('AtLeastOneUserAndOneURL') get_lang('AtLeastOneUserAndOneURL'),
'error'
); );
} else { } else {
UrlManager::add_users_to_urls($users, $url_list); UrlManager::add_users_to_urls($users, $url_list);
Display:: display_confirmation_message(get_lang('UsersBelongURL')); echo Display::return_message(get_lang('UsersBelongURL'), 'confirm');
} }
} }
} }

@ -208,7 +208,7 @@ if (count($errors) != 0) {
$error_message .= '</li>'; $error_message .= '</li>';
} }
$error_message .= '</ul>'; $error_message .= '</ul>';
Display :: display_error_message($error_message, false); echo Display::return_message($error_message, 'error', false);
} }
// Displaying the form. // Displaying the form.

@ -151,7 +151,7 @@ switch ($action) {
$values = $form->exportValues(); $values = $form->exportValues();
$res = $obj->save($values); $res = $obj->save($values);
if ($res) { if ($res) {
Display::display_confirmation_message(get_lang('ItemAdded')); echo Display::return_message(get_lang('ItemAdded'), 'confirm');
} }
} }
$obj->display(); $obj->display();
@ -174,7 +174,7 @@ switch ($action) {
if ($check) { if ($check) {
$values = $form->exportValues(); $values = $form->exportValues();
$res = $obj->update($values); $res = $obj->update($values);
Display::display_confirmation_message(get_lang('ItemUpdated'), false); echo Display::return_message(get_lang('ItemUpdated'), 'confirm', false);
} }
$obj->display(); $obj->display();
} else { } else {
@ -191,7 +191,7 @@ switch ($action) {
if ($check) { if ($check) {
$res = $obj->delete($_GET['id']); $res = $obj->delete($_GET['id']);
if ($res) { if ($res) {
Display::display_confirmation_message(get_lang('ItemDeleted')); echo Display::return_message(get_lang('ItemDeleted'), 'confirm');
} }
} }
$obj->display(); $obj->display();

@ -169,7 +169,7 @@ switch ($action) {
$res = $promotion->update($values); $res = $promotion->update($values);
$promotion->update_all_sessions_status_by_promotion_id($values['id'], $values['status']); $promotion->update_all_sessions_status_by_promotion_id($values['id'], $values['status']);
if ($res) { if ($res) {
Display::display_confirmation_message(get_lang('PromotionUpdated'), $values['name']); echo Display::return_message(get_lang('PromotionUpdated').': '.$values['name'], 'confirm');
} }
} }
$promotion->display(); $promotion->display();

@ -116,7 +116,7 @@ switch ($action) {
$values = $form->exportValues(); $values = $form->exportValues();
$res = $gradebook->update_skills_to_gradebook($values['id'], $values['skill']); $res = $gradebook->update_skills_to_gradebook($values['id'], $values['skill']);
if ($res) { if ($res) {
Display::display_confirmation_message(get_lang('ItemAdded')); echo Display::return_message(get_lang('ItemAdded'), 'confirm');
} }
} }
$form->display(); $form->display();

@ -310,7 +310,7 @@ function fullexportspecial()
return $name; return $name;
} }
} else { } else {
Display::display_error_message(get_lang('ErrorMsgSpecialExport')); //main API echo Display::return_message(get_lang('ErrorMsgSpecialExport'), 'error'); //main API
$export = false; $export = false;
return false; return false;
} }

@ -92,7 +92,7 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
if ($form_sent == 1) { if ($form_sent == 1) {
if (count($users) == 0 || count($courses) == 0) { if (count($users) == 0 || count($courses) == 0) {
Display :: display_error_message(get_lang('AtLeastOneUserAndOneCourse')); echo Display::return_message(get_lang('AtLeastOneUserAndOneCourse'), 'error');
} else { } else {
$errorDrh = 0; $errorDrh = 0;
foreach ($courses as $course_code) { foreach ($courses as $course_code) {
@ -107,9 +107,9 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
} }
if ($errorDrh == 0) { if ($errorDrh == 0) {
Display :: display_confirmation_message(get_lang('UsersAreSubscibedToCourse')); echo Display::return_message(get_lang('UsersAreSubscibedToCourse'), 'confirm');
} else { } else {
Display :: display_error_message(get_lang('HumanResourcesManagerShouldNotBeRegisteredToCourses')); echo Display::return_message(get_lang('HumanResourcesManagerShouldNotBeRegisteredToCourses'), 'error');
} }
} }
} }

@ -424,7 +424,7 @@ if (isset($_POST['formSent']) && $_POST['formSent'] && $_FILES['import_file']['s
Display :: display_header($tool_name); Display :: display_header($tool_name);
if (!empty($error_message)) { if (!empty($error_message)) {
Display::display_error_message($error_message); echo Display::return_message($error_message, 'error');
} }
$form = new FormValidator('user_update_import', 'post', api_get_self()); $form = new FormValidator('user_update_import', 'post', api_get_self());

@ -168,7 +168,7 @@ if (count($errors) != 0) {
$error_message .= "<br />"; $error_message .= "<br />";
} }
$error_message .= "\n"; $error_message .= "\n";
Display :: display_error_message($error_message, false); echo Display::return_message($error_message, 'error', false);
} }
$form->display(); $form->display();
?> ?>

@ -12,7 +12,7 @@ api_protect_course_script(true);
// error messages // error messages
if (isset($error)) { if (isset($error)) {
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false); echo Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error', false);
} }
if (!isset($error)) { if (!isset($error)) {

@ -12,7 +12,7 @@ api_protect_course_script(true);
// error messages // error messages
if (isset($error)) { if (isset($error)) {
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false); echo Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error', false);
} }
if (!isset($error)) { if (!isset($error)) {

@ -22,7 +22,7 @@ $courses_without_category = isset($courses_in_category[0]) ? $courses_in_categor
</div> </div>
<?php <?php
if (!empty($message)) { if (!empty($message)) {
Display::display_confirmation_message($message, false); echo Display::return_message($message, 'confirm', false);
} }
// COURSES WITH CATEGORIES // COURSES WITH CATEGORIES

@ -395,7 +395,7 @@ function ldap_get_users() {
} else { } else {
if (count($ldap_query) != 0) if (count($ldap_query) != 0)
Display :: display_error_message(get_lang('LDAPConnectionError')); echo Display::return_message(get_lang('LDAPConnectionError'), 'error');
return array(); return array();
} }
} }
@ -450,7 +450,7 @@ function ldap_get_user_data($from, $number_of_items, $column, $direction) {
$users[] = $user; $users[] = $user;
} }
} else { } else {
Display :: display_error_message(get_lang('NoUser')); echo Display::return_message(get_lang('NoUser'), 'error');
} }
} }
return $users; return $users;

@ -46,7 +46,7 @@ if ($form->validate()) {
header('Location: '.api_get_course_url($course_info['code'], $session_id)); header('Location: '.api_get_course_url($course_info['code'], $session_id));
exit; exit;
} else { } else {
$tpl->assign('error_message', Display::display_error_message(get_lang('CourseRegistrationCodeIncorrect'), true, true)); $tpl->assign('error_message', Display::return_message(get_lang('CourseRegistrationCodeIncorrect'), 'error', true));
} }
} }

@ -35,7 +35,7 @@ class ShibbolethDisplay
$page_title = get_lang('ShibbolethLogin'); $page_title = get_lang('ShibbolethLogin');
Display :: display_header($page_title); Display :: display_header($page_title);
Display :: display_error_message($message); echo Display::return_message($message, 'error');
Display :: display_footer(); Display :: display_footer();
die; die;
} }
@ -47,9 +47,9 @@ class ShibbolethDisplay
{ {
$title = $title ? $title : get_lang('ShibbolethLogin'); $title = $title ? $title : get_lang('ShibbolethLogin');
Display :: display_header($title); Display::display_header($title);
Display :: display_confirmation_message($message); echo Display::return_message($message, 'confirm');
Display :: display_footer(); Display::display_footer();
die; die;
} }

@ -33,7 +33,7 @@ class ShibbolethStatusRequestForm
if ($this->is_submitted() && $this->get_reason() == '') if ($this->is_submitted() && $this->get_reason() == '')
{ {
$reason_is_mandatory = get_lang('ReasonIsMandatory'); $reason_is_mandatory = get_lang('ReasonIsMandatory');
Display::display_error_message($reason_is_mandatory); echo Display::return_message($reason_is_mandatory, 'error');
} }
$status_request_message = get_lang('StatusRequestMessage'); $status_request_message = get_lang('StatusRequestMessage');

@ -329,7 +329,7 @@ if (Security::check_token('post') && (
if ((is_array($arr_course_origin) && count($arr_course_origin) > 0) && !empty($destination_session)) { if ((is_array($arr_course_origin) && count($arr_course_origin) > 0) && !empty($destination_session)) {
//We need only one value //We need only one value
if (count($arr_course_origin) > 1 || count($arr_course_destination) > 1) { if (count($arr_course_origin) > 1 || count($arr_course_destination) > 1) {
Display::display_error_message(get_lang('YouMustSelectACourseFromOriginalSession')); echo Display::return_message(get_lang('YouMustSelectACourseFromOriginalSession'), 'error');
} else { } else {
//first element of the array //first element of the array
$course_code = $arr_course_origin[0]; $course_code = $arr_course_origin[0];
@ -342,10 +342,10 @@ if (Security::check_token('post') && (
$cr->restore($course_destinatination, $destination_session); $cr->restore($course_destinatination, $destination_session);
} }
Display::display_confirmation_message(get_lang('CopyFinished')); echo Display::return_message(get_lang('CopyFinished'), 'confirm');
display_form(); display_form();
} else { } else {
Display::display_error_message(get_lang('YouMustSelectACourseFromOriginalSession')); echo Display::return_message(get_lang('YouMustSelectACourseFromOriginalSession'), 'error');
display_form(); display_form();
} }
} }
@ -400,8 +400,9 @@ if (Security::check_token('post') && (
). ).
get_lang('Back').'</a></div>'; get_lang('Back').'</a></div>';
} else { } else {
Display::display_error_message( echo Display::return_message(
get_lang('You must select a course from original session and select a destination session') get_lang('You must select a course from original session and select a destination session'),
'error'
); );
display_form(); display_form();
} }

@ -69,7 +69,7 @@ if (Security::check_token('post') && (
} }
$zip_file = CourseArchiver::createBackup($course); $zip_file = CourseArchiver::createBackup($course);
Display::display_confirmation_message(get_lang('BackupCreated')); echo Display::return_message(get_lang('BackupCreated'), 'confirm');
echo '<br /><a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.$zip_file.'&'.api_get_cidreq().'"> echo '<br /><a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.$zip_file.'&'.api_get_cidreq().'">
' . get_lang('Download').'</a>'; ' . get_lang('Download').'</a>';

@ -63,7 +63,7 @@ if (Security::check_token('post') && (
} }
$cr = new CourseRecycler($course); $cr = new CourseRecycler($course);
$cr->recycle($recycle_type); $cr->recycle($recycle_type);
Display::display_confirmation_message(get_lang('RecycleFinished')); echo Display::return_message(get_lang('RecycleFinished'), 'confirm');
} elseif (Security::check_token('post') && ( } elseif (Security::check_token('post') && (
isset($_POST['recycle_option']) && isset($_POST['recycle_option']) &&
$_POST['recycle_option'] == 'select_items' $_POST['recycle_option'] == 'select_items'

@ -89,7 +89,7 @@ if (isset($dashboard_view) && $dashboard_view == 'blocks') {
} else { } else {
// block dashboard list // block dashboard list
if (isset($success)) { if (isset($success)) {
Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully')); echo Display::return_message(get_lang('BlocksHaveBeenUpdatedSuccessfully'), 'confirm');
} }
$user_id = api_get_user_id(); $user_id = api_get_user_id();
DashboardManager::display_user_dashboard_list($user_id); DashboardManager::display_user_dashboard_list($user_id);

@ -400,7 +400,7 @@ function downloadMP3_google($filepath, $dir)
null, null,
$current_session_id $current_session_id
); );
Display::display_confirmation_message(get_lang('DocumentCreated')); echo Display::return_message(get_lang('DocumentCreated'), 'confirm');
//return to location //return to location
echo '<script>window.location.href="'.$location.'"</script>'; echo '<script>window.location.href="'.$location.'"</script>';
} }
@ -516,7 +516,7 @@ function downloadMP3_pediaphon($filepath, $dir)
null, null,
$current_session_id $current_session_id
); );
Display::display_confirmation_message(get_lang('DocumentCreated')); echo Display::return_message(get_lang('DocumentCreated'), 'confirm');
//return to location //return to location
echo '<script>window.location.href="'.$location.'"</script>'; echo '<script>window.location.href="'.$location.'"</script>';
} }

@ -166,7 +166,7 @@ if (api_browser_support('svg')) {
echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0" src="'.$svg_url.'"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'; echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0" src="'.$svg_url.'"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>';
echo '</noscript>'; echo '</noscript>';
} else { } else {
Display::display_error_message(get_lang('BrowserDontSupportsSVG')); echo Display::return_message(get_lang('BrowserDontSupportsSVG'), 'error');
} }
Display :: display_footer(); Display :: display_footer();

@ -97,7 +97,7 @@ if (Security::check_abs_path($sys_course_path.$doc_url, $sys_course_path.'/')) {
} }
if (!api_is_allowed_to_edit() && !$is_visible) { if (!api_is_allowed_to_edit() && !$is_visible) {
Display::display_error_message(get_lang('ProtectedDocument')); //api_not_allowed backbutton won't work. echo Display::return_message(get_lang('ProtectedDocument'), 'error'); //api_not_allowed backbutton won't work.
exit; // You shouldn't be here anyway. exit; // You shouldn't be here anyway.
} }
// Launch event // Launch event

@ -162,6 +162,6 @@ if (api_browser_support('svg')) {
echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0\' src="'.$svg_url.'"<noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'; echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0\' src="'.$svg_url.'"<noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>';
echo '</noscript>'; echo '</noscript>';
} else { } else {
Display::display_error_message(get_lang('BrowserDontSupportsSVG')); echo Display::return_message(get_lang('BrowserDontSupportsSVG'), 'error');
} }
Display::display_footer(); Display::display_footer();

@ -24,7 +24,7 @@ if (isset($_GET['recover_id']) && !empty($_GET['recover_id'])) {
$sql = "INSERT INTO $person_tbl VALUES('$course_id', $recover_id, $user_id)"; $sql = "INSERT INTO $person_tbl VALUES('$course_id', $recover_id, $user_id)";
$result = Database::query($sql); $result = Database::query($sql);
if ($result) { if ($result) {
Display::display_confirmation_message(get_lang('Recovered')); echo Display::return_message(get_lang('Recovered'), 'confirm');
} }
} }

@ -186,11 +186,12 @@ if ($is_allowedToEdit) {
} }
} }
} }
Display:: display_confirmation_message( echo Display::return_message(
sprintf( sprintf(
get_lang('XResultsCleaned'), get_lang('XResultsCleaned'),
$quantity_results_deleted $quantity_results_deleted
) ),
'confirm'
); );
} }
} }

@ -46,7 +46,7 @@ Display::display_header($nameTools, get_lang('Exercise'));
if (isset($_GET['message'])) { if (isset($_GET['message'])) {
if (in_array($_GET['message'], array('ExerciseEdited'))) { if (in_array($_GET['message'], array('ExerciseEdited'))) {
$my_message_history = Security::remove_XSS($_GET['message']); $my_message_history = Security::remove_XSS($_GET['message']);
Display::display_confirmation_message(get_lang($my_message_history)); echo Display::return_message(get_lang($my_message_history), 'confirm');
} }
} }

@ -349,7 +349,7 @@ if (($is_allowedToEdit || $is_tutor || api_is_coach()) &&
true, true,
$_GET['delete_before_date'].' 23:59:59' $_GET['delete_before_date'].' 23:59:59'
); );
Display::display_confirmation_message(sprintf(get_lang('XResultsCleaned'), $count)); echo Display::return_message(sprintf(get_lang('XResultsCleaned'), $count), 'confirm');
} }
} }
} }

@ -227,7 +227,7 @@ if (isset($fromExercise) && $fromExercise > 0) {
echo '</div>'; echo '</div>';
if ($displayMessage != "") { if ($displayMessage != "") {
Display::display_confirmation_message($displayMessage); echo Display::return_message($displayMessage, 'confirm');
$displayMessage = ""; $displayMessage = "";
} }

@ -101,9 +101,9 @@ if ($origin != 'learnpath') {
lp_view_id = $lpViewId lp_view_id = $lpViewId
"; ";
Database::query($sql); Database::query($sql);
Display::display_confirmation_message(get_lang('HotPotatoesFinished')); echo Display::return_message(get_lang('HotPotatoesFinished'), 'confirm');
} else { } else {
Display::display_error_message(get_lang('Error')); echo Display::return_message(get_lang('Error'), 'error');
} }
Display::display_footer(); Display::display_footer();

@ -196,7 +196,7 @@ if ($action == 'move' && isset($_GET['post'])) {
Display the action messages Display the action messages
*/ */
if (!empty($message)) { if (!empty($message)) {
Display:: display_confirmation_message(get_lang($message)); echo Display::return_message(get_lang($message), 'confirm');
} }
// show qualifications history // show qualifications history

@ -129,7 +129,7 @@ if ($actions == 'notify' && isset($_GET['content']) && isset($_GET['id'])) {
api_not_allowed(); api_not_allowed();
} }
$return_message = set_notification($_GET['content'], $_GET['id']); $return_message = set_notification($_GET['content'], $_GET['id']);
Display:: display_confirmation_message($return_message, false); echo Display::return_message($return_message, 'confirm', false);
} }
get_whats_new(); get_whats_new();

@ -221,7 +221,7 @@ if (
api_is_allowed_to_session_edit(false, true) api_is_allowed_to_session_edit(false, true)
) { ) {
$return_message = set_notification($_GET['content'], $_GET['id']); $return_message = set_notification($_GET['content'], $_GET['id']);
Display::display_confirmation_message($return_message, false); echo Display::return_message($return_message, 'confirm', false);
} }
// Student list // Student list
@ -344,7 +344,7 @@ if ($origin == 'learnpath') {
/* Display the action messages */ /* Display the action messages */
if (!empty($message)) { if (!empty($message)) {
Display::display_confirmation_message($message); echo Display::return_message($message, 'confirm');
} }
/* Action links */ /* Action links */

@ -138,7 +138,7 @@ if (api_is_allowed_to_edit(false, true)) {
// Notification // Notification
if ($action_forums == 'notify' && isset($_GET['content']) && isset($_GET['id'])) { if ($action_forums == 'notify' && isset($_GET['content']) && isset($_GET['id'])) {
$return_message = set_notification($_GET['content'], $_GET['id']); $return_message = set_notification($_GET['content'], $_GET['id']);
Display::display_confirmation_message($return_message, false); echo Display::return_message($return_message, 'confirm', false);
} }
if ($action_forums != 'add') { if ($action_forums != 'add') {

@ -105,7 +105,7 @@ if ($_GET['action'] == 'move' && isset($_GET['post'])) {
/* Display the action messages */ /* Display the action messages */
if (!empty($message)) { if (!empty($message)) {
Display :: display_confirmation_message(get_lang($message)); echo Display::return_message(get_lang($message), 'confirm');
} }
// In this case the first and only post of the thread is removed. // In this case the first and only post of the thread is removed.

@ -156,7 +156,7 @@ if ($my_action == 'move' && isset($_GET['post'])) {
$my_message = isset($message) ? $message : ''; $my_message = isset($message) ? $message : '';
if ($my_message) { if ($my_message) {
Display::display_confirmation_message(get_lang($my_message)); echo Display::return_message(get_lang($my_message), 'confirm');
} }
if ($my_message != 'PostDeletedSpecial') { if ($my_message != 'PostDeletedSpecial') {

@ -106,11 +106,11 @@ if (((isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') ||
(isset($_GET['selectcat']) && ($_SESSION['studentview'] == 'teacherview'))) (isset($_GET['selectcat']) && ($_SESSION['studentview'] == 'teacherview')))
) { ) {
if (isset ($_GET['scoringupdated'])) { if (isset ($_GET['scoringupdated'])) {
Display::display_confirmation_message(get_lang('ScoringUpdated'), false); echo Display::return_message(get_lang('ScoringUpdated'), 'confirm', false);
} }
if (isset ($_GET['nouniqueranges'])) { if (isset ($_GET['nouniqueranges'])) {
Display::display_error_message(get_lang('NoUniqueScoreRanges'), false); echo Display::return_message(get_lang('NoUniqueScoreRanges'), 'error', false);
} }
$scoreform->display(); $scoreform->display();
} }

@ -42,7 +42,7 @@ $displays = $displayscore->get_custom_score_display_settings();
if (!$displayscore->is_custom() || empty($displays)) { if (!$displayscore->is_custom() || empty($displays)) {
if (api_is_platform_admin() || api_is_course_admin()) { if (api_is_platform_admin() || api_is_course_admin()) {
Display :: display_error_message(get_lang('PleaseEnableScoringSystem'), false); echo Display::return_message(get_lang('PleaseEnableScoringSystem'), 'error', false);
} }
} else { } else {
$allresults = Result::load(null, null, $eval[0]->get_id()); $allresults = Result::load(null, null, $eval[0]->get_id());

@ -78,9 +78,10 @@ Display :: display_header($nameTools, 'Group');
if (isset($_POST['number_of_groups'])) { if (isset($_POST['number_of_groups'])) {
if (!is_numeric($_POST['number_of_groups']) || intval($_POST['number_of_groups']) < 1) { if (!is_numeric($_POST['number_of_groups']) || intval($_POST['number_of_groups']) < 1) {
Display :: display_error_message( echo Display::return_message(
get_lang('PleaseEnterValidNumber').'<br /><br /> get_lang('PleaseEnterValidNumber').'<br /><br />
<a href="group_creation.php?'.api_get_cidreq().'">&laquo; '.get_lang('Back').'</a>', <a href="group_creation.php?'.api_get_cidreq().'">&laquo; '.get_lang('Back').'</a>',
'error',
false false
); );
} else { } else {

@ -222,7 +222,7 @@ switch ($action) {
case 'empty': case 'empty':
if (api_is_allowed_to_edit(false, true)) { if (api_is_allowed_to_edit(false, true)) {
GroupManager:: unsubscribe_all_users($current_group); GroupManager:: unsubscribe_all_users($current_group);
Display :: display_confirmation_message(get_lang('GroupEmptied')); echo Display::return_message(get_lang('GroupEmptied'), 'confirm');
} }
break; break;
} }

@ -119,7 +119,7 @@ switch ($action) {
) )
); );
} }
Display::display_confirmation_message(get_lang('Saved')); echo Display::return_message(get_lang('Saved'), 'confirm');
} }
break; break;
case 'record_audio': case 'record_audio':

@ -1198,7 +1198,7 @@ class AnnouncementManager
if (!filter_extension($new_file_name)) { if (!filter_extension($new_file_name)) {
$return = -1; $return = -1;
Display::display_error_message(get_lang('UplUnableToSaveFileFilteredExtension')); echo Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'error');
} else { } else {
$new_file_name = uniqid(''); $new_file_name = uniqid('');
$new_path = $updir.'/'.$new_file_name; $new_path = $updir.'/'.$new_file_name;
@ -1255,7 +1255,7 @@ class AnnouncementManager
if (!filter_extension($new_file_name)) { if (!filter_extension($new_file_name)) {
$return = -1; $return = -1;
Display::display_error_message(get_lang('UplUnableToSaveFileFilteredExtension')); echo Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'error');
} else { } else {
$new_file_name = uniqid(''); $new_file_name = uniqid('');
$new_path = $updir.'/'.$new_file_name; $new_path = $updir.'/'.$new_file_name;
@ -1273,7 +1273,7 @@ class AnnouncementManager
$result = Database::query($sql); $result = Database::query($sql);
if ($result === false) { if ($result === false) {
$return = -1; $return = -1;
Display::display_error_message(get_lang('UplUnableToSaveFile')); echo Display::return_message(get_lang('UplUnableToSaveFile'), 'error');
} else { } else {
$return = 1; $return = 1;
} }

@ -713,8 +713,9 @@ class TicketManager
$file_name = $file_attach['name']; $file_name = $file_attach['name'];
$table_support_message_attachments = Database::get_main_table(TABLE_TICKET_MESSAGE_ATTACHMENTS); $table_support_message_attachments = Database::get_main_table(TABLE_TICKET_MESSAGE_ATTACHMENTS);
if (!filter_extension($new_file_name)) { if (!filter_extension($new_file_name)) {
Display::display_error_message( echo Display::return_message(
get_lang('UplUnableToSaveFileFilteredExtension') get_lang('UplUnableToSaveFileFilteredExtension'),
'error'
); );
} else { } else {
$new_file_name = uniqid(''); $new_file_name = uniqid('');

@ -14,7 +14,7 @@ use Chamilo\CoreBundle\Entity\ExtraField;
* *
* All public functions static public functions inside a class called Display, * All public functions static public functions inside a class called Display,
* so you use them like this: e.g. * so you use them like this: e.g.
* Display::display_normal_message($message) * Display::return_message($message)
* *
* @package chamilo.library * @package chamilo.library
* *

@ -2940,8 +2940,9 @@ class DocumentManager
// Showing message when sending zip files // Showing message when sending zip files
if ($new_path === true && $unzip == 1) { if ($new_path === true && $unzip == 1) {
if ($show_output) { if ($show_output) {
Display::display_confirmation_message( echo Display::return_message(
get_lang('UplUploadSucceeded').'<br />', get_lang('UplUploadSucceeded').'<br />',
'confirm',
false false
); );
} }

@ -690,10 +690,10 @@ function handle_uploaded_document(
// Display success message to user // Display success message to user
if ($output) { if ($output) {
Display::addFlash( Display::addFlash(
Display::display_confirmation_message( Display::return_message(
get_lang('UplUploadSucceeded').'<br /> '.$documentTitle, get_lang('UplUploadSucceeded').'<br /> '.$documentTitle,
false, 'confirm',
true false
) )
); );
} }
@ -1067,7 +1067,7 @@ function unzip_uploaded_document(
} }
if (!DocumentManager::enough_space($realSize, $maxFilledSpace)) { if (!DocumentManager::enough_space($realSize, $maxFilledSpace)) {
Display::display_error_message(get_lang('UplNotEnoughSpace')); echo Display::return_message(get_lang('UplNotEnoughSpace'), 'error');
return false; return false;
} }

@ -327,7 +327,7 @@ class Link extends Model
$description = trim($_POST['description']); $description = trim($_POST['description']);
if (empty($category_title)) { if (empty($category_title)) {
Display:: display_error_message(get_lang('GiveCategoryName')); echo Display::return_message(get_lang('GiveCategoryName'), 'error');
$ok = false; $ok = false;
} else { } else {
// Looking for the largest order number for this category. // Looking for the largest order number for this category.

@ -586,7 +586,7 @@ class MessageManager
// user's file name // user's file name
$file_name = $file_attach['name']; $file_name = $file_attach['name'];
if (!filter_extension($new_file_name)) { if (!filter_extension($new_file_name)) {
Display:: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension')); echo Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'error');
} else { } else {
$new_file_name = uniqid(''); $new_file_name = uniqid('');
if (!empty($receiver_user_id)) { if (!empty($receiver_user_id)) {

@ -814,9 +814,9 @@ class MySpace
// Displaying a feedback message // Displaying a feedback message
if (!empty($_SESSION['additional_export_fields'])) { if (!empty($_SESSION['additional_export_fields'])) {
Display::display_confirmation_message(get_lang('FollowingFieldsWillAlsoBeExported').': <br /><ul>'.$message.'</ul>', false); echo Display::return_message(get_lang('FollowingFieldsWillAlsoBeExported').': <br /><ul>'.$message.'</ul>', 'confirm', false);
} else { } else {
Display::display_confirmation_message(get_lang('NoAdditionalFieldsWillBeExported'), false); echo Display::return_message(get_lang('NoAdditionalFieldsWillBeExported'), 'confirm', false);
} }
} else { } else {
$form->display(); $form->display();

@ -265,5 +265,5 @@ function display_xapian_error($xapian_error_message) {
$message_error = get_lang('SearchOtherXapianError'); $message_error = get_lang('SearchOtherXapianError');
} }
$display_message = get_lang('Error').' : '.$message_error; $display_message = get_lang('Error').' : '.$message_error;
Display::display_error_message($display_message); echo Display::return_message($display_message, 'error');
} }

@ -50,6 +50,6 @@ if ($_SESSION['oLP']) {
} }
} }
Display::display_error_message(get_lang('ProtectedDocument')); echo Display::return_message(get_lang('ProtectedDocument'), 'error');
//api_not_allowed backbutton won't work. //api_not_allowed backbutton won't work.
exit; exit;

@ -150,7 +150,7 @@ if (isset($_POST['save_audio'])) {
Database::query($sql_insert_audio); Database::query($sql_insert_audio);
} }
} }
//Display::display_confirmation_message(get_lang('ItemUpdated')); //echo Display::return_message(get_lang('ItemUpdated'), 'confirm');
$url = api_get_self().'?action=add_item&type=step&lp_id='.intval($_SESSION['oLP']->lp_id).'&'.api_get_cidreq(); $url = api_get_self().'?action=add_item&type=step&lp_id='.intval($_SESSION['oLP']->lp_id).'&'.api_get_cidreq();
header('Location: '.$url); header('Location: '.$url);
exit; exit;
@ -279,14 +279,14 @@ echo '<div class="col-md-8">';
switch ($_GET['action']) { switch ($_GET['action']) {
case 'edit_item': case 'edit_item':
if (isset($is_success) && $is_success === true) { if (isset($is_success) && $is_success === true) {
Display::display_confirmation_message(get_lang('LearnpathItemEdited')); echo Display::return_message(get_lang('LearnpathItemEdited'), 'confirm');
} else { } else {
echo $_SESSION['oLP']->display_edit_item($_GET['id']); echo $_SESSION['oLP']->display_edit_item($_GET['id']);
} }
break; break;
case 'delete_item': case 'delete_item':
if (isset($is_success) && $is_success === true) { if (isset($is_success) && $is_success === true) {
Display::display_confirmation_message(get_lang('LearnpathItemDeleted')); echo Display::return_message(get_lang('LearnpathItemDeleted'), 'confirm');
} }
break; break;
} }

@ -33,7 +33,7 @@ search_widget_prepare($htmlHeadXtra);
Display::display_header(null, 'Path'); Display::display_header(null, 'Path');
if (api_get_setting('search_enabled') !== 'true') { if (api_get_setting('search_enabled') !== 'true') {
Display::display_error_message(get_lang('SearchFeatureNotEnabledComment')); echo Display::return_message(get_lang('SearchFeatureNotEnabledComment'), 'error');
} else { } else {
if (!empty($_GET['action'])) { if (!empty($_GET['action'])) {
search_widget_show($_GET['action']); search_widget_show($_GET['action']);

@ -250,7 +250,7 @@ class OpenofficeText extends OpenofficeDocument {
// Code for text indexing. // Code for text indexing.
if (api_get_setting('search_enabled') == 'true') { if (api_get_setting('search_enabled') == 'true') {
if (isset($_POST['index_document']) && $_POST['index_document']) { if (isset($_POST['index_document']) && $_POST['index_document']) {
//Display::display_normal_message(print_r($_POST)); //echo Display::return_message(print_r($_POST));
$di = new ChamiloIndexer(); $di = new ChamiloIndexer();
isset($_POST['language']) ? $lang = Database::escape_string($_POST['language']) : $lang = 'english'; isset($_POST['language']) ? $lang = Database::escape_string($_POST['language']) : $lang = 'english';
$di->connectDb(NULL, NULL, $lang); $di->connectDb(NULL, NULL, $lang);

@ -240,7 +240,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
} }
// Code for text indexing. // Code for text indexing.
if (isset($_POST['index_document']) && $_POST['index_document']) { if (isset($_POST['index_document']) && $_POST['index_document']) {
//Display::display_normal_message(print_r($_POST)); //echo Display::return_message(print_r($_POST));
$di = new ChamiloIndexer(); $di = new ChamiloIndexer();
isset($_POST['language']) ? $lang = Database::escape_string($_POST['language']) : $lang = 'english'; isset($_POST['language']) ? $lang = Database::escape_string($_POST['language']) : $lang = 'english';
$di->connectDb(NULL, NULL, $lang); $di->connectDb(NULL, NULL, $lang);

@ -35,7 +35,7 @@ $result_course = Database::query($sql_course);
if (Database::num_rows($result_course) > 0) { if (Database::num_rows($result_course) > 0) {
if (isset($_POST['export'])) { if (isset($_POST['export'])) {
$export_result = export_csv($header, $data, 'test.csv'); // TODO: There is no data for exporting yet. $export_result = export_csv($header, $data, 'test.csv'); // TODO: There is no data for exporting yet.
Display :: display_error_message($export_result); echo Display::return_message($export_result, 'error');
} }
echo '<table class="data_table"><tr><th>'.get_lang('Course').'</th><th>'.get_lang('TempsFrequentation').'</th><th>'.get_lang('Progression').'</th><th>'.get_lang('MoyenneTest').'</th></tr>'; echo '<table class="data_table"><tr><th>'.get_lang('Course').'</th><th>'.get_lang('TempsFrequentation').'</th><th>'.get_lang('Progression').'</th><th>'.get_lang('MoyenneTest').'</th></tr>';
$header = array(get_lang('Course', ''), get_lang('TempsFrequentation', ''), get_lang('Progression', ''), get_lang('MoyenneTest', '')); $header = array(get_lang('Course', ''), get_lang('TempsFrequentation', ''), get_lang('Progression', ''), get_lang('MoyenneTest', ''));

@ -89,7 +89,7 @@ if ($_POST['formSent'] && $_FILES['import_file']['size'] !== 0) {
Display :: display_header($tool_name); Display :: display_header($tool_name);
if ($_FILES['import_file']['size'] == 0 && $_POST) { if ($_FILES['import_file']['size'] == 0 && $_POST) {
Display::display_error_message(get_lang('ThisFieldIsRequired')); echo Display::return_message(get_lang('ThisFieldIsRequired'), 'error');
} }
if (count($errors) != 0) { if (count($errors) != 0) {
@ -100,7 +100,7 @@ if (count($errors) != 0) {
$error_message .= '</li>'; $error_message .= '</li>';
} }
$error_message .= '</ul>'; $error_message .= '</ul>';
Display :: display_error_message($error_message, false); echo Display::return_message($error_message, 'error', false);
} }
$form = new FormValidator('user_import'); $form = new FormValidator('user_import');

@ -5,7 +5,7 @@ Development information
Debugging help: Debugging help:
error_log('info: id = <'. $id .'>'); error_log('info: id = <'. $id .'>');
Display::display_normal_message(print_r($arrLP,1)); echo Display::return_message(print_r($arrLP,1));
DB modifications: DB modifications:
ALTER TABLE lp_item ADD terms TEXT NULL ; ALTER TABLE lp_item ADD terms TEXT NULL ;

@ -13,7 +13,7 @@ if (extension_loaded('xapian')) {
require '../lp/lp_list_search.php'; require '../lp/lp_list_search.php';
} else { } else {
Display::display_header(get_lang('Search')); Display::display_header(get_lang('Search'));
Display::display_error_message(get_lang('SearchXapianModuleNotInstalled')); echo Display::return_message(get_lang('SearchXapianModuleNotInstalled'), 'error');
Display::display_footer(); Display::display_footer();
exit; exit;
} }

@ -160,11 +160,11 @@ if (!empty($_GET['add'])) {
<input type="hidden" name="formSent" value="1"/> <input type="hidden" name="formSent" value="1"/>
<?php <?php
if (!empty($errorMsg)) { if (!empty($errorMsg)) {
Display::display_error_message($errorMsg); //main API echo Display::return_message($errorMsg, 'error'); //main API
} }
if (!empty($OkMsg)) { if (!empty($OkMsg)) {
Display::display_confirmation_message($OkMsg); //main API echo Display::return_message($OkMsg, 'confirm'); //main API
} }
/* /*

@ -218,7 +218,7 @@ if ($form->validate()) {
Display::display_header($tool_name); Display::display_header($tool_name);
if (!empty($return)) { if (!empty($return)) {
Display::display_error_message($return, false); echo Display::return_message($return, 'error', false);
} }
echo '<div class="actions">'; echo '<div class="actions">';

@ -61,7 +61,7 @@ $tool_name = get_lang('AddACategory');
//display the header //display the header
Display::display_header($tool_name); Display::display_header($tool_name);
if (!empty($return)) { if (!empty($return)) {
Display::display_error_message($return, false); echo Display::return_message($return, 'error', false);
} }
?> ?>
<div class="row"> <div class="row">

@ -73,7 +73,7 @@ $thisDay = date('d');
// display the header // display the header
Display::display_header($tool_name); Display::display_header($tool_name);
if (!empty($return)) { if (!empty($return)) {
Display::display_error_message($return, false); echo Display::return_message($return, 'error', false);
} }
?> ?>
<div class="row"> <div class="row">

@ -36,17 +36,17 @@ if (Security::check_token('post')) {
// Copy the survey to the target course // Copy the survey to the target course
SurveyManager::empty_survey($surveyCopyId, $courseId); SurveyManager::empty_survey($surveyCopyId, $courseId);
// Empty the copied survey // Empty the copied survey
Display::display_confirmation_message(get_lang('SurveyCopied')); echo Display::return_message(get_lang('SurveyCopied'), 'confirm');
} }
$surveys = SurveyManager::get_surveys(api_get_course_id(), api_get_session_id()); $surveys = SurveyManager::get_surveys(api_get_course_id(), api_get_session_id());
$courses = CourseManager::get_courses_list(); $courses = CourseManager::get_courses_list();
$form = new FormValidator('copy_survey', 'post', 'copy_survey.php?'.api_get_cidreq()); $form = new FormValidator('copy_survey', 'post', 'copy_survey.php?'.api_get_cidreq());
if (!$surveys) { if (!$surveys) {
Display::display_error_message(get_lang('NoSurveyAvailable')); echo Display::return_message(get_lang('NoSurveyAvailable'), 'error');
} }
if (count($courses) <= 1) { if (count($courses) <= 1) {
Display::display_error_message(get_lang('CourseListNotAvailable')); echo Display::return_message(get_lang('CourseListNotAvailable'), 'error');
} }
if ($surveys && count($courses) > 1) { if ($surveys && count($courses) > 1) {
// Surveys select // Surveys select

@ -579,7 +579,7 @@ if ($survey_data['form_fields'] &&
// Displaying the survey thanks message // Displaying the survey thanks message
if (isset($_POST['finish_survey'])) { if (isset($_POST['finish_survey'])) {
Display::display_confirmation_message(get_lang('SurveyFinished')); echo Display::return_message(get_lang('SurveyFinished'), 'confirm');
echo $survey_data['survey_thanks']; echo $survey_data['survey_thanks'];
SurveyManager::update_survey_answered( SurveyManager::update_survey_answered(

@ -109,7 +109,7 @@ if (api_is_course_admin() ||
// Displaying the survey thanks message // Displaying the survey thanks message
if (isset($_POST['finish_survey'])) { if (isset($_POST['finish_survey'])) {
Display::display_confirmation_message(get_lang('SurveyFinished')); echo Display::return_message(get_lang('SurveyFinished'), 'confirm');
echo $survey_data['survey_thanks']; echo $survey_data['survey_thanks'];
Display :: display_footer(); Display :: display_footer();
exit; exit;
@ -232,7 +232,7 @@ if (api_is_course_admin() ||
} }
$form->display(); $form->display();
} else { } else {
Display :: display_error_message(get_lang('NotAllowed'), false); echo Display::return_message(get_lang('NotAllowed'), 'error', false);
} }
Display :: display_footer(); Display :: display_footer();

@ -99,7 +99,7 @@ $actions .= '</div>';
if (!in_array($_GET['type'], $possible_types)) { if (!in_array($_GET['type'], $possible_types)) {
Display :: display_header($tool_name, 'Survey'); Display :: display_header($tool_name, 'Survey');
echo $actions; echo $actions;
Display :: display_error_message(get_lang('TypeDoesNotExist'), false); echo Display::return_message(get_lang('TypeDoesNotExist'), 'error', false);
Display :: display_footer(); Display :: display_footer();
} }

@ -13,11 +13,11 @@ $rs_id = intval($_POST['rs_id']);
api_protect_course_script(); api_protect_course_script();
if (!api_is_allowed_to_edit()) { if (!api_is_allowed_to_edit()) {
Display::display_error_message(get_lang("DeniedAccess")); echo Display::return_message(get_lang("DeniedAccess"), 'error');
} else { } else {
$sql = "UPDATE ".Database::get_main_table('rp_reporte_semanas')." $sql = "UPDATE ".Database::get_main_table('rp_reporte_semanas')."
SET work_id = '$work_id', forum_id = '$forum_id' SET work_id = '$work_id', forum_id = '$forum_id'
WHERE id ='$rs_id'"; WHERE id ='$rs_id'";
Database::query($sql); Database::query($sql);
Display::display_confirmation_message(get_lang('Updated')); echo Display::return_message(get_lang('Updated'), 'confirm');
} }

@ -122,13 +122,13 @@ if (!empty($message)) {
$userMessage .= implode(', ', $user)."<br />"; $userMessage .= implode(', ', $user)."<br />";
} }
if ($type == 'confirmation') { if ($type == 'confirmation') {
Display::display_confirmation_message($message.': <br />'.$userMessage, false); echo Display::return_message($message.': <br />'.$userMessage, 'confirm', false);
} else { } else {
echo Display::return_message($message.': <br />'.$userMessage, 'warning', false); echo Display::return_message($message.': <br />'.$userMessage, 'warning', false);
} }
} else { } else {
$empty_line_msg = ($empty_line == 0) ? get_lang('ErrorsWhenImportingFile') : get_lang('ErrorsWhenImportingFile').': '.get_lang('EmptyHeaderLine'); $empty_line_msg = ($empty_line == 0) ? get_lang('ErrorsWhenImportingFile') : get_lang('ErrorsWhenImportingFile').': '.get_lang('EmptyHeaderLine');
Display::display_error_message($empty_line_msg); echo Display::return_message($empty_line_msg, 'error');
} }
} }

Loading…
Cancel
Save