-function mathjax_install() {
- register_hook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
- register_hook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
- register_hook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
- logger('installed js_math plugin');
-}
-function mathjax_uninstall() {
- unregister_hook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
- unregister_hook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
- unregister_hook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
-}
-function mathjax_settings_post ($a, $post) {
- if (! local_user())
- return;
- // don't check statusnet settings if statusnet submit button is not clicked
- if (!x($_POST,'mathjax-submit'))
- return;
- set_pconfig(local_user(),'mathjax','use',intval($_POST['mathjax_use']));
+use Friendica\App;
+use Friendica\Core\Hook;
+use Friendica\Core\Renderer;
+use Friendica\DI;
+
+function mathjax_install()
+{
+ Hook::register('footer' , __FILE__, 'mathjax_footer');
+ Hook::register('addon_settings' , __FILE__, 'mathjax_settings');
+ Hook::register('addon_settings_post', __FILE__, 'mathjax_settings_post');