lib.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. // This file is part of Moodle - http://moodle.org/
  3. //
  4. // Moodle is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // Moodle is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
  16. /**
  17. * local_olimp_reports file description here.
  18. *
  19. * @package local_olimp_reports
  20. * @copyright 2022 alex sidorov <alex.sidorof@ya.ru>
  21. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  22. */
  23. /**
  24. * Display the list Teachers in the course menu.
  25. *
  26. * @param settings_navigation $navigation The settings navigation object
  27. * @param stdClass $course The course
  28. * @param context $context Course context
  29. */
  30. function local_olimp_reports_extend_navigation_course($navigation, $course, $context) {
  31. global $PAGE;
  32. if(($context->contextlevel === 50) &&
  33. has_capability('gradereport/grader:view', $context)){
  34. $certificatenode = $navigation->add(get_string('pluginname', 'local_olimp_reports'),
  35. null, navigation_node::TYPE_CONTAINER, null, 'tool_certificate');
  36. $url = new moodle_url('/local/olimp_reports/reports_cert_and_dip.php', ['courseid' => $course->id]);
  37. $certificatenode->add(get_string('reports_olimp', 'local_olimp_reports'), $url, navigation_node::TYPE_SETTING,
  38. null, 'local_olimp_reports');
  39. }
  40. }