diff --git a/Utility/Current.php b/Utility/Current.php index e1404d30..c2aa6b06 100644 --- a/Utility/Current.php +++ b/Utility/Current.php @@ -494,6 +494,10 @@ public static function hasSettingMode() { * @return bool */ public static function isControlPanel() { + if (! isset(self::$request)) { + return false; + } + if (self::$request->params['plugin'] === CurrentSystem::PLUGIN_CONTROL_PANEL) { return true; } diff --git a/Utility/NetCommonsUrl.php b/Utility/NetCommonsUrl.php index 86df22f1..72c85f0e 100644 --- a/Utility/NetCommonsUrl.php +++ b/Utility/NetCommonsUrl.php @@ -9,6 +9,9 @@ * @copyright Copyright 2014, NetCommons Project */ +App::uses('Current', 'NetCommons.Utility'); +App::uses('Page', 'Pages.Model'); + /** * NetCommons Utility *