diff -r f99fb84bd959 -r 7c68a18a27be plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Mon Aug 06 10:37:42 2007 -0400 +++ b/plugins/SpecialAdmin.php Thu Aug 09 12:26:16 2007 -0400 @@ -2,7 +2,7 @@ /* Plugin Name: Runt - the Enano administration panel Plugin URI: http://enanocms.org/ -Description: Provides the page Special:Administration, which is the AJAX frontend to the various Admin: +Description: Provides the page Special:Administration, which is the AJAX frontend to the various Admin pagelets. This plugin cannot be disabled. Author: Dan Fuhry Version: 1.0.1 Author URI: http://enanocms.org/ @@ -549,13 +549,13 @@ echo('

Error disabling plugin

The demo lockdown plugin cannot be disabled in demo mode.

'); break; } - if ( $_GET['plugin'] != 'SpecialAdmin.php' ) + if ( !in_array($_GET['plugin'], $plugins->system_plugins) ) { setConfig('plugin_'.$_GET['plugin'], '0'); } else { - echo('

Error disabling plugin

The administration panel plugin cannot be disabled.

'); + echo('

Error disabling plugin

The plugin you selected cannot be disabled because it is a system plugin.

'); } break; } @@ -563,6 +563,7 @@ $dir = './plugins/'; $plugin_list = Array(); $system = Array(); + $show_system = ( isset($_GET['show_system']) && $_GET['show_system'] == 'yes' ); if (is_dir($dir)) { @@ -572,10 +573,12 @@ { if(preg_match('#^(.*?)\.php$#is', $file) && $file != 'index.php') { + unset($thelist); if ( in_array($file, $plugins->system_plugins) ) { + if ( !$show_system ) + continue; $thelist =& $system; - continue; } else { @@ -614,28 +617,48 @@ } echo('
'); - $plugin_files = array_keys($plugin_list); + $plugin_files_1 = array_keys($plugin_list); + $plugin_files_2 = array_keys($system); + $plugin_files = array_values(array_merge($plugin_files_1, $plugin_files_2)); $cls = 'row2'; for ( $i = 0; $i < sizeof($plugin_files); $i++ ) { $cls = ( $cls == 'row2' ) ? 'row3' : 'row2'; + $this_plugin = ( isset($system[$plugin_files[$i]]) ) ? $system[$plugin_files[$i]] : $plugin_list[$plugin_files[$i]]; + $is_system = ( $system[$plugin_files[$i]] ); + $bgcolor = ''; + if ( $is_system && $cls == 'row2' ) + $bgcolor = ' style="background-color: #FFD8D8;"'; + else if ( $is_system && $cls == 'row3' ) + $bgcolor = ' style="background-color: #FFD0D0;"'; echo ' - - - - - - + + + + + '; } + $showhide_link = ( $show_system ) ? + 'Hide system plugins' : + 'Show system plugins' ; + echo ''; echo '
Plugin filenamePlugin nameDescriptionAuthorVersion
'.$plugin_files[$i].''.$plugin_list[$plugin_files[$i]]['name'].''.$plugin_list[$plugin_files[$i]]['desc'].''.$plugin_list[$plugin_files[$i]]['auth'].''.$plugin_list[$plugin_files[$i]]['vers'].''; - if ( getConfig('plugin_'.$plugin_files[$i]) == '1' ) + '.$plugin_files[$i].''.$this_plugin['name'].''.$this_plugin['desc'].''.$this_plugin['auth'].''.$this_plugin['vers'].''; + if ( !in_array($plugin_files[$i], $plugins->system_plugins) ) { - echo 'Disable'; + if ( getConfig('plugin_'.$plugin_files[$i]) == '1' ) + { + echo 'Disable'; + } + else + { + echo 'Enable'; + } } else { - echo 'Enable'; + echo '[System]'; } echo '
'.$showhide_link.'
'; }