function IIRS_0_set_message($mess_no, $message, $message_detail = null, $level = IIRS_MESSAGE_USER_INFORMATION, $_user_action = null, $_args = null) { // global $IIRS_widget_mode requires that the message is included in the HTML output // because the user is viewing the message through HTML transported in the widget on a *different* website // normal message display, that is through a plugin / module on *this* website can use the host framework function // e.g. Drupal uses drupal_set_message() which *indirectly* queues the message for display (once) $class = IIRS_0_message_class($level); IIRS_0_print_HTML("<div class=\"IIRS_0_message IIRS_0_message_{$mess_no} IIRS_0_message_level_{$class}\">" . IIRS_0_escape_for_HTML_text($message) . '</div>'); }
function IIRS_0_message_html($mess_no, $message, $message_detail = null, $level = IIRS_MESSAGE_USER_INFORMATION, $user_action = null, $args = null) { // SECURITY: $message is text, NOT HTML. it will be pushed through IIRS_0_escape_for_HTML_text() // SECURITY: $message_detail is text. SHOULD NOT be dynamic. it will be translated // the caller should NOT escape the input // IIRS_0_message_html() output should be pushed through IIRS_0_print_HTML() // $message is also NOT translated. the caller must use the translation functions // this is because the message may comprise of several separately translated parts $class = IIRS_0_message_class($level); $html = "<div class=\"IIRS_0_message IIRS_Error IIRS_Error_{$mess_no} IIRS_0_message_level_{$class}\">"; if ($user_action) { $html .= '<a class="IIRS_0_user_action" href="' . $user_action . '">' . IIRS_0_translation('continue') . '</a>'; } if ($message) { $html .= '<div class="IIRS_friendly_err_message">' . IIRS_0_escape_for_HTML_text($message) . '</div>'; } $html .= '<div class="IIRS_message_detail">'; $html .= IIRS_0_translation($message_detail); if ($args) { $html .= '<ul>'; foreach ($args as $key => $value) { $html .= "<li>{$key} = {$value}</li>"; } $html .= '</ul>'; } $html .= '</div>'; $html .= '</div>'; return $html; }