You are here

function addtocopy_requirements in Add link to copied text 7

Implements hook_requirements().

File

./addtocopy.install, line 16

Code

function addtocopy_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time
  $t = get_t();
  if ($phase == 'runtime') {
    if ($addtocopy_version = _addtocopy_library_version()) {
      $requirements['addtocopy'] = array(
        'title' => $t('Add to Copy library'),
        'value' => $addtocopy_version,
        'severity' => REQUIREMENT_OK,
      );
    }
    else {
      $requirements['addtocopy'] = array(
        'title' => $t('Add to Copy library'),
        'value' => $t('Add to Copy library is missing'),
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }
  return $requirements;
}