mirror of
https://github.com/moodle/moodle.git
synced 2025-03-24 09:30:17 +01:00
MDL-77248 mod_bigbluebuttonbn: Remove unused dpa pages
This commit is contained in:
parent
3c262bb46f
commit
1ca40fa664
11
mod/bigbluebuttonbn/amd/build/accept_dpa.min.js
vendored
11
mod/bigbluebuttonbn/amd/build/accept_dpa.min.js
vendored
@ -1,11 +0,0 @@
|
||||
define("mod_bigbluebuttonbn/accept_dpa",["exports","core_form/modalform","core/notification","core/str"],(function(_exports,_modalform,_notification,_str){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}
|
||||
/**
|
||||
* Javascript module for confirming the acceptance of the current data processing agreement before enabling
|
||||
* the BigBlueButton activity module.
|
||||
*
|
||||
* @module mod_bigbluebuttonbn/accept_dpa
|
||||
* @copyright 2022 Mihail Geshoski <mihail@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_modalform=_interopRequireDefault(_modalform),_notification=_interopRequireDefault(_notification);_exports.init=()=>{const modalForm=new _modalform.default({modalConfig:{title:(0,_str.get_string)("enablingbigbluebutton","mod_bigbluebuttonbn"),large:!1},formClass:"mod_bigbluebuttonbn\\form\\accept_dpa",saveButtonText:(0,_str.get_string)("enable")});modalForm.addEventListener(modalForm.events.FORM_SUBMITTED,(event=>{event.detail.result?window.location.reload():_notification.default.addNotification({type:"error",message:event.detail.errors.join("<br>")})})),modalForm.show()}}));
|
||||
|
||||
//# sourceMappingURL=accept_dpa.min.js.map
|
@ -1 +0,0 @@
|
||||
{"version":3,"file":"accept_dpa.min.js","sources":["../src/accept_dpa.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Javascript module for confirming the acceptance of the current data processing agreement before enabling\n * the BigBlueButton activity module.\n *\n * @module mod_bigbluebuttonbn/accept_dpa\n * @copyright 2022 Mihail Geshoski <mihail@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport ModalForm from 'core_form/modalform';\nimport Notification from 'core/notification';\nimport {get_string as getString} from 'core/str';\n\n/**\n * Initialize module.\n */\nexport const init = () => {\n\n const modalForm = new ModalForm({\n modalConfig: {\n title: getString('enablingbigbluebutton', 'mod_bigbluebuttonbn'),\n large: false,\n },\n formClass: 'mod_bigbluebuttonbn\\\\form\\\\accept_dpa',\n saveButtonText: getString('enable'),\n });\n\n // Once the form has been submitted and successfully processed, reload the page to enable the activity module.\n modalForm.addEventListener(modalForm.events.FORM_SUBMITTED, event => {\n if (event.detail.result) {\n window.location.reload();\n } else {\n Notification.addNotification({\n type: 'error',\n message: event.detail.errors.join('<br>')\n });\n }\n });\n\n modalForm.show();\n};\n"],"names":["modalForm","ModalForm","modalConfig","title","large","formClass","saveButtonText","addEventListener","events","FORM_SUBMITTED","event","detail","result","window","location","reload","addNotification","type","message","errors","join","show"],"mappings":";;;;;;;;kMA+BoB,WAEVA,UAAY,IAAIC,mBAAU,CAC5BC,YAAa,CACTC,OAAO,mBAAU,wBAAyB,uBAC1CC,OAAO,GAEXC,UAAW,wCACXC,gBAAgB,mBAAU,YAI9BN,UAAUO,iBAAiBP,UAAUQ,OAAOC,gBAAgBC,QACpDA,MAAMC,OAAOC,OACbC,OAAOC,SAASC,+BAEHC,gBAAgB,CACzBC,KAAM,QACNC,QAAUR,MAAMC,OAAOQ,OAAOC,KAAK,aAK/CpB,UAAUqB"}
|
@ -1,56 +0,0 @@
|
||||
// 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/>.
|
||||
|
||||
/**
|
||||
* Javascript module for confirming the acceptance of the current data processing agreement before enabling
|
||||
* the BigBlueButton activity module.
|
||||
*
|
||||
* @module mod_bigbluebuttonbn/accept_dpa
|
||||
* @copyright 2022 Mihail Geshoski <mihail@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
import ModalForm from 'core_form/modalform';
|
||||
import Notification from 'core/notification';
|
||||
import {get_string as getString} from 'core/str';
|
||||
|
||||
/**
|
||||
* Initialize module.
|
||||
*/
|
||||
export const init = () => {
|
||||
|
||||
const modalForm = new ModalForm({
|
||||
modalConfig: {
|
||||
title: getString('enablingbigbluebutton', 'mod_bigbluebuttonbn'),
|
||||
large: false,
|
||||
},
|
||||
formClass: 'mod_bigbluebuttonbn\\form\\accept_dpa',
|
||||
saveButtonText: getString('enable'),
|
||||
});
|
||||
|
||||
// Once the form has been submitted and successfully processed, reload the page to enable the activity module.
|
||||
modalForm.addEventListener(modalForm.events.FORM_SUBMITTED, event => {
|
||||
if (event.detail.result) {
|
||||
window.location.reload();
|
||||
} else {
|
||||
Notification.addNotification({
|
||||
type: 'error',
|
||||
message: event.detail.errors.join('<br>')
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
modalForm.show();
|
||||
};
|
@ -1,104 +0,0 @@
|
||||
<?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/>.
|
||||
|
||||
namespace mod_bigbluebuttonbn\form;
|
||||
|
||||
use context;
|
||||
use moodle_exception;
|
||||
use moodle_url;
|
||||
use core_form\dynamic_form;
|
||||
use mod_bigbluebuttonbn\local\config;
|
||||
|
||||
/**
|
||||
* Accept data processing agreement form presented before enabling the BigBlueButton activity module.
|
||||
*
|
||||
* @package mod_bigbluebuttonbn
|
||||
* @copyright 2022 Mihail Geshoski <mihail@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class accept_dpa extends dynamic_form {
|
||||
|
||||
/**
|
||||
* Form definition
|
||||
*/
|
||||
protected function definition() {
|
||||
$this->_form->addElement('html', \html_writer::tag('p',
|
||||
get_string('enablingbigbluebuttondpainfo', 'mod_bigbluebuttonbn', config::DEFAULT_DPA_URL)));
|
||||
$this->_form->addElement('checkbox', 'acceptdefaultdpa', false, get_string('acceptdpa', 'mod_bigbluebuttonbn'),
|
||||
['class' => 'bold']);
|
||||
$this->_form->addRule('acceptdefaultdpa', get_string('required'), 'required', null, 'client');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return form context
|
||||
*
|
||||
* @return context
|
||||
*/
|
||||
protected function get_context_for_dynamic_submission(): context {
|
||||
return \context_system::instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if current user has access to this form, otherwise throw exception.
|
||||
*
|
||||
* @return void
|
||||
* @throws moodle_exception
|
||||
*/
|
||||
protected function check_access_for_dynamic_submission(): void {
|
||||
require_capability('moodle/site:config', $this->get_context_for_dynamic_submission());
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the form submission, used if form was submitted via AJAX.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function process_dynamic_submission(): array {
|
||||
$result = false;
|
||||
$errors = [];
|
||||
|
||||
if ($this->get_data()->acceptdefaultdpa) {
|
||||
try {
|
||||
set_config('bigbluebuttonbn_default_dpa_accepted', true);
|
||||
$result = true;
|
||||
} catch (\Exception $e) {
|
||||
$errors[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'result' => $result,
|
||||
'errors' => $errors,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Load in existing data as form defaults (not applicable).
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_data_for_dynamic_submission(): void {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns url to set in $PAGE->set_url() when form is being rendered or submitted via AJAX.
|
||||
*
|
||||
* @return moodle_url
|
||||
*/
|
||||
protected function get_page_url_for_dynamic_submission(): moodle_url {
|
||||
return new moodle_url('/admin/modules.php', ['show' => 'bigbluebuttonbn', 'sesskey' => sesskey()]);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user