From f4a2518c325ff3c5fbbf4cd2ec74af7af4c205fb Mon Sep 17 00:00:00 2001 From: bettina Date: Tue, 1 May 2001 23:17:13 +0000 Subject: [PATCH] added images for categories_format --- phpgwapi/inc/class.categories.inc.php | 62 +++++++++++------- .../templates/default/images/grauer_pfeil.gif | Bin 0 -> 82 bytes .../templates/default/images/roter_pfeil.gif | Bin 0 -> 82 bytes .../idsociety/images/grauer_pfeil.gif | Bin 0 -> 82 bytes .../idsociety/images/roter_pfeil.gif | Bin 0 -> 82 bytes .../templates/justweb/images/grauer_pfeil.gif | Bin 0 -> 82 bytes .../templates/justweb/images/roter_pfeil.gif | Bin 0 -> 82 bytes .../verdilak/images/grauer_pfeil.gif | Bin 0 -> 82 bytes .../templates/verdilak/images/roter_pfeil.gif | Bin 0 -> 82 bytes 9 files changed, 38 insertions(+), 24 deletions(-) create mode 100644 phpgwapi/templates/default/images/grauer_pfeil.gif create mode 100644 phpgwapi/templates/default/images/roter_pfeil.gif create mode 100644 phpgwapi/templates/idsociety/images/grauer_pfeil.gif create mode 100644 phpgwapi/templates/idsociety/images/roter_pfeil.gif create mode 100644 phpgwapi/templates/justweb/images/grauer_pfeil.gif create mode 100644 phpgwapi/templates/justweb/images/roter_pfeil.gif create mode 100644 phpgwapi/templates/verdilak/images/grauer_pfeil.gif create mode 100644 phpgwapi/templates/verdilak/images/roter_pfeil.gif diff --git a/phpgwapi/inc/class.categories.inc.php b/phpgwapi/inc/class.categories.inc.php index 26209082fb..cb3e156d12 100644 --- a/phpgwapi/inc/class.categories.inc.php +++ b/phpgwapi/inc/class.categories.inc.php @@ -46,10 +46,10 @@ { switch ($type) { - case 'subs': $s = " and cat_parent != '0'"; break; - case 'mains': $s = " and cat_parent = '0'"; break; - case 'appandmains': $s = " and cat_appname='" . $this->app_name . "' and cat_parent ='0'"; break; - case 'appandsubs': $s = " and cat_appname='" . $this->app_name . "' and cat_parent !='0'"; break; + case 'subs': $s = " and cat_parent != '0'"; break; + case 'mains': $s = " and cat_parent = '0'"; break; + case 'appandmains': $s = " and cat_appname='" . $this->app_name . "' and cat_parent ='0'"; break; + case 'appandsubs': $s = " and cat_appname='" . $this->app_name . "' and cat_parent !='0'"; break; default: return False; } return $s; @@ -64,17 +64,17 @@ { switch($for) { - case 'app': $w = " where cat_appname='" . $this->app_name . "'"; break; - case 'appandmains': $w = " where cat_appname='" . $this->app_name . "' and cat_parent ='0'"; - case 'appandsubs': $w = " where cat_appname='" . $this->app_name . "' and cat_parent !='0'"; - case 'subs': $w = " where cat_parent != '0'"; break; - case 'mains': $w = " where cat_parent = '0'"; break; - default: return False; + case 'app': $w = " where cat_appname='" . $this->app_name . "'"; break; + case 'appandmains': $w = " where cat_appname='" . $this->app_name . "' and cat_parent ='0'"; + case 'appandsubs': $w = " where cat_appname='" . $this->app_name . "' and cat_parent !='0'"; + case 'subs': $w = " where cat_parent != '0'"; break; + case 'mains': $w = " where cat_parent = '0'"; break; + default: return False; } $this->db->query("select count(*) from phpgw_categories $w",__LINE__,__FILE__); $this->db->next_record(); - + return $this->db->f(0); } @@ -122,9 +122,9 @@ $public_user_list[] = $user; } reset($public_user_list); - $grant_cats = " (cat_owner='" . $this->account_id . "' OR cat_access='public' OR cat_owner in(" . implode(',',$public_user_list) . ")) "; + $grant_cats = " (cat_owner='" . $this->account_id . "' OR cat_access='public' OR cat_owner in(" . implode(',',$public_user_list) . ")) "; } - else + else { $grant_cats = " (cat_owner='" . $this->account_id . "' OR cat_access='public') "; } @@ -138,8 +138,8 @@ { $querymethod = " AND (cat_name like '%$query%' OR cat_description like '%$query%') "; } - - $sql = "SELECT * from phpgw_categories WHERE (cat_appname='" . $this->app_name . "' $public_cats $parent_filter) AND " + + $sql = "SELECT * from phpgw_categories WHERE (cat_appname='" . $this->app_name . "' $public_cats $parent_filter) AND " . " $grant_cats $querymethod $filter $ordermethod"; if ($limit) @@ -173,16 +173,16 @@ /*! @function return_single @abstract return single - @param $id integer id of category - @result $cats array populated with + @param $id integer id of category + @result $cats array populated with */ function return_single($id = '') { $this->db->query("select * from phpgw_categories where cat_id='$id' and " . "cat_appname='" . $this->app_name . "'",__LINE__,__FILE__); - - if ($this->db->next_record()) + + if ($this->db->next_record()) { $cats[0]['id'] = $this->db->f('cat_id'); $cats[0]['owner'] = $this->db->f('cat_owner'); @@ -263,14 +263,28 @@ $cats = $this->return_array($type,$start,False,$query,$sort,$order,$public); - $s = '' . "\n"; + $s = '
' . "\n"; for ($i=0;$i' . $phpgw->strip_html($cats[$i]['name']) . '' . "\n"; + $image_set = ' '; + + if ($cats[$i]['id'] == $selected) + { + $image_set = ''; + } + + if (($cats[$i]['level'] == 0) && ($cats[$i]['id'] != $selected)) + { + $image_set = ''; + } + + $space_set = str_repeat($space,$cats[$i]['level']); + + $s .= '' . "\n"; + $s .= '' . "\n"; + $s .= '' . "\n"; $s .= '' . "\n"; } @@ -352,7 +366,7 @@ function edit($cat_id,$cat_parent,$cat_name,$cat_description = '',$cat_data = '',$cat_access = '',$cat_main) { - if ($cat_parent && (!$cat_main)) + if ($cat_parent && (!$cat_main)) { $cat_main = $cat_parent; } diff --git a/phpgwapi/templates/default/images/grauer_pfeil.gif b/phpgwapi/templates/default/images/grauer_pfeil.gif new file mode 100644 index 0000000000000000000000000000000000000000..ef8978d8a3518fc794784b3a5ce4fe875a327c09 GIT binary patch literal 82 zcmZ?wbhEHbEX}k8ybzQpXy!h;$f||yutcIO4MHs9BJDVDX literal 0 HcmV?d00001 diff --git a/phpgwapi/templates/default/images/roter_pfeil.gif b/phpgwapi/templates/default/images/roter_pfeil.gif new file mode 100644 index 0000000000000000000000000000000000000000..865153c3a47e01ed09db7fd557ed4ea305f72119 GIT binary patch literal 82 zcmZ?wbhEHbEX}k8ybzQpXy!h;$f||yutcIO4MHs9BJDVDX literal 0 HcmV?d00001 diff --git a/phpgwapi/templates/idsociety/images/roter_pfeil.gif b/phpgwapi/templates/idsociety/images/roter_pfeil.gif new file mode 100644 index 0000000000000000000000000000000000000000..865153c3a47e01ed09db7fd557ed4ea305f72119 GIT binary patch literal 82 zcmZ?wbhEHbEX}k8ybzQpXy!h;$f||yutcIO4MHs9BJDVDX literal 0 HcmV?d00001 diff --git a/phpgwapi/templates/justweb/images/roter_pfeil.gif b/phpgwapi/templates/justweb/images/roter_pfeil.gif new file mode 100644 index 0000000000000000000000000000000000000000..865153c3a47e01ed09db7fd557ed4ea305f72119 GIT binary patch literal 82 zcmZ?wbhEHbEX}k8ybzQpXy!h;$f||yutcIO4MHs9BJDVDX literal 0 HcmV?d00001 diff --git a/phpgwapi/templates/verdilak/images/roter_pfeil.gif b/phpgwapi/templates/verdilak/images/roter_pfeil.gif new file mode 100644 index 0000000000000000000000000000000000000000..865153c3a47e01ed09db7fd557ed4ea305f72119 GIT binary patch literal 82 zcmZ?wbhEHb
' . $image_set . '' . $space_set . '' . $phpgw->strip_html($cats[$i]['name']) . '