[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpgwapi/inc class.nextmatchs.inc.php,1.45,1.46
From: |
Miles Lott <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpgwapi/inc class.nextmatchs.inc.php,1.45,1.46 |
Date: |
Wed, 27 Feb 2002 22:53:35 -0500 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv14618
Modified Files:
class.nextmatchs.inc.php
Log Message:
Modified to use new get_var() api function for start, sort, etc...
Index: class.nextmatchs.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.nextmatchs.inc.php,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** class.nextmatchs.inc.php 1 Feb 2002 03:36:57 -0000 1.45
--- class.nextmatchs.inc.php 28 Feb 2002 03:53:32 -0000 1.46
***************
*** 66,69 ****
--- 66,85 ----
/*!
+ @function get_var
+ @abstract Fetch commonly-used GP(C) vars
+ @discussion This calls get_var() from functions.inc.php
+ */
+ function get_var()
+ {
+ return array(
+ get_var('filter',array('GLOBAL','POST','GET')),
+ get_var('qfield',array('GLOBAL','POST','GET')),
+ get_var('start',array('GLOBAL','POST','GET')),
+ get_var('order',array('GLOBAL','POST','GET')),
+ get_var('sort',array('GLOBAL','POST','GET'))
+ );
+ }
+
+ /*!
@function set_icon
@abstract ?
***************
*** 174,180 ****
@param $showsearch ?
*/
! function show_tpl($sn,$localstart,$total,$extra, $twidth,
$bgtheme,$search_obj=0,$filter_obj=1,$showsearch=1,$yours=0,$cat_id=0,$cat_field='fcat_id')
{
! global $filter, $qfield, $start, $order, $sort;
$start = $localstart;
--- 190,197 ----
@param $showsearch ?
*/
! function
show_tpl($sn,$localstart,$total,$extra,$twidth,$bgtheme,$search_obj=0,$filter_obj=1,$showsearch=1,$yours=0,$cat_id=0,$cat_field='fcat_id')
{
! list($filter,$qfield,$start,$order,$sort) =
$this->get_var();
!
$start = $localstart;
***************
*** 276,280 ****
function left($scriptname,$start,$total,$extradata = '')
{
! global $filter, $qfield, $order, $sort;
$extravars = Array(
--- 293,297 ----
function left($scriptname,$start,$total,$extradata = '')
{
! list($filter,$qfield,$NULL,$order,$sort) =
$this->get_var();
$extravars = Array(
***************
*** 289,293 ****
$ret_str = '';
! if (($start != 0) &&
($start > $this->maxmatches))
{
--- 306,310 ----
$ret_str = '';
! if(($start != 0) &&
($start > $this->maxmatches))
{
***************
*** 300,307 ****
}
! if ($start != 0)
{
// Changing the sorting order screaws up the
starting number
! if (($start - $this->maxmatches) < 0)
{
$extravars['start'] = 0;
--- 317,324 ----
}
! if($start != 0)
{
// Changing the sorting order screaws up the
starting number
! if(($start - $this->maxmatches) < 0)
{
$extravars['start'] = 0;
***************
*** 330,334 ****
function right($scriptname,$start,$total,$extradata = '')
{
! global $filter, $qfield, $order, $sort;
$extravars = Array(
--- 347,351 ----
function right($scriptname,$start,$total,$extradata = '')
{
! list($filter,$qfield,$NULL,$order,$sort) =
$this->get_var();
$extravars = Array(
***************
*** 344,348 ****
$ret_str = '';
! if (($total > $this->maxmatches) &&
($total > $start + $this->maxmatches))
{
--- 361,365 ----
$ret_str = '';
! if(($total > $this->maxmatches) &&
($total > $start + $this->maxmatches))
{
***************
*** 355,359 ****
}
! if (($start != $total - $this->maxmatches) &&
(($total - $this->maxmatches) > ($start +
$this->maxmatches)))
{
--- 372,376 ----
}
! if(($start != $total - $this->maxmatches) &&
(($total - $this->maxmatches) > ($start +
$this->maxmatches)))
{
***************
*** 375,379 ****
function
search_filter($search_obj=0,$filter_obj=1,$yours=0,$link='',$extra='')
{
! global $filter, $qfield, $start, $order, $sort;
$start = $localstart;
--- 392,396 ----
function
search_filter($search_obj=0,$filter_obj=1,$yours=0,$link='',$extra='')
{
! list($filter,$qfield,$start,$order,$sort) =
$this->get_var();
$start = $localstart;
***************
*** 401,405 ****
function
cats_search_filter($search_obj=0,$filter_obj=1,$yours=0,$cat_id=0,$cat_field='fcat_id',$link='',$extra='')
{
! global $filter, $qfield, $start, $order, $sort;
$start = $localstart;
--- 418,422 ----
function
cats_search_filter($search_obj=0,$filter_obj=1,$yours=0,$cat_id=0,$cat_field='fcat_id',$link='',$extra='')
{
! list($filter,$qfield,$start,$order,$sort) =
$this->get_var();
$start = $localstart;
***************
*** 433,437 ****
function search($search_obj=0)
{
! if (is_array($search_obj))
{
$params = $search_obj;
--- 450,454 ----
function search($search_obj=0)
{
! if(is_array($search_obj))
{
$params = $search_obj;
***************
*** 446,450 ****
// If the place a in there search, it will mess
everything up
// Our only option is to remove it
! if (ereg('"',$_query))
{
$_query = ereg_replace('"','',$_query);
--- 463,467 ----
// If the place a in there search, it will mess
everything up
// Our only option is to remove it
! if(ereg('"',$_query))
{
$_query = ereg_replace('"','',$_query);
***************
*** 489,501 ****
function searchby($search_obj)
{
! global $qfield;
$str = '';
! if (is_array($search_obj))
{
$indexlimit = count($search_obj);
! for ($index=0; $index<$indexlimit; $index++)
{
! if ($qfield == '')
{
$qfield =
$search_obj[$index][0];
--- 506,518 ----
function searchby($search_obj)
{
! $qfield = $GLOBALS['HTTP_POST_VARS']['qfield'] ?
$GLOBALS['HTTP_POST_VARS']['qfield'] : $GLOBALS['HTTP_GET_VARS']['qfield'];
$str = '';
! if(is_array($search_obj))
{
$indexlimit = count($search_obj);
! for($index=0; $index<$indexlimit; $index++)
{
! if($qfield == '')
{
$qfield =
$search_obj[$index][0];
***************
*** 515,523 ****
function filter($filter_obj,$yours=0)
{
! if (is_array($yours))
{
! $params = $yours;
! $filter = $params['filter'];
! $yours = $params['yours'];
}
else
--- 532,540 ----
function filter($filter_obj,$yours=0)
{
! if(is_array($yours))
{
! $params = $yours;
! $filter = $params['filter'];
! $yours = $params['yours'];
}
else
***************
*** 526,537 ****
}
! if (is_long($filter_obj))
{
! if ($filter_obj == 1)
{
// $user_groups =
$GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
$indexlimit = count($user_groups);
! if ($yours)
{
$filter_obj = array(
--- 543,554 ----
}
! if(is_long($filter_obj))
{
! if($filter_obj == 1)
{
// $user_groups =
$GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
$indexlimit = count($user_groups);
! if($yours)
{
$filter_obj = array(
***************
*** 548,552 ****
);
}
! for ($index=0; $index<$indexlimit;
$index++)
{
$filter_obj[2+$index][0] =
$user_groups[$index]['account_id'];
--- 565,569 ----
);
}
! for($index=0; $index<$indexlimit;
$index++)
{
$filter_obj[2+$index][0] =
$user_groups[$index]['account_id'];
***************
*** 556,567 ****
}
! if (is_array($filter_obj))
{
$str = '';
$indexlimit = count($filter_obj);
! for ($index=0; $index<$indexlimit; $index++)
{
! if ($filter == '')
{
$filter =
$filter_obj[$index][0];
--- 573,584 ----
}
! if(is_array($filter_obj))
{
$str = '';
$indexlimit = count($filter_obj);
! for($index=0; $index<$indexlimit; $index++)
{
! if($filter == '')
{
$filter =
$filter_obj[$index][0];
***************
*** 585,595 ****
function alternate_row_color($currentcolor = '')
{
! if (! $currentcolor)
{
! global $tr_color;
! $currentcolor = $tr_color;
}
! if ($currentcolor ==
$GLOBALS['phpgw_info']['theme']['row_on'])
{
$tr_color =
$GLOBALS['phpgw_info']['theme']['row_off'];
--- 602,611 ----
function alternate_row_color($currentcolor = '')
{
! if(!$currentcolor)
{
! $currentcolor = $GLOBALS['tr_color'];
}
! if($currentcolor ==
$GLOBALS['phpgw_info']['theme']['row_on'])
{
$tr_color =
$GLOBALS['phpgw_info']['theme']['row_off'];
***************
*** 624,637 ****
@param $text ?
@param $extra default ''
*/
! function
show_sort_order($sort,$var,$order,$program,$text,$extra='',$build_a_href=True)
{
! global $filter, $qfield, $start;
! if (($order == $var) && ($sort == 'ASC'))
{
$sort = 'DESC';
}
! elseif (($order == $var) && ($sort == 'DESC'))
{
$sort = 'ASC';
--- 640,654 ----
@param $text ?
@param $extra default ''
+ @param $build_an_href default True
*/
! function
show_sort_order($sort,$var,$order,$program,$text,$extra='',$build_an_href=True)
{
! list($filter,$qfield,$start,$NULL1,$NULL) =
$this->get_var();
! if(($order == $var) && ($sort == 'ASC'))
{
$sort = 'DESC';
}
! elseif(($order == $var) && ($sort == 'DESC'))
{
$sort = 'ASC';
***************
*** 642,646 ****
}
! if (is_array($extra))
{
$extra = $this->extras_to_string($extra);
--- 659,663 ----
}
! if(is_array($extra))
{
$extra = $this->extras_to_string($extra);
***************
*** 651,655 ****
$link =
($this->action?$this->page($extravar):$GLOBALS['phpgw']->link($program,$extravar));
! if ($build_a_href)
{
return '<a href="' . $link . '">' . $text .
'</a>';
--- 668,672 ----
$link =
($this->action?$this->page($extravar):$GLOBALS['phpgw']->link($program,$extravar));
! if($build_an_href)
{
return '<a href="' . $link . '">' . $text .
'</a>';
***************
*** 663,669 ****
function show_hits($total_records='',$start=0)
{
! if ($total_records > $this->maxmatches)
{
! if ($start + $this->maxmatches > $total_records)
{
$end = $total_records;
--- 680,686 ----
function show_hits($total_records='',$start=0)
{
! if($total_records > $this->maxmatches)
{
! if($start + $this->maxmatches > $total_records)
{
$end = $total_records;
***************
*** 694,709 ****
function
show_sort_order_imap($old_sort,$new_sort,$default_order,$order,$program,$text,$extra='')
{
! if (is_array($extra))
{
$extra = $this->extras_to_string($extra);
}
! if ($old_sort == $new_sort)
{
// alternate order, like on outkrook, click on
present sorting reverses order
! if ((int)$order == 1)
{
$our_order = 0;
}
! elseif ((int)$order == 0)
{
$our_order = 1;
--- 711,726 ----
function
show_sort_order_imap($old_sort,$new_sort,$default_order,$order,$program,$text,$extra='')
{
! if(is_array($extra))
{
$extra = $this->extras_to_string($extra);
}
! if($old_sort == $new_sort)
{
// alternate order, like on outkrook, click on
present sorting reverses order
! if((int)$order == 1)
{
$our_order = 0;
}
! elseif((int)$order == 0)
{
$our_order = 1;
***************
*** 758,762 ****
// first page
! if (($feed_vars['start'] != 0) &&
($feed_vars['start'] > $this->maxmatches))
{
--- 775,779 ----
// first page
! if(($feed_vars['start'] != 0) &&
($feed_vars['start'] > $this->maxmatches))
{
***************
*** 769,776 ****
}
// previous page
! if ($feed_vars['start'] != 0)
{
// Changing the sorting order screaws up the
starting number
! if (($feed_vars['start'] - $this->maxmatches) <
0)
{
$out_vars['start'] = 0;
--- 786,793 ----
}
// previous page
! if($feed_vars['start'] != 0)
{
// Changing the sorting order screaws up the
starting number
! if(($feed_vars['start'] - $this->maxmatches) <
0)
{
$out_vars['start'] = 0;
***************
*** 791,795 ****
$out_vars['start'] = $feed_vars['start'];
// next page
! if (($feed_vars['total'] > $this->maxmatches) &&
($feed_vars['total'] > $feed_vars['start'] +
$this->maxmatches))
{
--- 808,812 ----
$out_vars['start'] = $feed_vars['start'];
// next page
! if(($feed_vars['total'] > $this->maxmatches) &&
($feed_vars['total'] > $feed_vars['start'] +
$this->maxmatches))
{
***************
*** 802,806 ****
}
// last page
! if (($feed_vars['start'] != $feed_vars['total'] -
$this->maxmatches) &&
(($feed_vars['total'] - $this->maxmatches) >
($feed_vars['start'] + $this->maxmatches)))
{
--- 819,823 ----
}
// last page
! if(($feed_vars['start'] != $feed_vars['total'] -
$this->maxmatches) &&
(($feed_vars['total'] - $this->maxmatches) >
($feed_vars['start'] + $this->maxmatches)))
{
***************
*** 814,818 ****
return $return_array;
}
!
/*!
@function set_link_imap
--- 831,835 ----
return $return_array;
}
!
/*!
@function set_link_imap
***************
*** 829,833 ****
return '<a
href="'.$out_vars['common_uri'].'&start='.$out_vars['start'].'">'.$image_part.'</a>';
}
!
function set_icon_imap($align,$img,$alt_text)
{
--- 846,850 ----
return '<a
href="'.$out_vars['common_uri'].'&start='.$out_vars['start'].'">'.$image_part.'</a>';
}
!
function set_icon_imap($align,$img,$alt_text)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpgwapi/inc class.nextmatchs.inc.php,1.45,1.46,
Miles Lott <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: phpgwapi/inc functions.inc.php,1.130,1.131
- Next by Date:
[Phpgroupware-cvs] CVS: addressbook/inc class.uiaddressbook.inc.php,1.38,1.39 class.boaddressbook.inc.php,1.22,1.23
- Previous by thread:
[Phpgroupware-cvs] CVS: phpgwapi/inc functions.inc.php,1.130,1.131
- Next by thread:
[Phpgroupware-cvs] CVS: addressbook/inc class.uiaddressbook.inc.php,1.38,1.39 class.boaddressbook.inc.php,1.22,1.23
- Index(es):