From 274956dd7271bfbe4f66b723b1f578898d428907 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Tue, 25 Apr 2023 15:01:31 +0200 Subject: [PATCH] add method to check if module is active on blog --- src/Utils.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Utils.php b/src/Utils.php index f924ae2..ebebf95 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -34,6 +34,16 @@ use Exception; */ class Utils { + /** + * Check if module is active on current blog + * + * @return bool True on activated + */ + public static function isActive(): bool + { + return !is_null(dcCore::app()->blog) && dcCore::app()->blog->settings->get(My::id())->get('active'); + } + /** * Open cursor. *