X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mathjax%2Fmathjax.php;h=d51857f3f789edca46d772c1a52ee32ca0151b1b;hb=215a18093a2822ccd0ba40b7b07142780bfd917b;hp=2a7bc89c221281160a4c2ef667e3e9dc156c660b;hpb=27b60e003f92dd9f3aebbeddb34ebb905488ca82;p=friendica-addons.git diff --git a/mathjax/mathjax.php b/mathjax/mathjax.php index 2a7bc89c..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()) @@ -36,18 +36,18 @@ function mathjax_settings (&$a, &$s) { $use = PConfig::get(local_user(),'mathjax','use'); $usetext = (($use) ? ' checked="checked" ' : ''); $s .= ''; - $s .= '

MathJax '.t('Settings').'

'; + $s .= '

MathJax '.L10n::t('Settings').'

'; $s .= '
'; $s .= ''; } /* we need to add one JavaScript include command to the html output @@ -68,19 +68,19 @@ function mathjax_page_header($a, &$b) { } } } -function mathjax_plugin_admin_post (&$a) { +function mathjax_addon_admin_post (&$a) { $baseurl = ((x($_POST, 'baseurl')) ? trim($_POST['baseurl']) : 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'); Config::set('mathjax','baseurl',$baseurl); - info( t('Settings updated.'). EOL); + info(L10n::t('Settings updated.'). EOL); } -function mathjax_plugin_admin (&$a, &$o) { +function mathjax_addon_admin (&$a, &$o) { $t = get_markup_template( "admin.tpl", "addon/mathjax/" ); if (Config::get('mathjax','baseurl','') == '') { Config::set('mathjax','baseurl','http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'); } $o = replace_macros( $t, [ - '$submit' => t('Save Settings'), - '$baseurl' => ['baseurl', t('MathJax Base URL'), Config::get('mathjax','baseurl' ), t('The URL for the javascript file that should be included to use MathJax. Can be either the MathJax CDN or another installation of MathJax.')], + '$submit' => L10n::t('Save Settings'), + '$baseurl' => ['baseurl', L10n::t('MathJax Base URL'), Config::get('mathjax','baseurl' ), L10n::t('The URL for the javascript file that should be included to use MathJax. Can be either the MathJax CDN or another installation of MathJax.')], ]); }