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

@ -26,8 +26,8 @@
@class nextmatchs @class nextmatchs
@abstract @abstract
*/ */
class nextmatchs class nextmatchs
{ {
var $maxmatches; var $maxmatches;
var $action; var $action;
var $template; var $template;
@ -194,7 +194,7 @@ class nextmatchs
$var = array( $var = array(
'form_action' => ($this->action?$this->page($extra):$phpgw->link($sn, $extra)), 'form_action' => ($this->action?$this->page($extra):$phpgw->link($sn, $extra)),
'lang_category'=> lang('Category'), 'lang_category' => lang('Category'),
'lang_all' => lang('All'), 'lang_all' => lang('All'),
'lang_select' => lang('Select'), 'lang_select' => lang('Select'),
'cat_field' => $cat_field, 'cat_field' => $cat_field,
@ -259,6 +259,21 @@ class nextmatchs
} }
return $extravars; 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 @function left
@abstract ? @abstract ?
@ -626,6 +641,11 @@ class nextmatchs
$sort = 'ASC'; $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; $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)); $link = ($this->action?$this->page($extravar):$phpgw->link($program,$extravar));
@ -644,6 +664,11 @@ class nextmatchs
{ {
global $phpgw, $filter, $qfield, $start, $query; 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; $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>'; return '<a href="' . ($this->action?$this->page($extravar):$phpgw->link($program,$extravar)) . '">' . $text . '</a>';
} }
@ -667,5 +692,5 @@ class nextmatchs
return lang('showing x',$total_records); return lang('showing x',$total_records);
} }
} }
} // End of nextmatchs class } // End of nextmatchs class
?> ?>