MDL-67999 core_contentbank: Add namespace to upload form

The form to upload/replace files has been moved to classes/form
(it's where it should have been added when it was created).
Besides, this class has been renamed because now, with the
namespace, contentbank and form don't need to be in the name ;-)
This commit is contained in:
Sara Arjona 2021-03-18 12:40:32 +01:00
parent 511a87f5fc
commit 9c07064417
2 changed files with 5 additions and 15 deletions

View file

@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_contentbank\form;
/** /**
* Upload files to content bank form * Upload files to content bank form
* *
@ -21,19 +23,7 @@
* @copyright 2020 Amaia Anabitarte <amaia@moodle.com> * @copyright 2020 Amaia Anabitarte <amaia@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
class upload_files extends \moodleform {
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/formslib.php");
/**
* Class contentbank_files_form
*
* @package core_contentbank
* @copyright 2020 Amaia Anabitarte <amaia@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class contentbank_files_form extends moodleform {
/** /**
* Add elements to this form. * Add elements to this form.

View file

@ -23,7 +23,6 @@
*/ */
require('../config.php'); require('../config.php');
require_once("$CFG->dirroot/contentbank/files_form.php");
use core\output\notification; use core\output\notification;
@ -86,7 +85,8 @@ $options = array(
); );
file_prepare_standard_filemanager($data, 'files', $options, $context, 'contentbank', 'public', 0); 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 = ''; $error = '';