Skip to content

Commit

Permalink
MDL-27857 Assignment does not use form tag to render portfolio export…
Browse files Browse the repository at this point in the history
… control widget

When this code was used as a part of the grading screen, the default
PORTFOLIO_ADD_FULL_FORM widget led to nested form elements. This patch replaces
the form widget with a plain text link that can be embedded safely.
  • Loading branch information
mudrd8mz committed Oct 3, 2011
1 parent 228d24f commit b777c79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mod/assignment/lib.php
Expand Up @@ -1927,7 +1927,7 @@ function print_user_files($userid=0, $return=false) {
}
if ($CFG->enableportfolios && count($files) > 1 && $this->portfolio_exportable() && has_capability('mod/assignment:exportownsubmission', $this->context)) {
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id), '/mod/assignment/locallib.php');
$output .= '<br />' . $button->to_html();
$output .= '<br />' . $button->to_html(PORTFOLIO_ADD_TEXT_LINK);
}
}

Expand Down
2 changes: 1 addition & 1 deletion mod/assignment/renderer.php
Expand Up @@ -98,7 +98,7 @@ public function __construct($context, $itemid, $filearea='submission') {
$button = new portfolio_add_button();
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id), '/mod/assignment/locallib.php');
$button->reset_formats();
$this->portfolioform = $button->to_html();
$this->portfolioform = $button->to_html(PORTFOLIO_ADD_TEXT_LINK);
}
}
$this->preprocess($this->dir, $filearea);
Expand Down

0 comments on commit b777c79

Please sign in to comment.