MDL-55567 messages: Use FORMAT_MOODLE as default for sending messages
This is like plain text, but it preserves new-lines and has some other special features.
This commit is contained in:
committed by
Mark Nelson
parent
edac7c8003
commit
14968ca9ac
+5
-2
@@ -815,11 +815,14 @@ class external_format_value extends external_value {
|
||||
*
|
||||
* @param string $textfieldname Name of the text field
|
||||
* @param int $required if VALUE_REQUIRED then set standard default FORMAT_HTML
|
||||
* @param int $default Default value.
|
||||
* @since Moodle 2.3
|
||||
*/
|
||||
public function __construct($textfieldname, $required = VALUE_REQUIRED) {
|
||||
public function __construct($textfieldname, $required = VALUE_REQUIRED, $default = null) {
|
||||
|
||||
$default = ($required == VALUE_DEFAULT) ? FORMAT_HTML : null;
|
||||
if ($default == null && $required == VALUE_DEFAULT) {
|
||||
$default = FORMAT_HTML;
|
||||
}
|
||||
|
||||
$desc = $textfieldname . ' format (' . FORMAT_HTML . ' = HTML, '
|
||||
. FORMAT_MOODLE . ' = MOODLE, '
|
||||
|
||||
@@ -52,7 +52,7 @@ class core_message_external extends external_api {
|
||||
array(
|
||||
'touserid' => new external_value(PARAM_INT, 'id of the user to send the private message'),
|
||||
'text' => new external_value(PARAM_RAW, 'the text of the message'),
|
||||
'textformat' => new external_format_value('text', VALUE_DEFAULT),
|
||||
'textformat' => new external_format_value('text', VALUE_DEFAULT, FORMAT_MOODLE),
|
||||
'clientmsgid' => new external_value(PARAM_ALPHANUMEXT, 'your own client id for the message. If this id is provided, the fail message id will be returned to you', VALUE_OPTIONAL),
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user