diff --git a/mod/chat/classes/external.php b/mod/chat/classes/external.php index ba542295996..45000f38ae2 100644 --- a/mod/chat/classes/external.php +++ b/mod/chat/classes/external.php @@ -543,7 +543,7 @@ class mod_chat_external extends external_api { $chatdetails['id'] = $chat->id; $chatdetails['coursemodule'] = $chat->coursemodule; $chatdetails['course'] = $chat->course; - $chatdetails['name'] = $chat->name; + $chatdetails['name'] = external_format_string($chat->name, $chatcontext->id); // Format intro. list($chatdetails['intro'], $chatdetails['introformat']) = external_format_text($chat->intro, $chat->introformat, $chatcontext->id, 'mod_chat', 'intro', null); @@ -586,16 +586,16 @@ class mod_chat_external extends external_api { array( 'id' => new external_value(PARAM_INT, 'Chat id'), 'coursemodule' => new external_value(PARAM_INT, 'Course module id'), - 'course' => new external_value(PARAM_TEXT, 'Course id'), - 'name' => new external_value(PARAM_TEXT, 'Chat name'), + 'course' => new external_value(PARAM_INT, 'Course id'), + 'name' => new external_value(PARAM_RAW, 'Chat name'), 'intro' => new external_value(PARAM_RAW, 'The Chat intro'), 'introformat' => new external_format_value('intro'), 'chatmethod' => new external_value(PARAM_ALPHA, 'chat method (sockets, daemon)', VALUE_OPTIONAL), 'keepdays' => new external_value(PARAM_INT, 'keep days', VALUE_OPTIONAL), 'studentlogs' => new external_value(PARAM_INT, 'student logs visible to everyone', VALUE_OPTIONAL), - 'chattime' => new external_value(PARAM_RAW, 'chat time', VALUE_OPTIONAL), + 'chattime' => new external_value(PARAM_INT, 'chat time', VALUE_OPTIONAL), 'schedule' => new external_value(PARAM_INT, 'schedule type', VALUE_OPTIONAL), - 'timemodified' => new external_value(PARAM_RAW, 'time of last modification', VALUE_OPTIONAL), + 'timemodified' => new external_value(PARAM_INT, 'time of last modification', VALUE_OPTIONAL), 'section' => new external_value(PARAM_INT, 'course section id', VALUE_OPTIONAL), 'visible' => new external_value(PARAM_BOOL, 'visible', VALUE_OPTIONAL), 'groupmode' => new external_value(PARAM_INT, 'group mode', VALUE_OPTIONAL), diff --git a/mod/data/classes/external.php b/mod/data/classes/external.php index eb0b2adc285..6db74923240 100644 --- a/mod/data/classes/external.php +++ b/mod/data/classes/external.php @@ -124,7 +124,7 @@ class mod_data_external extends external_api { $newdb['id'] = $database->id; $newdb['coursemodule'] = $database->coursemodule; $newdb['course'] = $database->course; - $newdb['name'] = $database->name; + $newdb['name'] = external_format_string($database->name, $datacontext->id); // Format intro. list($newdb['intro'], $newdb['introformat']) = external_format_text($database->intro, $database->introformat, @@ -188,8 +188,8 @@ class mod_data_external extends external_api { array( 'id' => new external_value(PARAM_INT, 'Database id'), 'coursemodule' => new external_value(PARAM_INT, 'Course module id'), - 'course' => new external_value(PARAM_TEXT, 'Course id'), - 'name' => new external_value(PARAM_TEXT, 'Database name'), + 'course' => new external_value(PARAM_INT, 'Course id'), + 'name' => new external_value(PARAM_RAW, 'Database name'), 'intro' => new external_value(PARAM_RAW, 'The Database intro'), 'introformat' => new external_format_value('intro'), 'comments' => new external_value(PARAM_BOOL, 'comments enabled', VALUE_OPTIONAL), diff --git a/mod/forum/externallib.php b/mod/forum/externallib.php index d41444d71a6..052e2d84e35 100644 --- a/mod/forum/externallib.php +++ b/mod/forum/externallib.php @@ -86,6 +86,7 @@ class mod_forum_external extends external_api { continue; } + $forum->name = external_format_string($forum->name, $context->id); // Format the intro before being returning using the format setting. list($forum->intro, $forum->introformat) = external_format_text($forum->intro, $forum->introformat, $context->id, 'mod_forum', 'intro', 0); @@ -113,9 +114,9 @@ class mod_forum_external extends external_api { new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'Forum id'), - 'course' => new external_value(PARAM_TEXT, 'Course id'), + 'course' => new external_value(PARAM_INT, 'Course id'), 'type' => new external_value(PARAM_TEXT, 'The forum type'), - 'name' => new external_value(PARAM_TEXT, 'Forum name'), + 'name' => new external_value(PARAM_RAW, 'Forum name'), 'intro' => new external_value(PARAM_RAW, 'The forum intro'), 'introformat' => new external_format_value('intro'), 'assessed' => new external_value(PARAM_INT, 'Aggregate type'),