phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: addbook/inc class.addbook_nextmatchs.inc.php,1.


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: addbook/inc class.addbook_nextmatchs.inc.php,1.2,1.3
Date: Thu, 13 Mar 2003 14:01:02 -0500

Update of /cvsroot/phpgroupware/addbook/inc
In directory subversions:/tmp/cvs-serv18847

Modified Files:
        class.addbook_nextmatchs.inc.php 
Log Message:
changed formated_list to formatted_list to get it working in HEAD

Index: class.addbook_nextmatchs.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addbook/inc/class.addbook_nextmatchs.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.addbook_nextmatchs.inc.php    7 May 2002 01:52:12 -0000       1.2
--- class.addbook_nextmatchs.inc.php    13 Mar 2003 19:00:27 -0000      1.3
***************
*** 1,243 ****
! <?php
!       
/**************************************************************************\
!       * phpGroupWare API - next                                               
   *
!       * This file written by Joseph Engo <address@hidden>                *
!       * Handles limiting number of rows displayed                             
   *
!       * Copyright (C) 2000, 2001 Joseph Engo                                  
   *
!       * 
-------------------------------------------------------------------------*
!       * This library is part of the phpGroupWare API                          
   *
!       * http://www.phpgroupware.org/api                                       
   * 
!       * 
------------------------------------------------------------------------ *
!       * This library is free software; you can redistribute it and/or modify 
it  *
!       * under the terms of the GNU Lesser General Public License as published 
by *
!       * the Free Software Foundation; either version 2.1 of the License,      
   *
!       * or any later version.                                                 
   *
!       * This library is distributed in the hope that it will be useful, but   
   *
!       * WITHOUT ANY WARRANTY; without even the implied warranty of            
   *
!       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  
   *
!       * See the GNU Lesser General Public License for more details.           
   *
!       * You should have received a copy of the GNU Lesser General Public 
License *
!       * along with this library; if not, write to the Free Software 
Foundation,  *
!       * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA         
   *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       //adjust the phpgwapi.nextmatchs to the addbook needs
!       //16.04.2002 heiko
!       class addbook_nextmatchs extends nextmatchs
!       {
!               var $maxmatches;
!               var $action;
!               var $template;
! 
!               /*!
!               @function show_tpl
!               @abstract ?
!               @param $sn ?
!               @param $start ?
!               @param $total ?
!               @param $extra ?
!               @param $twidth ?
!               @param $bgtheme ?
!               @param $search_obj ?
!               @param $filter_obj ?
!               @param $showsearch ?
!               */
!               function show_tpl($target, 
$start=0,$total,$twidth,$bgtheme,$search_obj=0,$filter_obj=1,$showsearch=1,$yours=0,$cat_id=0,
 $cat_field='')
