Skip to content

Commit 4ebc49a

Browse files
Merge pull request #56 from mwehr/PHP8_compatibility
Fixes PHP8 deprecation warning
2 parents ef447a5 + 7b5f2fd commit 4ebc49a

File tree

3 files changed

+95
-95
lines changed

3 files changed

+95
-95
lines changed

controller.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
// Make sure user is allowed to see cm with the question. (Might happen if user changes commentid in url).
5353
list($insql, $inparams) = $DB->get_in_or_equal(array_keys($cminfo));
5454
$sql = "SELECT c.*, a.page, cm.id AS cmid "
55-
. "FROM {pdfannotator_comments} c "
56-
. "JOIN {pdfannotator_annotations} a ON c.annotationid = a.id "
57-
. "JOIN {pdfannotator} p ON a.pdfannotatorid = p.id "
58-
. "JOIN {course_modules} cm ON p.id = cm.instance "
59-
. "WHERE c.isdeleted = 0 AND c.id = ? AND cm.id $insql";
55+
. "FROM {pdfannotator_comments} c "
56+
. "JOIN {pdfannotator_annotations} a ON c.annotationid = a.id "
57+
. "JOIN {pdfannotator} p ON a.pdfannotatorid = p.id "
58+
. "JOIN {course_modules} cm ON p.id = cm.instance "
59+
. "WHERE c.isdeleted = 0 AND c.id = ? AND cm.id $insql";
6060
$params = array_merge([$commentid], $inparams);
6161
$comments = $DB->get_records_sql($sql, $params);
6262
$error = false;
@@ -426,7 +426,7 @@
426426

427427
if ($action === 'view') { // Default.
428428
$PAGE->set_title("annotatorview");
429-
echo $myrenderer->pdfannotator_render_tabs($taburl, $action, $pdfannotator->name, $context);
429+
echo $myrenderer->pdfannotator_render_tabs($taburl, $pdfannotator->name, $context, $action);
430430

431431
pdfannotator_display_embed($pdfannotator, $cm, $course, $file, $page, $annoid, $commid);
432432
}
@@ -439,7 +439,7 @@
439439

440440
require_once($CFG->dirroot . '/mod/pdfannotator/model/statistics.class.php');
441441

442-
echo $myrenderer->pdfannotator_render_tabs($taburl, $action, $pdfannotator->name, $context);
442+
echo $myrenderer->pdfannotator_render_tabs($taburl, $pdfannotator->name, $context, $action);
443443
$PAGE->set_title("statisticview");
444444
echo $OUTPUT->heading(get_string('activities', 'pdfannotator'));
445445

@@ -488,7 +488,7 @@
488488
/* * ******************* Form processing and displaying is done here ************************ */
489489
if ($mform->is_cancelled()) {
490490
$action = 'view';
491-
echo $myrenderer->pdfannotator_render_tabs($taburl, $action, $pdfannotator->name, $context);
491+
echo $myrenderer->pdfannotator_render_tabs($taburl, $pdfannotator->name, $context, $action);
492492
pdfannotator_display_embed($pdfannotator, $cm, $course, $file);
493493
} else if ($report = $mform->get_data()) { // Process validated data. $mform->get_data() returns data posted in form.
494494
require_sesskey();
@@ -501,7 +501,7 @@
501501
$report->url = $CFG->wwwroot . '/mod/pdfannotator/view.php?id=' . $cm->id . '&action=overviewreports';
502502
$messagetext = new stdClass();
503503
$modulename = format_string($cm->name, true);
504-
$messagetext->text = pdfannotator_format_notification_message_text($course, $cm, $context, get_string('modulename', 'pdfannotator'), $modulename, $report, 'reportadded');
504+
$messagetext->text = pdfannotator_format_notification_message_text($course, $cm, $context, get_string('modulename', 'pdfannotator'), $modulename, $report, 'reportadded');
505505
$messagetext->url = $report->url;
506506
try {
507507
foreach ($recipients as $recipient) {
@@ -531,7 +531,7 @@
531531
}
532532

533533
$action = 'view';
534-
echo $myrenderer->pdfannotator_render_tabs($taburl, $action, $pdfannotator->name, $context);
534+
echo $myrenderer->pdfannotator_render_tabs($taburl, $pdfannotator->name, $context, $action);
535535
pdfannotator_display_embed($pdfannotator, $cm, $course, $file);
536536
} else { // This branch is executed if the form is submitted but the data doesn't validate and the form should be redisplayed
537537
// or on the first display of the form.

0 commit comments

Comments
 (0)