Permalink
Browse files

Merge branch 'MDL-29872_c_m23' of git://github.com/rwijaya/moodle int…

…o MOODLE_23_STABLE
  • Loading branch information...
2 parents bd39054 + cd02957 commit cdf30c74d8c958b4dfe61ff6e2ce37988b542e42 Sam Hemelryk committed Sep 12, 2012
View
1 files/renderer.php
@@ -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>
View
1 repository/dropbox/lang/en/repository_dropbox.php
@@ -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)';
View
2 repository/dropbox/lib.php
@@ -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'=>'/')
View
13 repository/filepicker.js
@@ -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();
@@ -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();
@@ -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
@@ -1817,6 +1822,12 @@ 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
+ if (toolbar.one('.fp-tb-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) {

0 comments on commit cdf30c7

Please sign in to comment.