MDL-13766
1. remove repo_id field in plugin 2. remove reset varible in javascript code.
This commit is contained in:
@@ -144,27 +144,23 @@ class repository_boxnet extends repository{
|
||||
$t = $this->box->getTicket();
|
||||
$ret = $this->get_login();
|
||||
if ($this->options['ajax']) {
|
||||
$e1->type = 'hidden';
|
||||
$e1->name = 'ticket';
|
||||
$e1->value = $t['ticket'];
|
||||
$ticket_field->type = 'hidden';
|
||||
$ticket_field->name = 'ticket';
|
||||
$ticket_field->value = $t['ticket'];
|
||||
|
||||
$e2->type = 'hidden';
|
||||
$e2->name = 'repo_id';
|
||||
$e2->value = $this->id;
|
||||
|
||||
$e3->label = get_string('username', 'repository_boxnet').': ';
|
||||
$e3->id = 'box_username';
|
||||
$e3->type = 'text';
|
||||
$e3->name = 'boxusername';
|
||||
$e3->value = $ret->username;
|
||||
$user_field->label = get_string('username', 'repository_boxnet').': ';
|
||||
$user_field->id = 'box_username';
|
||||
$user_field->type = 'text';
|
||||
$user_field->name = 'boxusername';
|
||||
$user_field->value = $ret->username;
|
||||
|
||||
$e4->label = get_string('password', 'repository_boxnet').': ';
|
||||
$e4->id = 'box_password';
|
||||
$e4->type = 'password';
|
||||
$e4->name = 'boxpassword';
|
||||
$passwd_field->label = get_string('password', 'repository_boxnet').': ';
|
||||
$passwd_field->id = 'box_password';
|
||||
$passwd_field->type = 'password';
|
||||
$passwd_field->name = 'boxpassword';
|
||||
|
||||
$ret = array();
|
||||
$ret['login'] = array($e1, $e2, $e3, $e4);
|
||||
$ret['login'] = array($ticket_field, $user_field, $passwd_field);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,15 +68,11 @@ class repository_flickr_public extends repository{
|
||||
public function print_login($ajax = true){
|
||||
if($ajax){
|
||||
$ret = array();
|
||||
$e1->label = get_string('username', 'repository_flickr_public').': ';
|
||||
$e1->id = 'account';
|
||||
$e1->type = 'text';
|
||||
$e1->name = 'flickr_account';
|
||||
|
||||
$e2->type = 'hidden';
|
||||
$e2->name = 'repo_id';
|
||||
$e2->value = $this->id;
|
||||
$ret['login'] = array($e1, $e2);
|
||||
$email_field->label = get_string('username', 'repository_flickr_public').': ';
|
||||
$email_field->id = 'account';
|
||||
$email_field->type = 'text';
|
||||
$email_field->name = 'flickr_account';
|
||||
$ret['login'] = array($email_field);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1943,6 +1943,7 @@ _client.login = function() {
|
||||
}
|
||||
}
|
||||
params['env'] = _client.env;
|
||||
params['repo_id'] = _client.repositoryid;
|
||||
params['ctx_id'] = $context->id;
|
||||
params['sesskey']= '$sesskey';
|
||||
_client.loading('load');
|
||||
@@ -1965,18 +1966,17 @@ _client.hide = function() {
|
||||
_client.viewfiles();
|
||||
}
|
||||
// request file list or login
|
||||
_client.req = function(id, path, reset) {
|
||||
_client.req = function(id, path, logout) {
|
||||
_client.viewbar.set('disabled', false);
|
||||
_client.loading('load');
|
||||
_client.repositoryid = id;
|
||||
if (reset == 1) {
|
||||
if (logout == 1) {
|
||||
action = 'logout';
|
||||
} else {
|
||||
action = 'list';
|
||||
}
|
||||
var params = [];
|
||||
params['p'] = path;
|
||||
params['reset']=reset;
|
||||
params['env']=_client.env;
|
||||
params['action']=action;
|
||||
params['sesskey']='$sesskey';
|
||||
|
||||
Reference in New Issue
Block a user