mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-18 11:21:23 +01:00
added new format to formated_list()
This commit is contained in:
parent
d13d1de39b
commit
0f2df213fd
@ -231,16 +231,11 @@
|
|||||||
@param $selected ?
|
@param $selected ?
|
||||||
@result $s array - populated with categories
|
@result $s array - populated with categories
|
||||||
*/
|
*/
|
||||||
function formated_list($format,$type,$selected = '',$public = False)
|
function formated_list($format,$type,$selected = '',$public = False,$site_link = 'site')
|
||||||
{
|
{
|
||||||
global $phpgw;
|
global $phpgw;
|
||||||
$filter = $this->filter($type);
|
$filter = $this->filter($type);
|
||||||
|
|
||||||
if ($public)
|
|
||||||
{
|
|
||||||
$public_cats = " OR cat_appname='phpgw' ";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($format == 'select')
|
if ($format == 'select')
|
||||||
{
|
{
|
||||||
$cats = $this->return_array($type,$start,False,$query,$sort,$order,$public);
|
$cats = $this->return_array($type,$start,False,$query,$sort,$order,$public);
|
||||||
@ -261,6 +256,28 @@
|
|||||||
}
|
}
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($format == 'list')
|
||||||
|
{
|
||||||
|
$space = ' ';
|
||||||
|
|
||||||
|
$cats = $this->return_array($type,$start,False,$query,$sort,$order,$public);
|
||||||
|
|
||||||
|
$s = '<table border="0" cellpadding="0" cellspacing="0">' . "\n";
|
||||||
|
|
||||||
|
for ($i=0;$i<count($cats);$i++)
|
||||||
|
{
|
||||||
|
$spaceset = str_repeat($space,$cats[$i]['level']);
|
||||||
|
|
||||||
|
$s .= "<tr>\n";
|
||||||
|
$s .= '<td height="25">' . $spaceset . '<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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
@function add
|
@function add
|
||||||
|
Loading…
Reference in New Issue
Block a user