Plugins and themes compatibility
This commit is contained in:
parent
b5d2d44769
commit
6dacbdbd54
@ -170,6 +170,13 @@ class Plugin {
|
|||||||
return $this->className;
|
return $this->className;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isCompatible()
|
||||||
|
{
|
||||||
|
$explode = explode(',', $this->getMetadata('compatible'));
|
||||||
|
|
||||||
|
return in_array(BLUDIT_VERSION, $explode);
|
||||||
|
}
|
||||||
|
|
||||||
public function directoryName()
|
public function directoryName()
|
||||||
{
|
{
|
||||||
return $this->directoryName;
|
return $this->directoryName;
|
||||||
|
@ -282,14 +282,14 @@ table.statistics tr:last-child td {
|
|||||||
/* ----------- ALERT ----------- */
|
/* ----------- ALERT ----------- */
|
||||||
|
|
||||||
#alert {
|
#alert {
|
||||||
|
bottom: 0;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
display: none;
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
display: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-ok {
|
.alert-ok {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
// Bludit version
|
// Bludit version
|
||||||
define('BLUDIT_VERSION', 'Github-Version');
|
define('BLUDIT_VERSION', '1.3');
|
||||||
define('BLUDIT_CODENAME', '');
|
define('BLUDIT_CODENAME', '');
|
||||||
define('BLUDIT_RELEASE_DATE', '');
|
define('BLUDIT_RELEASE_DATE', '');
|
||||||
define('BLUDIT_BUILD', '');
|
define('BLUDIT_BUILD', '');
|
||||||
@ -115,7 +115,7 @@ define('TOKEN_EMAIL_TTL', '+15 minutes');
|
|||||||
define('CHARSET', 'UTF-8');
|
define('CHARSET', 'UTF-8');
|
||||||
|
|
||||||
// EXTREME FRIENDLY URL, TRUE for dissmiss internet standard
|
// EXTREME FRIENDLY URL, TRUE for dissmiss internet standard
|
||||||
define('EXTREME_FRIENDLY_URL', true);
|
define('EXTREME_FRIENDLY_URL', false);
|
||||||
|
|
||||||
// Directory permissions
|
// Directory permissions
|
||||||
define('DIR_PERMISSIONS', 0755);
|
define('DIR_PERMISSIONS', 0755);
|
||||||
|
@ -96,16 +96,20 @@ function buildPlugins()
|
|||||||
$Language->add($database);
|
$Language->add($database);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Push Plugin to array all plugins installed and not installed.
|
// If the plugin is compatible with the Bludit version, add to arrays
|
||||||
$plugins['all'][$pluginClass] = $Plugin;
|
if($Plugin->isCompatible()) {
|
||||||
|
|
||||||
// If the plugin is installed, order by hooks.
|
// Push Plugin to array all plugins installed and not installed.
|
||||||
if($Plugin->installed())
|
$plugins['all'][$pluginClass] = $Plugin;
|
||||||
{
|
|
||||||
foreach($pluginsEvents as $event=>$value)
|
// If the plugin is installed, order by hooks.
|
||||||
{
|
if($Plugin->installed()) {
|
||||||
if(method_exists($Plugin, $event)) {
|
|
||||||
array_push($plugins[$event], $Plugin);
|
foreach($pluginsEvents as $event=>$value) {
|
||||||
|
|
||||||
|
if(method_exists($Plugin, $event)) {
|
||||||
|
array_push($plugins[$event], $Plugin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,9 +48,20 @@ function buildThemes()
|
|||||||
break;
|
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
|
// Theme data
|
||||||
|
$database = $database + $metadata;
|
||||||
array_push($themes, $database);
|
array_push($themes, $database);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user