Suppress showing unsupported addons in the administration.
This commit is contained in:
parent
4ca857e110
commit
7b7e372fb0
|
@ -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,13 +1028,24 @@ 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);
|
||||||
$plugins[] = array( $id, (in_array($id, $a->plugins)?"on":"off") , $info);
|
$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,16 +1138,16 @@ 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);
|
||||||
$is_experimental = intval(file_exists($file . '/experimental'));
|
$is_experimental = intval(file_exists($file . '/experimental'));
|
||||||
$is_supported = 1-(intval(file_exists($file . '/unsupported'))); // Is not used yet
|
$is_supported = 1-(intval(file_exists($file . '/unsupported'))); // Is not used yet
|
||||||
$is_allowed = intval(in_array($f,$allowed_themes));
|
$is_allowed = intval(in_array($f,$allowed_themes));
|
||||||
$themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed);
|
$themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! count($themes)) {
|
if(! count($themes)) {
|
||||||
notice( t('No themes found.'));
|
notice( t('No themes found.'));
|
||||||
|
|
Loading…
Reference in a new issue