Suppress showing unsupported addons in the administration.
This commit is contained in:
parent
4ca857e110
commit
7b7e372fb0
2 changed files with 37 additions and 25 deletions
|
@ -222,7 +222,8 @@ function get_plugin_info($plugin){
|
||||||
'name' => $plugin,
|
'name' => $plugin,
|
||||||
'description' => "",
|
'description' => "",
|
||||||
'author' => array(),
|
'author' => array(),
|
||||||
'version' => ""
|
'version' => "",
|
||||||
|
'status' => ""
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!is_file("addon/$plugin/$plugin.php")) return $info;
|
if (!is_file("addon/$plugin/$plugin.php")) return $info;
|
||||||
|
|
|
@ -1028,12 +1028,23 @@ function admin_page_plugins(&$a){
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$plugins = array();
|
$plugins = array();
|
||||||
$files = glob("addon/*/");
|
$files = glob("addon/*/"); /* */
|
||||||
if($files) {
|
if($files) {
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
if (is_dir($file)){
|
if (is_dir($file)){
|
||||||
list($tmp, $id)=array_map("trim", explode("/",$file));
|
list($tmp, $id)=array_map("trim", explode("/",$file));
|
||||||
$info = get_plugin_info($id);
|
$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);
|
$plugins[] = array($id, (in_array($id, $a->plugins)?"on":"off") , $info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1127,7 +1138,7 @@ function admin_page_themes(&$a){
|
||||||
$allowed_themes[] = trim($x);
|
$allowed_themes[] = trim($x);
|
||||||
|
|
||||||
$themes = array();
|
$themes = array();
|
||||||
$files = glob('view/theme/*');
|
$files = glob('view/theme/*'); /* */
|
||||||
if($files) {
|
if($files) {
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
$f = basename($file);
|
$f = basename($file);
|
||||||
|
|
Loading…
Reference in a new issue