From 4e16995d6f3f989ea706ed6068a7e57924167479 Mon Sep 17 00:00:00 2001 From: ceb Date: Wed, 25 Sep 2002 03:56:06 +0000 Subject: [PATCH] update delete cats --- admin/inc/class.bocategories.inc.php | 9 +-------- preferences/inc/class.bocategories.inc.php | 7 +++++-- preferences/inc/class.uicategories.inc.php | 4 ++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/admin/inc/class.bocategories.inc.php b/admin/inc/class.bocategories.inc.php index dbd414c29c..3d1f4f2527 100644 --- a/admin/inc/class.bocategories.inc.php +++ b/admin/inc/class.bocategories.inc.php @@ -147,14 +147,7 @@ { 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); - } + $this->cats->delete($data); } } diff --git a/preferences/inc/class.bocategories.inc.php b/preferences/inc/class.bocategories.inc.php index 8599c9f673..044d5da8c1 100644 --- a/preferences/inc/class.bocategories.inc.php +++ b/preferences/inc/class.bocategories.inc.php @@ -104,9 +104,12 @@ return $this->cats->formated_list($format,$type,$cat_parent,$global_cats); } - function delete($cat_id,$drop_subs,$modify_subs) + function delete($data) { - $this->cats->delete($cat_id,$drop_subs,$modify_subs); + if (is_array($data)) + { + $this->cats->delete($data); + } } function check_values($values) diff --git a/preferences/inc/class.uicategories.inc.php b/preferences/inc/class.uicategories.inc.php index 3526cfa722..1445485af0 100644 --- a/preferences/inc/class.uicategories.inc.php +++ b/preferences/inc/class.uicategories.inc.php @@ -530,11 +530,11 @@ switch (get_var('subs',array('POST'))) { 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: