MIOLO26
Carregando...
Procurando...
Nenhuma entrada encontrada
Referência à classe MBaseForm
Diagrama de heranças da classe MBaseForm
MContainerControl MDiv MControl MComponent MForm Form Form MCSSForm MCSSPForm MCompoundForm MDOMPDFReport MFormAJAX MIndexedForm MStepByStepForm MTabbedForm MTabbedForm2

Membros públicos

 __construct ($action='')
 
 __set ($name, $value)
 
 __get ($name)
 
 onLoad ()
 
 createFields ()
 
 isAjaxCall ()
 
 registerMethod ()
 
 addValidator ($validator)
 
 setValidators ($validators)
 
 setAjaxFields ($fields, $responseControl)
 
 isSubmitted ()
 
 setAlternate ($color0, $color1)
 
 setFocus ($fieldName)
 
 getFormFields ()
 
 getFormValue ($name, $value=NULL)
 
 setFormValue ($name, $value)
 
 onSubmit ($jscode)
 
 addJsCode ($jscode)
 
 setAction ($action)
 
 setFields ($fields)
 
 addField ($field, $hint=false)
 
 addFields ($fields)
 
 addButton ($button)
 
 setButtons ($buttons)
 
 setButtonLabel ( $index, $label)
 
 showReturn ( $state)
 
 setShowReturnButton ( $state)
 
 setShowPostButton ( $state)
 
 showReset ( $state)
 
 setShowResetButton ( $state)
 
 getShowHints ()
 
 setShowHints ( $state)
 
 showHints ( $state)
 
 getFieldList ()
 
 clearFields ()
 
 clearField ($name)
 
 clearButtons ()
 
 validate ()
 
 error ( $err)
 
 addError ($err)
 
 hasErrors ()
 
 addInfo ($info)
 
 hasInfos ()
 
 addAlert ($alert)
 
 hasAlerts ()
 
 collectInput ($data)
 
 getData ()
 
 setData (MBusiness $data)
 
 getFieldValue ($name, $value=false)
 
 setFieldValue ($name, $value)
 
 setFieldValidator ($name, $value)
 
getField ($name)
 
getButton ($name)
 
getPage ()
 
 setPage ($page)
 
 setFieldAttr ($name, $attr, $value)
 
 getFieldAttr ($name, $attr, $index=NULL)
 
 setButtonAttr ($name, $attr, $value)
 
 setResponse ($controls, $element='', $generateFormLayout=false)
 
 getCloseWindow ()
 
 setLabelWidth ($width)
 
 setFieldsReadOnly ($readOnly=true)
 
 setFieldReadOnly ($field, $readOnly=true)
 
 submit_button ()
 
 generateErrors ()
 
 generateInfos ()
 
 generateAlerts ()
 
 generateBody ()
 
 generateFooter ()
 
 generateLayoutFields (&$hidden)
 
 getFieldValidator ($name)
 
 generateLayoutField ($f, &$hidden=array())
 
 setJsValidationEnabled ($jsValidationEnabled)
 
 getJsValidationEnabled ()
 
 generateButtons ()
 
 generateHiddenFields ($hidden)
 
 generateScript ()
 
 generateInner ()
 
- Membros públicos herdados de MContainerControl
 __clone ()
 
 addControl ($control)
 
 insertControl ($control, $pos=0)
 
 setControl ($control, $pos=0)
 
 setControls ($controls)
 
 getControls ()
 
 getControl ($pos)
 
 getControlById ($id)
 
 findControlById ($id)
 
 setControlById ($control, $id)
 
 clearControls ()
 
- Membros públicos herdados de MDiv
 __construct ( $name=NULL, $content=' ', $class=NULL, $attributes=NULL)
 
 generate ()
 
- Membros públicos herdados de MControl
 setName ($name)
 
 setId ($id)
 
 getId ()
 
 getName ()
 
 getUniqueId ()
 
 setClass ($cssClass, $add=TRUE)
 
 insertClass ( $cssClass)
 
 addStyleFile ( $styleFile)
 
 getClass ()
 
 addStyle ($name, $value)
 
 setStyle ($style)
 
 getStyle ()
 
 getBoxStyle ()
 
 setPosition ($left, $top, $position='absolute')
 
 setWidth ($value)
 
 setHeight ($value)
 
 setColor ($value)
 
 setVisibility ($value)
 
 setFont ($value)
 
 getBox ()
 
 setBoxId ( $id)
 
 setBoxClass ( $cssClass, $add=true)
 
 getBoxClass ()
 
 setBoxAttributes ($attr)
 
 getBoxAttributes ()
 
 generateBox ( $content)
 
 addAttribute ( $name, $value='')
 
 setAttribute ( $name, $value)
 
 getAttribute ( $name)
 
 setAttributes ($attr)
 
 attributes ( $mergeDuplicates=false)
 
 getAttributes ( $mergeDuplicates=false)
 
 setReadOnly ($status)
 
 setEnabled ($state)
 
 setJsHint ( $hint)
 
 setHint ( $hint)
 
 setCaption ($caption)
 
 setHTMLTitle ($title)
 
 addBoxStyle ($name, $value)
 
 eventHandler ()
 
 attachEventHandler ( $name, $handler, $param=NULL)
 
 addEvent ($event, $handler, $preventDefault=true)
 
 hasEvent ($event)
 
 generateEvent ()
 
 setContent ($inner)
 
 setInner ($inner)
 
 getInner ()
 
 getRender ( $method)
 
 getInnerToString ()
 
 getCSSP ()
 
 __toString ()
 
