<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

/*
  -------------------- Name conventions --------------------
  Function names (except methods):

  ff_DescriptionOfFunction


  Constant names:

  cc_DescriptionOfConstant


  Variable names:

  $ST_DescriptionOfVariable

  where S is a scope, T is a type.

  The following scopes should be used:
  g - global
  s - static
  l - local
  m - member of class
  p - parameter

  The following types should be used:
  s - scalar
  a - array
  r - resource
  o - object
  m - mixed

  -------------------- end Name conventions --------------------
*/





include_once ( dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.ArrayValuesSource.php" );





class PostValuesSource extends ArrayValuesSource
{
    /* -------------------- Members -------------------- */
    /* -------------------- end Members -------------------- */





    /* -------------------- Constructor -------------------- */
    function PostValuesSource ( $pa_Columns, $pa_Search = array(), $ps_IDName=0, $ps_PageNumber = NULL,
	    $ps_ItemsPerPage = NULL )
    {
	$la_Data = array();
	foreach ( $pa_Columns as $lo_Column )
	    if ( strlen($lo_Column->ms_Name) && array_key_exists( $lo_Column->ms_Name, $_POST ) )
	    {
		foreach ( $_POST[$lo_Column->ms_Name] as $ls_Key => $ls_Value )
		    $la_Data[] = array( $ps_IDName => $ls_Key );
		break;
	    }
	foreach ( $pa_Columns as $lo_Column )
	    if ( strlen($lo_Column->ms_Name) && array_key_exists( $lo_Column->ms_Name, $_POST ) )
		for ( $i=0; $i<count($la_Data); $i++ )
		    $la_Data[$i][$lo_Column->ms_Name] = $_POST[$lo_Column->ms_Name][ $la_Data[$i][$ps_IDName] ];
	$this->ArrayValuesSource ( $la_Data, $pa_Search, $ps_IDName, $ps_PageNumber, $ps_ItemsPerPage );
    }
    /* -------------------- end Constructor -------------------- */

}
?>
