allow specify value for template specific link handler and using a javascript link, instead a a-tag

This commit is contained in:
Ralf Becker 2010-06-02 17:11:48 +00:00
parent 97b1130a36
commit bec64ee336
2 changed files with 11 additions and 19 deletions

View File

@ -29,21 +29,12 @@ class addressbook_hooks
if ($location == 'sidebox_menu')
{
$file = array(
array(
'text' => '<a class="textSidebox" href="'.egw::link('/index.php',array('menuaction' => 'addressbook.addressbook_ui.edit')).
'" onclick="egw_openWindowCentered2(this.href,\'_blank\',850,440,\'yes\');
return false;">'.lang('Add').'</a>',
'no_lang' => true,
'link' => false
),
array(
'text' => '<a class="textSidebox" href="'.egw::link('/index.php',array(
'menuaction' => 'addressbook.addressbook_ui.search',)).
'" onclick="egw_openWindowCentered2(this.href,\'advanced_search\',850,480,\'yes\');
return false;">'.lang('Advanced search').'</a>',
'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);

View File

@ -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);
}
/**