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

This commit is contained in:
Sam Hemelryk 2012-06-13 15:32:54 +12:00
commit a54a08b818
6 changed files with 14 additions and 17 deletions

View File

@ -270,7 +270,7 @@ class repository_alfresco extends repository {
*
* @return bool
*/
public function instance_config_form($mform) {
public static function instance_config_form($mform) {
if (!class_exists('SoapClient')) {
$mform->addElement('static', null, get_string('notice'), get_string('soapmustbeenabled', 'repository_alfresco'));
return false;

View File

@ -195,7 +195,7 @@ class repository_equella extends repository {
*
* @param moodleform $mform
*/
public function instance_config_form($mform) {
public static function instance_config_form($mform) {
$mform->addElement('text', 'equella_url', get_string('equellaurl', 'repository_equella'));
$mform->setType('equella_url', PARAM_URL);

View File

@ -166,7 +166,7 @@ class repository_filesystem extends repository {
return $ret;
}
public function instance_config_form($mform) {
public static function instance_config_form($mform) {
global $CFG, $PAGE;
if (has_capability('moodle/site:config', get_system_context())) {
$path = $CFG->dataroot . '/repository/';

View File

@ -459,7 +459,7 @@ class repository_flickr_public extends repository {
* Add Instance settings input to Moodle form
* @param object $mform
*/
public function instance_config_form($mform) {
public static function instance_config_form($mform) {
$mform->addElement('text', 'email_address', get_string('emailaddress', 'repository_flickr_public'));
$mform->addElement('checkbox', 'usewatermarks', get_string('watermark', 'repository_flickr_public'));
$mform->setDefault('usewatermarks', 0);

View File

@ -2002,7 +2002,7 @@ abstract class repository {
*
* @param moodleform $mform Moodle form (passed by reference)
*/
public function instance_config_form($mform) {
public static function instance_config_form($mform) {
}
/**
@ -2257,20 +2257,17 @@ final class repository_instance_form extends moodleform {
$mform =& $this->_form;
$this->add_defaults();
//add fields
if (!$this->instance) {
$result = repository::static_function($this->plugin, 'instance_config_form', $mform);
if ($result === false) {
$mform->removeElement('name');
}
} else {
// Add instance config options.
$result = repository::static_function($this->plugin, 'instance_config_form', $mform);
if ($result === false) {
// Remove the name element if no other config options.
$mform->removeElement('name');
}
if ($this->instance) {
$data = array();
$data['name'] = $this->instance->name;
if (!$this->instance->readonly) {
$result = $this->instance->instance_config_form($mform);
if ($result === false) {
$mform->removeElement('name');
}
// and set the data if we have some.
foreach ($this->instance->get_instance_option_names() as $config) {
if (!empty($this->instance->options[$config])) {

View File

@ -152,7 +152,7 @@ class repository_webdav extends repository {
return array('webdav_type', 'webdav_server', 'webdav_port', 'webdav_path', 'webdav_user', 'webdav_password', 'webdav_auth');
}
public function instance_config_form($mform) {
public static function instance_config_form($mform) {
$choices = array(0 => get_string('http', 'repository_webdav'), 1 => get_string('https', 'repository_webdav'));
$mform->addElement('select', 'webdav_type', get_string('webdav_type', 'repository_webdav'), $choices);
$mform->addRule('webdav_type', get_string('required'), 'required', null, 'client');