function mathjax_requirements in MathJax: LaTeX for Drupal 7
Same name and namespace in other branches
- 8.2 mathjax.install \mathjax_requirements()
- 6 mathjax.install \mathjax_requirements()
- 7.2 mathjax.install \mathjax_requirements()
- 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 23 - 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 any \'libraries\' folder (e.g. sites/all/libraries).');
$requirements['mathjax']['severity'] = REQUIREMENT_ERROR;
}
}
return $requirements;
}