PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/backup/backupfilesedit_form.php

https://bitbucket.org/moodle/moodle
PHP | 56 lines | 22 code | 11 blank | 23 comment | 0 complexity | 64bdbdfaf66aba2f76862f318e5a6547 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. * Manage backup files
  18. * @package moodlecore
  19. * @copyright 2010 Dongsheng Cai <dongsheng@moodle.com>
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  21. */
  22. require_once($CFG->libdir.'/formslib.php');
  23. class backup_files_edit_form extends moodleform {
  24. /**
  25. * Form definition.
  26. */
  27. public function definition() {
  28. $mform =& $this->_form;
  29. $types = (FILE_INTERNAL | FILE_REFERENCE | FILE_CONTROLLED_LINK);
  30. $options = array('subdirs' => 0, 'maxfiles' => -1, 'accepted_types' => '*', 'return_types' => $types);
  31. $mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options);
  32. $mform->addElement('hidden', 'contextid', $this->_customdata['contextid']);
  33. $mform->setType('contextid', PARAM_INT);
  34. $mform->addElement('hidden', 'currentcontext', $this->_customdata['currentcontext']);
  35. $mform->setType('currentcontext', PARAM_INT);
  36. $mform->addElement('hidden', 'filearea', $this->_customdata['filearea']);
  37. $mform->setType('filearea', PARAM_AREA);
  38. $mform->addElement('hidden', 'component', $this->_customdata['component']);
  39. $mform->setType('component', PARAM_COMPONENT);
  40. $mform->addElement('hidden', 'returnurl', $this->_customdata['returnurl']);
  41. $mform->setType('returnurl', PARAM_URL);
  42. $this->add_action_buttons(true, get_string('savechanges'));
  43. $this->set_data($this->_customdata['data']);
  44. }
  45. }