formslib MDL-19626 Changed JS string handling to new $PAGE methods, Thanks Dan

This commit is contained in:
samhemelryk
2009-06-29 02:10:49 +00:00
parent 9262d2d30f
commit fc4f5796cc
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -2153,9 +2153,9 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
$button_nojs = '<input name="'.$elementName.'" id="'.$elementName.(string)$advformcount.'" class="showadvancedbtn" value="'.$buttonlabel.'" type="submit" />';
$buttonlabel = addslashes_js($buttonlabel);
$showtext = addslashes_js(get_string('showadvanced', 'form'));
$hidetext = addslashes_js(get_string('hideadvanced', 'form'));
$PAGE->requires->js_function_call('showAdvancedInit', Array($elementName.(string)$advformcount, $elementName, $buttonlabel, $hidetext, $showtext));
$PAGE->requires->string_for_js('showadvanced', 'form');
$PAGE->requires->string_for_js('hideadvanced', 'form');
$PAGE->requires->js_function_call('showAdvancedInit', Array($elementName.(string)$advformcount, $elementName, $buttonlabel));
$advformcount++;
$header_html = str_replace('{button}', $button_nojs, $header_html);
+2 -2
View File
@@ -342,8 +342,8 @@ function showAdvancedInit(addBefore, nameAttr, buttonLabel, hideText, showText)
showHideButton.value = buttonLabel;
showHideButton.name = nameAttr;
showHideButton.moodle = {
hideLabel: hideText,
showLabel: showText
hideLabel: mstr.form.hideadvanced,
showLabel: mstr.form.showadvanced
};
YAHOO.util.Event.addListener(showHideButton, 'click', showAdvancedOnClick);
el = document.getElementById(addBefore);