Rename marketplace plugin to meetletacbfree (mdl_modules.name limit + CI table prefixes)

This commit is contained in:
2026-09-01 23:24:11 +03:30
parent 555cd725f7
commit d987994ded
77 changed files with 1497 additions and 1322 deletions
+19 -19
View File
@@ -7,12 +7,12 @@
* Hard-locks all plugin features until the administrator completes voluntary
* online activation. After activation, every Marketplace feature unlocks.
*
* @package mod_meetletacbmarketplace
* @package mod_meetletacbfree
* @copyright 2026 MeetLet
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_meetletacbmarketplace\registration;
namespace mod_meetletacbfree\registration;
defined('MOODLE_INTERNAL') || die();
@@ -28,7 +28,7 @@ class manager {
public const DEFAULT_API_URL = 'https://license.webatsign.com';
public static function api_base_url(): string {
$url = trim((string)get_config('meetletacbmarketplace', self::CONFIG_API_URL));
$url = trim((string)get_config('meetletacbfree', self::CONFIG_API_URL));
$url = rtrim($url, '/');
return $url !== '' ? $url : self::DEFAULT_API_URL;
}
@@ -53,16 +53,16 @@ class manager {
*/
public static function settings_tab_url(string $tab): \moodle_url {
return new \moodle_url('/admin/settings.php', [
'section' => 'modsettingmeetletacbmarketplace',
'section' => 'modsettingmeetletacbfree',
], $tab);
}
public static function settings_url(): \moodle_url {
return self::settings_tab_url('meetletacbmarketplace_registration');
return self::settings_tab_url('meetletacbfree_registration');
}
public static function privacy_tab_url(): \moodle_url {
return self::settings_tab_url('meetletacbmarketplace_privacy');
return self::settings_tab_url('meetletacbfree_privacy');
}
/**
@@ -82,7 +82,7 @@ class manager {
if (self::is_registered()) {
return;
}
throw new \moodle_exception('registration_required', 'meetletacbmarketplace', self::settings_url());
throw new \moodle_exception('registration_required', 'meetletacbfree', self::settings_url());
}
/** @deprecated Use require_registered() */
@@ -96,9 +96,9 @@ class manager {
}
$url = self::settings_url();
return \html_writer::div(
\html_writer::tag('strong', get_string('registration_gate_title', 'meetletacbmarketplace')) .
' ' . get_string('registration_gate_body', 'meetletacbmarketplace') . ' ' .
\html_writer::link($url, get_string('registration_gate_link', 'meetletacbmarketplace')),
\html_writer::tag('strong', get_string('registration_gate_title', 'meetletacbfree')) .
' ' . get_string('registration_gate_body', 'meetletacbfree') . ' ' .
\html_writer::link($url, get_string('registration_gate_link', 'meetletacbfree')),
'alert alert-warning meetlet-registration-gate mb-3'
);
}
@@ -113,7 +113,7 @@ class manager {
public static function activate(): array {
if (self::is_registered()) {
throw new \moodle_exception('registration_already_active', 'meetletacbmarketplace');
throw new \moodle_exception('registration_already_active', 'meetletacbfree');
}
$row = store::get_record();
$stale = $row && in_array($row->status ?? '', [
@@ -194,7 +194,7 @@ class manager {
'status' => $status,
'status_label' => self::status_label($active ? error_mapper::STATUS_ACTIVE : $status),
'product' => $active ? self::PRODUCT_SLUG : '',
'product_label' => $active ? get_string('registration_product_free', 'meetletacbmarketplace') : '',
'product_label' => $active ? get_string('registration_product_free', 'meetletacbfree') : '',
'can_deactivate' => self::can_deactivate($row),
'auth_expires_at' => self::parse_unix_timestamp($payload['expires_at'] ?? null),
'features' => is_array($payload['features'] ?? null) ? $payload['features'] : [],
@@ -263,8 +263,8 @@ class manager {
public static function status_label(string $status): string {
$key = 'registration_status_' . $status;
if (get_string_manager()->string_exists($key, 'meetletacbmarketplace')) {
return get_string($key, 'meetletacbmarketplace');
if (get_string_manager()->string_exists($key, 'meetletacbfree')) {
return get_string($key, 'meetletacbfree');
}
return $status;
}
@@ -301,7 +301,7 @@ class manager {
if ($expires !== null && time() >= $expires) {
self::invalidate_local([
'code' => 'LICENSE_EXPIRED',
'message' => get_string('registration_err_expired', 'meetletacbmarketplace'),
'message' => get_string('registration_err_expired', 'meetletacbfree'),
'at' => time(),
], error_mapper::STATUS_EXPIRED);
return true;
@@ -424,7 +424,7 @@ class manager {
'runtime' => 'php',
'runtime_version' => PHP_VERSION,
'metadata' => [
'plugin' => 'mod_meetletacbmarketplace',
'plugin' => 'mod_meetletacbfree',
'plugin_release' => self::plugin_release(),
],
];
@@ -555,7 +555,7 @@ class manager {
*/
protected static function status_error_message(string $status, ?array $lasterror): ?string {
if ($status === error_mapper::STATUS_EXPIRED) {
return get_string('registration_err_expired', 'meetletacbmarketplace');
return get_string('registration_err_expired', 'meetletacbfree');
}
return $lasterror['message'] ?? null;
}
@@ -603,14 +603,14 @@ class manager {
public static function plugin_release(): string {
global $CFG;
$plugin = new \stdClass();
$versionfile = $CFG->dirroot . '/mod/meetletacbmarketplace/version.php';
$versionfile = $CFG->dirroot . '/mod/meetletacbfree/version.php';
if (is_readable($versionfile)) {
include($versionfile);
}
if (!empty($plugin->release)) {
return (string)$plugin->release;
}
$ver = get_config('meetletacbmarketplace', 'version');
$ver = get_config('meetletacbfree', 'version');
return $ver !== false ? (string)$ver : '0';
}
}