Minor - Replace deprecated display_warning_message() by return_message(..., 'warning')

pull/2487/head
Yannick Warnier 8 years ago
parent 9380ce852d
commit 95dcb23620
  1. 2
      main/admin/legal_list.php
  2. 2
      main/admin/sub_language.php
  3. 3
      main/attendance/attendance_sheet.php
  4. 2
      main/coursecopy/recycle_course.php
  5. 2
      main/document/document.php
  6. 4
      main/document/slideshow.php
  7. 3
      main/exercise/exercise_result.php
  8. 2
      main/exercise/question_list_admin.inc.php
  9. 2
      main/gradebook/gradebook_add_user.php
  10. 2
      main/gradebook/gradebook_display_summary.php
  11. 2
      main/gradebook/gradebook_edit_all.php
  12. 5
      main/gradebook/gradebook_view_result.php
  13. 4
      main/gradebook/lib/fe/gradebooktable.class.php
  14. 2
      main/gradebook/lib/flatview_data_generator.class.php
  15. 2
      main/help/faq.php
  16. 5
      main/inc/lib/exercise.lib.php
  17. 2
      main/inc/lib/image.lib.php
  18. 2
      main/inc/lib/javascript/svgedit/extensions/imagelib/groups.php
  19. 2
      main/inc/lib/javascript/svgedit/extensions/imagelib/index.php
  20. 2
      main/inc/lib/javascript/svgedit/extensions/imagelib/users.php
  21. 2
      main/inc/lib/svg-edit/extensions/imagelib/groups.php
  22. 2
      main/inc/lib/svg-edit/extensions/imagelib/index.php
  23. 2
      main/inc/lib/svg-edit/extensions/imagelib/users.php
  24. 3
      main/install/index.php
  25. 4
      main/lp/lp_final_item.php
  26. 2
      main/mySpace/access_details.php
  27. 2
      main/session/add_many_session_to_category.php
  28. 2
      main/survey/survey_invite.php
  29. 2
      main/tracking/courseLog.php
  30. 2
      main/user/user_import.php
  31. 2
      main/work/add_user.php
  32. 2
      main/work/edit.php
  33. 6
      main/work/upload.php
  34. 2
      main/work/upload_from_template.php
  35. 7
      main/work/work.lib.php
  36. 2
      plugin/rss/index.php

@ -26,7 +26,7 @@ $legal_count = LegalManager::count();
$languages = api_get_languages();
$available_languages = count($languages['folder']);
if ($legal_count != $available_languages) {
Display::display_warning_message(get_lang('YouShouldCreateTermAndConditionsForAllAvailableLanguages'));
echo Display::return_message(get_lang('YouShouldCreateTermAndConditionsForAllAvailableLanguages'), 'warning');
}
$table = new SortableTable('conditions', 'count_mask', 'get_legal_data_mask', 2);

@ -115,7 +115,7 @@ $html .= '</div>';
echo $html;
echo '<br /><br /><br />';
if (!empty($sublanguage_folder_error)) {
Display::display_warning_message($sublanguage_folder_error);
echo Display::return_message($sublanguage_folder_error, 'warning');
}
echo '<div id="div_message_information_id">&nbsp;</div>';

