You are here

function mathjax_requirements in MathJax: LaTeX for Drupal 6

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

Implements hook_requirements().

This hook will issue warnings if:

  • MathJax relies on local files and the source files are not found

File

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

Code

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

  // Ensure translations don't break at install time.
  $t = get_t();
  if ($phase == 'runtime' && !variable_get('mathjax_use_cdn', TRUE)) {
    $requirements['mathjax'] = array(
      'title' => $t('MathJax'),
      'value' => $t('Installed correctly'),
      'severity' => REQUIREMENT_OK,
    );
    if (!_mathjax_requirements_isinstalled()) {
      $requirements['mathjax']['value'] = $t('Third party MathJax software not properly installed');
      $requirements['mathjax']['description'] = $t('MathJax was not found in the \'libraries\' folder (e.g. sites/all/libraries).');
      $requirements['mathjax']['severity'] = REQUIREMENT_ERROR;
    }
  }
  return $requirements;
}