mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00

Please forgive me if I have missed converting any output statements. If you do find an output statement that is not formatting correctly please refere to the table I added to this bug in regards to how it should be formatted.
44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
class profile_field_textarea extends profile_field_base {
|
|
|
|
function edit_field_add(&$mform) {
|
|
$cols = $this->field->param1;
|
|
$rows = $this->field->param2;
|
|
|
|
/// Create the form field
|
|
$mform->addElement('editor', $this->inputname, format_string($this->field->name), null, null);
|
|
$mform->setType($this->inputname, PARAM_CLEAN);
|
|
}
|
|
|
|
/// Overwrite base class method, data in this field type is potentially too large to be
|
|
/// included in the user object
|
|
function is_user_object_data() {
|
|
return false;
|
|
}
|
|
|
|
function edit_save_data_preprocess($data, &$datarecord) {
|
|
if (is_array($data)) {
|
|
$datarecord->dataformat = $data['format'];
|
|
$data = $data['text'];
|
|
}
|
|
return $data;
|
|
}
|
|
|
|
function edit_load_user_data(&$user) {
|
|
if ($this->data !== NULL) {
|
|
$this->data = clean_text($this->data, $this->dataformat);
|
|
$user->{$this->inputname} = array('text'=>$this->data, 'format'=>$this->dataformat);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Display the data for this field
|
|
*/
|
|
function display_data() {
|
|
return format_text($this->data, $this->dataformat, new stdClass());
|
|
}
|
|
|
|
}
|
|
|
|
?>
|