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.
This commit is contained in:
Adrian Greeve 2016-05-17 08:22:15 +08:00 committed by David Monllao
parent 13708875d3
commit 897444d761
3 changed files with 9 additions and 10 deletions

View File

@ -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.';

View File

@ -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...';

View File

@ -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'));