@ -407,9 +407,10 @@ if (api_is_allowed_to_edit(null, true) ||
</form>
<?php
} else {
echo Display::display_warning_message(
echo Display::return_message(
'<a href="'.api_get_path(WEB_CODE_PATH).'user/user.php?'.api_get_cidreq().'">'.
get_lang('ThereAreNoRegisteredLearnersInsidetheCourse').'</a>',
'warning',
false
);
}

@ -83,7 +83,7 @@ if (Security::check_token('post') && (
if (!$course->has_resources()) {
echo get_lang('NoResourcesToRecycle');
} else {
Display::display_warning_message(get_lang('RecycleWarning'), false);
echo Display::return_message(get_lang('RecycleWarning'), 'warning', false);
$form = new FormValidator('recycle_course', 'post', api_get_self().'?'.api_get_cidreq());
$form->addElement('header', get_lang('SelectOptionForBackup'));
$form->addElement('radio', 'recycle_option', null, get_lang('FullRecycle'), 'full_backup');

@ -2119,7 +2119,7 @@ if (count($documentAndFolders) > 1) {
}
}
if (!empty($table_footer)) {
Display::display_warning_message($table_footer);
echo Display::return_message($table_footer, 'warning');
}
echo '

@ -497,11 +497,11 @@ if ($slide_id != 'all' && !empty($image_files_only)) {
echo '</ul>';
}
} else {
Display::display_warning_message(get_lang('FileNotFound'));
echo Display::return_message(get_lang('FileNotFound'), 'warning');
}
} else {
if ($slide_id != 'all') {
Display::display_warning_message(get_lang('NoDataAvailable'));
echo Display::return_message(get_lang('NoDataAvailable'), 'warning');
}
}

@ -136,8 +136,9 @@ if ($objExercise->selectAttempts() > 0) {
$learnpath_item_view_id
);
if ($attempt_count >= $objExercise->selectAttempts()) {
Display :: display_warning_message(
echo Display::return_message(
sprintf(get_lang('ReachedMaxAttempts'), $objExercise->selectTitle(), $objExercise->selectAttempts()),
'warning',
false
);
if ($origin != 'learnpath') {

@ -311,7 +311,7 @@ if (!$inATest) {
}
if (!$nbrQuestions) {
echo Display::display_warning_message(get_lang('NoQuestion'));
echo Display::return_message(get_lang('NoQuestion'), 'warning');
}
echo '</div>'; //question list div
}

@ -72,7 +72,7 @@ $interbreadcrumb[] = array(
);
Display :: display_header(get_lang('AddUserToEval'));
if (isset ($_GET['erroroneuser'])) {
Display :: display_warning_message(get_lang('AtLeastOneUser'), false);
echo Display::return_message(get_lang('AtLeastOneUser'), 'warning', false);
}
DisplayGradebook :: display_header_result($evaluation[0], null, 0, 0);
echo '<div class="main">';

@ -130,7 +130,7 @@ if (count($userList) > 0) {
echo '</div>';
if (count($userList) == 0) {
echo Display::display_warning_message(get_lang('NoResultsAvailable'));
echo Display::return_message(get_lang('NoResultsAvailable'), 'warning');
} else {
echo '<br /><br /><table class="data_table">';
foreach ($userList as $index => $value) {

@ -276,7 +276,7 @@ $formNormal->addHeader(get_lang('EditWeight'));
$formNormal->display();
$warning_message = sprintf(get_lang('TotalWeightMustBeX'), $original_total);
Display::display_warning_message($warning_message, false);
echo Display::return_message($warning_message, 'warning', false);
?>
<form method="post"

@ -497,8 +497,9 @@ if (isset($_GET['overwritemax'])) {
if (isset($_GET['import_user_error'])) {
$userinfo = api_get_user_info($_GET['import_user_error']);
Display:: display_warning_message(
get_lang('UserInfoDoesNotMatch').' '.api_get_person_name($userinfo['firstname'], $userinfo['lastname'])
echo Display::return_message(
get_lang('UserInfoDoesNotMatch').' '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']),
'warning'
);
}
if (isset($_GET['import_score_error'])) {

@ -716,7 +716,7 @@ class GradebookTable extends SortableTable
$modify_icons = '<a href="gradebook_edit_cat.php?editcat='.$id_cat.'&cidReq='.$course_code.'&id_session='.api_get_session_id().'">'.
Display::return_icon('edit.png', $warning_message, array(), ICON_SIZE_SMALL).'</a>';
$warning_message .= $modify_icons;
Display::display_warning_message($warning_message, false);
echo Display::return_message($warning_message, 'warning', false);
}
$content_html = DocumentManager::replace_user_info_into_html(
@ -773,7 +773,7 @@ class GradebookTable extends SortableTable
}
if (!empty($warning_message)) {
Display::display_warning_message($warning_message, false);
echo Display::return_message($warning_message, 'warning', false);
}
}
}

@ -889,7 +889,7 @@ class FlatViewDataGenerator
$total_score = array($item_value, $item_total);
$score_final = ($item_value / $item_total) * 100;
if ($displayWarning) {
Display::display_warning_message($total_score[1]);
echo Display::return_message($total_score[1], 'warning');
}
$row[] = array($score_final, trim($scoredisplay->display_score($total_score, SCORE_CUSTOM, null, true)));
}

@ -40,7 +40,7 @@ if (!empty($_GET['edit']) && $_GET['edit'] == 'true' && api_is_platform_admin())
fwrite($fp, $content);
fclose($fp);
} else {
Display::display_warning_message(get_lang('WarningFaqFileNonWriteable'));
echo Display::return_message(get_lang('WarningFaqFileNonWriteable'), 'warning');
}
echo $content;
} else {

@ -1162,8 +1162,9 @@ HTML;
);
if (!$images_folder_visibility) {
//This message is shown only to the course/platform admin if the image is set to visibility = false
Display::display_warning_message(
get_lang('ChangeTheVisibilityOfTheCurrentImage')
echo Display::return_message(
get_lang('ChangeTheVisibilityOfTheCurrentImage'),
'warning'
);
}
}

@ -24,7 +24,7 @@ class Image
if (class_exists('Imagick')) {
$this->image_wrapper = new ImagickWrapper($path);
} else {
Display::display_warning_message('Class Imagick not found');
echo Display::return_message('Class Imagick not found', 'warning');
exit;
}
}

@ -91,7 +91,7 @@ if ((
echo '</ul>';
}
} else {
echo Display::display_warning_message(get_lang('OnlyAccessFromYourGroup'));
echo Display::return_message(get_lang('OnlyAccessFromYourGroup'), 'warning');
}
?>
</body>

@ -79,7 +79,7 @@ if (!empty($png_svg_files)) {
}
echo '</ul>';
} else {
Display::display_warning_message(get_lang('NoSVGImagesInImagesGalleryPath'));
echo Display::return_message(get_lang('NoSVGImagesInImagesGalleryPath'), 'warning');
}
?>
</body>

@ -63,7 +63,7 @@ if (!empty($png_svg_files)) {
}
echo '</ul>';
} else {
Display::display_warning_message(get_lang('NoSVGImages'));
echo Display::return_message(get_lang('NoSVGImages'), 'warning');
}
?>
</body>

