remove theme's plugins from the list

This commit is contained in:
Diego Najar 2021-11-21 18:50:58 +01:00
parent 4cfdf1722b
commit 9bf2663353
5 changed files with 30 additions and 19 deletions

View file

@ -97,6 +97,10 @@ echo Bootstrap::formTitle(array('icon' => 'check-square', 'title' => $L->g('Enab
echo '<table class="table table-striped"><tbody>';
foreach ($pluginsInstalled as $plugin) {
if ($plugin->type() == 'theme') {
// Do not display theme's plugins
continue;
}
echo '<tr id="' . $plugin->className() . '" class="searchItem">';
echo '<td class="align-middle pt-3 pb-3 w-25">';
@ -105,10 +109,7 @@ foreach ($pluginsInstalled as $plugin) {
if (method_exists($plugin, 'form')) {
echo '<a class="me-3" href="' . HTML_PATH_ADMIN_ROOT . 'plugins-settings/' . $plugin->className() . '">' . $L->g('Settings') . '</a>';
}
// You can not disable a plugin for theme which is active
if ($plugin->type() != 'theme') {
echo '<span class="link deactivatePlugin" data-class-name="' . $plugin->className() . '">' . $L->g('Deactivate') . '</a>';
}
echo '<span class="link deactivatePlugin" data-class-name="' . $plugin->className() . '">' . $L->g('Deactivate') . '</a>';
echo '</div>';
echo '</td>';
@ -137,6 +138,10 @@ echo '<table class="table table-striped"><tbody>';
$pluginsNotInstalled = array_diff_key($plugins['all'], $pluginsInstalled);
foreach ($pluginsNotInstalled as $plugin) {
if ($plugin->type() == 'theme') {
// Do not display theme's plugins
continue;
}
echo '<tr id="' . $plugin->className() . '" class="searchItem">';
echo '<td class="align-middle pt-3 pb-3 w-25">';

View file

@ -45,7 +45,7 @@ foreach ($themes as $theme) {
echo '
<tr>
<td class="align-middle pt-4 pb-4">
<div>'.$theme['name'].($theme['dirname']==$site->theme()?'<span class="badge bg-primary ms-2">'.$L->g('Enabled').'</span>':'').'</div>
<div>'.$theme['name'].($theme['dirname']==$site->theme()?'<span class="badge bg-primary ms-2">'.$L->g('Active').'</span>':'').'</div>
<div class="mt-1">
';

View file

@ -9,26 +9,23 @@ $theme = getPlugin($site->theme()); // Returns plugin object or False
// Functions
// ============================================================================
function buildThemes()
{
function buildThemes() {
global $site;
$themes = array();
$themesPaths = Filesystem::listDirectories(PATH_THEMES);
foreach($themesPaths as $themePath)
{
foreach ($themesPaths as $themePath) {
// Check if the theme is translated.
$languageFilename = $themePath.DS.'languages'.DS.$site->language().'.json';
if( !Sanitize::pathFile($languageFilename) ) {
$languageFilename = $themePath.DS.'languages'.DS.DEFAULT_LANGUAGE_FILE;
}
if( Sanitize::pathFile($languageFilename) )
{
if( Sanitize::pathFile($languageFilename) ) {
$database = file_get_contents($languageFilename);
$database = json_decode($database, true);
if(empty($database)) {
if (empty($database)) {
Log::set('99.themes.php'.LOG_SEP.'Language file error on theme '.$themePath);
break;
}

View file

@ -112,4 +112,13 @@ footer {
/* Icons */
.bi {
margin-right: .5rem!important;
}
}
/* Remove Focus glow */
.btn:focus,
.form-control:focus,
.form-select:focus,
input:focus {
outline: none !important;
box-shadow: none !important;
}

View file

@ -35,12 +35,12 @@
}
?>
<?php if ($theme->googleFonts()): ?>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:sans,bold">
<style>
body { font-family: "Open Sans", sans-serif; }
</style>
<?php endif; ?>
<?php if ($theme->googleFonts()): ?>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:sans,bold">
<style>
body { font-family: "Open Sans", sans-serif; }
</style>
<?php endif; ?>
<!-- Execute Bludit plugins for the hook "Site head" -->
<?php execPluginsByHook('siteHead'); ?>