PageRenderTime 39ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/report/eventlist/index.php

http://github.com/moodle/moodle
PHP | 53 lines | 22 code | 7 blank | 24 comment | 0 complexity | edf994151c4b9dfd5c836f5965f863b7 MD5 | raw file
Possible License(s): MIT, AGPL-3.0, MPL-2.0-no-copyleft-exception, LGPL-3.0, GPL-3.0, Apache-2.0, LGPL-2.1, BSD-3-Clause
  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('0' => get_string('all', 'report_eventlist'));
  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[] = $value['component'];
  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);