dirroot/repository/lib.php"); $options = (array)$options; 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); } function setHiddenLabel($hiddenLabel){ $this->_hiddenLabel = $hiddenLabel; } function toHtml(){ global $CFG, $COURSE, $USER, $PAGE, $OUTPUT; $id = $this->_attributes['id']; $elname = $this->_attributes['name']; if ($this->_hiddenLabel) { $this->_generateId(); $str = ''.parent::toHtml(); } else { $str = parent::toHtml(); } if (empty($this->_options['usefilepicker'])) { return $str; } $strsaved = get_string('filesaved', 'repository'); $straddlink = get_string('choosealink', 'repository'); if ($COURSE->id == SITEID) { $context = get_context_instance(CONTEXT_SYSTEM); } else { $context = get_context_instance(CONTEXT_COURSE, $COURSE->id); } $client_id = uniqid(); $str .= <<