From b958ac035d09a7f9f3594c67ce88ad605a4e3949 Mon Sep 17 00:00:00 2001 From: skeeter Date: Sat, 4 Aug 2001 20:38:52 +0000 Subject: [PATCH] Got nextmatchs to work. --- phpgwapi/inc/class.nextmatchs.inc.php | 41 +++++++----- phpgwapi/templates/default/nextmatchs.tpl | 72 ++++++++++++++------- phpgwapi/templates/idsociety/nextmatchs.tpl | 72 ++++++++++++++------- phpgwapi/templates/justweb/nextmatchs.tpl | 72 ++++++++++++++------- phpgwapi/templates/verdilak/nextmatchs.tpl | 72 ++++++++++++++------- 5 files changed, 218 insertions(+), 111 deletions(-) diff --git a/phpgwapi/inc/class.nextmatchs.inc.php b/phpgwapi/inc/class.nextmatchs.inc.php index 3f33d28ed5..b1f0b7faa7 100644 --- a/phpgwapi/inc/class.nextmatchs.inc.php +++ b/phpgwapi/inc/class.nextmatchs.inc.php @@ -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 .= ' '."\n"; + if(is_int($value)) + { + $param = intval($value); + } + else + { + $param = '"'.$value.'"'; + } + $hidden .= ' '."\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 { @@ -310,8 +321,8 @@ if (($total > $this->maxmatches) && ($total > $start + $this->maxmatches)) { - $extravars['start'] = ($start+$this->maxmatches); - $ret_str .= $this->set_link('right','right.gif',$scriptname,$extravars); + $extravars['start'] = ($start + $this->maxmatches); + $ret_str .= $this->set_link('right','right.gif',$scriptname,'Next page',$extravars); } else { @@ -320,8 +331,8 @@ 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); + $extravars['start'] = ($total - $this->maxmatches); + $ret_str .= $this->set_link('right','last.gif',$scriptname,'Next page',$extravars); } else { @@ -459,10 +470,10 @@ $filter = $filter_obj[$index][0]; } - $str .= ''."\n"; + $str .= ' '."\n"; } - $str = ''."\n"; + $str = ' '; $this->template->set_var('select',$str); $this->template->set_var('lang_filter',lang('Filter')); } diff --git a/phpgwapi/templates/default/nextmatchs.tpl b/phpgwapi/templates/default/nextmatchs.tpl index ad0355976a..2a36eb1b9f 100644 --- a/phpgwapi/templates/default/nextmatchs.tpl +++ b/phpgwapi/templates/default/nextmatchs.tpl @@ -1,38 +1,54 @@ -
- - - - - - - - +
+ {left} + {right} + -{left} -{search} -{filter} -{right} +
+ + + + + + + + + {search}{filter} + +
 
+ +

- -{select} + +{select} + + - -
-{hidden} - - + + +{hidden} + + + + +
+ +
+
+ @@ -42,13 +58,21 @@ - {label} + + + + + +
+ {label} +
+ - -  {searchby} - + +  {searchby} + diff --git a/phpgwapi/templates/idsociety/nextmatchs.tpl b/phpgwapi/templates/idsociety/nextmatchs.tpl index 737c45e52a..2a36eb1b9f 100755 --- a/phpgwapi/templates/idsociety/nextmatchs.tpl +++ b/phpgwapi/templates/idsociety/nextmatchs.tpl @@ -1,38 +1,54 @@ -
- - - - - - - - +
+ {left} + {right} + -{left} -{search} -{filter} -{right} +
+ + + + + + + + + {search}{filter} + +
 
+ +

- -{select} + +{select} + + - -
-{hidden} - - + + +{hidden} + + + + +
+ +
+
+ @@ -42,13 +58,21 @@ - {label} + + + + + +
+ {label} +
+ - -  {searchby} - + +  {searchby} + diff --git a/phpgwapi/templates/justweb/nextmatchs.tpl b/phpgwapi/templates/justweb/nextmatchs.tpl index 737c45e52a..2a36eb1b9f 100644 --- a/phpgwapi/templates/justweb/nextmatchs.tpl +++ b/phpgwapi/templates/justweb/nextmatchs.tpl @@ -1,38 +1,54 @@ -
- - - - - - - - +
+ {left} + {right} + -{left} -{search} -{filter} -{right} +
+ + + + + + + + + {search}{filter} + +
 
+ +

- -{select} + +{select} + + - -
-{hidden} - - + + +{hidden} + + + + +
+ +
+
+ @@ -42,13 +58,21 @@ - {label} + + + + + +
+ {label} +
+ - -  {searchby} - + +  {searchby} + diff --git a/phpgwapi/templates/verdilak/nextmatchs.tpl b/phpgwapi/templates/verdilak/nextmatchs.tpl index 737c45e52a..2a36eb1b9f 100644 --- a/phpgwapi/templates/verdilak/nextmatchs.tpl +++ b/phpgwapi/templates/verdilak/nextmatchs.tpl @@ -1,38 +1,54 @@ -
- - - - - - - - +
+ {left} + {right} + -{left} -{search} -{filter} -{right} +
+ + + + + + + + + {search}{filter} + +
 
+ +

- -{select} + +{select} + + - -
-{hidden} - - + + +{hidden} + + + + +
+ +
+
+ @@ -42,13 +58,21 @@ - {label} + + + + + +
+ {label} +
+ - -  {searchby} - + +  {searchby} +