Merge branch 'MDL-38852-master' of git://github.com/danpoltawski/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2013-04-05 02:51:48 +02:00
commit c5f4080a10
9 changed files with 16 additions and 0 deletions

View File

@ -274,6 +274,7 @@ class repository_alfresco extends repository {
return false;
}
$mform->addElement('text', 'alfresco_url', get_string('alfresco_url', 'repository_alfresco'), array('size' => '40'));
$mform->setType('alfresco_url', PARAM_URL);
$mform->addElement('static', 'alfreco_url_intro', '', get_string('alfrescourltext', 'repository_alfresco'));
$mform->addRule('alfresco_url', get_string('required'), 'required', null, 'client');
return true;

View File

@ -227,6 +227,7 @@ class repository_boxnet extends repository {
$strrequired = get_string('required');
$mform->addElement('text', 'api_key', get_string('apikey', 'repository_boxnet'), array('value'=>$api_key,'size' => '40'));
$mform->addRule('api_key', $strrequired, 'required', null, 'client');
$mform->setType('api_key', PARAM_RAW_TRIMMED);
$mform->addElement('static', null, '', get_string('information','repository_boxnet'));
//retrieve the flickr instances

View File

@ -458,10 +458,12 @@ class repository_dropbox extends repository {
$strrequired = get_string('required');
$mform->addElement('text', 'dropbox_key', get_string('apikey', 'repository_dropbox'), array('value'=>$key,'size' => '40'));
$mform->setType('dropbox_key', PARAM_RAW_TRIMMED);
$mform->addElement('text', 'dropbox_secret', get_string('secret', 'repository_dropbox'), array('value'=>$secret,'size' => '40'));
$mform->addRule('dropbox_key', $strrequired, 'required', null, 'client');
$mform->addRule('dropbox_secret', $strrequired, 'required', null, 'client');
$mform->setType('dropbox_secret', PARAM_RAW_TRIMMED);
$str_getkey = get_string('instruction', 'repository_dropbox');
$mform->addElement('static', null, '', $str_getkey);

View File

@ -207,6 +207,7 @@ class repository_filesystem extends repository {
if (empty($choices)) {
$mform->addElement('static', '', '', get_string('nosubdir', 'repository_filesystem', $path));
$mform->addElement('hidden', 'fs_path', '');
$mform->setType('fs_path', PARAM_PATH);
} else {
$mform->addElement('select', 'fs_path', $fieldname, $choices);
$mform->addElement('static', null, '', get_string('information','repository_filesystem', $path));

View File

@ -299,7 +299,9 @@ class repository_flickr extends repository {
$strrequired = get_string('required');
$mform->addElement('text', 'api_key', get_string('apikey', 'repository_flickr'), array('value'=>$api_key,'size' => '40'));
$mform->setType('api_key', PARAM_RAW_TRIMMED);
$mform->addElement('text', 'secret', get_string('secret', 'repository_flickr'), array('value'=>$secret,'size' => '40'));
$mform->setType('secret', PARAM_RAW_TRIMMED);
//retrieve the flickr instances
$params = array();

View File

@ -484,6 +484,7 @@ class repository_flickr_public extends repository {
*/
public static function instance_config_form($mform) {
$mform->addElement('text', 'email_address', get_string('emailaddress', 'repository_flickr_public'));
$mform->setType('email_address', PARAM_RAW_TRIMMED); // This is for sending to flickr. Not our job to validate it.
$mform->addElement('checkbox', 'usewatermarks', get_string('watermark', 'repository_flickr_public'));
$mform->setDefault('usewatermarks', 0);
}
@ -508,6 +509,7 @@ class repository_flickr_public extends repository {
$strrequired = get_string('required');
$mform->addElement('text', 'api_key', get_string('apikey', 'repository_flickr_public'), array('value'=>$api_key,'size' => '40'));
$mform->setType('api_key', PARAM_RAW_TRIMMED);
$mform->addRule('api_key', $strrequired, 'required', null, 'client');
$mform->addElement('static', null, '', get_string('information','repository_flickr_public'));

View File

@ -147,6 +147,7 @@ class repository_merlot extends repository {
}
$strrequired = get_string('required');
$mform->addElement('text', 'licensekey', get_string('licensekey', 'repository_merlot'), array('value'=>$licensekey,'size' => '40'));
$mform->setType('licensekey', PARAM_RAW_TRIMMED);
$mform->addRule('licensekey', $strrequired, 'required', null, 'client');
}

View File

@ -236,7 +236,9 @@ class repository_s3 extends 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->addRule('access_key', $strrequired, 'required', null, 'client');
$mform->addRule('secret_key', $strrequired, 'required', null, 'client');
}

View File

@ -166,9 +166,11 @@ class repository_webdav extends repository {
$mform->addElement('text', 'webdav_server', get_string('webdav_server', 'repository_webdav'), array('size' => '40'));
$mform->addRule('webdav_server', get_string('required'), 'required', null, 'client');
$mform->setType('webdav_server', PARAM_HOST);
$mform->addElement('text', 'webdav_path', get_string('webdav_path', 'repository_webdav'), array('size' => '40'));
$mform->addRule('webdav_path', get_string('required'), 'required', null, 'client');
$mform->setType('webdav_path', PARAM_PATH);
$choices = array();
$choices['none'] = get_string('none');
@ -178,7 +180,9 @@ class repository_webdav extends repository {
$mform->addRule('webdav_auth', get_string('required'), 'required', null, 'client');
$mform->addElement('text', 'webdav_port', get_string('webdav_port', 'repository_webdav'), array('size' => '40'));
$mform->setType('webdav_port', PARAM_INT);
$mform->addElement('text', 'webdav_user', get_string('webdav_user', 'repository_webdav'), array('size' => '40'));
$mform->setType('webdav_user', PARAM_RAW_TRIMMED); // Not for us to clean.
$mform->addElement('password', 'webdav_password', get_string('webdav_password', 'repository_webdav'),
array('size' => '40'));
}