pnForm
[ class tree: pnForm ] [ index: pnForm ] [ all elements ]

Class: pnFormTextInput

Source Location: /system/pnForm/plugins/function.pnformtextinput.php

Class Overview

pnFormPlugin
   |
   --pnFormStyledPlugin
      |
      --pnFormTextInput

TextInput plugin for pnForms


Variables

Methods


Child classes:

pnFormDateInput
Date input for pnForms
pnFormEMailInput
E-mail input for pnForms
pnFormFloatInput
Floating value input
pnFormIntInput
Integer input
pnFormURLInput
URL input for pnForms

Inherited Variables

Inherited Methods

Class: pnFormStyledPlugin

pnFormStyledPlugin::renderAttributes()

Class: pnFormPlugin

pnFormPlugin::pnFormPlugin()
Constructor
pnFormPlugin::create()
Create event handler
pnFormPlugin::dataBound()
DataBound event handler
pnFormPlugin::decode()
Decode event handler
pnFormPlugin::decodePostBackEvent()
Decode event handler for actions that generate a postback event
pnFormPlugin::getIdHtml()
Utility function to generate HTML for ID attribute
pnFormPlugin::initialize()
Initialize event handler
pnFormPlugin::load()
Load event handler
pnFormPlugin::postRender()
PostRender event handler
pnFormPlugin::readParameters()
Read Smarty plugin parameters
pnFormPlugin::registerPlugin()
pnFormPlugin::render()
Render event handler
pnFormPlugin::renderAttributes()
pnFormPlugin::renderBegin()
RenderBegin event handler
pnFormPlugin::renderContent()
RenderContent event handler
pnFormPlugin::renderEnd()
RenderEnd event handler

Class Details

[line 31]
TextInput plugin for pnForms

The pnFormTextInput plugin is a general purpose input plugin that allows the user to enter any kind of character based data, including text, numbers, dates and more.

Typical use in template file:

  1.  <!--[pnformtextinput id="title" maxLength="100" width="30em"]-->

The pnFormTextInput plugin supports basic CSS styling through attributes like "width", "color" and "font_weight". See pnFormStyledPlugin for more info.




[ Top ]


Class Variables

$cols =

[line 81]

Number of columns for multiline input


Type:   int


[ Top ]

$cssClass =

[line 75]

CSS class to use


Type:   string


[ Top ]

$dataBased =

[line 102]

Enable or disable use of $dataField


Type:   bool


[ Top ]

$dataField =

[line 96]

Data field name for looking up initial data

The name stored here is used to lookup initial data for the plugin in the render's variables. Defaults to the ID of the plugin. See also tutorials on the Zikula site.



Type:   string


[ Top ]

$errorMessage =

[line 141]

Error message to display when input does not validate

Use pnFormTextInput::setError() and pnFormTextInput::clearValidation() to change the value.



Type:   string


[ Top ]

$group =

[line 113]

Group name for this input

The group name is used to locate data in the render (when databased) and to restrict which plugins to do validation on (to be implemented).




Tags:


Type:   string


[ Top ]

$inputName =

[line 184]

HTML input name for this plugin. Defaults to the ID of the plugin.


Type:   string


[ Top ]

$isValid =  true

[line 124]

Validation indicator used by the framework.

The true/false value of this variable indicates whether or not the text input is valid (a valid input satisfies the mandatory requirement and regex validation pattern). Use pnFormTextInput::setError() and pnFormTextInput::clearValidation() to change the value.



Type:   bool


[ Top ]

$mandatory =

[line 132]

Enable or disable mandatory check

By enabling mandatory checking you force the user to enter something in the text input.



Type:   bool


[ Top ]

$maxLength =

[line 162]

Maximum number of characters allowed in the text input


Type:   int


[ Top ]

$myLabel =

[line 150]

Text label for this plugin

This variable contains the label text for the input. The pnFormLabel plugin will set this text automatically when it is a label for this input.



Type:   string


[ Top ]

$readOnly =

[line 63]

Enable or disable read only mode

A text input in read only mode do *not* decode posted data, since the user cannot enter anything in the read only input.



