function tmgmt_ui_write_request_messages in Translation Management Tool 7
Print all messages that occurred since our request to the screen.
Parameters
$job: The translation job for which the message should be written.
Return value
FALSE if there are message with severity error, TRUE otherwise.
4 calls to tmgmt_ui_write_request_messages()
- tmgmt_local_translation_form_update_state_ajax in translators/
tmgmt_local/ includes/ tmgmt_local.pages.inc - Ajax callback for the job item review form.
- tmgmt_ui_job_request_translation in ui/
tmgmt_ui.module - Requests translations for a job and prints messages which have happened since then.
- tmgmt_ui_translation_review_form_ajax in ui/
tmgmt_ui.module - Ajax callback for the job item review form.
- tmgmt_ui_translation_review_form_update_state in ui/
tmgmt_ui.module - Callback for the action at the job item review form.
File
- ui/
tmgmt_ui.module, line 543 - Common Translation managment UI.
Code
function tmgmt_ui_write_request_messages(TMGMTJob $job) {
$errors = FALSE;
foreach ($job
->getMessagesSince() as $message) {
// Ignore debug messages.
if ($message->type == 'debug') {
continue;
}
if ($message->type == 'error') {
$errors = TRUE;
}
if ($text = $message
->getMessage()) {
drupal_set_message(filter_xss($text), $message->type);
}
}
return !$errors;
}