clearFusionCMS 3.0.0
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • clearFusionCMS
    • module
      • cloudflare
      • comments
      • content
      • forms
      • members
      • search
  • fusionLib
  • None

Classes

  • _flFormGroup
  • _flUtf8Base
  • flAcMgr
  • flApiDbInstaller
  • flApiKeyMgr
  • flApiServer
  • flApiService
  • flApp
  • flAuthTOTP
  • flBufferCode
  • flBufferCss
  • flBufferJs
  • flCache
  • flCacheAPC
  • flCacheDb
  • flCacheDbInstaller
  • flCacheDummy
  • flCacheFile
  • flCacheFunction
  • flCacheMemcache
  • flCacheMemcached
  • flCacheOutput
  • flCacheRedis
  • flCacheSqlite
  • flConfig
  • flConfigDb
  • flConfigDbInstaller
  • flConfigFile
  • flConfigIni
  • flController
  • flControllerAction
  • flDate
  • flDateTzMenu
  • flDb
  • flDbInstaller
  • flDbInstallerInterface
  • flDbMySQL
  • flDbMySQLi
  • flDbMySQLiResult
  • flDbMySQLResult
  • flDbNestedSet
  • flDbResult
  • flDbSQLite
  • flDbSQLite3
  • flDbSQLite3Result
  • flDbSQLiteResult
  • flEmail
  • flEvent
  • flEventDbInstaller
  • flEventManager
  • flExceptionErrorController
  • flExceptionReporter
  • flForm
  • flFormBuilder
  • flFormDecorator
  • flFormDecoratorDl
  • flFormDecoratorDtDd
  • flFormDecoratorFieldset
  • flFormDecoratorForm
  • flFormDecoratorLi
  • flFormDecoratorList
  • flFormDecoratorUl
  • flFormElement
  • flFormElementButton
  • flFormElementCheckbox
  • flFormElementChecklist
  • flFormElementEmail
  • flFormElementFile
  • flFormElementHidden
  • flFormElementImage
  • flFormElementInteger
  • flFormElementNumber
  • flFormElementPane
  • flFormElementPassword
  • flFormElementRadio
  • flFormElementRecaptcha
  • flFormElementSearch
  • flFormElementSelect
  • flFormElementSubmit
  • flFormElementText
  • flFormElementTextArea
  • flFormElementTextSuggest
  • flFormElementUri
  • flFormElementWYSIWYG
  • flFormValidator
  • flFormValidatorAttribMax
  • flFormValidatorAttribMin
  • flFormValidatorCustomJS
  • flFormValidatorEmail
  • flFormValidatorEquals
  • flFormValidatorInteger
  • flFormValidatorMax
  • flFormValidatorMaxChecklist
  • flFormValidatorMaxLength
  • flFormValidatorMin
  • flFormValidatorMinChecklist
  • flFormValidatorMinLength
  • flFormValidatorMultiEmail
  • flFormValidatorNotEquals
  • flFormValidatorNumber
  • flFormValidatorRegex
  • flFormValidatorRequired
  • flFormValidatorSameAs
  • flFormValidatorUri
  • flFtpClient
  • flGravatar
  • flHttpClient
  • flHttpClientCookie
  • flImage
  • flImageFilter
  • flImageFilterBrightness
  • flImageFilterColorize
  • flImageFilterContrast
  • flImageFilterEdgeDetect
  • flImageFilterEmboss
  • flImageFilterGaussianBlur
  • flImageFilterGrayscale
  • flImageFilterMeanRemoval
  • flImageFilterNegative
  • flImageFilterPixelate
  • flImageFilterSelectiveBlur
  • flImageFilterSepia
  • flImageFilterSepia2
  • flImageFilterSmooth
  • flIntegrity
  • flKeygen
  • flLog
  • flLogHandlerChrome
  • flLogHandlerLoggly
  • flLogHandlerPapertrail
  • flLogHandlerSlack
  • flMimeTypes
  • flModuleDbInstaller
  • flModuleMgr
  • flRegistry
  • flRequest
  • flRequestDbInstaller
  • flRequestThrottle
  • flResponse
  • flRouter
  • flRouterRoute
  • flRssChannel
  • flRssClient
  • flRssItem
  • flSearch
  • flSearchIndexer
  • flSearchManager
  • flSearchResults
  • flSearchTags
  • flSession
  • flSessionData
  • flSessionDb
  • flSessionDbInstaller
  • flSessionFile
  • flSessionMemcache
  • flSessionMemcached
  • flSessionRedis
  • flTemplateDbInstaller
  • flTemplateEngine
  • flTemplateManager
  • flTextHTML
  • flTextSplitWords
  • flTextStemmer
  • flTextStemmerEn
  • flTextStrip
  • flTimer
  • flUri
  • flUser
  • flUserAdapter
  • flUserAdapterRemote
  • flUserDbInstaller
  • flUserMgr
  • flUserPwdGen
  • flUserServerApiV1
  • flUtf8
  • flUuid
  • flVariables
  • flVariablesDbInstaller
  • flWidgetBreadcrumb
  • flWidgetFloatingActionMenu
  • flWidgetPagination
  • flWidgetTable
  • flWidgetTabs
  • flWidgetToolbar
  • flWidgetTreeChildNode
  • flWidgetTreeLinkNode
  • flWidgetTreeNode
  • flWidgetTreeView
  • fusionLib

