From: moodler Date: Mon, 8 Sep 2008 05:41:45 +0000 (+0000) Subject: MDL-15348 Add changes for filepicker to support the display of existing files X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=757f30a20ce38ff8bda0c9b489bcdf406e7d97df;p=moodle.git MDL-15348 Add changes for filepicker to support the display of existing files --- diff --git a/lib/form/filepicker.php b/lib/form/filepicker.php index 856782a33b..38fe4f5150 100644 --- a/lib/form/filepicker.php +++ b/lib/form/filepicker.php @@ -5,9 +5,9 @@ require_once("HTML/QuickForm/button.php"); require_once(dirname(dirname(dirname(__FILE__))) . '/repository/lib.php'); /** - * HTML class for a button type element + * HTML class for a single filepicker element (based on button) * - * @author Dongsheng Cai + * @author Moodle.com * @version 1.0 * @since Moodle 2.0 * @access public @@ -52,21 +52,24 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_button { if ($this->_flagFrozen) { return $this->getFrozenHtml(); } else { - $strsaved = get_string('filesaved', 'repository'); + $currentvalue = $this->getValue(); + $strsaved = get_string('filesaved', 'repository'); if (empty($COURSE->context)) { - $ctx = get_context_instance(CONTEXT_SYSTEM); + $context = get_context_instance(CONTEXT_SYSTEM); } else { - $ctx = $COURSE->context; + $context = $COURSE->context; } - $ret = repository_get_client($ctx); + $repository_info = repository_get_client($context); + $suffix = $repository_info['suffix']; - $suffix = $ret['suffix']; $id = $this->_attributes['id']; $elname = $this->_attributes['name']; $str = $this->_getTabs(); - $str .= ''; + $str .= ''; + $id = $this->_attributes['id']; + $str .= << function updatefile_$suffix(str){ @@ -82,8 +85,7 @@ function callpicker_$suffix(){ } EOD; - // $this->_getAttrString($this->_attributes); - $str .= ''.''.$ret['css'].$ret['js']; + $str .= ''.''.$currentvalue.''.$repository_info['css'].$repository_info['js']; return $str; } } diff --git a/version.php b/version.php index 59022b3f57..2d2d81200f 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2008090108; // YYYYMMDD = date of the last version bump + $version = 2008090800; // YYYYMMDD = date of the last version bump // XX = daily increments $release = '2.0 dev (Build: 20080908)'; // Human-friendly version name