This commit is contained in:
Jean-Christian Paul Denis 2023-03-06 01:13:27 +01:00
parent 0e267a8299
commit b8af237c5d
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
2 changed files with 6 additions and 10 deletions

View File

@ -70,13 +70,9 @@ class Install extends dcNsProcess
],
];
// Nothing to change below
private static $pid = '';
public static function init(): bool
{
self::$pid = basename(dirname(__DIR__));
self::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->newVersion(self::$pid, dcCore::app()->plugins->moduleInfo(self::$pid, 'version'));
self::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->newVersion(Core::id(), dcCore::app()->plugins->moduleInfo(Core::id(), 'version'));
return self::$init;
}
@ -93,7 +89,7 @@ class Install extends dcNsProcess
// Set module settings
foreach (self::$mod_conf as $v) {
dcCore::app()->blog->settings->__get(self::$pid)->put(
dcCore::app()->blog->settings->__get(Core::id())->put(
$v[0],
$v[2],
$v[3],
@ -113,7 +109,7 @@ class Install extends dcNsProcess
public static function growUp(): void
{
$current = dcCore::app()->getVersion(self::$pid);
$current = dcCore::app()->getVersion(Core::id());
// Update settings id, ns
if ($current && version_compare($current, '2022.12.19.1', '<=')) {
@ -126,7 +122,7 @@ class Install extends dcNsProcess
if (preg_match('/^packman_(.*?)$/', $record->setting_id, $match)) {
$cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcNamespace::NS_TABLE_NAME);
$cur->setting_id = $match[1];
$cur->setting_ns = self::$pid;
$cur->setting_ns = Core::id();
$cur->update(
"WHERE setting_id = '" . $record->setting_id . "' and setting_ns = 'pacKman' " .
'AND blog_id ' . (null === $record->blog_id ? 'IS NULL ' : ("= '" . dcCore::app()->con->escape($record->blog_id) . "' "))

View File

@ -301,7 +301,7 @@ class Manage extends dcNsProcess
# Display
dcPage::openModule(
__('pacKman'),
Core::name(),
dcPage::jsPageTabs() .
dcPage::jsModuleLoad(self::$pid . '/js/packman.js') .
@ -312,7 +312,7 @@ class Manage extends dcNsProcess
echo
dcPage::breadcrumb([
__('Plugins') => '',
__('pacKman') => '',
Core::name() => '',
]) .
dcPage::notices();