!               {
!                       $debug=0;
!                       if($debug)
!                       {
!                               echo "<br>targe:$target";
!                               echo "<br>start:$localstart";
!                               echo "<br>total:$total";
!                               echo "<br>search_obj:$search_obj";
!                               echo "<br>filter_obj:$filter_obj";
!                               echo "<br>showsearch:$showsearch";
!                               echo "<br>yours:$yours";
!                       }
!                       
!                       //first modify some defaults of the orignial constructor
!                       $this->template = CreateObject('phpgwapi.Template', 
$GLOBALS['phpgw']->common->get_tpl_dir('addbook'));
!                       $this->template->set_file(array(
!                               '_nextmatchs' => 'addbook_nextmatchs.tpl'
!                       ));
!                       $this->bo = CreateObject('addbook.boaddbook');
!                       $this->template->set_block('_nextmatchs','nextmatchs');
!                       $this->template->set_block('_nextmatchs','filter');
!                       $this->template->set_block('_nextmatchs','form');
!                       $this->template->set_block('_nextmatchs','icon');
!                       $this->template->set_block('_nextmatchs','link');
!                       $this->template->set_block('_nextmatchs','search');
!                       $this->template->set_block('_nextmatchs','cats');
!                       
$this->template->set_block('_nextmatchs','search_filter');
!                       
$this->template->set_block('_nextmatchs','cats_search_filter');
! 
!                       $cats = CreateObject('phpgwapi.categories');
! 
!                       $url_params = array(
!                               $target.'start' => $start
!                       );
!                       
!                       $var = array(
!                               'form_action'   => (''),
!                               'lang_category' => lang('Category'),
!                               'lang_all'      => lang('All'),
!                               'lang_select'   => lang('Select'),
!                               'cat_field'     => $cat_field,
!                               'categories'    => 
$cats->formated_list('select','all',$cat_id,'True'),
!                               'filter'                => $target.'filter',
!                               'start'                 => $target.'start',
!                               'order'                 => $target.'order',
!                               'sort'                  => $target.'sort',
!                               'qfield'                => $target.'qfield',
!                               'query'                 => $target.'query',
!                               'filter_value'  => $filter,
!                               'qfield_value'  => $qfield,
!                               'start_value'   => $start,
!                               'order_value'   => $order,
!                               'sort_value'    => $sort,
!                               'query_value'   => 
urlencode(stripslashes($GLOBALS['query'])),
!                               'table_width'   => $twidth,
!                               'th_bg'         => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
!                               'left'          => 
$this->left($start,$total,$extra, $target),
!                               'search'        => 
($showsearch?$this->search($search_obj):''),
!                               'filter'        => 
($filter_obj?$this->filter($filter_obj,$yours):''),
!                               'right'         => 
$this->right($start,$total,$extra, $target)
!                       );
!                       $this->template->set_var($var);
!                       $this->template->parse('cats','cats');
!                       
$this->template->parse('cats_search_filter_data','cats_search_filter');
!                       return $this->template->fp('out','nextmatchs');
!               }
! 
!               function left($start,$total,$extradata = '', $target)
!               {
!                       global $filter, $qfield, $order, $sort;
! 
!                       $extravars = Array(
!                               'order'   => $order,
!                               'filter'  => $filter,
!                               'q_field' => $qfield,
!                               'sort'    => $sort,
!                               'query'   => 
urlencode(stripslashes($GLOBALS['query']))
!                       );
! 
!                       $extravars = $this->split_extras($extravars,$extradata);
!                       $ret_str = '';
! 
!                       if (($start != 0) &&
!                               ($start > $this->maxmatches))
!                       {
!                               $extravars['start'] = 0;
!                               $ret_str .= 
$this->set_link('left','first.gif',$scriptname,lang('First page'),$extravars, 
$target);
!                       }
!                       else
!                       {
!                               $ret_str .= 
$this->set_icon('left','first-grey.gif',lang('First page'));
!                       }
! 
!                       if ($start != 0)
!                       {
!                               // Changing the sorting order screaws up the 
starting number
!                               if (($start - $this->maxmatches) < 0)
!                               {
!                                       $extravars['start'] = 0;
!                               }
!                               else
!                               {
!                                       $extravars['start'] = ($start - 
$this->maxmatches);
!                               }
!                               $ret_str .= 
$this->set_link('left','left.gif',$scriptname,lang('Previous page'),$extravars, 
$target);
!                       }
!                       else
!                       {
!                               $ret_str .= 
$this->set_icon('left','left-grey.gif',lang('Previous page'));
!                       }
!                       return $ret_str;
!               } /* left() */
! 
!               /*!
!               @function right
!               @abstract ?
!               @param $scriptname ?
!               @param $start ?
!               @param $total ?
!               @param $extradate ?
!               */
!               function right($start,$total,$extradata = '', $target)
!               {
!                       global $filter, $qfield, $order, $sort;
! 
!                       $extravars = Array(
!                               'order'   => $order,
!                               'filter'  => $filter,
!                               'q_field' => $qfield,
!                               'sort'    => $sort,
!                               'query'   => 
urlencode(stripslashes($GLOBALS['query']))
!                       );
! 
!                       $extravars = $this->split_extras($extravars,$extradata);
! 
!                       $ret_str = '';
! 
!                       if (($total > $this->maxmatches) &&
!                               ($total > $start + $this->maxmatches))
!                       {
!                               $extravars['start'] = ($start + 
$this->maxmatches);
!                               $ret_str .= 
$this->set_link('right','right.gif',$scriptname,lang('Next page'),$extravars, 
$target);
!                       }
!                       else
!                       {
!                               $ret_str .= 
$this->set_icon('right','right-grey.gif',lang('Next page'));
!                       }
! 
!                       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,lang('Last page'),$extravars, 
$target);
!                       }
!                       else
!                       {
!                               $ret_str .= 
$this->set_icon('right','last-grey.gif',lang('Last page'));
!                       }
!                       return $ret_str;
!               } /* right() */
! 
!               function set_link($align,$img,$link,$alt,$extravars, $target)
!               {
!                       $hidden = '';
!                       while(list($var,$value) = each($extravars))
!                       {
!                               if((is_int($value) && $value == 0) || $value)
!                               {
! //                                    if(is_int($value))
! //                                    {
! //                                            $param = intval($value);
! //                                    }
! //                                    else
! //                                    {
!                                               $param = '"'.$value.'"';
! //                                    }
!                                       $hidden .= '     <input type="hidden" 
name="'.$target.$var.'" value='.$param.'>'."\n";
!                               }
!                       }
!                       $border = 0;
!                       $var = Array(
!                               'align'     => $align,
!                               'action'    => '',
!                               'form_name' => $img,
!                               'hidden'    => 
substr($hidden,0,strlen($hidden)-1),
!                               'img'       => 
$GLOBALS['phpgw']->common->image('phpgwapi',$img),
!                               'label'     => $alt,
!                               'border'    => $border,
!                               'start'     => $extravars['start']
!                       );
!                       $this->template->set_var($var);
!                       return $this->template->fp('out','form');
!               }
! 
!       } // End of nextmatchs class
! ?>
--- 1,243 ----
! <?php
!       
/**************************************************************************\
!       * phpGroupWare API - next                                               
   *
!       * This file written by Joseph Engo <address@hidden>                *
!       * Handles limiting number of rows displayed                             
   *
!       * Copyright (C) 2000, 2001 Joseph Engo                                  
   *
!       * 
-------------------------------------------------------------------------*
!       * This library is part of the phpGroupWare API                          
   *
!       * http://www.phpgroupware.org/api                                       
   * 
!       * 
------------------------------------------------------------------------ *
!       * This library is free software; you can redistribute it and/or modify 
it  *
!       * under the terms of the GNU Lesser General Public License as published 
by *
!       * the Free Software Foundation; either version 2.1 of the License,      
   *
!       * or any later version.                                                 
   *
!       * This library is distributed in the hope that it will be useful, but   
   *
!       * WITHOUT ANY WARRANTY; without even the implied warranty of            
   *
!       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  
   *
!       * See the GNU Lesser General Public License for more details.           
   *
!       * You should have received a copy of the GNU Lesser General Public 
License *
!       * along with this library; if not, write to the Free Software 
Foundation,  *
!       * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA         
   *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       //adjust the phpgwapi.nextmatchs to the addbook needs
!       //16.04.2002 heiko
!       class addbook_nextmatchs extends nextmatchs
!       {
!               var $maxmatches;
!               var $action;
!               var $template;
! 
!               /*!
!               @function show_tpl
!               @abstract ?
!               @param $sn ?
!               @param $start ?
!               @param $total ?
!               @param $extra ?
!               @param $twidth ?
!               @param $bgtheme ?
!               @param $search_obj ?
!               @param $filter_obj ?
!               @param $showsearch ?
!               */
!               function show_tpl($target, 
$start=0,$total,$twidth,$bgtheme,$search_obj=0,$filter_obj=1,$showsearch=1,$yours=0,$cat_id=0,
 $cat_field='')
