Got nextmatchs to work.

This commit is contained in:
skeeter 2001-08-04 20:38:52 +00:00
parent 8c570fcb19
commit b958ac035d
5 changed files with 218 additions and 111 deletions

View File

@ -119,16 +119,24 @@
@param $link ?
@param $extravars ?
*/
function set_link($align,$img,$link,$extravars)
function set_link($align,$img,$link,$alt,$extravars)
{
global $phpgw;
global $phpgw, $phpgw_info;
$hidden = '';
while(list($var,$value) = each($extravars))
{
if((is_int($value) && $value == 0) || $value)
if(((is_int($value) && $value == 0) || $value))
{
$hidden .= ' <input type="hidden" name="'.$var.'" value="'.$value.'">'."\n";
if(is_int($value))
{
$param = intval($value);
}
else
{
$param = '"'.$value.'"';
}
$hidden .= ' <input type="hidden" name="'.$var.'" value='.$param.'>'."\n";
}
}
@ -149,9 +157,12 @@
$var = Array(
'align' => $align,
'action' => ($this->action?$this->page():$phpgw->link($link)),
'hidden' => $hidden,
'form_name' => $img,
'hidden' => substr($hidden,0,strlen($hidden)-1),
'img' => $phpgw->common->image('phpgwapi',$img),
'border' => $border
'label' => $alt,
'border' => $border,
'start' => $extravars['start']
);
$this->template->set_var($var);
return $this->template->fp('out','form');
@ -202,7 +213,7 @@
if(is_string($extradata))
{
$extraparams = explode('&',$extradata);
$c_extraparams = count($extraparams);
$c_extraparams = count($extraparams) + 1;
for($i=0;$i<$c_extraparams;$i++)
{
if($extraparams[$i])
@ -255,7 +266,7 @@
if (($start != 0) && ($start > $this->maxmatches))
{
$extravars['start'] = 0;
$ret_str .= $this->set_link('left','first.gif',$scriptname,$extravars);
$ret_str .= $this->set_link('left','first.gif',$scriptname,'First page',$extravars);
}
else
{
@ -274,7 +285,7 @@
$extravars['start'] = ($start - $this->maxmatches);
}
$ret_str .= $this->set_link('left','left.gif',$scriptname,$extravars);
$ret_str .= $this->set_link('left','left.gif',$scriptname,'Previous page',$extravars);
}
else
{
@ -311,7 +322,7 @@
if (($total > $this->maxmatches) && ($total > $start + $this->maxmatches))
{
$extravars['start'] = ($start + $this->maxmatches);
$ret_str .= $this->set_link('right','right.gif',$scriptname,$extravars);
$ret_str .= $this->set_link('right','right.gif',$scriptname,'Next page',$extravars);
}
else
{
@ -321,7 +332,7 @@
if (($start != $total - $this->maxmatches) && (($total - $this->maxmatches) > ($start + $this->maxmatches)))
{
$extravars['start'] = ($total - $this->maxmatches);
$ret_str .= $this->set_link('right','last.gif',$scriptname,$extravars);
$ret_str .= $this->set_link('right','last.gif',$scriptname,'Next page',$extravars);
}
else
{
@ -462,7 +473,7 @@
$str .= ' <option value="' . $filter_obj[$index][0] . '"'.($filter == $filter_obj[$index][0]?' selected':'') . '>' . $filter_obj[$index][1] . '</option>'."\n";
}
$str = '<select name="filter" onChange="this.form.submit()">'."\n" . $str . '</select>'."\n";
$str = ' <select name="filter" onChange="this.form.submit()">'."\n" . $str . ' </select>';
$this->template->set_var('select',$str);
$this->template->set_var('lang_filter',lang('Filter'));
}

View File

@ -1,37 +1,53 @@
<!-- BEGIN nextmatchs -->
<form method="POST" action="{form_action}">
<table width="{table_width}" border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0" cols="5">
<tr> {left}
<td align="center" valign="top" width="92%"></td> {right}
</tr>
<tr>
<td align="center" valign="top" colspan="5">
<form method="POST" action="{form_action}" name="filter">
<input type="hidden" name="filter" value="{filter_value}">
<input type="hidden" name="qfield" value="{qfield_value}">
<input type="hidden" name="start" value="{start_value}">
<input type="hidden" name="order" value="{order_value}">
<input type="hidden" name="sort" value="{sort_value}">
<input type="hidden" name="query" value="{query_value}">
<table width="{table_width}" height="50" border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
<tr>
{left}
{search}
{filter}
{right}
<table border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
<tr>{search}<td>&nbsp;</td>{filter}
</tr>
</table>
</form>
</td>
</tr>
</table>
<br>
</form>
<!-- END nextmatchs -->
<!-- BEGIN filter -->
<td>{select}<noscript><input type="submit" value="{lang_filter}"></noscript></td>
<td>
{select}
<noscript>
<input type="submit" value="{lang_filter}">
</noscript>
</td>
<!-- END filter -->
<!-- BEGIN form -->
<td width="2%" align="{align}">
<form method="POST" action="{action}">
{hidden} <input type="image" src="{img}" border="{border}">
<form>
<td width="2%" align="{align}" valign="top">
<form method="POST" action="{action}" name="{form_name}">
{hidden}
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="{align}">
<input type="image" src="{img}" border="{border}" alt="{label}" width="12" height="12" name="start" value="{start}">
</td>
</tr>
</table>
</form>
</td>
<!-- END form -->
@ -42,7 +58,15 @@
<!-- BEGIN link -->
<td width="2%" align="{align}"><img src="{img}" border="{border}" width="12" height="12" alt="{label}"></td>
<td width="2%" align="{align}" valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="{align}">
<img src="{img}" border="{border}" width="12" height="12" alt="{label}">
</td>
</tr>
</table>
</td>
<!-- END link -->

View File

@ -1,37 +1,53 @@
<!-- BEGIN nextmatchs -->
<form method="POST" action="{form_action}">
<table width="{table_width}" border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0" cols="5">
<tr> {left}
<td align="center" valign="top" width="92%"></td> {right}
</tr>
<tr>
<td align="center" valign="top" colspan="5">
<form method="POST" action="{form_action}" name="filter">
<input type="hidden" name="filter" value="{filter_value}">
<input type="hidden" name="qfield" value="{qfield_value}">
<input type="hidden" name="start" value="{start_value}">
<input type="hidden" name="order" value="{order_value}">
<input type="hidden" name="sort" value="{sort_value}">
<input type="hidden" name="query" value="{query_value}">
<table width="{table_width}" height="50" border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
<tr>
{left}
{search}
{filter}
{right}
<table border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
<tr>{search}<td>&nbsp;</td>{filter}
</tr>
</table>
</form>
</td>
</tr>
</table>
<br>
</form>
<!-- END nextmatchs -->
<!-- BEGIN filter -->
<td>{select}<noscript><input type="submit" value="{lang_filter}"></noscript></td>
<td>
{select}
<noscript>
<input type="submit" value="{lang_filter}">
</noscript>
</td>
<!-- END filter -->
<!-- BEGIN form -->
<td width="2%" align="{align}">
<form method="POST" action="{action}">
{hidden} <input type="image" src="{img}" border="0">
<form>
<td width="2%" align="{align}" valign="top">
<form method="POST" action="{action}" name="{form_name}">
{hidden}
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="{align}">
<input type="image" src="{img}" border="{border}" alt="{label}" width="12" height="12" name="start" value="{start}">
</td>
</tr>
</table>
</form>
</td>
<!-- END form -->
@ -42,7 +58,15 @@
<!-- BEGIN link -->
<td width="2%" align="{align}"><img src="{img}" border="0" width="12" height="12" alt="{label}"></td>
<td width="2%" align="{align}" valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="{align}">
<img src="{img}" border="{border}" width="12" height="12" alt="{label}">
</td>
</tr>
</table>
</td>
<!-- END link -->

View File

@ -1,37 +1,53 @@
<!-- BEGIN nextmatchs -->
<form method="POST" action="{form_action}">
<table width="{table_width}" border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0" cols="5">
<tr> {left}
<td align="center" valign="top" width="92%"></td> {right}
</tr>
<tr>
<td align="center" valign="top" colspan="5">
<form method="POST" action="{form_action}" name="filter">
<input type="hidden" name="filter" value="{filter_value}">
<input type="hidden" name="qfield" value="{qfield_value}">
<input type="hidden" name="start" value="{start_value}">
<input type="hidden" name="order" value="{order_value}">
<input type="hidden" name="sort" value="{sort_value}">
<input type="hidden" name="query" value="{query_value}">
<table width="{table_width}" height="50" border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
<tr>
{left}
{search}
{filter}
{right}
<table border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
<tr>{search}<td>&nbsp;</td>{filter}
</tr>
</table>
</form>
</td>
</tr>
</table>
<br>
</form>
<!-- END nextmatchs -->
<!-- BEGIN filter -->
<td>{select}<noscript><input type="submit" value="{lang_filter}"></noscript></td>
<td>
{select}
<noscript>
<input type="submit" value="{lang_filter}">
</noscript>
</td>
<!-- END filter -->
<!-- BEGIN form -->
<td width="2%" align="{align}">
<form method="POST" action="{action}">
{hidden} <input type="image" src="{img}" border="0">
<form>
<td width="2%" align="{align}" valign="top">
<form method="POST" action="{action}" name="{form_name}">
{hidden}
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="{align}">
<input type="image" src="{img}" border="{border}" alt="{label}" width="12" height="12" name="start" value="{start}">
</td>
</tr>
</table>
</form>
</td>
<!-- END form -->
@ -42,7 +58,15 @@
<!-- BEGIN link -->
<td width="2%" align="{align}"><img src="{img}" border="0" width="12" height="12" alt="{label}"></td>
<td width="2%" align="{align}" valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="{align}">
<img src="{img}" border="{border}" width="12" height="12" alt="{label}">
</td>
</tr>
</table>
</td>
<!-- END link -->

View File

@ -1,37 +1,53 @@
<!-- BEGIN nextmatchs -->
<form method="POST" action="{form_action}">
<table width="{table_width}" border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0" cols="5">
<tr> {left}
<td align="center" valign="top" width="92%"></td> {right}
</tr>
<tr>
<td align="center" valign="top" colspan="5">
<form method="POST" action="{form_action}" name="filter">
<input type="hidden" name="filter" value="{filter_value}">
<input type="hidden" name="qfield" value="{qfield_value}">
<input type="hidden" name="start" value="{start_value}">
<input type="hidden" name="order" value="{order_value}">
<input type="hidden" name="sort" value="{sort_value}">
<input type="hidden" name="query" value="{query_value}">
<table width="{table_width}" height="50" border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
<tr>
{left}
{search}
{filter}
{right}
<table border="0" bgcolor="{th_bg}" cellspacing="0" cellpadding="0">
<tr>{search}<td>&nbsp;</td>{filter}
</tr>
</table>
</form>
</td>
</tr>
</table>
<br>
</form>
<!-- END nextmatchs -->
<!-- BEGIN filter -->
<td>{select}<noscript><input type="submit" value="{lang_filter}"></noscript></td>
<td>
{select}
<noscript>
<input type="submit" value="{lang_filter}">
</noscript>
</td>
<!-- END filter -->
<!-- BEGIN form -->
<td width="2%" align="{align}">
<form method="POST" action="{action}">
{hidden} <input type="image" src="{img}" border="0">
<form>
<td width="2%" align="{align}" valign="top">
<form method="POST" action="{action}" name="{form_name}">
{hidden}
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="{align}">
<input type="image" src="{img}" border="{border}" alt="{label}" width="12" height="12" name="start" value="{start}">
</td>
</tr>
</table>
</form>
</td>
<!-- END form -->
@ -42,7 +58,15 @@
<!-- BEGIN link -->
<td width="2%" align="{align}"><img src="{img}" border="0" width="12" height="12" alt="{label}"></td>
<td width="2%" align="{align}" valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="{align}">
<img src="{img}" border="{border}" width="12" height="12" alt="{label}">
</td>
</tr>
</table>
</td>
<!-- END link -->