<?
########## 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.ListColumn.php" );





class InputCheckboxColumn extends ListColumn
{
    /* -------------------- Members -------------------- */
    var $ms_Checked; // value that is used for checked checkbox
		var $ms_RetValue;
    /* -------------------- end Members -------------------- */





    /* -------------------- Constructor -------------------- */
    function InputCheckboxColumn (  $ps_Checked, $ps_Name, $ps_Label, $ps_Value, $pa_Attributes=array(), $ps_Width=NULL,
	    $ps_Align=NULL, $ps_ID=NULL )
    {
			$this->ms_Checked = $ps_Checked;
			if ( $ps_Value ) {
				$this->ms_RetValue = $ps_Value;
			} else {
				$this->ms_RetValue = 1;
			}
			$this->ListColumn ( $ps_Name, $ps_Label, $ps_Value, $pa_Attributes, $ps_Width, $ps_Align, $ps_ID );
    }
    /* -------------------- end Constructor -------------------- */





    /* -------------------- definitions of "abstract" methods -------------------- */
    function GetHTML()
    {
			$ls_More = $this->GetAttributesHTML();
			$ls_Checked = $this->GetValue() == $this->ms_Checked ? "checked" : "";
			return "<input type=checkbox name=\"" . htmlspecialchars($this->GetName()) . "\" $ls_More value=\"" .
				htmlspecialchars($this->ms_RetValue) . "\" $ls_Checked>";
    }
    /* -------------------- end definitions of "abstract" methods -------------------- */

}
?>
