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:
bettina 2001-09-02 18:37:38 +00:00
parent d0c4053077
commit cd4828bf09

View File

@ -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>';
}