You are here

function theme_security_review_check_help in Security Review 6

Same name and namespace in other branches
  1. 7 security_review.pages.inc \theme_security_review_check_help()

Theme function for help on a security check.

Calling function should filter and sanitize.

1 theme call to theme_security_review_check_help()
security_review_check_help in ./security_review.module
Page callback provides general help and check specific help documentation.

File

./security_review.module, line 215
Site security review and reporting Drupal module.

Code

function theme_security_review_check_help($element) {
  $output = "<h3>" . $element['title'] . "</h3>\n";
  foreach ($element['descriptions'] as $description) {
    $output .= "<p>" . $description . "</p>\n";
  }
  if (!empty($element['findings'])) {
    foreach ($element['findings']['descriptions'] as $description) {
      $output .= "<p>" . $description . "</p>\n";
    }
    if (!empty($element['findings']['items'])) {
      $items = $element['findings']['items'];
      $output .= "<ul>\n";

      // Loop through items outputting the best value HTML, safe, or raw if thats all there is.
      foreach ($items as $item) {
        if (is_array($item)) {
          if (isset($item['html'])) {
            $data = $item['html'];
          }
          elseif (isset($item['safe'])) {
            $data = $item['safe'];
          }
          else {
            $data = $item['raw'];
          }
        }
        else {
          $data = $item;
        }
        $output .= "<li>" . $data . "</li>\n";
      }
      $output .= "</ul>\n";
    }
    if (!empty($element['findings']['pager'])) {
      $output .= $element['findings']['pager'];
    }
  }
  return $output;
}