Source for file HTMLTextArea.class.php
Documentation is available at HTMLTextArea.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>\r\n";
echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\r\n";
require_once( CLASSPATH. "forms/items/ABSTHTMLFormItem.class.php" );
* @author Daniel Plücken <daniel@debakel.net>
* @license http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
* @copyright Copyright (c) 2004 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
* Stores the width of this text area in text cols (letter count per row).
* Stores the height of this text area in text rows.
* @author Daniel Plücken <daniel@debakel.net>
* @param integer $cols Width of textarea in chars.
* @param integer $rows Height of textarea in chars.
$this->cols = !empty( $cols ) ? $cols : 25;
$this->rows = !empty( $rows ) ? $rows : 5;
* Returns the the width of this text area in text cols (letter count per
* @author Daniel Plücken <daniel@debakel.net>
* Returns the the height of this text area in text rows.
* @author Daniel Plücken <daniel@debakel.net>
* Sets the the width of this text area in text cols (letter count per
* @author Daniel Plücken <daniel@debakel.net>
* Sets the the height of this text area in text rows.
* @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>
$out_str = "document.". $this->parentform->name. "."
. $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_POST[\"". $this -> getName(). "\"]\r\n"
. " .\x24_GET[\"". $this -> getName(). "\"];\r\n";
$out .= "\x24input[] = new HTMLTextArea(\r\n"
. " \"". $this -> getName(). "\",\r\n"
. " \"". $this -> getCols(). "\",\r\n"
? "if( \x24value === \"\" )\r\n"
. " \x24input[count(\x24input)-1]"
. "->setValue( \"". $tmp. "\" );\r\n\r\n"
* Returns a generated string based on the attributes of this object.
* @author Daniel Plücken <daniel@debakel.net>
* @param string $forminput The possible values are "POST" and "GET".
* If one of this value is set, the source of
* this textarea will be output with php-source
* in the body to put the value from the form in
function get( $forminput = "" )
if( $forminput == "POST" || $forminput == "GET" )
$tmp = "<?php echo \x24_". $forminput. "['". $this->name. "']; ?>";
. " name=\"". $this->name. "\"\r\n";
$out .= " style=\"". $this->freestyle. "\"\r\n";
if ( !empty( $this->click ) )
$out .= " onClick=\"". $this->click. "\"\r\n";
if ( !empty( $this->blur ) )
$out .= " onBlur=\"". $this->blur. "\"\r\n";
if ( !empty( $this->focus ) )
$out .= " onFocus=\"". $this->focus. "\"\r\n";
$out .= " onMouseup=\"". $this->mouseup. "\"\r\n";
$out .= " onMouseover=\"". $this->mouseover. "\"\r\n";
$out .= " onMousemove=\"". $this->mousemove. "\"\r\n";
$out .= " onMouseout=\"". $this->mouseout. "\"\r\n";
$out .= " cols=\"". $this->cols. "\"\r\n";
$out .= " rows=\"". $this->rows. "\"\r\n";
$out .= ( !$this->enabled ) ? " readonly\r\n" : "";
$out .= " >". $tmp. "</textarea>";
} // ENDE class HTMLTextArea
|