- $s .= "\t</tr></table>\n";
-
- /**
- *
- * Add css to page
- *
- */
-
- $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/smileybutton/smileybutton.css' . '" media="all" />' . "\r\n";
-
- /**
- *
- * Add the button to the Inputbox
- *
- */
- if (! $nobutton) {
- $b = "<div id=\"profile-smiley-wrapper\" style=\"display: block;\" >\n";
- $b .= "\t<img src=\"" . $a->get_baseurl() . "/addon/smileybutton/icon.gif\" onclick=\"toggle_smileybutton()\" alt=\"smiley\">\n";
- $b .= "\t</div>\n";
- }
-
-
- /**
- *
- * Write the smileies to an (hidden) div
- *
- */
-
- if ($nobutton) {
- $b .= "\t<div id=\"smileybutton\">\n";
- } else {
- $b .= "\t<div id=\"smileybutton\" style=\"display:none;\">\n";
- }
- $b .= $s . "\n";
- $b .= "</div>\n";
-
- /**
- *
- * Function to show and hide the smiley-list in the hidden div
- *
- */
-
- $b .= "<script>\n";
-
- if (! $nobutton) {
- $b .= " smileybutton_show = 0;\n";
- $b .= " function toggle_smileybutton() {\n";
- $b .= " if (! smileybutton_show) {\n";
- $b .= " $(\"#smileybutton\").show();\n";
- $b .= " smileybutton_show = 1;\n";
- $b .= " } else {\n";
- $b .= " $(\"#smileybutton\").hide();\n";
- $b .= " smileybutton_show = 0;\n";
- $b .= " }}\n";
- }
-
- /**
- *
- * Function to add the chosen smiley to the inputbox
- *
- */
-
- $b .= " function smileybutton_addsmiley(text) {\n";
- $b .= " if(plaintext == 'none') {\n";
- $b .= " var v = $(\"#profile-jot-text\").val();\n";
- $b .= " v = v + text;\n";
- $b .= " $(\"#profile-jot-text\").val(v);\n";
- $b .= " $(\"#profile-jot-text\").focus();\n";
- $b .= " } else {\n";
- $b .= " var v = tinymce.activeEditor.getContent();\n";
- $b .= " v = v + text;\n";
- $b .= " tinymce.activeEditor.setContent(v);\n";
- $b .= " tinymce.activeEditor.focus();\n";
- $b .= " }\n";
- $b .= " }\n";
- $b .= "</script>\n";
-}
-
-
-
-
-
-/**
- *
- * Set the configuration
- *
- */
-
-function smileybutton_settings_post($a,$post) {
- if(! local_user())
- return;
- if($_POST['smileybutton-submit'])
- set_pconfig(local_user(),'smileybutton','nobutton',intval($_POST['smileybutton']));
-
-}
-
-
-/**
- *
- * Add configuration-dialog to form
- *
- */
-
-
-function smileybutton_settings(&$a,&$s) {
-
- if(! local_user())
- return;
-
- /* Add our stylesheet to the page so we can make our settings look nice */
-
- $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/smileybutton/smileybutton.css' . '" media="all" />' . "\r\n";
-
- /* Get the current state of our config variable */
-
- $nobutton = get_pconfig(local_user(),'smileybutton','nobutton');
- $checked = (($nobutton) ? ' checked="checked" ' : '');
-
- /* Add some HTML to the existing form */