. /** * Creates an upload form on the settings page. * * @package mod_customcert * @copyright 2013 Mark Nelson * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once($CFG->libdir.'/adminlib.php'); require_once($CFG->dirroot.'/mod/customcert/upload_image_form.php'); /** * Class extends admin setting class to allow/process an uploaded file */ class mod_customcert_admin_setting_upload extends admin_setting_configtext { /** * Output the link to the upload image page. * * @param mixed $data * @param string $query * @return string */ public function output_html($data, $query = '') { // Create a dummy variable for this field to avoid being redirected back to the upgrade settings page. $this->config_write($this->name, ''); return format_admin_setting($this, $this->visiblename, html_writer::link(new moodle_url('/mod/customcert/upload_image.php'), get_string('upload')), $this->description, true, '', null, $query); } }