<?php

/**
 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @package fusionLib
 * @copyright Copyright (c) 2007 - 2013 fusionLib. All rights reserved.
 * @link http://fusionlib.com
 */

/**
 * flFormElementTextArea Class
 *
 * Multiline text input form element.
 *
 * @package fusionLib
 */
class flFormElementTextArea extends flFormElement {

	/**
	 * The number of rows for the textarea.
	 *
	 * @var int
	 */
	protected $rows = 10;

	/**
	 * Draw the element.
	 *
	 * @return string The HTML.
	 */
	function render() {
		return "<textarea id=\"$this->name\" name=\"$this->name\" cols=\"30\" rows=\"$this->rows\"" . $this->attribHTML() . '>' . $this->_getValueEscaped() . "</textarea>\n";
	}

	/**
	 * Set the rows for the textarea.
	 *
	 * @param int $rows The row value.
	 * @return flFormElementTextArea This object.
	 */
	function setRows($rows) {
		$this->rows = $rows;
		return $this;
	}
}
