From 897444d761398226b5340819e2b2a780dbfabbe6 Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Tue, 17 May 2016 08:22:15 +0800 Subject: [PATCH] MDL-53923 mod_assign: Put messages into notifications. The unoconv test page was before just outputting text to page. Now it is wrapped in a nice notification. One of the warnings has been improved as well. --- lang/en/admin.php | 2 +- .../editpdf/lang/en/assignfeedback_editpdf.php | 10 +++++----- mod/assign/feedback/editpdf/testunoconv.php | 7 +++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lang/en/admin.php b/lang/en/admin.php index 4ffb7054d8c..7ad5c344fa8 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -1073,7 +1073,7 @@ $string['unbookmarkthispage'] = 'Unbookmark this page'; $string['unicoderequired'] = 'It is required that you store all your data in Unicode format (UTF-8). New installations must be performed into databases that have their default character set as Unicode. If you are upgrading, you should perform the UTF-8 migration process (see the Admin page).'; $string['uninstallplugin'] = 'Uninstall'; $string['unlockaccount'] = 'Unlock account'; -$string['unoconvwarning'] = 'The installed version of your unoconv is not supported, the required version to support assignment grading features is 0.7.'; +$string['unoconvwarning'] = 'The version of unoconv you have installed is not supported. Moodle\'s assignment grading feature requires version 0.7 or higher.'; $string['unsettheme'] = 'Unset theme'; $string['unsupported'] = 'Unsupported'; $string['unsupporteddbstorageengine'] = 'The database storage engine being used is no longer supported.'; diff --git a/mod/assign/feedback/editpdf/lang/en/assignfeedback_editpdf.php b/mod/assign/feedback/editpdf/lang/en/assignfeedback_editpdf.php index 5f0db7e2b7e..83646dd5c09 100644 --- a/mod/assign/feedback/editpdf/lang/en/assignfeedback_editpdf.php +++ b/mod/assign/feedback/editpdf/lang/en/assignfeedback_editpdf.php @@ -88,12 +88,12 @@ $string['test_doesnotexist'] = 'The ghostscript path points to a non-existent fi $string['test_empty'] = 'The ghostscript path is empty - please enter the correct path'; $string['test_unoconv'] = 'Test unoconv path'; $string['test_unoconvdoesnotexist'] = 'The unoconv path does not point to the unoconv program. Please review your path settings.'; -$string['test_unoconvdownload'] = 'Download converted pdf test file.'; +$string['test_unoconvdownload'] = 'Download the converted pdf test file.'; $string['test_unoconvisdir'] = 'The unoconv path points to a folder, please include the unoconv program in the path you specify'; -$string['test_unoconvnotestfile'] = 'The test DOC is missing'; -$string['test_unoconvnotexecutable'] = 'The unoconv points to a file that is not executable'; -$string['test_unoconvok'] = 'The unoconv path appears to properly configured.'; -$string['test_unoconvversionnotsupported'] = 'The minimum supported version for unoconv is 0.7'; +$string['test_unoconvnotestfile'] = 'The test document to be coverted into a PDF is missing'; +$string['test_unoconvnotexecutable'] = 'The unoconv path points to a file that is not executable'; +$string['test_unoconvok'] = 'The unoconv path appears to be properly configured.'; +$string['test_unoconvversionnotsupported'] = 'The version of unoconv you have installed is not supported. Moodle\'s assignment grading feature requires version 0.7 or higher.'; $string['toolbarbutton'] = '{$a->tool} {$a->shortcut}'; $string['tool'] = 'Tool'; $string['viewfeedbackonline'] = 'View annotated PDF...'; diff --git a/mod/assign/feedback/editpdf/testunoconv.php b/mod/assign/feedback/editpdf/testunoconv.php index c3d4d4c0793..78a3ffabee7 100644 --- a/mod/assign/feedback/editpdf/testunoconv.php +++ b/mod/assign/feedback/editpdf/testunoconv.php @@ -51,19 +51,18 @@ if ($sendpdf) { $result = file_storage::test_unoconv_path(); switch ($result->status) { case file_storage::UNOCONVPATH_OK: - $msg = get_string('test_unoconvok', 'assignfeedback_editpdf'); - $msg .= html_writer::empty_tag('br'); + $msg = $OUTPUT->notification(get_string('test_unoconvok', 'assignfeedback_editpdf'), 'success'); $pdflink = new moodle_url($PAGE->url, array('sendpdf' => 1, 'sesskey' => sesskey())); $msg .= html_writer::link($pdflink, get_string('test_unoconvdownload', 'assignfeedback_editpdf')); $msg .= html_writer::empty_tag('br'); break; case file_storage::UNOCONVPATH_ERROR: - $msg = $result->message; + $msg = $OUTPUT->notification($result->message, 'warning'); break; default: - $msg = get_string("test_unoconv{$result->status}", 'assignfeedback_editpdf'); + $msg = $OUTPUT->notification(get_string("test_unoconv{$result->status}", 'assignfeedback_editpdf'), 'warning'); break; } $returl = new moodle_url('/admin/settings.php', array('section' => 'assignfeedback_editpdf'));