Interfaces

  • flFormElementWYSIWYGCodeInterface
  • flFormElementWYSIWYGInterface
  • flFormElementWYSIWYGTransformInterface
  • flLogHandler
  • flModuleInstallInterface

Exceptions

  • flAcException
  • flAppException
  • flCacheException
  • flConfigException
  • flDateException
  • flDbException
  • flEventException
  • flException
  • flExceptionBadRequest
  • flExceptionForbidden
  • flExceptionLoadClass
  • flExceptionNotFound
  • flExceptionPHP
  • flFormException
  • flHttpClientException
  • flImageException
  • flRegistryException
  • flRequestThrottleException
  • flRouterException
  • flSessionException
  • flTemplateEngineException
  • flUserException
  • flVariablesException
  • flWidgetException

Functions

  • __
  • __noop
  • _flErrorHandler
  • _n
  • _n_noop

Class flFormElement

flFormElement Class

Base class for all form elements.

Direct known subclasses

flFormElementButton, flFormElementCheckbox, flFormElementChecklist, flFormElementHidden, flFormElementPane, flFormElementRecaptcha, flFormElementSelect, flFormElementSubmit, flFormElementText, flFormElementTextArea

Indirect known subclasses

flFormElementEmail, flFormElementFile, flFormElementWYSIWYG, flFormElementImage, flFormElementInteger, flFormElementNumber, flFormElementPassword, flFormElementRadio, flFormElementSearch, flFormElementTextSuggest, flFormElementUri

Abstract
Package: fusionLib
Copyright: Copyright (c) 2007 - 2016 fusionLib. All rights reserved.
Located at system/libs/Form/flFormElement.php

Methods summary

public
# __construct( flForm $form, string $name, string $default = null )

Construct the element.

Construct the element.

Parameters

$form
The form the element will be used with or null if not using flForm
$name
The name of the element.
$default
The default value of the element.
protected string
# _getValueEscaped( )

Get the escaped value, HTML elements and the characters [ ] are escaped.

Get the escaped value, HTML elements and the characters [ ] are escaped.

Returns

string
The escaped value.
public flFormElement
# hide( boolean $hide = true )

Hide the element to stop it being output as part of the form.

Hide the element to stop it being output as part of the form.

Parameters

$hide
true to hide the element; else false.

Returns

flFormElement
This object.
public boolean
# isHidden( )

Test if the element is hidden.

Test if the element is hidden.

Returns

boolean
true if the element is hidden; else false.
public
# processRequest( flRequest $request )

