You are here

function feedback_format_message in Feedback 5.2

Same name and namespace in other branches
  1. 6.2 feedback.module \feedback_format_message()

Format a feedback entry.

Parameters

$entry: A feedback object.

2 calls to feedback_format_message()
feedback_admin_view_form in ./feedback.module
Build a (sortable) form containing a checkbox for each feedback entry.
feedback_form in ./feedback.module
Form builder function for a user feedback form.

File

./feedback.module, line 147
Allows site visitors and users to report issues about this site.

Code

function feedback_format_message($entry) {
  $message = check_plain($entry->message);
  if (!empty($entry->useragent)) {
    if (module_exists('browscap')) {
      $browserinfo = browscap_get_browser($entry->useragent);
      $browser = $browserinfo['parent'] ? $browserinfo['parent'] . ' / ' . $browserinfo['platform'] : $browserinfo['useragent'];
      $message .= '<div class="browserinfo">(' . check_plain($browser) . ')</div>';
    }
    else {
      $message .= '<div class="browserinfo">(' . check_plain($entry->useragent) . ')</div>';
    }
  }
  return $message;
}