From: <cod...@go...> - 2009-06-08 15:04:08
|
Author: ke...@se... Date: Mon Jun 8 08:03:49 2009 New Revision: 1374 Modified: trunk/andro/lib/androX6.php Log: Allow PHP level actions before and after an ajax delete. fixes issue 29 Modified: trunk/andro/lib/androX6.php ============================================================================== --- trunk/andro/lib/androX6.php (original) +++ trunk/andro/lib/androX6.php Mon Jun 8 08:03:49 2009 @@ -270,13 +270,29 @@ return; } + # KFD 6/8/09 Google #29 Various changes to allow pre- and post- + # delete methods + $table_id = gp('x6page'); $view = ddView(gp('x6page')); $skey = SQLFN(gp('skey')); - $sq="Delete from $view where skey = $skey"; - if(Errors()) { - x6Errors(hErrors()); + $method = $table_id."_before_delete"; + $continue = true; + if(method_exists($this,$method)) { + $continue = $this->$method($skey); + } + if($continue) { + $sq="Delete from $view where skey = $skey"; + SQL($sq); + if(Errors()) { + x6Errors(hErrors()); + } + else { + $method = $table_id."_after_delete"; + if(method_exists($this,$method)) { + $this->$method(); + } + } } - SQL($sq); } # =================================================================== |