HTMLeditor not showing with function print_textarea

HTMLeditor not showing with function print_textarea

by Ye Chen -
Number of replies: 2
Hello,
I am using moodle version 1.8.4. I want to use function print_textarea() to create HTML editor enabled textarea. following is part of my code
$canuse returns 'MSIE', but it only shows the textarea with the HTML Editor Hotkey link, the HTML Editor doesn't show up.
Can anyone help?

Thanks
Ye

****part of the code***
$canuse=can_use_html_editor();
$mytext=print_textarea($canuse,10,50,80,60,'mytext','',0,true);

$myform=<<<fm
<form name='testform' action='test-htmleditor.php' method='post'>
<input type='text' name='itext' size='50'>
<br>
My Text Area $canuse <br>
$mytext <br><br>
<input type='submit' name='sub' value='submitme'>
<br>
</form>
fm;
echo $myform;
Average of ratings: -
In reply to Ye Chen

Re: HTMLeditor not showing with function print_textarea

by Mauno Korpelainen -

You could check code of some activity that renders htmleditor. For htmlarea the 3 steps are usually something like

1) $usehtmleditor = can_use_html_editor();


2) Inside form elements:

<?php print_textarea($usehtmleditor, 25, 60, 660, 200, "summary", $form->summary); ?>


3) if ($usehtmleditor) {
        use_html_editor("summary");
    }

Janne has give some other ways to render editor in file lib/editor/neweditor_readme.txt

In reply to Mauno Korpelainen

Re: HTMLeditor not showing with function print_textarea

by Ye Chen -
Mauno, Thanks a lot.

It works after I add use_html_editor() which I missed in my code.