$temp->add(new admin_setting_heading('managerepositoriescommonheading', get_string('commonsettings', 'admin'), ''));
$temp->add(new admin_setting_configtext('repositorycacheexpire', get_string('cacheexpire', 'repository'), get_string('configcacheexpire', 'repository'), 120));
$temp->add(new admin_setting_configcheckbox('repositoryuseexternallink', get_string('useexternallink', 'repository'), get_string('configuseexternallink', 'repository'), 0));
- $temp->add(new admin_setting_configcheckbox('repositoryusepickerbutton', get_string('usepickerbutton', 'repository'), '', 1));
$ADMIN->add('repositorysettings', $temp);
$ADMIN->add('repositorysettings', new admin_externalpage('repositorynew',
get_string('addplugin', 'repository'), $url, 'moodle/site:config', true),
$string['uploadsucc'] = 'The file has been uploaded successfully';
$string['useexternallink'] = 'Use external link instead downloading files';
$string['configuseexternallink'] = 'Will return the external link to file picker instead downloading external files';
-$string['usepickerbutton'] = 'Use file picker button beside text element';
$string['wrongcontext'] = 'You cannot access to this context';
$string['xhtmlerror'] = 'You are probably using XHTML strict header, some YUI Component doesn\'t work in this mode, please turn it off in moodle';
$string['ziped'] = 'Compress folder successfully';
foreach ($options as $name=>$value) {
$this->_options[$name] = $value;
}
+ if (!isset($this->_options['usefilepicker'])) {
+ $this->_options['usefilepicker'] = true;
+ }
parent::HTML_QuickForm_text($elementName, $elementLabel, $attributes);
repository_head_setup();
}
} else {
$str = parent::toHtml();
}
- if (!$CFG->repositoryusepickerbutton) {
+ if (empty($this->_options['usefilepicker'])) {
return $str;
}
$strsaved = get_string('filesaved', 'repository');
//-------------------------------------------------------
$mform->addElement('header', 'content', get_string('contentheader', 'url'));
- $mform->addElement('url', 'externalurl', get_string('externalurl', 'url'), array('size'=>'60'), null);
+ $mform->addElement('url', 'externalurl', get_string('externalurl', 'url'), array('size'=>'60'), array('usefilepicker'=>true));
//-------------------------------------------------------
$mform->addElement('header', 'optionssection', get_string('optionsheader', 'url'));