"MDL-20470, add an option to enable/disable filepicker button"
This commit is contained in:
@@ -206,7 +206,6 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
|
||||
$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),
|
||||
|
||||
@@ -121,7 +121,6 @@ $string['uploading'] = 'Uploading...';
|
||||
$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';
|
||||
|
||||
+4
-1
@@ -23,6 +23,9 @@ class MoodleQuickForm_url extends HTML_QuickForm_text{
|
||||
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();
|
||||
}
|
||||
@@ -43,7 +46,7 @@ class MoodleQuickForm_url extends HTML_QuickForm_text{
|
||||
} else {
|
||||
$str = parent::toHtml();
|
||||
}
|
||||
if (!$CFG->repositoryusepickerbutton) {
|
||||
if (empty($this->_options['usefilepicker'])) {
|
||||
return $str;
|
||||
}
|
||||
$strsaved = get_string('filesaved', 'repository');
|
||||
|
||||
@@ -46,7 +46,7 @@ class mod_url_mod_form extends moodleform_mod {
|
||||
|
||||
//-------------------------------------------------------
|
||||
$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'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user