From aba5044091f6850b37c480be3e597234569488a5 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Tue, 8 Oct 2013 13:59:16 +0700 Subject: [PATCH] MDL-26244 mod_date:added some logic show or hide the file picker button based on repository availability --- lib/form/url.php | 24 +++++++++++------------- mod/data/field/url/field.class.php | 4 +++- repository/filepicker.js | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/form/url.php b/lib/form/url.php index aa7100e35d1..1193086c332 100644 --- a/lib/form/url.php +++ b/lib/form/url.php @@ -79,7 +79,7 @@ class MoodleQuickForm_url extends HTML_QuickForm_text{ * @return string */ function toHtml(){ - global $CFG, $COURSE, $USER, $PAGE, $OUTPUT; + global $PAGE, $OUTPUT; $id = $this->_attributes['id']; $elname = $this->_attributes['name']; @@ -94,20 +94,9 @@ class MoodleQuickForm_url extends HTML_QuickForm_text{ if (empty($this->_options['usefilepicker'])) { return $str; } - $strsaved = get_string('filesaved', 'repository'); - $straddlink = get_string('choosealink', 'repository'); - if ($COURSE->id == SITEID) { - $context = context_system::instance(); - } else { - $context = context_course::instance($COURSE->id); - } + $client_id = uniqid(); - $str .= <<