1
1
Fork 0

Suppress showing unsupported addons in the administration.

This commit is contained in:
Michael Vogel 2014-04-29 14:22:37 +02:00
parent 4ca857e110
commit 7b7e372fb0
2 changed files with 37 additions and 25 deletions

View file

@ -222,7 +222,8 @@ function get_plugin_info($plugin){
'name' => $plugin,
'description' => "",
'author' => array(),
'version' => ""
'version' => "",
'status' => ""
);
if (!is_file("addon/$plugin/$plugin.php")) return $info;

View file

@ -1028,12 +1028,23 @@ function admin_page_plugins(&$a){
*/
$plugins = array();
$files = glob("addon/*/");
$files = glob("addon/*/"); /* */
if($files) {
foreach($files as $file) {
if (is_dir($file)){
list($tmp, $id)=array_map("trim", explode("/",$file));
$info = get_plugin_info($id);
$show_plugin = true;
// If the addon is unsupported, then only show it, when it is enabled
if ((strtolower($info["status"]) == "unsupported") AND !in_array($id, $a->plugins))
$show_plugin = false;
// Override the above szenario, when the admin really wants to see outdated stuff
if (get_config("system", "show_unsupported_addons"))
$show_plugin = true;
if ($show_plugin)
$plugins[] = array($id, (in_array($id, $a->plugins)?"on":"off") , $info);
}
}
@ -1127,7 +1138,7 @@ function admin_page_themes(&$a){
$allowed_themes[] = trim($x);
$themes = array();
$files = glob('view/theme/*');
$files = glob('view/theme/*'); /* */
if($files) {
foreach($files as $file) {
$f = basename($file);