From 557c3842f27f503128073f2618397dfc5a24bbf8 Mon Sep 17 00:00:00 2001 From: ceb Date: Wed, 25 Sep 2002 01:10:26 +0000 Subject: [PATCH] update delete cats --- admin/inc/class.bocategories.inc.php | 14 ++++++++++++-- admin/inc/class.uicategories.inc.php | 5 ++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/admin/inc/class.bocategories.inc.php b/admin/inc/class.bocategories.inc.php index a97dd998d0..dbd414c29c 100644 --- a/admin/inc/class.bocategories.inc.php +++ b/admin/inc/class.bocategories.inc.php @@ -143,9 +143,19 @@ } } - function delete($cat_id,$drop_subs,$modify_subs) + function delete($data) { - $this->cats->delete($cat_id,$drop_subs,$modify_subs); + if (is_array($data)) + { + $cat_id = $data['cat_id']; + $drop_subs = (isset($data['drop_subs'])?$data['drop_subs']:False); + $modify_subs = (isset($data['modify_subs'])?$data['modify_subs']:False); + + if ($cat_id > 0) + { + $this->cats->delete($cat_id,$drop_subs,$modify_subs); + } + } } function check_values($values) diff --git a/admin/inc/class.uicategories.inc.php b/admin/inc/class.uicategories.inc.php index c7a783a1a9..a6a6794414 100644 --- a/admin/inc/class.uicategories.inc.php +++ b/admin/inc/class.uicategories.inc.php @@ -430,16 +430,15 @@ switch ($GLOBALS['HTTP_POST_VARS']['subs']) { case 'move': - $this->bo->delete($this->cat_id,False,True); + $this->bo->delete(array('cat_id' => $this->cat_id, 'modify_subs' => True)); Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); break; case 'drop': - $this->bo->delete($this->cat_id,True); + $this->bo->delete(array('cat_id' => $this->cat_id, 'drop_subs' => True)); Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); break; default: $error_msg = lang('Please choose one of the methods to handle the subcategories'); - //$this->bo->delete($this->cat_id); break; } }