MDL-43752 repository_s3: Using setDefault

This commit is contained in:
David Monllao 2015-02-03 10:59:58 +08:00
parent 5428d6b065
commit 9afe4eb556

View File

@ -256,8 +256,8 @@ class repository_s3 extends repository {
$mform->setType('access_key', PARAM_RAW_TRIMMED);
$mform->addElement('text', 'secret_key', get_string('secret_key', 'repository_s3'));
$mform->setType('secret_key', PARAM_RAW_TRIMMED);
$endpointselected = $mform->addElement('select', 'endpoint', get_string('endpoint', 'repository_s3'), $endpointselect);
$endpointselected->setSelected('s3.amazonaws.com'); // Default to US Endpoint.
$mform->addElement('select', 'endpoint', get_string('endpoint', 'repository_s3'), $endpointselect);
$mform->setDefault('endpoint', 's3.amazonaws.com'); // Default to US Endpoint.
$mform->addRule('access_key', $strrequired, 'required', null, 'client');
$mform->addRule('secret_key', $strrequired, 'required', null, 'client');
}