- Membros públicos herdados de MComponent
 getManager ()
 

Campos de Dados

 $method
 
 $buttons
 
 $fields = array()
 
 $return
 
 $reset
 
 $styles
 
 $width
 
 $enctype
 
 $validations
 
 $defaultButton
 
 $errors = array()
 
 $infos = array()
 
 $alerts = array()
 
 $layout
 
 $zebra = false
 
 $labelWidth = NULL
 
 $focus = ''
 
 $ajax
 
 $cp
 
 $cssForm = false
 
 $cssButtons
 
- Campos de Dados herdados de MContainerControl
 $controls
 
 $controlsId
 
- Campos de Dados herdados de MControl
 $id
 
 $uniqueId
 
 $enabled
 
 $style
 
 $attrs
 
 $attributes
 
 $maintainState
 
 $readonly
 
 $visible
 
 $caption
 
 $jsHint
 
 $hint
 
 $cssp
 
 $inner
 
 $parent
 
 $eventHandlers
 
 $painter
 
 $event
 
 $formId
 
const ALIGN_CENTER = 'center'
 
const ALIGN_LEFT = 'left'
 
const ALIGN_RIGHT = 'right'
 
const FORM_MODE_WHOLE_ROW = 0
 
const FORM_MODE_SHOW_SIDE = 1
 
const FORM_MODE_SHOW_ABOVE = 2
 
const FORM_MODE_SHOW_NBSP = 3
 
 $formMode
 
- Campos de Dados herdados de MComponent
 $manager
 
 $page
 
 $owner
 
 $name
 
 $className
 

Atributos Públicos Estáticos

static $showHints = true
 
static $fieldNum = 0
 
- Atributos Públicos Estáticos herdados de MControl
static $_number = 0
 

Membros protegidos

 _getFormFieldValue ($field)
 
- Membros protegidos herdados de MContainerControl
 _AddControl ($control, $pos=0, $op='add')
 
- Membros protegidos herdados de MControl
 _addStyle ($name, $value)
 

Atributos Protegidos

 $action
 

Descrição detalhada

Documentação dos Construtores & Destrutor

◆ __construct()

__construct ( $action = '')

This is the constructor of the MBaseForm class. It takes an action url as optional parameter. The action URL is typically obtained by calling the MIOLO->getActionURL() method.

Parâmetros
$action(string) the URL for the forms ACTION attribute.

Reimplementado de MContainerControl.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

Documentação das funções

◆ __get()

__get ( $name)

Brief Description. Complete Description.

Parâmetros
$name(tipo) desc
Retorna
(tipo) desc

Reimplementado de MControl.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ __set()

__set ( $name,
$value )

Brief Description. Complete Description.

Parâmetros
$name(tipo) desc
$value(tipo) desc
Retorna
(tipo) desc

Reimplementado de MControl.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ _getFormFieldValue()

_getFormFieldValue ( $field)
protected

Brief Description. Complete Description.

Parâmetros
$field(tipo) desc
Retorna
(tipo) desc
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ addAlert()

addAlert ( $alert)

Register an alert related to the form

Parâmetros
(mixed)$alert Message string or array of messages
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ addButton()

addButton ( $button)

Add button to the form. This method adds a button to the form. Existing buttons will remaing unchanged.

Veja também
setButtons()
MButton
Parâmetros
(MButton)$btn Button object
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ addError()

addError ( $err)

Adds the related form error

Parâmetros
(mixed)$err Error message string or array of messages
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ addField()

addField ( $field,
$hint = false )

Adds a single field to the list of form fields and optionally adds a hint text for the field.

Parâmetros
(object)$field Form field object
(string)$hint Optional hinto for the form field
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ addFields()

◆ addInfo()

addInfo ( $info)

Register an information related to the form

Parâmetros
(mixed)$info Information message string or array of messages
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ addJsCode()

addJsCode ( $jscode)

