You are here

function activity_requirements in Activity 6.2

Same name and namespace in other branches
  1. 7 activity.install \activity_requirements()

Implementation of hook_requirements().

File

./activity.install, line 176

Code

function activity_requirements($phase) {
  $requirements = array();
  $t = get_t();
  $views_schema_version = db_result(db_query("SELECT schema_version FROM {system} WHERE name = 'views'"));
  if (intval($views_schema_version) < 6006) {
    $requirements['activity_views'] = array(
      'title' => $t('Activity Views'),
      'description' => $t('Activity2 requires Views >= 6.2. It can be downloaded !release. The change that is required by Activity2 is !issue', array(
        '!release' => l('here', 'http://drupal.org/node/488082'),
        '!issue' => l('#419270', 'http://drupal.org/node/419270'),
      )),
      // set the severity to warning on install because we don't want to stop the install...
      'severity' => $phase == 'install' ? REQUIREMENT_WARNING : REQUIREMENT_ERROR,
    );
  }
  if (activity_bad_trigger_weight()) {
    $requirements['activity_trigger_weight'] = array(
      'title' => $t('Activity Trigger Weight'),
      'description' => $t('Activity2 requires Trigger\'s weight be greater then Pathauto\'s in order to produce proper aliased paths. !clickhere to fix that', array(
        '!clickhere' => l(t('Click here'), 'admin/activity/weight', array(
          'query' => drupal_get_destination(),
        )),
      )),
      'severity' => REQUIREMENT_WARNING,
    );
  }
  return $requirements;
}