[mathjax] Add addon config

- Update mentions of .htconfig.php
This commit is contained in:
Hypolite Petovan 2018-06-27 23:17:57 -04:00
parent 8220a78a71
commit 88278dbe19
3 changed files with 27 additions and 6 deletions

View file

@ -13,6 +13,7 @@ use Friendica\Core\L10n;
use Friendica\Core\PConfig;
function mathjax_install() {
Addon::registerHook('load_config', 'addon/mathjax/mathjax.php', 'mathjax_load_config');
Addon::registerHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
Addon::registerHook('addon_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
Addon::registerHook('addon_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
@ -21,12 +22,18 @@ function mathjax_install() {
}
function mathjax_uninstall() {
Addon::unregisterHook('load_config', 'addon/mathjax/mathjax.php', 'mathjax_load_config');
Addon::unregisterHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
Addon::unregisterHook('addon_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
Addon::unregisterHook('addon_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
Addon::unregisterHook('template_vars', 'addon/mathjax/mathjax.php', 'mathjax_template_vars');
}
function mathjax_load_config(\Friendica\App $a)
{
$a->loadConfigFile(__DIR__. '/config/mathjax.ini.php');
}
function mathjax_template_vars($a, &$arr)
{
if (!array_key_exists('addon_hooks',$arr['vars']))