$statusMessages = array();
$statusType = 'alert';
foreach ($messages as $message) {
+ if (!$message->isVisible()) {
+ continue;
+ }
if ($filter === TRUE || $message->getSeverity() >= 3) {
$statusType = $message->getSeverity() >= 4 ? 'error' : $statusType;
$statusMessage = $message->getMessage();
}
/**
- * Run some sanity checks.
+ * Run all system checks.
*
- * This could become a hook so that CiviCRM can run both built-in
- * configuration & sanity checks, and modules/extensions can add
- * their own checks.
+ * This functon is wrapped by the System.check api.
*
- * We might even expose the results of these checks on the Wordpress
- * plugin status page or the Drupal admin/reports/status path.
+ * Calls hook_civicrm_check() for extensions to add or modify messages.
+ * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_check
*
* @param bool $max
* Whether to return just the maximum non-hushed severity
*
* @return array
- * Array of messages
- * @link https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_requirements
+ * Array of CRM_Utils_Check_Message objects
*/
public static function checkAll($max = FALSE) {
$checks = array();
foreach ($messages as $key => $message) {
$hush = self::checkHushSnooze($message);
- $message->setVisible(!$hush);
+ $messages[$key]->setVisible(!$hush);
}
uasort($messages, array(__CLASS__, 'severitySort'));
/**
* Evaluate if a system check should be hushed/snoozed.
*
- * @param string $message
+ * @param CRM_Utils_Check_Message $message
+ * The message to evaluate.
*
* @return bool
* TRUE means hush/snooze, FALSE means display.