mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
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:
parent
511a87f5fc
commit
9c07064417
2 changed files with 5 additions and 15 deletions
|
@ -14,6 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace core_contentbank\form;
|
||||
|
||||
/**
|
||||
* Upload files to content bank form
|
||||
*
|
||||
|
@ -21,19 +23,7 @@
|
|||
* @copyright 2020 Amaia Anabitarte <amaia@moodle.com>
|
||||
* @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 <amaia@moodle.com>
|
||||
* @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.
|
|
@ -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 = '';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue