diff --git a/contentbank/files_form.php b/contentbank/classes/form/upload_files.php similarity index 86% rename from contentbank/files_form.php rename to contentbank/classes/form/upload_files.php index 6a001f05675..bcb37d4fa9f 100644 --- a/contentbank/files_form.php +++ b/contentbank/classes/form/upload_files.php @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +namespace core_contentbank\form; + /** * Upload files to content bank form * @@ -21,19 +23,7 @@ * @copyright 2020 Amaia Anabitarte * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - -defined('MOODLE_INTERNAL') || die(); - -require_once("$CFG->libdir/formslib.php"); - -/** - * Class contentbank_files_form - * - * @package core_contentbank - * @copyright 2020 Amaia Anabitarte - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -class contentbank_files_form extends moodleform { +class upload_files extends \moodleform { /** * Add elements to this form. diff --git a/contentbank/upload.php b/contentbank/upload.php index 81a7870d044..d4892a344b2 100644 --- a/contentbank/upload.php +++ b/contentbank/upload.php @@ -23,7 +23,6 @@ */ require('../config.php'); -require_once("$CFG->dirroot/contentbank/files_form.php"); use core\output\notification; @@ -86,7 +85,8 @@ $options = array( ); file_prepare_standard_filemanager($data, 'files', $options, $context, 'contentbank', 'public', 0); -$mform = new contentbank_files_form(null, ['contextid' => $contextid, 'data' => $data, 'options' => $options, 'id' => $id]); +$customdata = ['contextid' => $contextid, 'data' => $data, 'options' => $options, 'id' => $id]; +$mform = new \core_contentbank\form\upload_files(null, $customdata); $error = '';