Merge branch 'MDL-65019-master' of git://github.com/jleyva/moodle
[moodle.git] / course / externallib.php
index a4d322c..fb3481a 100644 (file)
@@ -326,6 +326,11 @@ class core_course_external extends external_api {
                                     'mimetypes' => array(),
                                 );
                                 foreach ($contents as $content) {
+                                    // Check repository file (only main file).
+                                    if (!isset($module['contentsinfo']['repositorytype'])) {
+                                           $module['contentsinfo']['repositorytype'] =
+                                                   isset($content['repositorytype']) ? $content['repositorytype'] : '';
+                                    }
                                     if (isset($content['filesize'])) {
                                         $module['contentsinfo']['filessize'] += $content['filesize'];
                                     }
@@ -501,6 +506,8 @@ class core_course_external extends external_api {
                                                 new external_value(PARAM_RAW, 'File mime type.'),
                                                 'Files mime types.'
                                             ),
+                                            'repositorytype' => new external_value(PARAM_PLUGIN, 'The repository type for
+                                                the main file.', VALUE_OPTIONAL),
                                         ), 'Contents summary information.', VALUE_OPTIONAL
                                     ),
                                 )