You are here

function view_mode_page_requirements in View Mode Page 7.2

Same name and namespace in other branches
  1. 8.2 view_mode_page.module \view_mode_page_requirements()

Implements hook_requirements().

Check that there are no missing view modes.

File

./view_mode_page.module, line 223
View Mode Page module allows users to add a page for a specific view mode.

Code

function view_mode_page_requirements($phase) {
  if ($phase == 'runtime') {
    $missing = variable_get('view_mode_page_missing_view_modes', NULL);
    if ($missing) {
      $t = get_t();
      $modes = array();
      foreach ($missing as $missing_view_mode) {
        if (in_array($missing_view_mode->view_mode, $modes)) {
          continue;
        }
        $modes[] = $missing_view_mode->view_mode;
      }
      return array(
        array(
          'title' => $t('View Mode Page'),
          'description' => $t('View mode page has found patterns for view modes that are no longer in use. ') . l($t('Review missing view modes'), 'admin/structure/view_mode_page/missing'),
          'value' => implode(', ', $modes),
          'severity' => REQUIREMENT_WARNING,
        ),
      );
    }
  }
}