Add new hook 'sidebox_all' to allow another app to add something to all other apps' sidebox instead of just adding in importexport stuff

This commit is contained in:
Nathan Gray 2011-02-03 16:30:40 +00:00
parent d5a4b78bae
commit 40f8600bc5

View File

@ -188,39 +188,11 @@ class idots_framework extends egw_framework
// calling the old hook
$GLOBALS['egw']->hooks->single('sidebox_menu',$GLOBALS['egw_info']['flags']['currentapp']);
// allow other apps to hook into sidebox menu of every app: sidebox_all
$GLOBALS['egw']->hooks->process('sidebox_all',array($GLOBALS['egw_info']['flags']['currentapp']),true);
if($this->sidebox_content)
{
// Add in import / export, if available
if($GLOBALS['egw_info']['user']['apps']['importexport']) {
$appname = $GLOBALS['egw_info']['flags']['currentapp'];
$file = array();
if(importexport_helper_functions::has_definitions($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(importexport_helper_functions::has_definitions($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);
}
if($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox'])
{
$this->tpl->set_var('lang_show_menu',lang('show menu'));