From 1b1329661fcabd0d7996fd78139ba8faf4395ac1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 30 Aug 2003 10:59:32 +0000 Subject: [PATCH] admin/cats: changed logic and look to apply with the style-guide --- admin/inc/class.uicategories.inc.php | 40 +++++++++++------------ admin/templates/default/category_form.tpl | 11 ++++--- admin/templates/default/listcats.tpl | 5 +-- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/admin/inc/class.uicategories.inc.php b/admin/inc/class.uicategories.inc.php index 14e35c725a..7d85e1b65b 100644 --- a/admin/inc/class.uicategories.inc.php +++ b/admin/inc/class.uicategories.inc.php @@ -285,15 +285,6 @@ $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); } - $GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Add global category'); - $GLOBALS['phpgw']->common->phpgw_header(); - echo parse_navbar(); - - $this->set_langs(); - - $this->template->set_file(array('form' => 'category_form.tpl')); - $this->template->set_block('form','delete','deletehandle'); - if ($_POST['save']) { $values = array @@ -312,11 +303,20 @@ else { $this->bo->save_cat($values); - $this->template->set_var('message',lang('Category %1 has been added !', $cat_name)); + $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); } } - $link_data['menuaction'] = 'admin.uicategories.add'; + $GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Add global category'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + + $this->set_langs(); + + $this->template->set_file(array('form' => 'category_form.tpl')); + $this->template->set_block('form','delete','deletehandle'); + + $link_data['menuaction'] = 'admin.uicategories.add'; $this->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data)); $this->template->set_var('category_list',$this->bo->cats->formatted_list(array('selected' => $cat_parent))); @@ -350,14 +350,6 @@ $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); } - $GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Edit global category'); - $GLOBALS['phpgw']->common->phpgw_header(); - echo parse_navbar(); - - $this->set_langs(); - - $this->template->set_file(array('form' => 'category_form.tpl')); - if ($_POST['save']) { $values = array @@ -378,10 +370,18 @@ else { $this->cat_id = $this->bo->save_cat($values); - $this->template->set_var('message',lang('Category %1 has been updated !',$cat_name)); + $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); } } + $GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Edit global category'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + + $this->set_langs(); + + $this->template->set_file(array('form' => 'category_form.tpl')); + $cats = $this->bo->cats->return_single($this->cat_id); $hidden_vars = '' . "\n" diff --git a/admin/templates/default/category_form.tpl b/admin/templates/default/category_form.tpl index 1bea5d9bd8..75b0194e46 100644 --- a/admin/templates/default/category_form.tpl +++ b/admin/templates/default/category_form.tpl @@ -7,20 +7,21 @@
- + - + - - + + - + +
{lang_parent}{lang_parent}
{lang_name}:{lang_name}:
{lang_descr}:{lang_descr}:
 
diff --git a/admin/templates/default/listcats.tpl b/admin/templates/default/listcats.tpl index 95ff7edf60..ed13973a2a 100644 --- a/admin/templates/default/listcats.tpl +++ b/admin/templates/default/listcats.tpl @@ -44,9 +44,10 @@
- +   - + +