@ -93,7 +93,7 @@ if ((
echo '</ul>';
}
} else {
echo Display::display_warning_message(get_lang('OnlyAccessFromYourGroup'));
echo Display::return_message(get_lang('OnlyAccessFromYourGroup'), 'warning');
}
?>
</body>

@ -80,7 +80,7 @@ if (!empty($png_svg_files)) {
}
echo '</ul>';
} else {
Display::display_warning_message(get_lang('NoSVGImagesInImagesGalleryPath'));
echo Display::return_message(get_lang('NoSVGImagesInImagesGalleryPath'), 'warning');
}
?>
</body>

@ -63,7 +63,7 @@ if (!empty($png_svg_files)) {
}
echo '</ul>';
} else {
Display::display_warning_message(get_lang('NoSVGImages'));
echo Display::return_message(get_lang('NoSVGImages'), 'warning');
}
?>
</body>

@ -609,10 +609,11 @@ if (@$_POST['step2']) {
<?php echo get_lang('ChamiloURL').' : '.$urlForm; ?><br /><br />
<?php
if ($installType == 'new') {
echo Display::display_warning_message(
echo Display::return_message(
'<h4 style="text-align: center">'.get_lang(
'Warning'
).'</h4>'.get_lang('TheInstallScriptWillEraseAllTables'),
'warning',
false
);
}

@ -92,7 +92,7 @@ unset($currentItem);
// If for some reason we consider the requirements haven't been completed yet,
// show a prerequisites warning
if ($accessGranted == false) {
Display::display_warning_message(get_lang('LearnpathPrereqNotCompleted'));
echo Display::return_message(get_lang('LearnpathPrereqNotCompleted'), 'warning');
$finalItemTemplate = '';
} else {
$catLoad = Category::load(null, null, $courseCode, null, null, $sessionId, 'ORDER By id');
@ -141,7 +141,7 @@ if ($accessGranted == false) {
$finalItemTemplate = generateLPFinalItemTemplate($id, $courseCode, $sessionId, $downloadCertificateLink, $badgeLink);
if (!$finalItemTemplate) {
Display::display_warning_message(get_lang('FileNotFound'));
echo Display::return_message(get_lang('FileNotFound'), 'warning');
}
}
}

@ -151,7 +151,7 @@ $form->display();
$foo_stats .= '<strong>'.get_lang('Quantity').' : </strong>'.$rst['times'].'<br />';
echo $foo_stats;
} else {
echo Display::display_warning_message(get_lang('NoDataAvailable'));
echo Display::return_message(get_lang('NoDataAvailable'), 'warning');
}
?>
</div>

@ -136,7 +136,7 @@ if ((isset($_POST['CategorySessionId']) && $_POST['formSent'] == 0) || isset($_G
$rows_session_category = SessionManager::get_all_session_category();
if (empty($rows_session_category)) {
Display::display_warning_message(get_lang('YouNeedToAddASessionCategoryFirst'));
echo Display::return_message(get_lang('YouNeedToAddASessionCategoryFirst'), 'warning');
Display::display_footer();
exit;
}

@ -74,7 +74,7 @@ $sql = "SELECT * FROM $table_survey
WHERE c_id = $course_id AND code='".Database::escape_string($survey_data['code'])."'";
$result = Database::query($sql);
if (Database::num_rows($result) > 1) {
Display::display_warning_message(get_lang('IdenticalSurveycodeWarning'));
echo Display::return_message(get_lang('IdenticalSurveycodeWarning'), 'warning');
}
// Invited / answered message

@ -489,7 +489,7 @@ if (count($a_students) > 0) {
$html .= $table->return_table();
$html .= "</div>";
} else {
$html .= Display::display_warning_message(get_lang('NoUsersInCourse'), true, true);
$html .= Display::return_message(get_lang('NoUsersInCourse'), 'warning', true);
}
echo Display::panel($html, $titleSession);
// Send the csv file if asked.

@ -124,7 +124,7 @@ if (!empty($message)) {
if ($type == 'confirmation') {
Display::display_confirmation_message($message.': <br />'.$userMessage, false);
} else {
Display::display_warning_message($message.': <br />'.$userMessage, false);
echo Display::return_message($message.': <br />'.$userMessage, 'warning', false);
}
} else {
$empty_line_msg = ($empty_line == 0) ? get_lang('ErrorsWhenImportingFile') : get_lang('ErrorsWhenImportingFile').': '.get_lang('EmptyHeaderLine');

@ -111,7 +111,7 @@ if (!empty($userToAddList)) {
}
echo '</ul>';
} else {
Display::display_warning_message(get_lang('NoUsersToAdd'));
echo Display::return_message(get_lang('NoUsersToAdd'), 'warning');
}
echo '<hr /><div class="clear"></div>';

@ -304,7 +304,7 @@ $content = null;
if (!empty($work_id)) {
if ($is_allowed_to_edit) {
if (api_resource_is_locked_by_gradebook($work_id, LINK_STUDENTPUBLICATION)) {
echo Display::display_warning_message(get_lang('ResourceLockedByGradebook'));
echo Display::return_message(get_lang('ResourceLockedByGradebook'), 'warning');
} else {
$content .= $form->returnForm();
}

@ -53,9 +53,9 @@ if (!empty($workInfo) && !empty($workInfo['qualification'])) {
if ($count >= 1) {
Display::display_header();
if (api_get_course_setting('student_delete_own_publication') == '1') {
Display::display_warning_message(get_lang('CantUploadDeleteYourPaperFirst'));
echo Display::return_message(get_lang('CantUploadDeleteYourPaperFirst'), 'warning');
} else {
Display::display_warning_message(get_lang('YouAlreadySentAPaperYouCantUpload'));
echo Display::return_message(get_lang('YouAlreadySentAPaperYouCantUpload'), 'warning');
}
Display::display_footer();
exit;
@ -146,7 +146,7 @@ if (!empty($work_id)) {
echo $validationStatus['message'];
if ($is_allowed_to_edit) {
if (api_resource_is_locked_by_gradebook($work_id, LINK_STUDENTPUBLICATION)) {
echo Display::display_warning_message(get_lang('ResourceLockedByGradebook'));
echo Display::return_message(get_lang('ResourceLockedByGradebook'), 'warning');
} else {
echo $tabs;
}

@ -121,7 +121,7 @@ if (!empty($work_id)) {
echo $validationStatus['message'];
if ($is_allowed_to_edit) {
if (api_resource_is_locked_by_gradebook($work_id, LINK_STUDENTPUBLICATION)) {
echo Display::display_warning_message(get_lang('ResourceLockedByGradebook'));
echo Display::return_message(get_lang('ResourceLockedByGradebook'), 'warning');
} else {
$form->display();
}

@ -292,8 +292,9 @@ function getWorkList($id, $my_folder_data, $add_in_where_query = null, $course_i
if ($workInGradeBookLinkId) {
if ($is_allowed_to_edit) {
if (intval($my_folder_data['qualification']) == 0) {
Display::display_warning_message(
get_lang('MaxWeightNeedToBeProvided')
echo Display::return_message(
get_lang('MaxWeightNeedToBeProvided'),
'warning'
);
}
}
@ -758,7 +759,7 @@ function deleteDirWork($id)
$locked = api_resource_is_locked_by_gradebook($id, LINK_STUDENTPUBLICATION);
if ($locked == true) {
Display::display_warning_message(get_lang('ResourceLockedByGradebook'));
echo Display::return_message(get_lang('ResourceLockedByGradebook'), 'warning');
return false;
}

@ -12,7 +12,7 @@ $css = $css ? "<style type=\"text/css\" scoped=\"scoped\">$css</style>" : '';
$bullet = api_get_path(WEB_PLUGIN_PATH).'rss/resources/arrow-bullet.png';
if (empty($rss)) {
Display::display_warning_message(get_lang('NoRSSItem'));
echo Display::return_message(get_lang('NoRSSItem'), 'warning');
return;
}

Loading…
Cancel
Save