Skip to content

Commit

Permalink
Merge branch 'MDL-29872_c' of git://github.com/rwijaya/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Sep 12, 2012
2 parents 7ec6851 + a343321 commit 4113e29
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions files/renderer.php
Expand Up @@ -526,6 +526,7 @@ private function fp_js_template_generallayout() {
<div class="{!}fp-tb-logout"><img src="'.$this->pix_url('a/logout').'" /><a href="#"></a></div>
<div class="{!}fp-tb-manage"><a href="#"><img src="'.$this->pix_url('a/setting').'" /> '.get_string('manageurl', 'repository').'</a></div>
<div class="{!}fp-tb-help"><a href="#"><img src="'.$this->pix_url('a/help').'" /> '.get_string('help').'</a></div>
<div class="{!}fp-tb-message"></div>
</div>
<div class="{!}fp-viewbar">
<a class="{!}fp-vb-icons" href="#"></a>
Expand Down
1 change: 1 addition & 0 deletions repository/dropbox/lang/en/repository_dropbox.php
Expand Up @@ -33,3 +33,4 @@
$string['cachelimit'] = 'Cache limit';
$string['cachelimit_info'] = 'Enter the maximum size of files (in bytes) to be cached on server for Dropbox aliases/shortcuts. Cached files will be served when the source is no longer available. Empty value or zero mean caching of all files regardless of size.';
$string['dropbox:view'] = 'View a Dropbox folder';
$string['logoutdesc'] = '(Logout when you finish using Dropbox)';
2 changes: 2 additions & 0 deletions repository/dropbox/lib.php
Expand Up @@ -179,6 +179,8 @@ public function get_listing($path = '', $page = '1') {
$list['manage'] = 'https://www.dropbox.com/home';
$list['dynload'] = true;
$list['nosearch'] = true;
$list['logouturl'] = 'https://www.dropbox.com/logout';
$list['message'] = get_string('logoutdesc', 'repository_dropbox');
// process breadcrumb trail
$list['path'] = array(
array('name'=>get_string('dropbox', 'repository_dropbox'), 'path'=>'/')
Expand Down
11 changes: 10 additions & 1 deletion repository/filepicker.js
Expand Up @@ -1386,6 +1386,8 @@ M.core_filepicker.init = function(Y, options) {
this.active_repo.norefresh = (data.login || data.norefresh); // this is either login form or 'norefresh' attribute set
this.active_repo.nologin = (data.login || data.nologin); // this is either login form or 'nologin' attribute is set
this.active_repo.logouttext = data.logouttext?data.logouttext:null;
this.active_repo.logouturl = (data.logouturl || '');
this.active_repo.message = (data.message || '');
this.active_repo.help = data.help?data.help:null;
this.active_repo.manage = data.manage?data.manage:null;
this.print_header();
Expand Down Expand Up @@ -1698,6 +1700,9 @@ M.core_filepicker.init = function(Y, options) {
callback: this.display_response
}, true);
}
if (this.active_repo.logouturl) {
window.open(this.active_repo.logouturl, 'repo_auth', 'location=0,status=0,width=500,height=300,scrollbars=yes');
}
}, this);
toolbar.one('.fp-tb-refresh').one('a,button').on('click', function(e) {
e.preventDefault();
Expand All @@ -1720,7 +1725,7 @@ M.core_filepicker.init = function(Y, options) {
callback: this.display_response
}, true);
}
}, this);
}, this);

// it does not matter what kind of element is .fp-tb-manage, we create a dummy <a>
// element and use it to open url on click event
Expand Down Expand Up @@ -1817,6 +1822,10 @@ M.core_filepicker.init = function(Y, options) {
// help url
enable_tb_control(toolbar.one('.fp-tb-help'), r.help);
Y.one('#fp-tb-help-'+client_id+'-link').set('href', r.help);

// message
enable_tb_control(toolbar.one('.fp-tb-message'), r.message);
toolbar.one('.fp-tb-message').setContent(r.message);
},
print_path: function() {
if (!this.pathbar) {
Expand Down

0 comments on commit 4113e29

Please sign in to comment.