From bec64ee33642fe3216874801a48deca12f9a3dcc Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 2 Jun 2010 17:11:48 +0000 Subject: [PATCH] allow specify value for template specific link handler and using a javascript link, instead a a-tag --- .../inc/class.addressbook_hooks.inc.php | 21 ++++++------------- phpgwapi/inc/class.egw.inc.php | 9 ++++---- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index e79c06d37d..cabd6a269e 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -29,21 +29,12 @@ class addressbook_hooks if ($location == 'sidebox_menu') { $file = array( - array( - 'text' => ''.lang('Add').'', - 'no_lang' => true, - 'link' => false - ), - array( - 'text' => ''.lang('Advanced search').'', - 'no_lang' => true, - 'link' => false - ), + 'Add' => "javascript:egw_openWindowCentered2('". + egw::link('/index.php',array('menuaction' => 'addressbook.addressbook_ui.edit'),false). + "','_blank',850,440,'yes')", + 'Advanced search' => "javascript:egw_openWindowCentered2('". + egw::link('/index.php',array('menuaction' => 'addressbook.addressbook_ui.search'),false). + "','_blank',850,480,'yes')", 'CSV-Import' => egw::link('/addressbook/csv_import.php') ); display_sidebox($appname,lang('Addressbook menu'),$file); diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php index ba31b79131..9048019d05 100644 --- a/phpgwapi/inc/class.egw.inc.php +++ b/phpgwapi/inc/class.egw.inc.php @@ -434,13 +434,14 @@ class egw extends egw_minimal /** * Link url generator * - * @param string $string The url the link is for - * @param string/array $extravars Extra params to be passed to the url + * @param string='' $string The url the link is for + * @param string|array $extravars='' Extra params to be passed to the url + * @param string $link_app=null if appname or true, some templates generate a special link-handler url * @return string The full url after processing */ - static function link($url = '', $extravars = '') + static function link($url = '', $extravars = '', $link_app=null) { - return $GLOBALS['egw']->framework->link($url, $extravars); + return $GLOBALS['egw']->framework->link($url, $extravars, $link_app); } /**