From 25f4e928ad9b69aae26edfc0cefe32b73381bc2b Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 25 Dec 2022 21:48:47 +0100 Subject: [PATCH] use abstract plugin id --- _admin.php | 4 ++-- _define.php | 8 ++++---- _install.php | 2 +- _public.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/_admin.php b/_admin.php index a2b33a2..886adef 100644 --- a/_admin.php +++ b/_admin.php @@ -15,7 +15,7 @@ if (!defined('DC_CONTEXT_ADMIN')) { } # Check plugin version -if (dcCore::app()->getVersion('postExpired') != dcCore::app()->plugins->moduleInfo('postExpired', 'version')) { +if (dcCore::app()->getVersion(basename(__DIR__)) != dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version')) { return null; } @@ -83,7 +83,7 @@ class adminBehaviorPostExpired */ public static function adminPostHeaders() { - return dcPage::jsLoad(dcPage::getPF('postExpired/js/postexpired.js')); + return dcPage::jsModuleLoad(basename(__DIR__) . '/js/postexpired.js'); } /** diff --git a/_define.php b/_define.php index 7299054..d979b88 100644 --- a/_define.php +++ b/_define.php @@ -25,9 +25,9 @@ $this->registerModule( dcAuth::PERMISSION_USAGE, dcAuth::PERMISSION_CONTENT_ADMIN, ]), - 'type' => 'plugin', - 'support' => 'https://github.com/JcDenis/postExpired', - 'details' => 'https://plugins.dotaddict.org/dc2/details/postExpired', - 'repository' => 'https://raw.githubusercontent.com/JcDenis/postExpired/master/dcstore.xml', + 'type' => 'plugin', + 'support' => 'https://github.com/JcDenis/' . basename(__DIR__), + 'details' => 'https://plugins.dotaddict.org/dc2/details/' . basename(__DIR__), + 'repository' => 'https://raw.githubusercontent.com/JcDenis/' . basename(__DIR__) . '/master/dcstore.xml', ] ); diff --git a/_install.php b/_install.php index 71b6e6b..dc7be9a 100644 --- a/_install.php +++ b/_install.php @@ -18,7 +18,7 @@ if (!defined('DC_CONTEXT_ADMIN')) { try { # Check module version if (!dcCore::app()->newVersion( - basename(__DIR__), + basename(__DIR__), dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version') )) { return null; diff --git a/_public.php b/_public.php index f44f503..cf73dce 100644 --- a/_public.php +++ b/_public.php @@ -14,7 +14,7 @@ if (!defined('DC_RC_PATH')) { return null; } -if (dcCore::app()->getVersion('postExpired') != dcCore::app()->plugins->moduleInfo('postExpired', 'version')) { +if (dcCore::app()->getVersion(basename(__DIR__)) != dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version')) { return null; }