Skip to content

Instantly share code, notes, and snippets.

@DanBennettUK
Created January 20, 2015 15:18
Show Gist options
  • Save DanBennettUK/59cbcae4601a951da005 to your computer and use it in GitHub Desktop.
Save DanBennettUK/59cbcae4601a951da005 to your computer and use it in GitHub Desktop.
public static function type_config_form($mform, $classname = 'repository') {
parent::type_config_form($mform);
$strrequired = get_string('required');
$mform->addElement('text', 'access_key', get_string('access_key', 'repository_s3'));
$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);
$mform->addElement('text', 'endpoint', get_string('endpoint', 'repository_s3'));
$mform->setType('endpoint', PARAM_RAW_TRIMMED);
$mform->setDefault('endpoint', 's3.amazonaws.com');
$mform->addRule('access_key', $strrequired, 'required', null, 'client');
$mform->addRule('secret_key', $strrequired, 'required', null, 'client');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment