add method to check if module is active on blog

master
Jean-Christian Paul Denis 2023-04-25 15:01:31 +02:00
parent 0e46e1cafa
commit 274956dd72
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
1 changed files with 10 additions and 0 deletions

View File

@ -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.
*