diff --git a/admin/tool/lp/classes/competency.php b/admin/tool/lp/classes/competency.php index 7324164247dc7..11295d3374198 100644 --- a/admin/tool/lp/classes/competency.php +++ b/admin/tool/lp/classes/competency.php @@ -68,7 +68,7 @@ protected static function define_properties() { ), 'description' => array( 'default' => '', - 'type' => PARAM_TEXT + 'type' => PARAM_RAW ), 'descriptionformat' => array( 'choices' => array(FORMAT_HTML, FORMAT_MOODLE, FORMAT_PLAIN, FORMAT_MARKDOWN), diff --git a/admin/tool/lp/classes/competency_framework.php b/admin/tool/lp/classes/competency_framework.php index c74d54667ee31..0a36a4b847441 100644 --- a/admin/tool/lp/classes/competency_framework.php +++ b/admin/tool/lp/classes/competency_framework.php @@ -90,7 +90,7 @@ protected static function define_properties() { 'type' => PARAM_TEXT ), 'description' => array( - 'type' => PARAM_TEXT, + 'type' => PARAM_RAW, 'default' => '' ), 'descriptionformat' => array( diff --git a/admin/tool/lp/classes/external/exporter.php b/admin/tool/lp/classes/external/exporter.php index f109de76d9df3..1cce2173ee1c4 100644 --- a/admin/tool/lp/classes/external/exporter.php +++ b/admin/tool/lp/classes/external/exporter.php @@ -144,7 +144,7 @@ final public function export(renderer_base $output) { $data->$property = $record->$property; - // If the field is PARAM_TEXT and has a format field. + // If the field is PARAM_RAW and has a format field. if ($propertyformat = self::get_format_field($properties, $property)) { if (!property_exists($record, $propertyformat)) { // Whoops, we got something that wasn't defined. @@ -155,7 +155,6 @@ final public function export(renderer_base $output) { $data->$property = $text; $data->$propertyformat = $format; - // If it's a PARAM_TEXT without format field. } else if ($definition['type'] === PARAM_TEXT) { if (!empty($definition['multiple'])) { foreach ($data->$property as $key => $value) { @@ -334,7 +333,7 @@ final protected static function get_context_structure() { */ final protected static function get_format_field($definitions, $property) { $formatproperty = $property . 'format'; - if ($definitions[$property]['type'] == PARAM_TEXT && isset($definitions[$formatproperty]) + if ($definitions[$property]['type'] == PARAM_RAW && isset($definitions[$formatproperty]) && $definitions[$formatproperty]['type'] == PARAM_INT) { return $formatproperty; } diff --git a/admin/tool/lp/classes/form/competency.php b/admin/tool/lp/classes/form/competency.php index 0b7be07403285..a01f57d4b7d41 100644 --- a/admin/tool/lp/classes/form/competency.php +++ b/admin/tool/lp/classes/form/competency.php @@ -76,7 +76,7 @@ public function definition() { $mform->addRule('shortname', null, 'required', null, 'client'); $mform->addElement('editor', 'description', get_string('description', 'tool_lp'), array('rows' => 4)); - $mform->setType('description', PARAM_TEXT); + $mform->setType('description', PARAM_RAW); $mform->addElement('text', 'idnumber', get_string('idnumber', 'tool_lp')); $mform->setType('idnumber', PARAM_TEXT); diff --git a/admin/tool/lp/classes/form/competency_framework.php b/admin/tool/lp/classes/form/competency_framework.php index fd9ad4daf8a3f..5ae3604d6ec1a 100644 --- a/admin/tool/lp/classes/form/competency_framework.php +++ b/admin/tool/lp/classes/form/competency_framework.php @@ -60,7 +60,7 @@ public function definition() { $mform->addRule('shortname', null, 'required', null, 'client'); $mform->addElement('editor', 'description', get_string('description', 'tool_lp'), array('rows' => 4)); - $mform->setType('description', PARAM_TEXT); + $mform->setType('description', PARAM_RAW); $mform->addElement('text', 'idnumber', get_string('idnumber', 'tool_lp')); $mform->setType('idnumber', PARAM_TEXT); diff --git a/admin/tool/lp/classes/form/plan.php b/admin/tool/lp/classes/form/plan.php index fda7d5062a95d..5bbbb93fbc2c5 100644 --- a/admin/tool/lp/classes/form/plan.php +++ b/admin/tool/lp/classes/form/plan.php @@ -54,7 +54,7 @@ public function definition() { $mform->setType('name', PARAM_TEXT); $mform->addRule('name', null, 'required', null, 'client'); $mform->addElement('editor', 'description', get_string('plandescription', 'tool_lp'), array('rows' => 4)); - $mform->setType('description', PARAM_TEXT); + $mform->setType('description', PARAM_RAW); $mform->addElement('date_time_selector', 'duedate', get_string('duedate', 'tool_lp'), array('optional' => true)); $mform->addHelpButton('duedate', 'duedate', 'tool_lp'); diff --git a/admin/tool/lp/classes/form/template.php b/admin/tool/lp/classes/form/template.php index 1ca86ef9cbaed..0e7f62afb590d 100644 --- a/admin/tool/lp/classes/form/template.php +++ b/admin/tool/lp/classes/form/template.php @@ -56,7 +56,7 @@ public function definition() { $mform->addRule('shortname', null, 'required', null, 'client'); $mform->addElement('editor', 'description', get_string('description', 'tool_lp'), array('rows' => 4)); - $mform->setType('description', PARAM_TEXT); + $mform->setType('description', PARAM_RAW); $mform->addElement('selectyesno', 'visible', get_string('visible', 'tool_lp')); $mform->addElement('date_time_selector', diff --git a/admin/tool/lp/classes/form/user_evidence.php b/admin/tool/lp/classes/form/user_evidence.php index 932eb92bba91e..937dd0bc44ed0 100644 --- a/admin/tool/lp/classes/form/user_evidence.php +++ b/admin/tool/lp/classes/form/user_evidence.php @@ -53,7 +53,7 @@ public function definition() { $mform->addElement('editor', 'description', get_string('userevidencedescription', 'tool_lp'), array('rows' => 10)); // TODO MDL-52454 Make PARAM_RAW. - $mform->setType('description', PARAM_TEXT); + $mform->setType('description', PARAM_RAW); $mform->addElement('url', 'url', get_string('userevidenceurl', 'tool_lp'), array(), array('usefilepicker' => false)); $mform->setType('url', PARAM_RAW_TRIMMED); // Can not use PARAM_URL, it silently converts bad URLs to ''. diff --git a/admin/tool/lp/classes/persistent.php b/admin/tool/lp/classes/persistent.php index eb24433433951..6755ba47259a4 100644 --- a/admin/tool/lp/classes/persistent.php +++ b/admin/tool/lp/classes/persistent.php @@ -232,8 +232,7 @@ final public static function get_formatted_properties() { $formatted = array(); foreach ($properties as $property => $definition) { $propertyformat = $property . 'format'; - // TODO MDL-52454 Check PARAM_RAW. - if ($definition['type'] == PARAM_TEXT && array_key_exists($propertyformat, $properties) + if ($definition['type'] == PARAM_RAW && array_key_exists($propertyformat, $properties) && $properties[$propertyformat]['type'] == PARAM_INT) { $formatted[$property] = $propertyformat; } diff --git a/admin/tool/lp/classes/plan.php b/admin/tool/lp/classes/plan.php index 8583ff1a3df09..10f9b403a5e65 100644 --- a/admin/tool/lp/classes/plan.php +++ b/admin/tool/lp/classes/plan.php @@ -58,7 +58,7 @@ protected static function define_properties() { 'type' => PARAM_TEXT, ), 'description' => array( - 'type' => PARAM_TEXT, + 'type' => PARAM_RAW, 'default' => '' ), 'descriptionformat' => array( diff --git a/admin/tool/lp/classes/template.php b/admin/tool/lp/classes/template.php index 1108fdeab3480..568fdc8dcafa7 100644 --- a/admin/tool/lp/classes/template.php +++ b/admin/tool/lp/classes/template.php @@ -53,7 +53,7 @@ protected static function define_properties() { ), 'description' => array( 'default' => '', - 'type' => PARAM_TEXT, + 'type' => PARAM_RAW, ), 'descriptionformat' => array( 'choices' => array(FORMAT_HTML, FORMAT_MOODLE, FORMAT_PLAIN, FORMAT_MARKDOWN), diff --git a/admin/tool/lp/classes/user_evidence.php b/admin/tool/lp/classes/user_evidence.php index 61e19d8ec16b6..823765e10e9a1 100644 --- a/admin/tool/lp/classes/user_evidence.php +++ b/admin/tool/lp/classes/user_evidence.php @@ -53,7 +53,7 @@ protected static function define_properties() { 'type' => PARAM_TEXT ), 'description' => array( - 'type' => PARAM_TEXT, // TODO MDL-52454 Make PARAM_RAW. + 'type' => PARAM_RAW, 'default' => '', ), 'descriptionformat' => array( diff --git a/admin/tool/lp/templates/competency_summary.mustache b/admin/tool/lp/templates/competency_summary.mustache index 429d0f2fa6040..5606cfa7088ae 100644 --- a/admin/tool/lp/templates/competency_summary.mustache +++ b/admin/tool/lp/templates/competency_summary.mustache @@ -1,9 +1,9 @@

{{competency.shortname}} {{competency.idnumber}}

-

{{competency.description}}

+

{{{competency.description}}}

{{#framework}}

{{framework.shortname}}

-

{{framework.description}}

+

{{{framework.description}}}

{{/framework}} {{#showrelatedcompetencies}} diff --git a/admin/tool/lp/templates/plan_page.mustache b/admin/tool/lp/templates/plan_page.mustache index d59310cab44e7..96caba22fd41c 100644 --- a/admin/tool/lp/templates/plan_page.mustache +++ b/admin/tool/lp/templates/plan_page.mustache @@ -52,7 +52,7 @@ {{/plan.template}} {{#description}}
{{#str}}description{{/str}}
-
{{plan.description}}
+
{{{plan.description}}}
{{/description}} diff --git a/admin/tool/lp/templates/user_evidence_page.mustache b/admin/tool/lp/templates/user_evidence_page.mustache index ce7d849089c31..6a6ab4875d4a1 100644 --- a/admin/tool/lp/templates/user_evidence_page.mustache +++ b/admin/tool/lp/templates/user_evidence_page.mustache @@ -40,7 +40,7 @@
{{#description}}
- {{description}} + {{{description}}}
{{/description}}