Class name instead of name

This commit is contained in:
floppy0 2017-12-27 14:19:28 +01:00
parent a2ac9461b9
commit d7f3f67b2f
3 changed files with 16 additions and 18 deletions

View File

@ -66,7 +66,7 @@
<ul class="uk-list uk-list-line">
<?php
// Print New version if the plugin Version is installed
if (pluginEnabled('Version')) {
if (pluginEnabled('pluginVersion')) {
if ($plugins['all']['pluginVersion']->newVersion()) {
echo '<li>';
echo '<b>'.$L->g('New version available').'</b>';
@ -98,8 +98,8 @@
<div class="uk-width-1-3">
<?php if (pluginEnabled('SimpleStats')) {
$SimpleStats = getPlugin('SimpleStats');
<?php if (pluginEnabled('pluginSimpleStats')) {
$SimpleStats = getPlugin('pluginSimpleStats');
echo '<div class="uk-panel">';
echo '<h4 class="panel-title">'.$SimpleStats->getValue('label').'</h4>';
echo $SimpleStats->dashboard();
@ -169,4 +169,4 @@
</div>
</div>
</div>

View File

@ -263,25 +263,23 @@ function buildAllpages($publishedPages=true, $staticPages=true, $draftPages=true
return $tmp;
}
function getPlugin($pluginName) {
// Returns the plugin Object if is enabled and installed, FALSE otherwise
function getPlugin($pluginClassName) {
global $plugins;
if (pluginEnabled($pluginName)) {
$pluginClass = 'plugin'.Text::firstCharUp($pluginName);
return $plugins['all'][$pluginClass];
if (pluginEnabled($pluginClassName)) {
return $plugins['all'][$pluginClassName];
}
return false;
}
// Returns TRUE if the plugin is enabled, FALSE otherwise
function pluginEnabled($pluginName) {
// Returns TRUE if the plugin is enabled and installed, FALSE otherwise
function pluginEnabled($pluginClassName) {
global $plugins;
$pluginClass = 'plugin'.Text::firstCharUp($pluginName);
if( isset($plugins['all'][$pluginClass]) ) {
return $plugins['all'][$pluginClass]->installed();
if (isset($plugins['all'][$pluginClassName])) {
return $plugins['all'][$pluginClassName]->installed();
}
return false;
}
@ -778,4 +776,4 @@ function activateTheme($themeDirectory) {
return true;
}
return false;
}
}

View File

@ -28,7 +28,7 @@ class Theme {
public static function rssUrl()
{
if (pluginEnabled('RSS')) {
if (pluginEnabled('pluginRSS')) {
return DOMAIN_BASE.'rss.xml';
}
return false;
@ -36,7 +36,7 @@ class Theme {
public static function sitemapUrl()
{
if (pluginEnabled('Sitemap')) {
if (pluginEnabled('pluginSitemap')) {
return DOMAIN_BASE.'sitemap.xml';
}
return false;
@ -183,4 +183,4 @@ class Theme {
}
}
?>
?>