Show mis-assigned plugins when a template supports custom sidebars
This commit is contained in:
parent
20dce86770
commit
9c85c0349f
@ -434,7 +434,7 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
|
||||
/* Load the new plugin */
|
||||
$plugin = &serendipity_plugin_api::load_plugin($inst);
|
||||
if (!is_object($plugin)) {
|
||||
echo "DEBUG: Plugin $inst not an object: " . print_r($plugin, true) . ".<br />Input: " . print_r($serendipity['GET'], true) . ".<br /><br />\n\nPlease report this bug. This error can happen if a plugin was not properly downloaded (check your plugins directory if the requested plugin was downloaded) or the inclusion of a file failed (permissions?)<br />\n";
|
||||
echo "DEBUG: Plugin $inst not an object: " . print_r($plugin, true) . ".<br />Input: " . print_r($serendipity['GET'], true) . ".<br /><br />\n\nThis error can happen if a plugin was not properly downloaded (check your plugins directory if the requested plugin was downloaded) or the inclusion of a file failed (permissions?)<br />\n";
|
||||
echo "Backtrace:<br />\n" . implode("<br />\n", $serendipity['debug']['pluginload']) . "<br />";
|
||||
}
|
||||
$bag = new serendipity_property_bag;
|
||||
|
@ -58,6 +58,7 @@ function show_plugins($event_only = false, $sidebars = null)
|
||||
|
||||
global $serendipity;
|
||||
|
||||
$sql_filter = '';
|
||||
if (is_array($sidebars)) {
|
||||
foreach($sidebars AS $sidebar) {
|
||||
$up = strtoupper($sidebar);
|
||||
@ -70,6 +71,19 @@ function show_plugins($event_only = false, $sidebars = null)
|
||||
} else {
|
||||
$opts[$sidebar] = $up;
|
||||
}
|
||||
$sql_filter .= "AND placement != '" . serendipity_db_escape_string($sidebar) . "' ";
|
||||
}
|
||||
}
|
||||
|
||||
if (!$event_only) {
|
||||
$sql = "SELECT * from {$serendipity['dbPrefix']}plugins
|
||||
WHERE placement != 'event'
|
||||
AND placement != 'eventh'
|
||||
" . $sql_filter;
|
||||
$invisible_plugins = serendipity_db_query($sql);
|
||||
if (is_array($invisible_plugins)) {
|
||||
$sidebars[] = 'NONE';
|
||||
$opts['NONE'] = NONE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,10 +128,22 @@ function show_plugins($event_only = false, $sidebars = null)
|
||||
|
||||
$total = 0;
|
||||
foreach ($plugin_placements as $plugin_placement) {
|
||||
if (!$event_only && $plugin_placement == 'NONE') {
|
||||
$is_invisible = true;
|
||||
} else {
|
||||
$is_invisible = false;
|
||||
}
|
||||
$ptitle = $opts[$plugin_placement];
|
||||
$pid = $plugin_placement;
|
||||
|
||||
echo '<td class="pluginmanager_side">';
|
||||
echo '<div class="heading">' . $opts[$plugin_placement] . '</div>';
|
||||
echo '<ol id="' . $plugin_placement . '_col" class="pluginmanager_container">';
|
||||
echo '<div class="heading">' . $ptitle . '</div>';
|
||||
echo '<ol id="' . $pid . '_col" class="pluginmanager_container">';
|
||||
if ($is_invisible) {
|
||||
$plugins = $invisible_plugins;
|
||||
} else {
|
||||
$plugins = serendipity_plugin_api::enum_plugins($plugin_placement);
|
||||
}
|
||||
|
||||
if (!is_array($plugins)) {
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user