mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
update formated_list to prevent error msg if array empty
This commit is contained in:
parent
f64f65b91a
commit
6121405967
@ -219,7 +219,7 @@
|
||||
$this->app_name = $app_name;
|
||||
$this->db = $phpgw->db;
|
||||
$this->db2 = $this->db;
|
||||
$this->total_records = $this->db->num_rows();
|
||||
$this->total_records = $this->db2->num_rows();
|
||||
$this->grants = $phpgw->acl->get_grants($app_name);
|
||||
$this->cats = $this->return_array($type,$start,$limit,$query,$sort,$order,$public);
|
||||
}
|
||||
@ -286,28 +286,34 @@
|
||||
|
||||
$cats = $this->return_array($type,$start,False,$query,$sort,$order,$public);
|
||||
|
||||
$this->total_records = $this->db2->num_rows();
|
||||
|
||||
$s = '<table border="0" cellpadding="2" cellspacing="2">' . "\n";
|
||||
|
||||
for ($i=0;$i<count($cats);$i++)
|
||||
if ($this->total_records > 0)
|
||||
{
|
||||
$image_set = ' ';
|
||||
|
||||
if ($this->in_array($cats[$i]['id'],$selected))
|
||||
for ($i=0;$i<count($cats);$i++)
|
||||
{
|
||||
$image_set = '<img src="' . PHPGW_IMAGES_DIR . '/roter_pfeil.gif">';
|
||||
$image_set = ' ';
|
||||
|
||||
if ($this->in_array($cats[$i]['id'],$selected))
|
||||
{
|
||||
$image_set = '<img src="' . PHPGW_IMAGES_DIR . '/roter_pfeil.gif">';
|
||||
}
|
||||
|
||||
if (($cats[$i]['level'] == 0) && !$this->in_array($cats[$i]['id'],$selected))
|
||||
{
|
||||
$image_set = '<img src="' . PHPGW_IMAGES_DIR . '/grauer_pfeil.gif">';
|
||||
}
|
||||
|
||||
$space_set = str_repeat($space,$cats[$i]['level']);
|
||||
|
||||
$s .= '<tr>' . "\n";
|
||||
$s .= '<td width="8">' . $image_set . '</td>' . "\n";
|
||||
$s .= '<td>' . $space_set . '<a href="' . $phpgw->link($site_link,'cat_id=' . $cats[$i]['id']) . '">' . $phpgw->strip_html($cats[$i]['name'])
|
||||
. '</a></td>' . "\n";
|
||||
$s .= '</tr>' . "\n";
|
||||
}
|
||||
|
||||
if (($cats[$i]['level'] == 0) && !$this->in_array($cats[$i]['id'],$selected))
|
||||
{
|
||||
$image_set = '<img src="' . PHPGW_IMAGES_DIR . '/grauer_pfeil.gif">';
|
||||
}
|
||||
|
||||
$space_set = str_repeat($space,$cats[$i]['level']);
|
||||
|
||||
$s .= '<tr>' . "\n";
|
||||
$s .= '<td width="8">' . $image_set . '</td>' . "\n";
|
||||
$s .= '<td>' . $space_set . '<a href="' . $phpgw->link($site_link,'cat_id=' . $cats[$i]['id']) . '">' . $phpgw->strip_html($cats[$i]['name']) . '</a></td>' . "\n";
|
||||
$s .= '</tr>' . "\n";
|
||||
}
|
||||
$s .= '</table>' . "\n";
|
||||
return $s;
|
||||
|
Loading…
Reference in New Issue
Block a user