Brief Description. Complete Description.

Parâmetros
$jscode(tipo) desc
Retorna
(tipo) desc
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ addValidator()

addValidator ( $validator)

◆ clearButtons()

clearButtons ( )

◆ clearField()

◆ clearFields()

◆ collectInput()

◆ createFields()

createFields ( )

Brief Description. Complete Description.

Retorna
(tipo) desc

Reimplementado em MStepByStepForm.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ error()

error ( $err)

Regiter the error Registers the error related to the form

Parâmetros
$err(tipo) desc
Retorna
(tipo) desc
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ generateAlerts()

generateAlerts ( )

Generate a MPrompt object with all the alerts added to $this->alerts

Retorna
(MPrompt) Alert MPrompt object
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ generateBody()

generateBody ( )

Brief Description. Complete Description.

Retorna
(tipo) desc

Reimplementado em MIndexedForm e MTabbedForm2.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ generateButtons()

◆ generateErrors()

generateErrors ( )

Brief Description. Complete Description.

Retorna
(tipo) desc
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ generateFooter()

generateFooter ( )

Brief Description. Complete Description.

Retorna
(tipo) desc

Reimplementado em MForm e MTabbedForm.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ generateHiddenFields()

◆ generateInfos()

generateInfos ( )

Brief Description. Complete Description.

Retorna
(tipo) desc
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ generateInner()

◆ generateLayoutField()

generateLayoutField ( $f,
& $hidden = array() )

Generate field according to form layout.

Parâmetros
mixed$fField or array of fields.
array$hiddenArray of hidden fields.
Retorna
MDiv Div containing the field(s) with the class mFormRow.
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ generateLayoutFields()

generateLayoutFields ( & $hidden)

Brief Description. Complete Description.

Parâmetros
&$hidden(tipo) desc
Retorna
(tipo) desc

Reimplementado em MCSSForm e MCSSPForm.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ generateScript()

generateScript ( )

◆ getButton()

◆ getCloseWindow()

◆ getData()

getData ( )

Obtains form fields in a FormData object.

Retorna
(Object) Form fields

Reimplementado em MForm.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ getField()

& getField ( $name)

◆ getFieldAttr()

getFieldAttr ( $name,
$attr,
$index = NULL )

Get a form field's attribute value

Reimplementado em MForm.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ getFieldList()

getFieldList ( )

Returns form fields list. This is a placeholder function to bu the form's field list. It is excpected, that the form returns a scalar list of all defined fields which carry a form field value. Thus, form elements of decorative purpose only should be omitted.

Derived classes such as TabbedForm override this function to provide the list of fields independently of the form's layout.

Retorna
(array) a scalar array of form fields

Reimplementado em MTabbedForm e MTabbedForm2.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ getFieldValidator()

◆ getFieldValue()

getFieldValue ( $name,
$value = false )

Obtains a form field's value

Reimplementado em MForm.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ getFormFields()

getFormFields ( )

Obtains a submitted form fields's values and sets the array fields Uses $page->request

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ getFormValue()

getFormValue ( $name,
$value = NULL )

Obtains a submitted form field's value. This is a static function.

Parâmetros
(string)$name
(string)$value
Retorna
(mixed) value of field contained in $HTTP_POST_VARS
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ getJsValidationEnabled()

getJsValidationEnabled ( )
Retorna
boolean Return whether the form must validate data via JavaScript.
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ getPage()

◆ getShowHints()

getShowHints ( )

Form's hints visibility. This function returns the visibility of the form's hint texts.

Veja também
ShowHints
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ hasAlerts()

hasAlerts ( )

Returns the number of alert messages

Retorna
(integer) Alert messages count
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ hasErrors()

hasErrors ( )

Returns the number of error messages or 0 if no errors exist

Retorna
(integer) Error count
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ hasInfos()

hasInfos ( )

Returns the number of info messages or 0, if no info exist

Retorna
(integer) Information messages count
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ isAjaxCall()

isAjaxCall ( )

Brief Description. Complete Description.

Retorna
(tipo) desc
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ isSubmitted()

isSubmitted ( )

Detects if a form has been submitted.

Retorna
(boolean) true if the form has been submitted otherwise false
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ onLoad()

onLoad ( )

Brief Description. Complete Description.

Retorna
(tipo) desc

Reimplementado em MStepByStepForm.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ onSubmit()

onSubmit ( $jscode)

Adds JavaScript code which is to be executed, when the form is submitted. When the form is generated, and any JS code has been registered using this function, an OnSubmit handler is dynamically generated where the code is placed.

The generated code looks like the following where stmt stands for the registered statments

Parâmetros
(string)$jscode Javascript code
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ registerMethod()

registerMethod ( )

Deprecated; only for compatibility with olf MFormAjax. Complete Description.

