|
52 | 52 | // Make sure user is allowed to see cm with the question. (Might happen if user changes commentid in url). |
53 | 53 | list($insql, $inparams) = $DB->get_in_or_equal(array_keys($cminfo)); |
54 | 54 | $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"; |
60 | 60 | $params = array_merge([$commentid], $inparams); |
61 | 61 | $comments = $DB->get_records_sql($sql, $params); |
62 | 62 | $error = false; |
|
426 | 426 |
|
427 | 427 | if ($action === 'view') { // Default. |
428 | 428 | $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); |
430 | 430 |
|
431 | 431 | pdfannotator_display_embed($pdfannotator, $cm, $course, $file, $page, $annoid, $commid); |
432 | 432 | } |
|
439 | 439 |
|
440 | 440 | require_once($CFG->dirroot . '/mod/pdfannotator/model/statistics.class.php'); |
441 | 441 |
|
442 | | - echo $myrenderer->pdfannotator_render_tabs($taburl, $action, $pdfannotator->name, $context); |
| 442 | + echo $myrenderer->pdfannotator_render_tabs($taburl, $pdfannotator->name, $context, $action); |
443 | 443 | $PAGE->set_title("statisticview"); |
444 | 444 | echo $OUTPUT->heading(get_string('activities', 'pdfannotator')); |
445 | 445 |
|
|
488 | 488 | /* * ******************* Form processing and displaying is done here ************************ */ |
489 | 489 | if ($mform->is_cancelled()) { |
490 | 490 | $action = 'view'; |
491 | | - echo $myrenderer->pdfannotator_render_tabs($taburl, $action, $pdfannotator->name, $context); |
| 491 | + echo $myrenderer->pdfannotator_render_tabs($taburl, $pdfannotator->name, $context, $action); |
492 | 492 | pdfannotator_display_embed($pdfannotator, $cm, $course, $file); |
493 | 493 | } else if ($report = $mform->get_data()) { // Process validated data. $mform->get_data() returns data posted in form. |
494 | 494 | require_sesskey(); |
|
501 | 501 | $report->url = $CFG->wwwroot . '/mod/pdfannotator/view.php?id=' . $cm->id . '&action=overviewreports'; |
502 | 502 | $messagetext = new stdClass(); |
503 | 503 | $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'); |
505 | 505 | $messagetext->url = $report->url; |
506 | 506 | try { |
507 | 507 | foreach ($recipients as $recipient) { |
|
531 | 531 | } |
532 | 532 |
|
533 | 533 | $action = 'view'; |
534 | | - echo $myrenderer->pdfannotator_render_tabs($taburl, $action, $pdfannotator->name, $context); |
| 534 | + echo $myrenderer->pdfannotator_render_tabs($taburl, $pdfannotator->name, $context, $action); |
535 | 535 | pdfannotator_display_embed($pdfannotator, $cm, $course, $file); |
536 | 536 | } else { // This branch is executed if the form is submitted but the data doesn't validate and the form should be redisplayed |
537 | 537 | // or on the first display of the form. |
|
0 commit comments