-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']));
-}
-function mathjax_settings (&$a, &$s) {
- if (! local_user())
- return;
- $use = get_pconfig(local_user(),'mathjax','use');
- $usetext = (($use) ? ' checked="checked" ' : '');
- $s .= '<div class="settings-block">';
- $s .= '<h3>MathJax '.t('Settings').'</h3>';
- $s .= '<p>'.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.').'</p>';
- $s .= '<label id="mathjax_label" for="mathjax_use">'.t('Use the MathJax renderer').'</label>';
- $s .= '<input id="mathjax_use" type="checkbox" name="mathjax_use" value="1"'. $usetext .' />';
- $s .= '<div class="clear"></div>';