Modified to use new get_var() api function for start, sort, etc...

This commit is contained in:
Miles Lott 2002-02-28 03:53:32 +00:00
parent 9a63aa57ae
commit e61f24032b

View File

@ -64,6 +64,22 @@
}
}
/*!
@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 ?
@ -175,7 +191,8 @@
*/
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;
list($filter,$qfield,$start,$order,$sort) = $this->get_var();
$start = $localstart;
$cats = CreateObject('phpgwapi.categories');
@ -275,7 +292,7 @@
*/
function left($scriptname,$start,$total,$extradata = '')
{
global $filter, $qfield, $order, $sort;
list($filter,$qfield,$NULL,$order,$sort) = $this->get_var();
$extravars = Array(
'order' => $order,
@ -329,7 +346,7 @@
*/
function right($scriptname,$start,$total,$extradata = '')
{
global $filter, $qfield, $order, $sort;
list($filter,$qfield,$NULL,$order,$sort) = $this->get_var();
$extravars = Array(
'order' => $order,
@ -374,7 +391,7 @@
*/
function search_filter($search_obj=0,$filter_obj=1,$yours=0,$link='',$extra='')
{
global $filter, $qfield, $start, $order, $sort;
list($filter,$qfield,$start,$order,$sort) = $this->get_var();
$start = $localstart;
$var = array(
@ -400,7 +417,7 @@
*/
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;
list($filter,$qfield,$start,$order,$sort) = $this->get_var();
$start = $localstart;
$cats = CreateObject('phpgwapi.categories');
@ -488,7 +505,7 @@
*/
function searchby($search_obj)
{
global $qfield;
$qfield = $GLOBALS['HTTP_POST_VARS']['qfield'] ? $GLOBALS['HTTP_POST_VARS']['qfield'] : $GLOBALS['HTTP_GET_VARS']['qfield'];
$str = '';
if(is_array($search_obj))
@ -586,8 +603,7 @@
{
if(!$currentcolor)
{
global $tr_color;
$currentcolor = $tr_color;
$currentcolor = $GLOBALS['tr_color'];
}
if($currentcolor == $GLOBALS['phpgw_info']['theme']['row_on'])
@ -623,10 +639,11 @@
@param $program ?
@param $text ?
@param $extra default ''
@param $build_an_href default True
*/
function show_sort_order($sort,$var,$order,$program,$text,$extra='',$build_a_href=True)
function show_sort_order($sort,$var,$order,$program,$text,$extra='',$build_an_href=True)
{
global $filter, $qfield, $start;
list($filter,$qfield,$start,$NULL1,$NULL) = $this->get_var();
if(($order == $var) && ($sort == 'ASC'))
{
@ -650,7 +667,7 @@
$link = ($this->action?$this->page($extravar):$GLOBALS['phpgw']->link($program,$extravar));
if ($build_a_href)
if($build_an_href)
{
return '<a href="' . $link . '">' . $text . '</a>';
}