mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
Allow to specify app in egw::link() pseudo function
This commit is contained in:
parent
59c35020e7
commit
661572206c
@ -2102,12 +2102,12 @@ class etemplate_old extends boetemplate
|
||||
{
|
||||
if (strpos($on,'::') !== false) // avoid the expensive regular expresions, for performance reasons
|
||||
{
|
||||
if (preg_match_all("/egw::link\\('([^']+)','(.+?)'\\)/",$on,$matches)) // the ? alters the expression to shortest match
|
||||
if (preg_match_all("/egw::link\\('([^']+)','(.+?)'(?:,'(.+?)')?\\)/",$on,$matches)) // the ? alters the expression to shortest match
|
||||
{
|
||||
foreach(array_keys($matches[1]) as $n) // this way we can correctly parse ' in the 2. argument
|
||||
{
|
||||
$url = $GLOBALS['egw']->link($matches[1][$n],$matches[2][$n]);
|
||||
$on = str_replace($matches[0][$n],'\''.$url.'\'',$on);
|
||||
$url = $GLOBALS['egw']->link($matches[1][$n],$matches[2][$n],$matches[3][$n]);
|
||||
$on = str_replace($matches[0][$n],'\''.addslashes($url).'\'',$on);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user