mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-64675' of https://github.com/paulholden/moodle
This commit is contained in:
commit
efaade00b5
@ -57,9 +57,13 @@ $PAGE->set_url($url);
|
||||
// If the typ is pagebreak so the item will be saved directly.
|
||||
if (!$item->id && $typ === 'pagebreak') {
|
||||
require_sesskey();
|
||||
feedback_create_pagebreak($feedback->id);
|
||||
redirect($editurl->out(false));
|
||||
exit;
|
||||
|
||||
$redirectmessage = '';
|
||||
if (!feedback_create_pagebreak($feedback->id)) {
|
||||
$redirectmessage = get_string('cannotcreatepagebreak', 'mod_feedback');
|
||||
}
|
||||
|
||||
redirect($editurl, $redirectmessage, null, \core\output\notification::NOTIFY_WARNING);
|
||||
}
|
||||
|
||||
//get the existing item or create it
|
||||
|
@ -41,6 +41,7 @@ $string['bold'] = 'Bold';
|
||||
$string['calendarend'] = '{$a} closes';
|
||||
$string['calendarstart'] = '{$a} opens';
|
||||
$string['cannotaccess'] = 'You can only access this feedback from a course';
|
||||
$string['cannotcreatepagebreak'] = 'Page breaks cannot be added at the beginning of a feedback, and only one page break can be added at the end';
|
||||
$string['cannotsavetempl'] = 'Saving templates is not allowed';
|
||||
$string['captcha'] = 'Captcha';
|
||||
$string['captchanotset'] = 'Captcha hasn\'t been set.';
|
||||
|
@ -1972,7 +1972,7 @@ function feedback_delete_completedtmp() {
|
||||
function feedback_create_pagebreak($feedbackid) {
|
||||
global $DB;
|
||||
|
||||
//check if there already is a pagebreak on the last position
|
||||
// Disallow pagebreak if there's already one present in last position, or the feedback has no items.
|
||||
$lastposition = $DB->count_records('feedback_item', array('feedback'=>$feedbackid));
|
||||
if ($lastposition == feedback_get_last_break_position($feedbackid)) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user