head	1.3;
access;
symbols;
locks; strict;
comment	@# @;


1.3
date	2007.09.03.00.37.37;	author mkanat;	state dead;
branches;
next	1.2;

1.2
date	2007.05.01.19.42.02;	author arturkeska;	state Exp;
branches;
next	1.1;

1.1
date	2007.04.30.20.49.32;	author arturkeska;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Remove a bunch of files so that I don't have to deal with them in EXPECTED_CONTENTS.
@
text
@<?PHP


class HTOM_InputID extends HTOM_ID
{
  // Set the name
  public function __construct( $name )
  {
    $this->name = $name;
  }
  // implements the abstraction
  public function getValue()
  {
    return $this->name;
  }
  private $name="";
}

// used to hold the input method type attribute
class HTOM_InputMethod implements HTOM_Attribute
{
  public function __construct( $value="" )
  {
    if ($value instanceof HTOM_InputMethod) {
      $this->value = $value->value;
    } else {
      $this->value = $value;
    }
  }
  public function Name()
  {
    return "HTOM_InputMethod";
  }

  public function Evaluate()
  {
    return "type='".$this->value."'";
  }

  private $value = "";
}


/*! \brief The HTOM_Input is a superclass of user input handlers elements. */
class HTOM_Input extends HTOM_Element
{
  /*! */
  public function __construct($id, $type, $attributes=NULL )
  {
    $this->SetAttributes($attributes);
    $this->SetAttributes( new HTOM_InputMethod($type) );
    $this->SetAttributes( new HTOM_SimpleAttribute("name",$id) );
    $this->Init( );
  }

  //! Disable/enable input.
  public function SetDisabled( BOOL $disable )
  {
    if ($disable)
      $this->SetAttributes( new HTOM_SimpleAttribute("disabled","") );
    else 
      $this->SetAttributes( new HTOM_SimpleAttribute("disabled",NULL) );
  }

  //! Disable/enable input.
  public function SetReadOnly( BOOL $readonly )
  {
    if ($readonly)
      $this->SetAttributes( new HTOM_SimpleAttribute("readonly","") );
    else 
      $this->SetAttributes( new HTOM_SimpleAttribute("readonly",NULL) );
  }

  //! Evaluate to the input tag
  public function Evaluate()
  {
    return "<INPUT ".$this->Attributes().">";
  }
}


?>@


1.2
log
@ID evaluation moved to HTOM_Eelement, so there is no need to call it to particular elements.
@
text
@@


1.1
log
@*** empty log message ***
@
text
@d77 1
a77 1
    return "<INPUT ".$this->ID()->Evaluate().$this->Attributes().">";
@