mirror of
https://github.com/moodle/moodle.git
synced 2025-02-28 14:04:32 +01:00
MDL-50225 core: replace usages of print_textarea()
This commit is contained in:
parent
dc4dea0e40
commit
4d67fe6161
lib/form
mod
@ -88,21 +88,17 @@ class MoodleQuickForm_htmleditor extends MoodleQuickForm_textarea{
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function toHtml(){
|
public function toHtml() {
|
||||||
|
global $OUTPUT;
|
||||||
|
|
||||||
if ($this->_flagFrozen) {
|
if ($this->_flagFrozen) {
|
||||||
return $this->getFrozenHtml();
|
return $this->getFrozenHtml();
|
||||||
} else {
|
} else {
|
||||||
|
$value = preg_replace("/(\r\n|\n|\r)/", '
', $this->getValue());
|
||||||
|
|
||||||
return $this->_getTabs() .
|
return $this->_getTabs() .
|
||||||
print_textarea(true,
|
$OUTPUT->print_textarea($this->getName(), $this->getAttribute('id'), $value, $this->_options['rows'],
|
||||||
$this->_options['rows'],
|
$this->_options['cols']);
|
||||||
$this->_options['cols'],
|
|
||||||
$this->_options['width'],
|
|
||||||
$this->_options['height'],
|
|
||||||
$this->getName(),
|
|
||||||
preg_replace("/(\r\n|\n|\r)/", '
',$this->getValue()),
|
|
||||||
0, // unused anymore
|
|
||||||
true,
|
|
||||||
$this->getAttribute('id'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ require_once($CFG->libdir.'/tablelib.php');
|
|||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
$id = required_param('id', PARAM_INT);
|
$id = required_param('id', PARAM_INT);
|
||||||
$subject = optional_param('subject', '', PARAM_CLEANHTML);
|
$subject = optional_param('subject', '', PARAM_CLEANHTML);
|
||||||
$message = optional_param('message', '', PARAM_CLEANHTML);
|
$message = optional_param_array('message', '', PARAM_CLEANHTML);
|
||||||
$format = optional_param('format', FORMAT_MOODLE, PARAM_INT);
|
$format = optional_param('format', FORMAT_MOODLE, PARAM_INT);
|
||||||
$messageuser = optional_param_array('messageuser', false, PARAM_INT);
|
$messageuser = optional_param_array('messageuser', false, PARAM_INT);
|
||||||
$action = optional_param('action', '', PARAM_ALPHA);
|
$action = optional_param('action', '', PARAM_ALPHA);
|
||||||
@ -44,6 +44,10 @@ $current_tab = 'nonrespondents';
|
|||||||
//get the objects
|
//get the objects
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
if ($message) {
|
||||||
|
$message = $message['text'];
|
||||||
|
}
|
||||||
|
|
||||||
list ($course, $cm) = get_course_and_cm_from_cmid($id, 'feedback');
|
list ($course, $cm) = get_course_and_cm_from_cmid($id, 'feedback');
|
||||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||||
print_error('invalidcoursemodule');
|
print_error('invalidcoursemodule');
|
||||||
@ -275,7 +279,7 @@ if (empty($students)) {
|
|||||||
echo '<label for="feedback_subject">'.get_string('subject', 'feedback').' </label>';
|
echo '<label for="feedback_subject">'.get_string('subject', 'feedback').' </label>';
|
||||||
echo '<input type="text" id="feedback_subject" size="50" maxlength="255" name="subject" value="'.s($subject).'" />';
|
echo '<input type="text" id="feedback_subject" size="50" maxlength="255" name="subject" value="'.s($subject).'" />';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
print_textarea(true, 15, 25, 30, 10, "message", $message);
|
echo $OUTPUT->print_textarea('message', 'edit-message', $message, 15, 25);
|
||||||
print_string('formathtml');
|
print_string('formathtml');
|
||||||
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
|
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
|
||||||
echo '<br /><div class="buttons">';
|
echo '<br /><div class="buttons">';
|
||||||
|
@ -75,7 +75,8 @@ function wiki_print_editor_wiki($pageid, $content, $editor, $version = -1, $sect
|
|||||||
|
|
||||||
echo $OUTPUT->container_start();
|
echo $OUTPUT->container_start();
|
||||||
echo '<form method="post" id="mform1" action="' . $action . '">';
|
echo '<form method="post" id="mform1" action="' . $action . '">';
|
||||||
echo $OUTPUT->container(print_textarea(false, 20, 60, 0, 0, "newcontent", $content, 0, true), false, 'wiki_editor');
|
$textarea = $OUTPUT->print_textarea('newcontent', 'edit-newcontent', $content, 20, 60);
|
||||||
|
echo $OUTPUT->container($textarea, false, 'wiki_editor');
|
||||||
echo $OUTPUT->container_start();
|
echo $OUTPUT->container_start();
|
||||||
wiki_print_edit_form_default_fields($editor, $pageid, $version, $upload, $deleteuploads);
|
wiki_print_edit_form_default_fields($editor, $pageid, $version, $upload, $deleteuploads);
|
||||||
echo $OUTPUT->container_end();
|
echo $OUTPUT->container_end();
|
||||||
|
@ -41,9 +41,13 @@ $pageid = required_param('pageid', PARAM_TEXT);
|
|||||||
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
|
||||||
$id = optional_param('id', 0, PARAM_INT);
|
$id = optional_param('id', 0, PARAM_INT);
|
||||||
$commentid = optional_param('commentid', 0, PARAM_INT);
|
$commentid = optional_param('commentid', 0, PARAM_INT);
|
||||||
$newcontent = optional_param('newcontent', '', PARAM_CLEANHTML);
|
$newcontent = optional_param_array('newcontent', '', PARAM_CLEANHTML);
|
||||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||||
|
|
||||||
|
if ($newcontent) {
|
||||||
|
$newcontent = $newcontent['text'];
|
||||||
|
}
|
||||||
|
|
||||||
if (!$page = wiki_get_page($pageid)) {
|
if (!$page = wiki_get_page($pageid)) {
|
||||||
print_error('incorrectpageid', 'wiki');
|
print_error('incorrectpageid', 'wiki');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user