From 444ef87edcbb02b717c1191aa075acdba8bfc123 Mon Sep 17 00:00:00 2001 From: bettina Date: Tue, 3 Jul 2001 12:38:09 +0000 Subject: [PATCH] update function return_lingle to also return the app_name plus function id2name to only return -- if =='name' --- phpgwapi/inc/class.categories.inc.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/phpgwapi/inc/class.categories.inc.php b/phpgwapi/inc/class.categories.inc.php index 222520d5d9..a8a7a08bd5 100644 --- a/phpgwapi/inc/class.categories.inc.php +++ b/phpgwapi/inc/class.categories.inc.php @@ -428,19 +428,13 @@ function id2name($cat_id, $item = 'name') { - if ($item == 'name') + switch($item) { - $value = 'cat_name'; - } - elseif ($item == 'owner') - { - $value = 'cat_owner'; - } - elseif ($item == 'main') - { - $value = 'cat_main'; - } - endif; + case 'name': $value = 'cat_name'; + case 'owner': $value = 'cat_owner'; + case 'main': $value = 'cat_main'; + return $value; + } $this->db->query("select $value from phpgw_categories where cat_id='" . "$cat_id'",__LINE__,__FILE__);