From 8a4b563143d9c0539c22fd622acb58bb7089a6db Mon Sep 17 00:00:00 2001 From: skeeter Date: Fri, 19 Oct 2001 02:11:46 +0000 Subject: [PATCH] Fixes for the listbox portion of portals. --- phpgwapi/inc/class.listbox.inc.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/phpgwapi/inc/class.listbox.inc.php b/phpgwapi/inc/class.listbox.inc.php index 11bb101636..ed31e56549 100755 --- a/phpgwapi/inc/class.listbox.inc.php +++ b/phpgwapi/inc/class.listbox.inc.php @@ -68,18 +68,21 @@ */ function draw($extra_data='') { - $this->p->parse('row','portal_listbox_header',True); - - for ($x = 0; $x < count($this->data); $x++) + if(count($this->data)) { - $var = Array( - 'text' => $this->data[$x]['text'], - 'link' => $this->data[$x]['link'] - ); - $this->p->set_var($var); - $this->p->parse('row','portal_listbox_link',True); + $this->p->parse('row','portal_listbox_header',True); + + for ($x = 0; $x < count($this->data); $x++) + { + $var = Array( + 'text' => $this->data[$x]['text'], + 'link' => $this->data[$x]['link'] + ); + $this->p->set_var($var); + $this->p->parse('row','portal_listbox_link',True); + } + $this->p->parse('row','portal_listbox_footer',True); } - $this->p->parse('row','portal_listbox_footer',True); $this->set_internal($extra_data); return $this->draw_box(); }