function hook_status

Reports status information which each module is aware of, visible on admin/config/status.

This allows modules to let the user know about requirements which are not being met, or simply to let them know that someting is working successfully.

For example, you may want to let the user know that a nightly job failed to run the night before.

3 functions implement hook_status()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

Course::assign_display_status in classes/Course.php
This will assign the $this->display_status string based on the grade the student has made on the course. The display_status is used by other display functions to decide what color the course should show up as.
system_status in modules/system/system.module
Implementation of hook_status Expected return is array( "severity" => "normal" or "warning" or "alert", "status" => "A message to display to the user.", );
update_status_status in modules/update_status/update_status.module
Implementation of hook_status.

File

includes/hook.api.php, line 313
Lists all available hooks within FlightPath's core code.

Code

function hook_status() {
  // Example from system.module, reporting on if Cron has run recently:
  $rtn = array();
  $rtn ["severity"] = "normal";
  // Check on the last time cron was run; make sure it's working properly.
  $last_run = variable_get("cron_last_run", 0);

  if ($last_run < strtotime("-2 DAY")) {
    $rtn ["severity"] = "alert";
    $rtn ["status"] .= t("Cron hasn't run in over 2 days.  For your installation of FlightPath
               to function properly, cron.php must be accessed routinely. At least once per day is recommended.");
  }
  else {
    $rtn ["status"] .= t("Cron was last run on %date", array("%date" => format_date($last_run)));
  }

  $rtn ["status"] .= "<p style='font-size: 0.8em;'>" . t("Your site's cron URL is:");
  $rtn ["status"] .= "<br>&nbsp; &nbsp; <i>" . $GLOBALS ["fp_system_settings"]["base_url"] . "/cron.php?t=" . $GLOBALS ["fp_system_settings"]["cron_security_token"] . "</i>
                        <br>" . t("Example linux cron command:") . "&nbsp; <i>wget -O - -q -t 1 http://ABOVE_URL</i>";
  $rtn ["status"] .= "</p>";


  return $rtn;
}