From 5a02da5172ed220a293a0cd6f586c900f9f94a00 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 7 Dec 2005 00:37:05 +0000 Subject: --- framework/Web/UI/WebControls/TTextBox.php | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'framework/Web/UI') diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php index bfd7c029..4d4fcff6 100644 --- a/framework/Web/UI/WebControls/TTextBox.php +++ b/framework/Web/UI/WebControls/TTextBox.php @@ -38,15 +38,6 @@ */ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable { - /** - * @var array enumeration of the valid AutoCompleteType values. - */ - public static $AUTO_COMPLETE_TYPE=array('BusinessCity','BusinessCountryRegion','BusinessFax','BusinessPhone','BusinessState','BusinessStreetAddress','BusinessUrl','BusinessZipCode','Cellular','Company','Department','Disabled','DisplayName','Email','FirstName','Gender','HomeCity','HomeCountryRegion','HomeFax','Homepage','HomePhone','HomeState','HomeStreetAddress','HomeZipCode','JobTitle','LastName','MiddleName','None','Notes','Office','Pager','Search'); - /** - * @var array enumeration of the valid TextMode values. - */ - public static $TEXT_MODE=array('SingleLine','MultiLine','Password'); - /** * @return string tag name of the textbox */ @@ -55,18 +46,6 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable return ($this->getTextMode()==='MultiLine')?'textarea':'input'; } - /** - * Processes an object that is created during parsing template. - * This overrides the parent implementation by forbidding any body components. - * @param mixed the newly created object in template - * @throws TInvalidOperationException if a component is found within body - */ - public function addParsedObject($object) - { - if(!is_string($object)) - throw new TInvalidOperationException('body_contents_not_allowed',get_class($this).':'.$this->getUniqueID()); - } - /** * Adds attribute name-value pairs to renderer. * This overrides the parent implementation with additional textbox specific attributes. @@ -232,6 +211,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable } $this->onTextChanged(new TEventParameter); } + /** * Renders the body content of the textbox when it is in MultiLine text mode. * @param THtmlWriter the writer for rendering @@ -263,7 +243,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable */ public function setAutoCompleteType($value) { - $this->setViewState('AutoCompleteType',TPropertyValue::ensureEnum($value,self::$AUTO_COMPLETE_TYPE),'None'); + $this->setViewState('AutoCompleteType',TPropertyValue::ensureEnum($value,array('BusinessCity','BusinessCountryRegion','BusinessFax','BusinessPhone','BusinessState','BusinessStreetAddress','BusinessUrl','BusinessZipCode','Cellular','Company','Department','Disabled','DisplayName','Email','FirstName','Gender','HomeCity','HomeCountryRegion','HomeFax','Homepage','HomePhone','HomeState','HomeStreetAddress','HomeZipCode','JobTitle','LastName','MiddleName','None','Notes','Office','Pager','Search')),'None'); } /** @@ -403,7 +383,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable */ public function setTextMode($value) { - $this->setViewState('TextMode',TPropertyValue::ensureEnum($value,self::$TEXT_MODE),'SingleLine'); + $this->setViewState('TextMode',TPropertyValue::ensureEnum($value,array('SingleLine','MultiLine','Password')),'SingleLine'); } /** -- cgit v1.2.3