You are here

function workbench_workflows_requirements in Workbench Moderation 7.2

Implements hook_requirements().

File

modules/workbench_workflows/workbench_workflows.install, line 187
Database functions for workbench_workflows.

Code

function workbench_workflows_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $states = workbench_workflows_load_all('states');
    $events = workbench_workflows_load_all('events');
    $workflows = workbench_workflows_load_all('workflows');
    if (empty($states) && empty($events) && empty($workflows)) {
      $form = drupal_get_form('workbench_workflows_install_default_workflow_form');
      $requirements['workbench_workflows_default'] = array(
        'title' => t('Workbench Workflows default workflow'),
        'value' => t('Install the default workflow'),
        'description' => drupal_render($form),
        'severity' => REQUIREMENT_WARNING,
      );
    }
  }
  return $requirements;
}