You are here

function mathjax_requirements in MathJax: LaTeX for Drupal 7.2

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

Implements hook_requirements().

File

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

Code

function mathjax_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime') {
    if (!variable_get('mathjax_use_cdn', TRUE)) {
      if (!_mathjax_library_present()) {
        $requirements['mathjax_local_libraries'] = array(
          '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,
        );
      }
      if (!function_exists('libraries_get_path')) {
        $requirements['mathjax_libraries_dependency'] = array(
          'title' => $t('MathJax'),
          'value' => $t('Missing libraries module'),
          'description' => $t("MathJax is configured to use local library files but the libraries module is not enabled. See the README."),
          'severity' => REQUIREMENT_ERROR,
        );
      }
    }
  }
  return $requirements;
}