You are here

function checklistapi_help in Checklist API 8

Same name and namespace in other branches
  1. 7 checklistapi.module \checklistapi_help()

Implements hook_help().

File

./checklistapi.module, line 132
An API for creating fillable, persistent checklists.

Code

function checklistapi_help($route_name, RouteMatchInterface $route_match) {
  foreach (checklistapi_get_checklist_info() as $id => $definition) {
    $checklist = new ChecklistapiChecklist($definition);
    if ($checklist
      ->getRouteName() == $route_name) {

      // The checklist has help and the current user has access to view it.
      if (!empty($definition['#help']) && checklistapi_checklist_access($id)) {
        return $definition['#help'];
      }
      else {
        break;
      }
    }
  }
}