Merge branch 's8_MDL-26798_dropbox_repo' of git://github.com/dongsheng/moodle
This commit is contained in:
@@ -19,11 +19,6 @@
|
||||
* repository_dropbox class
|
||||
* This plugin is used to access user's dropbox files
|
||||
*
|
||||
* TODO:
|
||||
* Dropbox has problems to process filepath with spaces, tried to use
|
||||
* urlencode filepath, still doesn't work
|
||||
* http://code.google.com/p/dropbox-php/ has the same problem
|
||||
*
|
||||
* @since 2.0
|
||||
* @package repository
|
||||
* @subpackage dropbox
|
||||
@@ -130,18 +125,19 @@ class repository_dropbox extends repository {
|
||||
} else {
|
||||
$path = file_correct_filepath($path);
|
||||
}
|
||||
$encoded_path = str_replace("%2F", "/", rawurlencode($path));
|
||||
|
||||
$list = array();
|
||||
$list['list'] = array();
|
||||
$list['manage'] = false;
|
||||
$list['dynload'] = true;
|
||||
$list['nosearch'] = true;
|
||||
// process breacrumb trail
|
||||
// process breadcrumb trail
|
||||
$list['path'] = array(
|
||||
array('name'=>get_string('dropbox', 'repository_dropbox'), 'path'=>'/')
|
||||
);
|
||||
|
||||
$result = $this->dropbox->get_listing($path, $this->access_key, $this->access_secret);
|
||||
$result = $this->dropbox->get_listing($encoded_path, $this->access_key, $this->access_secret);
|
||||
|
||||
if (!is_object($result) || empty($result)) {
|
||||
return $list;
|
||||
|
||||
@@ -70,7 +70,8 @@ class dropbox extends oauth_helper {
|
||||
$basename = $info['basename'];
|
||||
$filepath = $dirname . rawurlencode($basename);
|
||||
if ($dirname != '/') {
|
||||
$filepath = $dirname . '/' . rawurlencode($basename);
|
||||
$filepath = $dirname . '/' . $basename;
|
||||
$filepath = str_replace("%2F", "/", rawurlencode($filepath));
|
||||
}
|
||||
|
||||
$url = $this->dropbox_content_api.'/files/'.$this->mode.$filepath;
|
||||
|
||||
Reference in New Issue
Block a user