forked from extern/egroupware
added function to convert array to string plus ability to include arrays as extravar to the show_sort_order function
This commit is contained in:
parent
d0c4053077
commit
cd4828bf09
@ -259,6 +259,21 @@ class nextmatchs
|
||||
}
|
||||
return $extravars;
|
||||
}
|
||||
|
||||
function extras_to_string($extra)
|
||||
{
|
||||
if(is_array($extra))
|
||||
{
|
||||
@reset($extra);
|
||||
while(list($var,$value) = each($extra))
|
||||
{
|
||||
$t_extras[] = $var . '=' . $value;
|
||||
}
|
||||
$extra_s = '&' . implode('&',$t_extras);
|
||||
}
|
||||
return $extra_s;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function left
|
||||
@abstract ?
|
||||
@ -626,6 +641,11 @@ class nextmatchs
|
||||
$sort = 'ASC';
|
||||
}
|
||||
|
||||
if (is_array($extra))
|
||||
{
|
||||
$extra = $this->extras_to_string($extra);
|
||||
}
|
||||
|
||||
$extravar = 'order='.$var.'&sort='.$sort.'&filter='.$filter.'&qfield='.$qfield.'&start='.$start.'&query='.urlencode(stripslashes($query)).$extra;
|
||||
|
||||
$link = ($this->action?$this->page($extravar):$phpgw->link($program,$extravar));
|
||||
@ -644,6 +664,11 @@ class nextmatchs
|
||||
{
|
||||
global $phpgw, $filter, $qfield, $start, $query;
|
||||
|
||||
if (is_array($extra))
|
||||
{
|
||||
$extra = $this->extras_to_string($extra);
|
||||
}
|
||||
|
||||
$extravar = 'sort='.$sort.'&order='.$order.'&filter='.$filter.'&qfield='.$qfield.'&start='.$start.$extra;
|
||||
return '<a href="' . ($this->action?$this->page($extravar):$phpgw->link($program,$extravar)) . '">' . $text . '</a>';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user