X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mathjax%2Fmathjax.php;h=d51857f3f789edca46d772c1a52ee32ca0151b1b;hb=3ce1c8cf2e65581af5fe94c1273f9381987f9f89;hp=d97e9649698b1daa58a56166f38ae23330a020b7;hpb=1b250fad733200f28752d1b0bf9c148d95686af1;p=friendica-addons.git diff --git a/mathjax/mathjax.php b/mathjax/mathjax.php index d97e9649..d51857f3 100644 --- a/mathjax/mathjax.php +++ b/mathjax/mathjax.php @@ -1,5 +1,4 @@ * License: 3-clause BSD license */ +use Friendica\Core\Addon; +use Friendica\Core\Config; +use Friendica\Core\L10n; +use Friendica\Core\PConfig; 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'); + 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'); + logger('installed js_math addon'); } 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'); + 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'); } function mathjax_settings_post ($a, $post) { if (! local_user()) @@ -25,21 +28,26 @@ function mathjax_settings_post ($a, $post) { // 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'])); + PConfig::set(local_user(),'mathjax','use',intval($_POST['mathjax_use'])); } function mathjax_settings (&$a, &$s) { if (! local_user()) return; - $use = get_pconfig(local_user(),'mathjax','use'); + $use = PConfig::get(local_user(),'mathjax','use'); $usetext = (($use) ? ' checked="checked" ' : ''); - $s .= '
'.t('The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail.').'
'; - $s .= ''; + $s .= ''; + $s .= '