Commit 5fb29115 authored by Penny Leach's avatar Penny Leach
Browse files

portfolio MDL-21079 updated a few more portfolio_callers

fixed a few more that were pointing to lib.php rather than locallib.php
parent 521a6ab0
......@@ -44,7 +44,7 @@ class portfoliolibaddbutton_test extends FakeDBUnitTestCase {
function test_set_formats() {
$button = new portfolio_add_button();
$button->set_callback_options('assignment_portfolio_caller', array('id' => 6), '/mod/assignment/lib.php');
$button->set_callback_options('assignment_portfolio_caller', array('id' => 6), '/mod/assignment/locallib.php');
$formats = array(PORTFOLIO_FORMAT_FILE, PORTFOLIO_FORMAT_IMAGE);
$button->set_formats($formats);
......
......@@ -1820,7 +1820,7 @@ class assignment_base {
$output .= '<br />';
}
if (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));
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id), '/mod/assignment/locallib.php');
$output .= '<br />' . $button->to_html();
}
}
......
......@@ -109,7 +109,7 @@ class assignment_online extends assignment_base {
$text = file_rewrite_pluginfile_urls($submission->data1, 'pluginfile.php', $this->context->id, 'assignment_online_submission', $this->assignment->id);
echo format_text($text, $submission->data2);
$button = new portfolio_add_button();
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id), '/mod/assignment/lib.php');
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id), '/mod/assignment/locallib.php');
$button->set_formats(PORTFOLIO_FORMAT_PLAINHTML); //TODO this might have files?
$button->render();
} else if (!has_capability('mod/assignment:submit', $context)) { //fix for #4604
......
......@@ -360,14 +360,14 @@ class assignment_upload extends assignment_base {
}
if (has_capability('mod/assignment:exportownsubmission', $this->context)) {
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id, 'fileid' => $file->get_id()), '/mod/assignment/lib.php');
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id, 'fileid' => $file->get_id()), '/mod/assignment/locallib.php');
$button->set_format_by_file($file);
$output .= $button->to_html(PORTFOLIO_ADD_ICON_LINK);
}
$output .= '<br />';
}
if (count($files) > 1 && has_capability('mod/assignment:exportownsubmission', $this->context)) {
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id), '/mod/assignment/lib.php');
$button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id), '/mod/assignment/locallib.php');
$button->reset_formats(); // reset what we set before, since it's multi-file
$output .= $button->to_html();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment