From a0d7bde2fbb86488fca7a0321823a59d98e43f35 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 3 Feb 2011 16:49:49 +0000 Subject: [PATCH] By default, don't show apps user doesn't have access to any definitions for --- .../inc/class.importexport_helper_functions.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/importexport/inc/class.importexport_helper_functions.inc.php b/importexport/inc/class.importexport_helper_functions.inc.php index 0fdeab26a0..227d054265 100755 --- a/importexport/inc/class.importexport_helper_functions.inc.php +++ b/importexport/inc/class.importexport_helper_functions.inc.php @@ -371,8 +371,14 @@ class importexport_helper_functions { * @param string $_type * @return array $num => $appname */ - public static function get_apps($_type) { - return array_keys(self::get_plugins('all',$_type)); + public static function get_apps($_type, $ignore_acl = false) { + $apps = array_keys(self::get_plugins('all',$_type)); + if($ignore_acl) return $apps; + + foreach($apps as $key => $app) { + if(!self::has_definitions($app, $_type)) unset($apps[$key]); + } + return $apps; } public static function guess_filetype( $_file ) {