mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-24 22:21:34 +01:00
Use new sidebox_all hook to add importexport links to other apps' sideboxes
This commit is contained in:
parent
40f8600bc5
commit
ae07ff2331
@ -70,4 +70,46 @@ class importexport_admin_prefs_sidebox_hooks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called from framework so Import / Export can add links into other apps' sidebox.
|
||||||
|
*/
|
||||||
|
public static function other_apps() {
|
||||||
|
$appname = $GLOBALS['egw_info']['flags']['currentapp'];
|
||||||
|
$cache = egw_cache::getCache(egw_cache::SESSION, 'importexport', 'sidebox_links');
|
||||||
|
|
||||||
|
if(!$cache[$appname] && $GLOBALS['egw_info']['user']['apps']['importexport']) {
|
||||||
|
$cache[$appname]['import'] = importexport_helper_functions::has_definitions($appname, 'import');
|
||||||
|
$cache[$appname]['export'] = importexport_helper_functions::has_definitions($appname, 'export');
|
||||||
|
egw_cache::setCache(egw_cache::SESSION, 'importexport', 'sidebox_links', $cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add in import / export, if available
|
||||||
|
$file = array();
|
||||||
|
if($cache[$appname]['import'])
|
||||||
|
{
|
||||||
|
$file['Import'] = array('link' => "javascript:egw_openWindowCentered2('".
|
||||||
|
egw::link('/index.php',array(
|
||||||
|
'menuaction' => 'importexport.importexport_import_ui.import_dialog',
|
||||||
|
'appname'=>$appname
|
||||||
|
),false)."','_blank',500,220,'yes')",
|
||||||
|
'icon' => 'import',
|
||||||
|
'app' => 'importexport',
|
||||||
|
'text' => 'import'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if($cache[$appname]['export'])
|
||||||
|
{
|
||||||
|
$file['Export'] = array('link' => "javascript:egw_openWindowCentered2('".
|
||||||
|
egw::link('/index.php',array(
|
||||||
|
'menuaction' => 'importexport.importexport_export_ui.export_dialog',
|
||||||
|
'appname'=>$appname
|
||||||
|
),false)."','_blank',850,440,'yes')",
|
||||||
|
'icon' => 'export',
|
||||||
|
'app' => 'importexport',
|
||||||
|
'text' => 'export'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if($file) display_sidebox($appname,lang('importexport'),$file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ $setup_info['importexport']['note'] =
|
|||||||
$setup_info['importexport']['hooks']['preferences'] =
|
$setup_info['importexport']['hooks']['preferences'] =
|
||||||
$setup_info['importexport']['hooks']['admin'] =
|
$setup_info['importexport']['hooks']['admin'] =
|
||||||
$setup_info['importexport']['hooks']['sidebox_menu'] = 'importexport_admin_prefs_sidebox_hooks::all_hooks';
|
$setup_info['importexport']['hooks']['sidebox_menu'] = 'importexport_admin_prefs_sidebox_hooks::all_hooks';
|
||||||
|
$setup_info['importexport']['hooks']['sidebox_all'] = 'importexport_admin_prefs_sidebox_hooks::other_apps';
|
||||||
|
|
||||||
/* Dependencies for this app to work */
|
/* Dependencies for this app to work */
|
||||||
$setup_info['importexport']['depends'][] = array(
|
$setup_info['importexport']['depends'][] = array(
|
||||||
|
Loading…
Reference in New Issue
Block a user