!               {
!                       $debug=0;
!                       if($debug)
!                       {
!                               echo "<br>targe:$target";
!                               echo "<br>start:$localstart";
!                               echo "<br>total:$total";
!                               echo "<br>search_obj:$search_obj";
!                               echo "<br>filter_obj:$filter_obj";
!                               echo "<br>showsearch:$showsearch";
!                               echo "<br>yours:$yours";
!                       }
!                       
!                       //first modify some defaults of the orignial constructor
!                       $this->template = CreateObject('phpgwapi.Template', 
$GLOBALS['phpgw']->common->get_tpl_dir('addbook'));
!                       $this->template->set_file(array(
!                               '_nextmatchs' => 'addbook_nextmatchs.tpl'
!                       ));
!                       $this->bo = CreateObject('addbook.boaddbook');
!                       $this->template->set_block('_nextmatchs','nextmatchs');
!                       $this->template->set_block('_nextmatchs','filter');
!                       $this->template->set_block('_nextmatchs','form');
!                       $this->template->set_block('_nextmatchs','icon');
!                       $this->template->set_block('_nextmatchs','link');
!                       $this->template->set_block('_nextmatchs','search');
!                       $this->template->set_block('_nextmatchs','cats');
!                       
$this->template->set_block('_nextmatchs','search_filter');
!                       
$this->template->set_block('_nextmatchs','cats_search_filter');
! 
!                       $cats = CreateObject('phpgwapi.categories');
! 
!                       $url_params = array(
!                               $target.'start' => $start
!                       );
!                       
!                       $var = array(
!                               'form_action'   => (''),
!                               'lang_category' => lang('Category'),
!                               'lang_all'      => lang('All'),
!                               'lang_select'   => lang('Select'),
!                               'cat_field'     => $cat_field,
!                               'categories'    => 
$cats->formatted_list('select','all',$cat_id,'True'),
!                               'filter'                => $target.'filter',
!                               'start'                 => $target.'start',
!                               'order'                 => $target.'order',
!                               'sort'                  => $target.'sort',
!                               'qfield'                => $target.'qfield',
!                               'query'                 => $target.'query',
!                               'filter_value'  => $filter,
!                               'qfield_value'  => $qfield,
!                               'start_value'   => $start,
!                               'order_value'   => $order,
!                               'sort_value'    => $sort,
!                               'query_value'   => 
urlencode(stripslashes($GLOBALS['query'])),
!                               'table_width'   => $twidth,
!                               'th_bg'         => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
!                               'left'          => 
$this->left($start,$total,$extra, $target),
!                               'search'        => 
($showsearch?$this->search($search_obj):''),
!                               'filter'        => 
($filter_obj?$this->filter($filter_obj,$yours):''),
!                               'right'         => 
$this->right($start,$total,$extra, $target)
!                       );
!                       $this->template->set_var($var);
!                       $this->template->parse('cats','cats');
!                       
$this->template->parse('cats_search_filter_data','cats_search_filter');
!                       return $this->template->fp('out','nextmatchs');
!               }
! 
!               function left($start,$total,$extradata = '', $target)
!               {
!                       global $filter, $qfield, $order, $sort;
! 
!                       $extravars = Array(
!                               'order'   => $order,
!                               'filter'  => $filter,
!                               'q_field' => $qfield,
!                               'sort'    => $sort,
!                               'query'   => 
urlencode(stripslashes($GLOBALS['query']))
!                       );
! 
!                       $extravars = $this->split_extras($extravars,$extradata);
!                       $ret_str = '';
! 
!                       if (($start != 0) &&
!                               ($start > $this->maxmatches))
!                       {
!                               $extravars['start'] = 0;
!                               $ret_str .= 
$this->set_link('left','first.gif',$scriptname,lang('First page'),$extravars, 
$target);
!                       }
!                       else
!                       {
!                               $ret_str .= 
$this->set_icon('left','first-grey.gif',lang('First page'));
!                       }
! 
!                       if ($start != 0)
!                       {
!                               // Changing the sorting order screaws up the 
starting number
!                               if (($start - $this->maxmatches) < 0)
!                               {
!                                       $extravars['start'] = 0;
!                               }
!                               else
!                               {
!                                       $extravars['start'] = ($start - 
$this->maxmatches);
!                               }
!                               $ret_str .= 
$this->set_link('left','left.gif',$scriptname,lang('Previous page'),$extravars, 
$target);
!                       }
!                       else
!                       {
!                               $ret_str .= 
$this->set_icon('left','left-grey.gif',lang('Previous page'));
!                       }
!                       return $ret_str;
!               } /* left() */
! 
!               /*!
!               @function right
!               @abstract ?
!               @param $scriptname ?
!               @param $start ?
!               @param $total ?
!               @param $extradate ?
!               */
!               function right($start,$total,$extradata = '', $target)
!               {
!                       global $filter, $qfield, $order, $sort;
! 
!                       $extravars = Array(
!                               'order'   => $order,
!                               'filter'  => $filter,
!                               'q_field' => $qfield,
!                               'sort'    => $sort,
!                               'query'   => 
urlencode(stripslashes($GLOBALS['query']))
!                       );
! 
!                       $extravars = $this->split_extras($extravars,$extradata);
! 
!                       $ret_str = '';
! 
!                       if (($total > $this->maxmatches) &&
!                               ($total > $start + $this->maxmatches))
!                       {
!                               $extravars['start'] = ($start + 
$this->maxmatches);
!                               $ret_str .= 
$this->set_link('right','right.gif',$scriptname,lang('Next page'),$extravars, 
$target);
!                       }
!                       else
!                       {
!                               $ret_str .= 
$this->set_icon('right','right-grey.gif',lang('Next page'));
!                       }
! 
!                       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,lang('Last page'),$extravars, 
$target);
!                       }
!                       else
!                       {
!                               $ret_str .= 
$this->set_icon('right','last-grey.gif',lang('Last page'));
!                       }
!                       return $ret_str;
!               } /* right() */
! 
!               function set_link($align,$img,$link,$alt,$extravars, $target)
!               {
!                       $hidden = '';
!                       while(list($var,$value) = each($extravars))
!                       {
!                               if((is_int($value) && $value == 0) || $value)
!                               {
! //                                    if(is_int($value))
! //                                    {
! //                                            $param = intval($value);
! //                                    }
! //                                    else
! //                                    {
!                                               $param = '"'.$value.'"';
! //                                    }
!                                       $hidden .= '     <input type="hidden" 
name="'.$target.$var.'" value='.$param.'>'."\n";
!                               }
!                       }
!                       $border = 0;
!                       $var = Array(
!                               'align'     => $align,
!                               'action'    => '',
!                               'form_name' => $img,
!                               'hidden'    => 
substr($hidden,0,strlen($hidden)-1),
!                               'img'       => 
$GLOBALS['phpgw']->common->image('phpgwapi',$img),
!                               'label'     => $alt,
!                               'border'    => $border,
!                               'start'     => $extravars['start']
!                       );
!                       $this->template->set_var($var);
!                       return $this->template->fp('out','form');
!               }
! 
!       } // End of nextmatchs class
! ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]