547 if ( defined('ENANO_DEMO_MODE') && strstr($_GET['plugin'], 'Demo') ) |
547 if ( defined('ENANO_DEMO_MODE') && strstr($_GET['plugin'], 'Demo') ) |
548 { |
548 { |
549 echo('<h3>Error disabling plugin</h3><p>The demo lockdown plugin cannot be disabled in demo mode.</p>'); |
549 echo('<h3>Error disabling plugin</h3><p>The demo lockdown plugin cannot be disabled in demo mode.</p>'); |
550 break; |
550 break; |
551 } |
551 } |
552 if ( $_GET['plugin'] != 'SpecialAdmin.php' ) |
552 if ( !in_array($_GET['plugin'], $plugins->system_plugins) ) |
553 { |
553 { |
554 setConfig('plugin_'.$_GET['plugin'], '0'); |
554 setConfig('plugin_'.$_GET['plugin'], '0'); |
555 } |
555 } |
556 else |
556 else |
557 { |
557 { |
558 echo('<h3>Error disabling plugin</h3><p>The administration panel plugin cannot be disabled.</p>'); |
558 echo('<h3>Error disabling plugin</h3><p>The plugin you selected cannot be disabled because it is a system plugin.</p>'); |
559 } |
559 } |
560 break; |
560 break; |
561 } |
561 } |
562 } |
562 } |
563 $dir = './plugins/'; |
563 $dir = './plugins/'; |
564 $plugin_list = Array(); |
564 $plugin_list = Array(); |
565 $system = Array(); |
565 $system = Array(); |
|
566 $show_system = ( isset($_GET['show_system']) && $_GET['show_system'] == 'yes' ); |
566 |
567 |
567 if (is_dir($dir)) |
568 if (is_dir($dir)) |
568 { |
569 { |
569 if ($dh = opendir($dir)) |
570 if ($dh = opendir($dir)) |
570 { |
571 { |
571 while (($file = readdir($dh)) !== false) |
572 while (($file = readdir($dh)) !== false) |
572 { |
573 { |
573 if(preg_match('#^(.*?)\.php$#is', $file) && $file != 'index.php') |
574 if(preg_match('#^(.*?)\.php$#is', $file) && $file != 'index.php') |
574 { |
575 { |
|
576 unset($thelist); |
575 if ( in_array($file, $plugins->system_plugins) ) |
577 if ( in_array($file, $plugins->system_plugins) ) |
576 { |
578 { |
|
579 if ( !$show_system ) |
|
580 continue; |
577 $thelist =& $system; |
581 $thelist =& $system; |
578 continue; |
|
579 } |
582 } |
580 else |
583 else |
581 { |
584 { |
582 $thelist =& $plugin_list; |
585 $thelist =& $plugin_list; |
583 } |
586 } |
612 echo '<div class="error-box">The plugins/ directory is missing from your Enano installation.</div>'; |
615 echo '<div class="error-box">The plugins/ directory is missing from your Enano installation.</div>'; |
613 return; |
616 return; |
614 } |
617 } |
615 echo('<div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4"> |
618 echo('<div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4"> |
616 <tr><th>Plugin filename</th><th>Plugin name</th><th>Description</th><th>Author</th><th>Version</th><th></th></tr>'); |
619 <tr><th>Plugin filename</th><th>Plugin name</th><th>Description</th><th>Author</th><th>Version</th><th></th></tr>'); |
617 $plugin_files = array_keys($plugin_list); |
620 $plugin_files_1 = array_keys($plugin_list); |
|
621 $plugin_files_2 = array_keys($system); |
|
622 $plugin_files = array_values(array_merge($plugin_files_1, $plugin_files_2)); |
618 $cls = 'row2'; |
623 $cls = 'row2'; |
619 for ( $i = 0; $i < sizeof($plugin_files); $i++ ) |
624 for ( $i = 0; $i < sizeof($plugin_files); $i++ ) |
620 { |
625 { |
621 $cls = ( $cls == 'row2' ) ? 'row3' : 'row2'; |
626 $cls = ( $cls == 'row2' ) ? 'row3' : 'row2'; |
|
627 $this_plugin = ( isset($system[$plugin_files[$i]]) ) ? $system[$plugin_files[$i]] : $plugin_list[$plugin_files[$i]]; |
|
628 $is_system = ( $system[$plugin_files[$i]] ); |
|
629 $bgcolor = ''; |
|
630 if ( $is_system && $cls == 'row2' ) |
|
631 $bgcolor = ' style="background-color: #FFD8D8;"'; |
|
632 else if ( $is_system && $cls == 'row3' ) |
|
633 $bgcolor = ' style="background-color: #FFD0D0;"'; |
622 echo '<tr> |
634 echo '<tr> |
623 <td class="'.$cls.'">'.$plugin_files[$i].'</td> |
635 <td class="'.$cls.'"'.$bgcolor.'>'.$plugin_files[$i].'</td> |
624 <td class="'.$cls.'"><a href="'.$plugin_list[$plugin_files[$i]]['uri'].'">'.$plugin_list[$plugin_files[$i]]['name'].'</a></td> |
636 <td class="'.$cls.'"'.$bgcolor.'><a href="'.$this_plugin['uri'].'">'.$this_plugin['name'].'</a></td> |
625 <td class="'.$cls.'">'.$plugin_list[$plugin_files[$i]]['desc'].'</td> |
637 <td class="'.$cls.'"'.$bgcolor.'>'.$this_plugin['desc'].'</td> |
626 <td class="'.$cls.'"><a href="'.$plugin_list[$plugin_files[$i]]['aweb'].'">'.$plugin_list[$plugin_files[$i]]['auth'].'</a></td> |
638 <td class="'.$cls.'"'.$bgcolor.'><a href="'.$this_plugin['aweb'].'">'.$this_plugin['auth'].'</a></td> |
627 <td class="'.$cls.'">'.$plugin_list[$plugin_files[$i]]['vers'].'</td> |
639 <td class="'.$cls.'"'.$bgcolor.'>'.$this_plugin['vers'].'</td> |
628 <td class="'.$cls.'">'; |
640 <td class="'.$cls.'"'.$bgcolor.'>'; |
629 if ( getConfig('plugin_'.$plugin_files[$i]) == '1' ) |
641 if ( !in_array($plugin_files[$i], $plugins->system_plugins) ) |
630 { |
642 { |
631 echo '<a href="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'&action=disable&plugin='.$plugin_files[$i].'">Disable</a>'; |
643 if ( getConfig('plugin_'.$plugin_files[$i]) == '1' ) |
|
644 { |
|
645 echo '<a href="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'&show_system=' . ( $show_system ? 'yes' : 'no' ) . '&action=disable&plugin='.$plugin_files[$i].'">Disable</a>'; |
|
646 } |
|
647 else |
|
648 { |
|
649 echo '<a href="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'&show_system=' . ( $show_system ? 'yes' : 'no' ) . '&action=enable&plugin='.$plugin_files[$i].'">Enable</a>'; |
|
650 } |
632 } |
651 } |
633 else |
652 else |
634 { |
653 { |
635 echo '<a href="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'&action=enable&plugin='.$plugin_files[$i].'">Enable</a>'; |
654 echo '[System]'; |
636 } |
655 } |
637 echo '</td></tr>'; |
656 echo '</td></tr>'; |
638 } |
657 } |
|
658 $showhide_link = ( $show_system ) ? |
|
659 '<a style="color: white;" href="' . makeUrlNS('Special', 'Administration', 'module=' . $paths->cpage['module'] . '&show_system=no', true) . '">Hide system plugins</a>' : |
|
660 '<a style="color: white;" href="' . makeUrlNS('Special', 'Administration', 'module=' . $paths->cpage['module'] . '&show_system=yes', true) . '">Show system plugins</a>' ; |
|
661 echo '<tr><th colspan="6" class="subhead">'.$showhide_link.'</th></tr>'; |
639 echo '</table></div>'; |
662 echo '</table></div>'; |
640 } |
663 } |
641 |
664 |
642 function page_Admin_UploadAllowedMimeTypes() |
665 function page_Admin_UploadAllowedMimeTypes() |
643 { |
666 { |