update delete cats

This commit is contained in:
ceb 2002-09-25 01:10:26 +00:00
parent b6e2ef8143
commit 557c3842f2
2 changed files with 14 additions and 5 deletions

View File

@ -143,10 +143,20 @@
}
}
function delete($cat_id,$drop_subs,$modify_subs)
function delete($data)
{
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)
{

View File

@ -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;
}
}