Skip to content

Commit

Permalink
MDL-16587 portfolio export formats - support straight file export not…
Browse files Browse the repository at this point in the history
… just RICHHTML (html + attachments) , it doesn't make sense in things like box.net
  • Loading branch information
mjollnir_ committed Nov 11, 2008
1 parent 1ab1728 commit 62e7195
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lang/en_utf8/portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
$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';
Expand Down
2 changes: 1 addition & 1 deletion mod/data/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2767,7 +2767,7 @@ public static function formats($fields, $record) {
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);
}
Expand Down
4 changes: 2 additions & 2 deletions mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -7300,7 +7300,7 @@ public function load_data() {
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);
}
Expand Down
4 changes: 4 additions & 0 deletions portfolio/type/boxnet/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,8 @@ public function instance_sanity_check() {
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
}
}

0 comments on commit 62e7195

Please sign in to comment.