PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/report/eventlist/index.php

https://bitbucket.org/moodle/moodle
PHP | 53 lines | 27 code | 4 blank | 22 comment | 0 complexity | 127c8405d61ea478be837cf3e12813b3 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.1, BSD-3-Clause, MIT, GPL-3.0
  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. * Event documentation.
  18. *
  19. * @package report_eventlist
  20. * @copyright 2014 Adrian Greeve <adrian@moodle.com>
  21. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  22. */
  23. require_once(__DIR__ . '/../../config.php');
  24. require_once($CFG->libdir . '/adminlib.php');
  25. admin_externalpage_setup('reporteventlists');
  26. // Retrieve all events in a list.
  27. $completelist = report_eventlist_list_generator::get_all_events_list();
  28. $tabledata = array();
  29. $components = array();
  30. $edulevel = array('0' => get_string('all', 'report_eventlist'));
  31. $crud = array('0' => get_string('all', 'report_eventlist'));
  32. foreach ($completelist as $value) {
  33. $components[] = explode('\\', $value['eventname'])[1];
  34. $edulevel[] = $value['edulevel'];
  35. $crud[] = $value['crud'];
  36. $tabledata[] = (object)$value;
  37. }
  38. $components = array_unique($components);
  39. $edulevel = array_unique($edulevel);
  40. $crud = array_unique($crud);
  41. // Create the filter form for the table.
  42. $filtersection = new report_eventlist_filter_form(null, array('components' => $components, 'edulevel' => $edulevel,
  43. 'crud' => $crud));
  44. // Output.
  45. $renderer = $PAGE->get_renderer('report_eventlist');
  46. echo $renderer->render_event_list($filtersection, $tabledata);