]> git.mjollnir.org Git - moodle.git/commitdiff
"REPOSITORY/MDL-13766, provide accepted_types when sending request"
authordongsheng <dongsheng>
Tue, 13 Jan 2009 05:04:15 +0000 (05:04 +0000)
committerdongsheng <dongsheng>
Tue, 13 Jan 2009 05:04:15 +0000 (05:04 +0000)
repository/javascript.php
repository/lib.php

index 80f1b2aff5f66d2a153228b8259692a4709b808e..cf17858fbe1f2b86f8ae7e480f72bfe3d923b68b 100644 (file)
@@ -871,6 +871,7 @@ _client.login = function() {
     params['repo_id'] = _client.repositoryid;
     params['ctx_id'] = $context->id;
     params['sesskey']= '$sesskey';
+    params['accepted_types'] = _client.accepted_types;
     _client.loading('load');
     var trans = YAHOO.util.Connect.asyncRequest('POST',
             '$CFG->httpswwwroot/repository/ws.php?action=sign', _client.req_cb, _client.postdata(params));
index 3a878b0e3fef2b2dd09a19b97decb7e05c343ded..26112e615ab45f592febc1d22d78fa1475f69aae 100644 (file)
@@ -1481,7 +1481,8 @@ abstract class repository {
                 $value->children = array_filter($value->children, array($this, 'filter'));
             }
         } else {
-            if ($accepted_types == '*' || in_array('*', $accepted_types)) {
+            if ($accepted_types == '*' or empty($accepted_types)
+                or (is_array($accepted_types) and in_array('*', $accepted_types))) {
                 $pass = true;
             } elseif (is_array($accepted_types)) {
                 foreach ($accepted_types as $type) {