mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-02 20:19:27 +01:00
"fixed not working plugin cache (on tree level): callback has to be public, as it's get called static by an other class (egw_cache)"
This commit is contained in:
parent
b47b6ed7ff
commit
80a1fb5a53
@ -16,8 +16,10 @@
|
||||
*/
|
||||
class importexport_helper_functions {
|
||||
|
||||
// Plugins are scanned and cached for all instances using this source path
|
||||
const CACHE_EXPIRATION = 86400;
|
||||
/**
|
||||
* Plugins are scanned and cached for all instances using this source path for given time (in seconds)
|
||||
*/
|
||||
const CACHE_EXPIRATION = 3600;
|
||||
|
||||
/**
|
||||
* Files known to cause problems, and will be skipped in a plugin scan
|
||||
@ -118,11 +120,9 @@ class importexport_helper_functions {
|
||||
* @return mixed comma seperated list or array with cat_names
|
||||
*/
|
||||
public static function cat_id2name( $_cat_ids ) {
|
||||
$cats = &CreateObject( 'phpgwapi.categories' );
|
||||
|
||||
$cat_ids = is_array( $_cat_ids ) ? $_cat_ids : explode( ',', $_cat_ids );
|
||||
foreach ( $cat_ids as $cat_id ) {
|
||||
$cat_names[] = $cats->id2name( (int)$cat_id );
|
||||
$cat_names[] = categories::id2name( (int)$cat_id );
|
||||
}
|
||||
return is_array( $_cat_ids ) ? $cat_names : implode(',',(array)$cat_names);
|
||||
} // end of member function category_id2name
|
||||
@ -135,8 +135,7 @@ class importexport_helper_functions {
|
||||
* @return mixed comma seperated list or array with cat_ids
|
||||
*/
|
||||
public static function cat_name2id( $_cat_names ) {
|
||||
$cats = CreateObject( 'phpgwapi.categories' );
|
||||
$cats->app_name = $GLOBALS['egw_info']['flags']['currentapp'];
|
||||
$cats = new categories(); // uses current user and app (egw_info[flags][currentapp])
|
||||
|
||||
$cat_names = is_array( $_cat_names ) ? $_cat_names : explode( ',', $_cat_names );
|
||||
foreach ( $cat_names as $cat_name ) {
|
||||
@ -279,7 +278,6 @@ class importexport_helper_functions {
|
||||
* @return array(<appname> => array( <type> => array(<plugin> => <title>)))
|
||||
*/
|
||||
public static function get_plugins( $_appname = 'all', $_type = 'all' ) {
|
||||
/*
|
||||
$plugins = egw_cache::getTree(
|
||||
__CLASS__,
|
||||
'plugins',
|
||||
@ -287,9 +285,6 @@ class importexport_helper_functions {
|
||||
array(array_keys($GLOBALS['egw_info']['apps']), array('import', 'export')),
|
||||
self::CACHE_EXPIRATION
|
||||
);
|
||||
*/
|
||||
$plugins = self::_get_plugins(array_keys($GLOBALS['egw_info']['apps']), array('import', 'export'));
|
||||
|
||||
$appnames = $_appname == 'all' ? array_keys($GLOBALS['egw_info']['apps']) : (array)$_appname;
|
||||
$types = $_type == 'all' ? array('import','export') : (array)$_type;
|
||||
|
||||
@ -302,7 +297,7 @@ class importexport_helper_functions {
|
||||
return $plugins;
|
||||
}
|
||||
|
||||
protected static function _get_plugins(Array $appnames, Array $types) {
|
||||
public static function _get_plugins(Array $appnames, Array $types) {
|
||||
$plugins = array();
|
||||
foreach ($appnames as $appname) {
|
||||
if(array_key_exists($appname, self::$blacklist_files) && self::$blacklist_files[$appname] === true) continue;
|
||||
@ -356,4 +351,3 @@ class importexport_helper_functions {
|
||||
|
||||
}
|
||||
} // end of importexport_helper_functions
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user