Source for file ABSTHTMLTextInput.class.php
Documentation is available at ABSTHTMLTextInput.class.php
* For including this file you have to define the constant "CLASSPATH".
* Because every include in the framework depends on the CLASSPATH definition.
* The CLASSPATH means the relative path to the folder that contains the
echo "<h3>You have to define the constant CLASSPATH!</h3>\n";
echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\n";
require_once( CLASSPATH. "forms/items/ABSTHTMLFormItem.class.php" );
* A class to generate text input fields.
* @author Daniel Plücken <daniel@debakel.net>
* @license http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
* @copyright Copyright (c) 2003 Daniel Plücken <daniel@debakel.net>
* 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.
* 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
* @var integer The value of the "size"-attribute of this text-input.
* @var integer The value of the "maxLength"-attribute of this text-input.
* @author Daniel Plücken <daniel@debakel.net>
"ABSTHTMLTextInput is an abstract class. "
. "You cannot get an instance of it."
* @author Daniel Plücken <daniel@debakel.net>
* @param integer $maxchar
* @param string $style_class
* @param string $other_attributes
* Returns the value of this item's "size"-attribute.
* @author Daniel Plücken <daniel@debakel.net>
* Returns the value of this item's "maxLength"-attribute.
* @author Daniel Plücken <daniel@debakel.net>
* Stores the value of this item's "size"-attribute.
* @author Daniel Plücken <daniel@debakel.net>
* Stores the value of this item's "maxLength"-attribute.
* @author Daniel Plücken <daniel@debakel.net>
* Returns an if-order of a javascript to check whether this item is NOT
* @author Daniel Plücken <daniel@debakel.net>
. $this->name. ".value == \"\"";
* Generates the sourcecode to build this object and returns it.
* @author Daniel Plücken <daniel@debakel.net>
$out = "unset( \x24value );\r\n";
$out .= "\x24value = \x24_REQUEST[\"". $this->name. "\"]\r\n";
$out .= "\x24input[] = new ". $type. "(\r\n"
. " \"". $this->name. "\",\r\n"
$type != "HTMLPasswordInput"
? " \"". $this->size. "\",\r\n"
$out .= !empty( $this->value )
? "if( \x24value === \"\" )\r\n"
. " \x24input[count(\x24input)-1] "
. "-> setValue( \"". $this->value. "\" );\r\n\r\n"
* Returns a generated string based on the attributes of this object.
* @author Daniel Plücken <daniel@debakel.net>
* @param string type Possible values are "text" or "password"
if ( empty( $this->id ) )
. "--><input type=\"". $type. "\"\r\n"
. " name=\"". $this->name. "\"\r\n";
$out .= " id=\"". $this->id. "\"\r\n";
if ( $type != "password" )
"\"", """, $this->value
$out .= !empty( $this->blur )
? " onBlur=\"". $this->blur. "\"\r\n"
$out .= !empty( $this->focus )
? " onFocus=\"". $this->focus. "\"\r\n"
$out .= !empty( $this->click )
? " onClick=\"". $this->click. "\"\r\n"
? " onMouseup=\"". $this->mouseup. "\"\r\n"
? " onMouseover=\"". $this->mouseover. "\"\r\n"
? " onMouseout=\"". $this->mouseout. "\"\r\n"
? " onMousemove=\"". $this->mousemove. "\"\r\n"
$out .= !empty( $this->size )
? " size=\"". $this->size. "\"\r\n"
? " maxLength=\"". $this->maxchars. "\"\r\n"
: " disabled=\"disabled\"\r\n";
: " readonly=\"readonly\"\r\n";
} // END of class ABSTHTMLTextInput
|