]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-20470, add an option to enable/disable filepicker button"
authordongsheng <dongsheng>
Wed, 14 Oct 2009 03:11:48 +0000 (03:11 +0000)
committerdongsheng <dongsheng>
Wed, 14 Oct 2009 03:11:48 +0000 (03:11 +0000)
admin/settings/plugins.php
lang/en_utf8/repository.php
lib/form/url.php
mod/url/mod_form.php

index fd30e8239e0e8b37f6f158b6898a771ad2939d25..0fd5a1c7f6ea57283daa57f47d0087021178716f 100644 (file)
@@ -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),
index 486a5f6187e5295789cb22835f6112f96db2fb84..586236c07db90dc607bb1b7dd76f9865a3e887e8 100644 (file)
@@ -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';
index a167e365bae3e4614af08ba77ea2e20e1b053977..2c82eeb1a7106b269bdc0ac5024571b53c58be3a 100755 (executable)
@@ -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');
index ce9b3db9b5b4326fb57845b86d8749aac8d095ba..abab8c7ebb7fe66bf84b7bd30f8d996fe5650441 100644 (file)
@@ -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'));