Process the request data, normally called by the flForm::isSubmitted(). Validation of the data is also performed and the results stored.

Process the request data, normally called by the flForm::isSubmitted(). Validation of the data is also performed and the results stored.

Parameters

$request
The request object.
public string
# getName( )

Get the name of the element.

Get the name of the element.

Returns

string
The name.
public flFormElement
# setCSS( string $class )

Set a CSS Class to include in the element.

Set a CSS Class to include in the element.

Parameters

$class
The CSS class to include.

Returns

flFormElement
Ths object.
public flFormElement
# setPlaceholder( string $placeholder )

Set the HTML5 placeholder text for the element.

Set the HTML5 placeholder text for the element.

Parameters

$placeholder
The placeholder text for the element.

Returns

flFormElement
This object.
public flFormElement
# setAutocomplete( string $autocomplete )

Set the autocomplete value for the element.

Set the autocomplete value for the element.

Parameters

$autocomplete
The autocomplete value.

Returns

flFormElement
This object.
public string
# getPlaceholder( )

Get the current placeholder text.

Get the current placeholder text.

Returns

string
The placeholder text of null if not set.
public flFormElement
# setLabel( string $label )

Set the label for the element.

Set the label for the element.

Parameters

$label
The label for the element.

Returns

flFormElement
This object.
public string
# getLabel( )

Get the label.

Get the label.

Returns

string
The elements label.
public flFormElement
# setTitle( string $title )

Set the title for the element.

Set the title for the element.

Parameters

$title
The title of the element.

Returns

flFormElement
This object.
public string
# getTitle( )

Get the title.

Get the title.

Returns

string
The elements title.
public flFormElement
# setValue( string $value )

Set the value.

Set the value.

Parameters

$value
The value.

Returns

flFormElement
This object.
public string
# getValue( )

Get the value of the element.

Get the value of the element.

Returns

string
The value.
public string
# getCleanedValue( array $tags = null )

Clean the current value removing XSS issues where possible.

Clean the current value removing XSS issues where possible.

This method only has value if HTML is being preserved otherwise passing the value to fusionLib::htmlChars is quicker.

See http://ha.ckers.org/xss.html for test cases.

Parameters

$tags

Array of tags to remove from the data being cleaned, default is: array('xml', 'html', 'body', 'meta', 'title', 'base', 'applet', 'script', 'embed', 'object', 'ilayer', 'layer', 'link', 'style', 'blink', 'iframe', 'frame', 'frameset', 'bgsound')

Returns

string
The cleaned value or null if there's a mismatch between open and closed tags.
public flFormElement
# setReadonly( boolean $readonly = true )

Set the element readonly state.

Set the element readonly state.

Parameters

$readonly
true to make the element readonly.

Returns

flFormElement
This object.
public boolean
# isReadonly( )

Get if the element is readonly.

Get if the element is readonly.

Returns

boolean
true if the element is readonly.
public flFormElement
# setDisabled( boolean $disabled = true )

Set the element disabled state.

Set the element disabled state.

Parameters

$disabled
true to make the element disabled.

Returns

flFormElement
This object.
public boolean
# isDisabled( )

Get if the element is disabled.

Get if the element is disabled.

Returns

boolean
true if the element is disabled.
public flFormElement
# setRequired( boolean $required = true )

Set the element required state.

Set the element required state.

Parameters

$required
true if the element is required.

Returns

flFormElement
This object.
public boolean
# isRequired( )

Get if the element is required.

Get if the element is required.

Returns

boolean
true if the element is required.
public
# setValidText( string $text )

Set the text to return with getError() for valid elements if not the form default.

Set the text to return with getError() for valid elements if not the form default.

Parameters

$text
The text to set.
public string
# getError( )

Get the error message from form validation.

Get the error message from form validation.

Returns

string

The error message or the system wide valid text message or an empty string of validation has not yet been performed.

public flFormElement
# setDescription( string $description )

