mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 03:16:11 +01:00
Allow to see plugins and themes list without internet connection. Also add a more helpful message in the "add" view. re https://github.com/getgrav/grav/issues/1008
This commit is contained in:
@@ -708,15 +708,21 @@ class Admin
|
||||
return false;
|
||||
}
|
||||
|
||||
return $local
|
||||
? $gpm->getInstalledPlugins()
|
||||
: $gpm->getRepositoryPlugins()->filter(function (
|
||||
$package,
|
||||
$slug
|
||||
) use ($gpm) {
|
||||
return !$gpm->isPluginInstalled($slug);
|
||||
})
|
||||
;
|
||||
if ($local) {
|
||||
return $gpm->getInstalledPlugins();
|
||||
} else {
|
||||
$plugins = $gpm->getRepositoryPlugins();
|
||||
if ($plugins) {
|
||||
return $plugins->filter(function (
|
||||
$package,
|
||||
$slug
|
||||
) use ($gpm) {
|
||||
return !$gpm->isPluginInstalled($slug);
|
||||
});
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -734,11 +740,21 @@ class Admin
|
||||
return false;
|
||||
}
|
||||
|
||||
return $local
|
||||
? $gpm->getInstalledThemes()
|
||||
: $gpm->getRepositoryThemes()->filter(function ($package, $slug) use ($gpm) {
|
||||
return !$gpm->isThemeInstalled($slug);
|
||||
});
|
||||
if ($local) {
|
||||
return $gpm->getInstalledThemes();
|
||||
} else {
|
||||
$themes = $gpm->getRepositoryThemes();
|
||||
if ($themes) {
|
||||
return $themes->filter(function (
|
||||
$package,
|
||||
$slug
|
||||
) use ($gpm) {
|
||||
return !$gpm->isThemeInstalled($slug);
|
||||
});
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user