Retorna
(tipo) desc
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setAction()

setAction ( $action)

Sets the action URL for this form. This is the URL to which the form data will be submitted. Usually, the URL is obtained by the GetActionURL of the MIOLO class.

Parâmetros
(string)$action URL of the action
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setAjaxFields()

setAjaxFields ( $fields,
$responseControl )

Brief Description. Complete Description.

Parâmetros
$validators(tipo) desc
Retorna
(tipo) desc
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setAlternate()

setAlternate ( $color0,
$color1 )

Detects if a form has been submitted.

Retorna
(boolean) true if the form has been submitted otherwise false
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setButtonAttr()

setButtonAttr ( $name,
$attr,
$value )

Set a form field's attribute a value

Reimplementado em MForm.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setButtonLabel()

setButtonLabel ( $index,
$label )

Set the buttons labels. This function is mainly used, to change the labels of the form's default buttons for submit and return.

Parâmetros
(integer)$index The 0 based index of the button
(string)$label The new button label
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setButtons()

setButtons ( $buttons)

Sets the form buttons. This method adds buttons to the form, but first removes existing ones.

Veja também
addButton()
Parâmetros
(mixed)$buttons MButton object or array of MButtons
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setData()

◆ setFieldAttr()

setFieldAttr ( $name,
$attr,
$value )

Set a form field's attribute a value

Reimplementado em MForm.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setFieldReadOnly()

setFieldReadOnly ( $field,
$readOnly = true )

Set a field as read-only.

Parâmetros
object$fieldMControl instance.
boolean$readOnlyWhether is read-only.
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setFields()

setFields ( $fields)

This function is used to set an array of fields for the form.

Parâmetros
(array)$fields Fields array
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setFieldsReadOnly()

setFieldsReadOnly ( $readOnly = true)

Set all fields as read-only.

Parâmetros
boolean$readOnlyWhether is read-only.
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setFieldValidator()

setFieldValidator ( $name,
$value )

Set a form field's validator

Reimplementado em MForm.

Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setFieldValue()

setFieldValue ( $name,
$value )

◆ setFocus()

◆ setFormValue()

setFormValue ( $name,
$value )

Sets the content of a form field to the specified value. The function does this by setting both, the field's value member and the global $_POST to remain consistency between the values.

Parâmetros
(string)$name Field name
(string)$value Value to set to the field
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setJsValidationEnabled()

setJsValidationEnabled ( $jsValidationEnabled)
Parâmetros
boolean$jsValidationEnabledDefine whether the form must validate data via JavaScript.
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setLabelWidth()

setLabelWidth ( $width)

◆ setPage()

setPage ( $page)

◆ setResponse()

setResponse ( $controls,
$element = '',
$generateFormLayout = false )

◆ setShowHints()

setShowHints ( $state)

Set form's hints visibility. This function can be used to show or hide the form's hint texts. Each form element may have a hint text associated with it. Using this method, one can enable/disable the display of the texts. This may be useful for implementing kind of an beginner/expert mode.

Parâmetros
(boolean)$state The visible state of the hint texts
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setShowPostButton()

setShowPostButton ( $state)

Post button visibility. Use this method to set the visibility of the Post Button.

Parâmetros
(boolean)$state The visible state of the Post Button
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setShowResetButton()

setShowResetButton ( $state)

Reset button visibility. This function can be used to show or hide the form's reset button.

Parâmetros
(boolean)$state The visible state of the reset button
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setShowReturnButton()

setShowReturnButton ( $state)

Return button visibility. Use this function to set the visibility of the form's return button.

Parâmetros
(boolean)$state True to show, false to not show.
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ setValidators()

setValidators ( $validators)

Brief Description. Complete Description.

Parâmetros
$validators(tipo) desc
Retorna
(tipo) desc
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

◆ showHints()

◆ showReset()

◆ showReturn()

◆ submit_button()

◆ validate()

validate ( )

Validates the form input. Check if form data is valid according to validator components added to form.

Retorna
boolean Return whether data is valid.
Exemplos
/var/docker/solisge-devel/www/solisge/miolo26/classes/ui/controls/mbaseform.class.php.

Documentação dos campos e atributos

◆ $action

◆ $ajax

◆ $alerts

◆ $buttons

◆ $cp

◆ $cssButtons

◆ $cssForm

◆ $defaultButton

◆ $enctype

◆ $errors

◆ $fieldNum

◆ $fields

◆ $focus

◆ $infos

◆ $labelWidth

◆ $layout

◆ $method

◆ $reset

◆ $return

◆ $showHints

◆ $styles

◆ $validations

◆ $width

◆ $zebra


A documentação para esta classe foi gerada a partir do seguinte ficheiro: