"REPOSITORY/MDL-13766, provide accepted_types when sending request"

This commit is contained in:
dongsheng
2009-01-13 05:04:15 +00:00
parent 00cd897979
commit 46ee50dcc3
2 changed files with 3 additions and 1 deletions
+1
View 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));
+2 -1
View 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) {