2010-08-26 06:19:46 +00:00
|
|
|
<?php
|
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Manage backup files
|
|
|
|
* @package moodlecore
|
|
|
|
* @copyright 2010 Dongsheng Cai <dongsheng@moodle.com>
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
|
|
|
require_once($CFG->libdir.'/formslib.php');
|
|
|
|
|
|
|
|
class backup_files_edit_form extends moodleform {
|
2013-07-22 18:12:48 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Form definition.
|
|
|
|
*/
|
|
|
|
public function definition() {
|
2010-08-26 06:19:46 +00:00
|
|
|
$mform =& $this->_form;
|
2013-07-22 18:12:48 +08:00
|
|
|
|
2017-04-04 10:40:01 +08:00
|
|
|
$types = (FILE_INTERNAL | FILE_REFERENCE | FILE_CONTROLLED_LINK);
|
2017-03-07 22:04:30 +08:00
|
|
|
$options = array('subdirs' => 0, 'maxfiles' => -1, 'accepted_types' => '*', 'return_types' => $types);
|
2013-07-22 17:42:42 +08:00
|
|
|
|
2010-08-26 06:19:46 +00:00
|
|
|
$mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options);
|
2013-07-22 17:42:42 +08:00
|
|
|
|
2010-08-26 06:19:46 +00:00
|
|
|
$mform->addElement('hidden', 'contextid', $this->_customdata['contextid']);
|
2013-07-22 17:42:42 +08:00
|
|
|
$mform->setType('contextid', PARAM_INT);
|
|
|
|
|
2010-08-30 03:44:44 +00:00
|
|
|
$mform->addElement('hidden', 'currentcontext', $this->_customdata['currentcontext']);
|
2013-07-22 17:42:42 +08:00
|
|
|
$mform->setType('currentcontext', PARAM_INT);
|
|
|
|
|
2010-08-26 06:19:46 +00:00
|
|
|
$mform->addElement('hidden', 'filearea', $this->_customdata['filearea']);
|
2013-07-22 17:42:42 +08:00
|
|
|
$mform->setType('filearea', PARAM_AREA);
|
|
|
|
|
2010-08-26 06:19:46 +00:00
|
|
|
$mform->addElement('hidden', 'component', $this->_customdata['component']);
|
2013-07-22 17:42:42 +08:00
|
|
|
$mform->setType('component', PARAM_COMPONENT);
|
|
|
|
|
2010-08-26 06:19:46 +00:00
|
|
|
$mform->addElement('hidden', 'returnurl', $this->_customdata['returnurl']);
|
2023-01-06 12:55:40 +00:00
|
|
|
$mform->setType('returnurl', PARAM_LOCALURL);
|
2013-07-22 17:42:42 +08:00
|
|
|
|
2010-08-26 06:19:46 +00:00
|
|
|
$this->add_action_buttons(true, get_string('savechanges'));
|
|
|
|
$this->set_data($this->_customdata['data']);
|
|
|
|
}
|
|
|
|
}
|