From: mjollnir_ Date: Tue, 11 Nov 2008 19:54:50 +0000 (+0000) Subject: MDL-16587 portfolio export formats - support straight file export not just RICHHTML... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=62e71954808fab46659ec98137cae054384d0d8d;p=moodle.git MDL-16587 portfolio export formats - support straight file export not just RICHHTML (html + attachments) , it doesn't make sense in things like box.net --- diff --git a/lang/en_utf8/portfolio.php b/lang/en_utf8/portfolio.php index 8b4ef3d011..f957c94d8e 100644 --- a/lang/en_utf8/portfolio.php +++ b/lang/en_utf8/portfolio.php @@ -41,7 +41,8 @@ $string['failedtopackage'] = 'Could not find files to package'; $string['filedenied'] = 'Access denied to this file'; $string['filenotfound'] = 'File not found'; $string['format_file'] = 'File'; -$string['format_html'] = 'HTML'; +$string['format_richhtml'] = 'HTML with attachments'; +$string['format_plainhtml'] = 'HTML'; $string['format_image'] = 'Image'; $string['format_mbkp'] = 'Moodle Backup Format'; $string['format_video'] = 'Video'; diff --git a/mod/data/lib.php b/mod/data/lib.php index d097bc3374..861e5fdc78 100755 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -2767,7 +2767,7 @@ class data_portfolio_caller extends portfolio_module_caller_base { if (count($includedfiles) == 1 && count($fields) == 1) { $formats= array(portfolio_format_from_file($includedfiles[0])); } else if (count($includedfiles) > 0) { - $formats = array(PORTFOLIO_FORMAT_RICHHTML); + $formats = array(PORTFOLIO_FORMAT_FILE, PORTFOLIO_FORMAT_RICHHTML); } return array($formats, $includedfiles); } diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 7b82ca4d83..31e34a5abc 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3184,7 +3184,7 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa if (empty($attachments)) { $button->set_formats(PORTFOLIO_FORMAT_PLAINHTML); } else { - $button->set_formats(PORTFOLIO_FORMAT_RICHHTML); + $button->set_formats(PORTFOLIO_FORMAT_FILE, PORTFOLIO_FORMAT_RICHHTML); } $commands[] = $button->to_html(PORTFOLIO_ADD_TEXT_LINK); } @@ -7300,7 +7300,7 @@ class forum_portfolio_caller extends portfolio_module_caller_base { if ($this->attachment) { // do nothing } else if (!empty($this->multifiles) || !empty($this->singlefile)) { - $this->supportedformats = array(PORTFOLIO_FORMAT_RICHHTML); + $this->supportedformats = array(PORTFOLIO_FORMAT_FILE, PORTFOLIO_FORMAT_RICHHTML); } else { $this->supportedformats = array(PORTFOLIO_FORMAT_PLAINHTML); } diff --git a/portfolio/type/boxnet/lib.php b/portfolio/type/boxnet/lib.php index 91668a82f0..0763c9f525 100644 --- a/portfolio/type/boxnet/lib.php +++ b/portfolio/type/boxnet/lib.php @@ -243,4 +243,8 @@ class portfolio_plugin_boxnet extends portfolio_plugin_push_base { public static function allows_multiple() { return false; } + + public static function supported_formats() { + return array(PORTFOLIO_FORMAT_FILE); // don't support rich html, it breaks links + } }