diff --git a/bl-kernel/abstract/plugin.class.php b/bl-kernel/abstract/plugin.class.php index 3ebd4f44..13acf26c 100644 --- a/bl-kernel/abstract/plugin.class.php +++ b/bl-kernel/abstract/plugin.class.php @@ -170,6 +170,13 @@ class Plugin { return $this->className; } + public function isCompatible() + { + $explode = explode(',', $this->getMetadata('compatible')); + + return in_array(BLUDIT_VERSION, $explode); + } + public function directoryName() { return $this->directoryName; diff --git a/bl-kernel/admin/themes/default/css/default.css b/bl-kernel/admin/themes/default/css/default.css index 92f4e913..d65fc9c8 100644 --- a/bl-kernel/admin/themes/default/css/default.css +++ b/bl-kernel/admin/themes/default/css/default.css @@ -282,14 +282,14 @@ table.statistics tr:last-child td { /* ----------- ALERT ----------- */ #alert { + bottom: 0; color: #ffffff; - display: none; padding: 10px; + display: none; position: fixed; text-align: center; - top: 0; - width: 100%; z-index: 100; + right: 0; } .alert-ok { diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index e1082157..9c1f9cb2 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -1,7 +1,7 @@ add($database); } - // Push Plugin to array all plugins installed and not installed. - $plugins['all'][$pluginClass] = $Plugin; + // If the plugin is compatible with the Bludit version, add to arrays + if($Plugin->isCompatible()) { - // If the plugin is installed, order by hooks. - if($Plugin->installed()) - { - foreach($pluginsEvents as $event=>$value) - { - if(method_exists($Plugin, $event)) { - array_push($plugins[$event], $Plugin); + // Push Plugin to array all plugins installed and not installed. + $plugins['all'][$pluginClass] = $Plugin; + + // If the plugin is installed, order by hooks. + if($Plugin->installed()) { + + foreach($pluginsEvents as $event=>$value) { + + if(method_exists($Plugin, $event)) { + array_push($plugins[$event], $Plugin); + } } } } diff --git a/bl-kernel/boot/rules/99.themes.php b/bl-kernel/boot/rules/99.themes.php index c4931ce2..3b3b386c 100644 --- a/bl-kernel/boot/rules/99.themes.php +++ b/bl-kernel/boot/rules/99.themes.php @@ -48,9 +48,20 @@ function buildThemes() break; } - $database = $database + $metadata; + // Check if the theme is compatible + if(empty($metadata['compatible'])) { + Log::set('99.themes.php'.LOG_SEP.'Metadata error, field compatible invalid '.$themePath); + break; + } + + $explode = explode(',', $metadata['compatible']); + if(!in_array(BLUDIT_VERSION, $explode)) { + Log::set('99.themes.php'.LOG_SEP.'Theme incompatible '.$themePath); + break; + } // Theme data + $database = $database + $metadata; array_push($themes, $database); } } @@ -81,4 +92,4 @@ if( Sanitize::pathFile($languageFilename) ) if(!empty($database)) { $Language->add($database); } -} +} \ No newline at end of file