index.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. * Display the custom file type settings page.
  18. *
  19. * @package tool_filetypes
  20. * @copyright 2014 The Open University
  21. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  22. */
  23. require(__DIR__ . '/../../../config.php');
  24. require_once($CFG->libdir . '/adminlib.php');
  25. admin_externalpage_setup('tool_filetypes');
  26. // Page settings.
  27. $title = get_string('pluginname', 'tool_filetypes');
  28. $context = context_system::instance();
  29. $PAGE->set_url(new \moodle_url('/admin/tool/filetypes/index.php'));
  30. $PAGE->set_context($context);
  31. $PAGE->set_pagelayout('admin');
  32. $PAGE->set_title($SITE->fullname. ': ' . $title);
  33. $renderer = $PAGE->get_renderer('tool_filetypes');
  34. // Is it restricted because set in config.php?
  35. $restricted = array_key_exists('customfiletypes', $CFG->config_php_settings);
  36. // Display the page.
  37. echo $renderer->header();
  38. echo $renderer->edit_table(get_mimetypes_array(), core_filetypes::get_deleted_types(),
  39. $restricted);
  40. echo $renderer->footer();