diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index f098e6e5b..82bb6c9d8 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -141,8 +141,9 @@ class Context private static $_oFrontEndFileHandler = null; /** - * Plugin blacklist cache + * Plugin default and blacklist cache */ + private static $_default_plugins = null; private static $_blacklist = null; /** @@ -2590,6 +2591,27 @@ class Context return Rhymix\Framework\Router::getRewriteLevel(); } + /** + * Check whether an addon, layout, module, or widget is distributed with Rhymix core. + * + * @param string $plugin_name + * @param string $type + * @return bool + */ + public static function isDefaultPlugin($plugin_name, $type) + { + if (self::$_default_plugins === null) + { + self::$_default_plugins = (include RX_BASEDIR . 'common/defaults/plugins.php'); + if (!is_array(self::$_default_plugins)) + { + self::$_default_plugins = array(); + } + } + + return isset(self::$_default_plugins[$type][$plugin_name]); + } + /** * Check whether an addon, module, or widget is blacklisted * diff --git a/common/defaults/plugins.php b/common/defaults/plugins.php new file mode 100644 index 000000000..53ea36d9f --- /dev/null +++ b/common/defaults/plugins.php @@ -0,0 +1,73 @@ + array( + 'adminlogging' => true, + 'autolink' => true, + 'counter' => true, + 'member_extra_info' => true, + 'photoswipe' => true, + 'point_level_icon' => true, + ), + + // Layouts + 'layout' => array( + 'colorCode' => true, + 'default' => true, + 'simpleGray' => true, + 'user_layout' => true, + 'xedition' => true, + ), + + // Modules + 'module' => array( + 'addon' => true, + 'admin' => true, + 'adminlogging' => true, + 'advanced_mailer' => true, + 'autoinstall' => true, + 'board' => true, + 'comment' => true, + 'communication' => true, + 'counter' => true, + 'document' => true, + 'editor' => true, + 'file' => true, + 'importer' => true, + 'install' => true, + 'integration_search' => true, + 'krzip' => true, + 'layout' => true, + 'member' => true, + 'menu' => true, + 'message' => true, + 'module' => true, + 'ncenterlite' => true, + 'page' => true, + 'point' => true, + 'poll' => true, + 'rss' => true, + 'session' => true, + 'spamfilter' => true, + 'tag' => true, + 'trash' => true, + 'widget' => true, + ), + + // Widgets + 'widget' => array( + 'content' => true, + 'counter_status' => true, + 'language_select' => true, + 'login_info' => true, + 'mcontent' => true, + 'pollWidget' => true, + ), +);