diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 15da1f93ed6..2d8b58106dc 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -534,6 +534,17 @@ function convert_urls_into_links($text) { debugging('convert_urls_into_links() has been deprecated and replaced by a new filter'); } +/** + * Used to be called from help.php to inject a list of smilies into the + * emoticons help file. + * + * @return string HTML + */ +function get_emoticons_list_for_help_file() { + debugging('get_emoticons_list_for_help_file() has been deprecated, see the new emoticon_manager API'); + return ''; +} + /** * deprecated - use clean_param($string, PARAM_FILE); instead * Check for bad characters ? diff --git a/lib/javascript-static.js b/lib/javascript-static.js index f8831c6a49a..e356e3945af 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -978,37 +978,6 @@ function openpopup(event, args) { return false; } -/* This is only used on a few help pages. */ -emoticons_help = { - inputarea: null, - - init: function(formname, fieldname, listid) { - if (!opener || !opener.document.forms[formname]) { - return; - } - emoticons_help.inputarea = opener.document.forms[formname][fieldname]; - if (!emoticons_help.inputarea) { - return; - } - var emoticons = document.getElementById(listid).getElementsByTagName('li'); - for (var i = 0; i < emoticons.length; i++) { - var text = emoticons[i].getElementsByTagName('img')[0].alt; - YAHOO.util.Event.addListener(emoticons[i], 'click', emoticons_help.inserttext, text); - } - }, - - inserttext: function(e, text) { - text = ' ' + text + ' '; - if (emoticons_help.inputarea.createTextRange && emoticons_help.inputarea.caretPos) { - var caretPos = emoticons_help.inputarea.caretPos; - caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text; - } else { - emoticons_help.inputarea.value += text; - } - emoticons_help.inputarea.focus(); - } -}; - /** Close the current browser window. */ function close_window(e) { if (e.preventDefault) { @@ -1570,4 +1539,4 @@ M.util.init_mp3flowplayerplugin = function (id, playerpath, audioplayerpath, fil autoPlay: false } }); -}; \ No newline at end of file +}; diff --git a/lib/weblib.php b/lib/weblib.php index 398a9611095..fe73f6dc8bf 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1680,42 +1680,6 @@ function replace_smilies(&$text) { } } -/** - * This code is called from help.php to inject a list of smilies into the - * emoticons help file. - * - * @global object - * @global object - * @return string HTML for a list of smilies. - */ -function get_emoticons_list_for_help_file() { - global $CFG, $SESSION, $PAGE, $OUTPUT; - if (empty($CFG->emoticons)) { - return ''; - } - - $items = explode('{;}', $CFG->emoticons); - $output = ''; - if (!empty($SESSION->inserttextform)) { - $formname = $SESSION->inserttextform; - $fieldname = $SESSION->inserttextfield; - } else { - $formname = 'theform'; - $fieldname = 'message'; - } - - $PAGE->requires->yui2_lib('event'); - $PAGE->requires->js_function_call('emoticons_help.init', array($formname, $fieldname, 'emoticonlist')); - return $output; - -} - /** * Given plain text, makes it into HTML as nicely as possible. * May contain HTML tags already