File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/api/form/class.field.textarea.php
<?php
/**
* This file contains the iwp_field_textarea class
*
* @version $Id$
*
*
* @package IWP
* @subpackage IWP_FormFields
*/
/**
* Textarea Field Class
* This class is used by the api form class to generate a textarea field
*
* @package IWP
* @subpackage IWP_FormFields
*/
class iwp_field_textarea extends iwp_field {
/**
* This is the form field type of the field
*
* @var string
*/
public $type = 'textarea';
protected $showLabel = false;
/**
* __construct
* The constructor which calls the parent constructor that sets up the field name if it is passed in during the initialization
*
* @var string
*/
function __construct($name=null){
parent::__construct($name);
}
/**
* GetFieldOutput
* Returns the HTML for this field. It generates the relevant parts, assigns them to template variables and returns a parse template file.
*
* @return string Returns the field HTML
*/
function GetFieldOutput($setOnly=false){
$this->template->Assign('showLabel', false);
$inputField = $this->Prepend.'<textarea id="'. iwp_htmlspecialchars($this->FieldName) .'" name="'. iwp_htmlspecialchars($this->FieldName) .'" ';
$inputField .= $this->GetAttributes();
if(!is_array($this->Attributes) || !array_key_exists('cols', $this->Attributes)){
$inputField .= ' class="Field400" ';
}
if(!is_array($this->Attributes) || !array_key_exists('rows', $this->Attributes)){
$inputField .= ' rows="8" ';
}
$inputField .= '>'.iwp_htmlspecialchars($this->FieldValue).'</textarea>';
$inputField .= $this->Append;
parent::GetFieldOutput();
$this->template->Assign('inputField', $inputField);
$this->template->Assign('FieldName', $this->FieldName);
if(!$setOnly){
return $this->template->ParseTemplate('form.field', true);
}
return '';
}
/**
* Validate
* This is the function that data for this field is passed to to ensure it was submitted properly.
*
* @return string|boolean If the data is not valid, it will return false, if it is valid it will return a value
*/
function Validate($arrData){
return $arrData[$this->FieldName];
}
}