Address Moodle Marketplace review for mod_meetletacbfree 1.1.3.
Migrate legacy ajax/JS to external services and AMD, enable TLS verification, scope admin CSS with RTLCSS-safe rules, and fix README/lang/boilerplate gaps. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
namespace mod_meetletacbfree\admin;
|
||||
|
||||
use mod_meetletacbfree\local\icons;
|
||||
use moodle_url;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
@@ -65,7 +64,7 @@ class access_reset_ui {
|
||||
/**
|
||||
* Modal + config root (render once on the access settings tab).
|
||||
*/
|
||||
public static function page_assets(moodle_url $ajaxurl): string {
|
||||
public static function page_assets(): string {
|
||||
if (self::$assetsrendered) {
|
||||
return '';
|
||||
}
|
||||
@@ -75,8 +74,6 @@ class access_reset_ui {
|
||||
$html = \html_writer::div('', '', [
|
||||
'id' => 'meetlet-access-reset-root',
|
||||
'hidden' => 'hidden',
|
||||
'data-endpoint' => $ajaxurl->out(false),
|
||||
'data-sesskey' => sesskey(),
|
||||
'data-strings' => json_encode($strings, JSON_UNESCAPED_UNICODE),
|
||||
]);
|
||||
$html .= self::modal_html();
|
||||
|
||||
@@ -45,16 +45,9 @@ class setting_registration extends admin_setting {
|
||||
$summary = manager::status_summary();
|
||||
$active = !empty($summary['active']);
|
||||
$candeactivate = !empty($summary['can_deactivate']);
|
||||
$ajaxurl = new \moodle_url('/mod/meetletacbfree/ajax/registration.php');
|
||||
$scrolljsurl = new \moodle_url('/mod/meetletacbfree/javascript/meetlet_modal_scroll.js', [
|
||||
'v' => '2026090146',
|
||||
]);
|
||||
$jsurl = new \moodle_url('/mod/meetletacbfree/javascript/settings_registration.js', [
|
||||
'v' => '2026090146',
|
||||
]);
|
||||
$privacytaburl = manager::privacy_tab_url();
|
||||
$PAGE->requires->js($scrolljsurl);
|
||||
$PAGE->requires->js($jsurl);
|
||||
$PAGE->requires->js_call_amd('mod_meetletacbfree/meetlet_modal_scroll', 'init');
|
||||
$PAGE->requires->js_call_amd('mod_meetletacbfree/settings_registration', 'init');
|
||||
|
||||
$statusbadge = \html_writer::span(
|
||||
s($summary['status_label'] ?? ($active
|
||||
@@ -169,8 +162,6 @@ class setting_registration extends admin_setting {
|
||||
\html_writer::div('', 'mt-3 d-none', ['id' => 'meetlet-registration-flash']) .
|
||||
\html_writer::div('', '', [
|
||||
'id' => 'meetlet-registration-config',
|
||||
'data-ajaxurl' => $ajaxurl->out(false),
|
||||
'data-sesskey' => sesskey(),
|
||||
'data-api-input' => 'id_s_meetletacbfree_registration_api_url',
|
||||
'data-label-active' => get_string('registration_status_active', 'meetletacbfree'),
|
||||
'data-label-inactive' => get_string('registration_status_inactive', 'meetletacbfree'),
|
||||
|
||||
@@ -44,6 +44,22 @@ class settingspage_tabs extends \theme_boost_admin_settingspage_tabs {
|
||||
* @return string
|
||||
*/
|
||||
public function output_html() {
|
||||
return $this->herohtml . parent::output_html();
|
||||
global $PAGE;
|
||||
if ($PAGE) {
|
||||
$PAGE->requires->js_call_amd('mod_meetletacbfree/meetlet_modal_scroll', 'init');
|
||||
$PAGE->requires->js_call_amd('mod_meetletacbfree/settings_registration', 'init');
|
||||
$PAGE->requires->js_call_amd('mod_meetletacbfree/settings_conntest', 'init');
|
||||
$PAGE->requires->js_call_amd('mod_meetletacbfree/settings_toggles', 'init');
|
||||
$PAGE->requires->js_call_amd('mod_meetletacbfree/featureaccess_matrix', 'init');
|
||||
$PAGE->requires->js_call_amd('mod_meetletacbfree/settings_access_reset', 'init');
|
||||
}
|
||||
// Scope MeetLet admin CSS under this root (Marketplace CSS guideline).
|
||||
// dir attribute is not processed by Moodle RTLCSS (unlike styles.css values).
|
||||
$attrs = right_to_left() ? ['dir' => 'rtl'] : [];
|
||||
return \html_writer::div(
|
||||
$this->herohtml . parent::output_html(),
|
||||
'meetlet-admin-settings',
|
||||
$attrs
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user