From 5eb0d6ad038c87a480eb4ce0cccbb404b15a16a5 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Thu, 18 Sep 2008 22:29:39 +0100 Subject: [PATCH] MDL-16541 make plain text resource export as html --- mod/resource/lib.php | 7 +++---- mod/resource/type/text/resource.class.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mod/resource/lib.php b/mod/resource/lib.php index 6eb9dee..fa663b7 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -254,11 +254,10 @@ class resource_base { } - function portfolio_prepare_package_online($exporter, $text=false) { - $filename = clean_filename($this->cm->name . '.' . (($text) ? 'txt' : 'html')); + function portfolio_prepare_package_online($exporter) { + $filename = clean_filename($this->cm->name . '.html'); $formatoptions = (object)array('noclean' => true); - $format = (($text) ? FORMAT_MOODLE : FORMAT_HTML); - $content = format_text($this->resource->alltext, $format, $formatoptions, $this->course->id); + $content = format_text($this->resource->alltext, FORMAT_HTML, $formatoptions, $this->course->id); return $exporter->write_new_file($content, $filename); } diff --git a/mod/resource/type/text/resource.class.php b/mod/resource/type/text/resource.class.php index 9fed61d..680ec00 100644 --- a/mod/resource/type/text/resource.class.php +++ b/mod/resource/type/text/resource.class.php @@ -200,7 +200,7 @@ function setup_elements(&$mform) { function portfolio_prepare_package($exporter) { - return parent::portfolio_prepare_package_online($exporter, true); + return parent::portfolio_prepare_package_online($exporter); } function portfolio_get_sha1() { -- 1.5.6.5