function mathjax_active in MathJax: LaTeX for Drupal 6
Same name and namespace in other branches
- 7 mathjax.module \mathjax_active()
Verify that MathJax should be active for the current URL.
1 call to mathjax_active()
- mathjax_init in ./
mathjax.module - Implements hook_init().
File
- ./
mathjax.module, line 39 - MathJax module.
Code
function mathjax_active() {
$pages = variable_get('mathjax_pages', "admin*\nnode/add/*\nnode/*/edit");
$path = drupal_strtolower(drupal_get_path_alias($_GET['q']));
// Compare the lowercase internal and lowercase path alias (if any).
$page_match = drupal_match_path($path, $pages);
if ($path != $_GET['q']) {
$page_match = $page_match || drupal_match_path($_GET['q'], $pages);
}
if (variable_get('mathjax_active_type', 'disable') == 'disable') {
return !$page_match;
}
else {
return $page_match;
}
}