You are here

function mathjax_requirements in MathJax: LaTeX for Drupal 3.0.x

Same name and namespace in other branches
  1. 8.2 mathjax.install \mathjax_requirements()
  2. 6 mathjax.install \mathjax_requirements()
  3. 7.2 mathjax.install \mathjax_requirements()
  4. 7 mathjax.install \mathjax_requirements()

Implements hook_requirements().

File

./mathjax.install, line 11
MathJax module install.

Code

function mathjax_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime') {
    $config = Drupal::config('mathjax.settings');
    if (!$config
      ->get('use_cdn')) {
      if (!_mathjax_library_present()) {
        $requirements['mathjax_local_libraries'] = [
          'title' => t('MathJax'),
          'value' => t('Missing JavaScript libraries'),
          'description' => t("MathJax is configured to use local library files but they could not be found. See the README."),
          'severity' => REQUIREMENT_ERROR,
        ];
      }
    }
  }
  return $requirements;
}