MDL-76583 core_external: external_format_value coding style fixes
This commit is contained in:
+8
-6
@@ -36,18 +36,20 @@ 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, $default = null) {
|
||||
|
||||
if ($default == null && $required == VALUE_DEFAULT) {
|
||||
$default = FORMAT_HTML;
|
||||
}
|
||||
|
||||
$desc = $textfieldname . ' format (' . FORMAT_HTML . ' = HTML, '
|
||||
. FORMAT_MOODLE . ' = MOODLE, '
|
||||
. FORMAT_PLAIN . ' = PLAIN or '
|
||||
. FORMAT_MARKDOWN . ' = MARKDOWN)';
|
||||
$desc = sprintf(
|
||||
"%s format (%s = HTML, %s = MOODLE, %s = PLAIN, or %s = MARKDOWN",
|
||||
$textfieldname,
|
||||
FORMAT_HTML,
|
||||
FORMAT_MOODLE,
|
||||
FORMAT_PLAIN,
|
||||
FORMAT_MARKDOWN,
|
||||
);
|
||||
|
||||
parent::__construct(PARAM_INT, $desc, $required, $default);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user