You are here

function ace_editor_requirements in Ace Code Editor 8

Same name and namespace in other branches
  1. 7 ace_editor.install \ace_editor_requirements()

Implements hook_requirements().

File

./ace_editor.install, line 26
Install functions for the Ace Editor module.

Code

function ace_editor_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime') {
    $requirements['ace_editor']['title'] = t('Ace library');
    $lib_path = ace_editor_lib_path();
    if ($lib_path) {
      $requirements['ace_editor']['value'] = t('Installed at @location', [
        '@location' => $lib_path,
      ]);
      $requirements['ace_editor']['severity'] = REQUIREMENT_OK;
    }
    else {
      $requirements['ace_editor']['value'] = t('Not installed');
      $requirements['ace_editor']['severity'] = REQUIREMENT_ERROR;
      $requirements['ace_editor']['description'] = t('Please download the Ace library from <a href="@url">@url</a> to the @location directory for using the Ace Editor module.', [
        '@url' => 'https://github.com/ajaxorg/ace-builds',
        '@location' => '/libraries/',
      ]);
    }
  }
  return $requirements;
}