Set a description for the element.

Set a description for the element.

Parameters

$description
The description.

Returns

flFormElement
This object.
public string
# getDescription( )

Get the elements description.

Get the elements description.

Returns

string
The description or null if none set.
public flFormElement
# addValidator( flFormValidator $validator )

Add a validator to the element.

Add a validator to the element.

Parameters

$validator
The validator object.

Returns

flFormElement
This object.
public boolean
# hasValidators( )

Test if the element has validators.

Test if the element has validators.

Returns

boolean
true if the element has validators; else false.
public boolean
# isValid( )

Test if the element input is valid.

Test if the element input is valid.

Returns

boolean
true if the element is valid or isSubmitted() returns false, false if it is not valid.
public boolean
# isSubmitted( )

Test if data has been submitted to the element.

Test if data has been submitted to the element.

Returns

boolean
true if data has been submitted; else false.
abstract public string
# render( )

Draw the element.

Draw the element.

Returns

string
The HTML.
public string
# getJavaScript( )

Get the JavaScript for the element if any.

Get the JavaScript for the element if any.

Returns

string
The string holding the JavaScript for the element.
public flFormElement
# setJavaScript( string $js )

Add JavaScript to the element.

Add JavaScript to the element.

Parameters

$js
JavaScript to include with element.

Returns

flFormElement
This element.
protected string
# _getClientRuleName( )

Get the name of the element for use in JS validation rules.

Get the name of the element for use in JS validation rules.

Returns

string
The element name for use in a client rule.
public string
# getClientRules( )

Get the client side validation rules if any.

Get the client side validation rules if any.

Returns

string
The client side validation rules for use with $fl.attachValidation
public string
# getValidText( )

Get the text to show for valid elements during client side validation.

Get the text to show for valid elements during client side validation.

Returns

string
The client side validation message for valid elements.
protected string
# attribHTML( )

Generate the HTML for common attributes.

Generate the HTML for common attributes.

Returns

string
HTML attributes.
public string
# getLabelHTML( )

Generate the HTML for the elements label.

Generate the HTML for the elements label.

Returns

string
The label HTML.
public string
# getDescriptionHTML( )

Generate the HTML for the description if any.

Generate the HTML for the description if any.

Returns

string
The description HTML.
public
# forceError( string $message )

Force the element to be invalid with an error message.

Force the element to be invalid with an error message.

Parameters

$message
The error message to show on the element.

Properties summary

protected string $name

The name of the element.

The name of the element.

#
protected string $label

The label for the element.

The label for the element.

# null
protected string $title

The title for the element.

The title for the element.

# null
protected string $description

The description for the element.

The description for the element.

# null
protected string $value

The value of the element.

The value of the element.

#
protected boolean $readonly

Flags the element as readonly.

Flags the element as readonly.

Param

bool
# false
protected boolean $disabled

Flags the element as disabled.

Flags the element as disabled.

Param

bool
# false
protected boolean $required

Flags element is required.

Flags element is required.

# false
protected array $validators

Element validators.

Element validators.

# array()
protected array $error

The first error generated during validating the form.

The first error generated during validating the form.

# null
protected boolean $isValid

Flags if the element is valid according to the validators.

Flags if the element is valid according to the validators.

# true
protected flForm $form

The form the element belongs to.

The form the element belongs to.

# null
protected string $isValidText

Text to return for valid elements.

Text to return for valid elements.

# null
protected string $class

CSS Class to include in attribHTML.

CSS Class to include in attribHTML.

# null
protected boolean $hidden

Flags if to hide the element when rendering the form.

Flags if to hide the element when rendering the form.

# false
protected string $placeholder

HTML5 Placeholder.

HTML5 Placeholder.

# null
protected string $autocomplete

Optional autocomplete parameter

Optional autocomplete parameter

# null
protected string $js

JavaScript required by the element.

JavaScript required by the element.

# ''
clearFusionCMS 3.0.0 API documentation generated by ApiGen