Added an isAdminPlugin() helper method in Utils

This commit is contained in:
Andy Miller
2016-04-13 15:05:17 -06:00
parent 40348124a1
commit 8bdceb6919
2 changed files with 15 additions and 5 deletions

View File

@@ -101,11 +101,7 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess
*/
public function isAdmin()
{
if (isset($this->grav['admin'])) {
return true;
}
return false;
return Utils::isAdminPlugin();
}
/**

View File

@@ -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;
}
}