update cats prefs

This commit is contained in:
ceb 2002-01-13 23:54:46 +00:00
parent 1f611ae1b3
commit fb6a15917b
4 changed files with 20 additions and 39 deletions

View File

@ -138,7 +138,7 @@
}
else
{
if (!$values['cat_parent'])
if (!$values['parent'])
{
$exists = $this->exists(array
(

View File

@ -195,7 +195,6 @@
{
$values = array
(
'id' => '',
'parent' => $cat_parent,
'descr' => $cat_description,
'name' => $cat_name,

View File

@ -101,9 +101,9 @@
return $this->cats->exists($data['type'],$data['cat_name'],$data['cat_id']);
}
function formatted_list($data)
function formatted_list($format,$type,$cat_parent,$public_cats)
{
return $this->cats->formated_list($data['select'],$data['all'],$data['cat_parent']);
return $this->cats->formated_list($format,$type,$cat_parent,$public_cats);
}
function delete($cat_id,$subs)

View File

@ -297,6 +297,11 @@
$cat_parent = $new_parent;
}
if (!$global_cats)
{
$global_cats = False;
}
if ($submit)
{
$data = serialize($cat_data);
@ -328,28 +333,14 @@
if ($cats_level)
{
if ($global_cats)
{
$cats_list = $this->bo->cats->formated_list('select','all',$cat_parent,True);
}
else
{
$cats_list = $this->bo->cats->formated_list('select','all',$cat_parent);
}
$type = 'all';
}
else
{
if ($global_cats)
{
$cats_list = $this->bo->cats->formated_list('select','mains',$cat_parent,True);
}
else
{
$cats_list = $this->bo->cats->formated_list('select','mains',$cat_parent);
}
$type = 'mains';
}
$this->t->set_var('category_list',$cats_list);
$this->t->set_var('category_list',$this->bo->cats->formated_list('select',$type,$cat_parent,$global_cats));
$this->t->set_var('cat_name',$cat_name);
$this->t->set_var('cat_description',$cat_description);
@ -419,6 +410,11 @@
$cat_parent = $new_parent;
}
if (!$global_cats)
{
$global_cats = False;
}
if ($submit)
{
$data = serialize($cat_data);
@ -455,30 +451,16 @@
$this->t->set_var('cat_name',$GLOBALS['phpgw']->strip_html($cats[0]['name']));
$this->t->set_var('cat_description',$GLOBALS['phpgw']->strip_html($cats[0]['description']));
if ($cats_level)
if ($cats_level)
{
if ($global_cats)
{
$cats_list = $this->bo->cats->formated_list('select','all',$cats[0]['parent'],True);
}
else
{
$cats_list = $this->bo->cats->formated_list('select','all',$cats[0]['parent']);
}
$type = 'all';
}
else
{
if ($global_cats)
{
$cats_list = $this->bo->cats->formated_list('select','mains',$cats[0]['parent'],True);
}
else
{
$cats_list = $this->bo->cats->formated_list('select','mains',$cats[0]['parent']);
}
$type = 'mains';
}
$this->t->set_var('category_list',$cats_list);
$this->t->set_var('category_list',$this->bo->cats->formated_list('select',$type,$cats[0]['parent'],$global_cats));
$this->t->set_var('access','<input type="checkbox" name="cat_access" value="True"'
. ($cats[0]['access'] == private ?' checked':'') . '>');