From 8ef28951a882c1acefbb1644e7d1000421bf88f4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 12 Jun 2005 13:22:47 +0000 Subject: [PATCH] added form::name() pseudo function for onclick events to find out the name used in the form --- etemplate/inc/class.uietemplate.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index 2090a2fbd8..3eaa6f7426 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -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