added form::name() pseudo function for onclick events to find out the name used in the form

This commit is contained in:
Ralf Becker 2005-06-12 13:22:47 +00:00
parent dc8e6a8280
commit 8ef28951a8

View File

@ -909,6 +909,10 @@
$url = $GLOBALS['phpgw']->link($matches[1],$matches[2]);
$onclick = preg_replace('/egw::link\(\'([^\']+)\',\'([^\']+)\'\)/','\''.$url.'\'',$onclick);
}
elseif (preg_match("/form::name\\('([^']+)'\\)/",$onclick,$matches))
{
$onclick = preg_replace("/form::name\\('([^']+)'\\)/",'\''.$this->form_name($cname,$matches[1]).'\'',$onclick);
}
elseif (preg_match('/^return confirm\(["\']{1}(.*)["\']{1}\);?$/',$cell['onclick'],$matches))
{
$question = lang($matches[1]).(substr($matches[1],-1) != '?' ? '?' : ''); // add ? if not there, saves extra phrase