Type:   bool


[ Top ]

$regexValidationMessage =

[line 178]

Regular expression error message

Error message to display when the regex validation pattern does not match input.



Type:   string


[ Top ]

$regexValidationPattern =

[line 170]

Regular expression to match input against

User input must match this pattern. Uses PHP preg_match() to match the input and pattern.



Type:   string


[ Top ]

$rows =

[line 87]

Number of rows for multiline input


Type:   int


[ Top ]

$size =

[line 156]

Size of HTML input (number of characters)


Type:   int


[ Top ]

$text =  ''

[line 42]

Displayed text in the text input

This variable contains the text to be displayed in the input. At first page display this variable contains whatever set in the template. At postback it contains user input. User input is always trimmed using the HPH function trim().



Type:   string


[ Top ]

$textMode =  'singleline'

[line 54]

Text input mode

The text mode defines what kind of HTML element to render. The possible values are:

  • Singleline: renders a normal input element (default).
  • Password: renders a input element of type "password" (means you cannot read what you are typing).
  • Multiline: renders a textarea element.



Type:   string


[ Top ]

$toolTip =

[line 69]

Text to show as tool tip for the input


Type:   string


[ Top ]



Class Methods


method clearValidation [line 356]

void clearValidation( &$render)



Parameters:

   &$render  

[ Top ]

method create [line 210]

void create( &$render, $params)



Overridden in child classes as:

pnFormDateInput::create()
pnFormEMailInput::create()
pnFormFloatInput::create()
pnFormIntInput::create()
pnFormURLInput::create()

Overrides pnFormPlugin::create() (Create event handler)

Parameters:

   &$render  
   $params  

[ Top ]

method decode [line 310]

void decode( &$render)



Overrides pnFormPlugin::decode() (Decode event handler)

Parameters:

   &$render  

[ Top ]

method formatValue [line 422]

void formatValue( &$render, $value)



Overridden in child classes as:

pnFormDateInput::formatValue()

Parameters:

   &$render  
   $value  

[ Top ]

method getFilename [line 193]

string getFilename( )

Get filename for this plugin

A requirement from the framework - must be implemented like this. Used to restore plugins on postback.




Overridden in child classes as:

pnFormDateInput::getFilename()
pnFormEMailInput::getFilename()
pnFormFloatInput::getFilename()
pnFormIntInput::getFilename()
pnFormURLInput::getFilename()

[ Top ]

method initialize [line 240]

void initialize( &$render)



Overrides pnFormPlugin::initialize() (Initialize event handler)

Parameters:

   &$render  

[ Top ]

method isEmpty [line 204]

bool isEmpty( )

Indicates whether or not the input is empty



[ Top ]

method load [line 231]

void load( &$render, &$params)



Overrides pnFormPlugin::load() (Load event handler)

Parameters:

   &$render  
   &$params  

[ Top ]

method loadValue [line 395]

void loadValue( &$render, &$values)



Parameters:

   &$render  
   &$values  

[ Top ]

method parseValue [line 387]

void parseValue( &$render, $text)



Overridden in child classes as:

pnFormDateInput::parseValue()
pnFormFloatInput::parseValue()
pnFormIntInput::parseValue()

Parameters:

   &$render  
   $text  

[ Top ]

method render [line 246]

void render( &$render)



Overridden in child classes as:

pnFormDateInput::render()

Overrides pnFormPlugin::render() (Render event handler)

Parameters:

   &$render  

[ Top ]

method saveValue [line 366]

void saveValue( &$render, &$data)



Parameters:

   &$render  
   &$data  

[ Top ]

method setError [line 348]

void setError( $msg)



Parameters:

   $msg  

[ Top ]

method validate [line 328]

void validate( &$render)



Overridden in child classes as:

pnFormDateInput::validate()
pnFormEMailInput::validate()
pnFormFloatInput::validate()
pnFormIntInput::validate()
pnFormURLInput::validate()

Parameters:

   &$render  

[ Top ]


Documentation generated on Fri, 18 Jul 2008 21:46:00 +0200 by phpDocumentor 1.4.1