mirror of
https://github.com/getgrav/grav.git
synced 2026-02-14 18:47:42 +01:00
Added an isAdminPlugin() helper method in Utils
This commit is contained in:
@@ -101,11 +101,7 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess
|
||||
*/
|
||||
public function isAdmin()
|
||||
{
|
||||
if (isset($this->grav['admin'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return Utils::isAdminPlugin();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -622,4 +622,18 @@ abstract class Utils
|
||||
//Invalid nonce
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple helper method to get whether or not the admin plugin is active
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isAdminPlugin()
|
||||
{
|
||||
if (isset(Grav::instance()['admin'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user