Adds default element loading to standard form

package Gems
subpackage User
copyright Copyright (c) 2012 Erasmus MC
license New BSD License
since Class available since version 1.5
inherited_from \Gems_User_Form_OrganizationFormAbstract

 Methods

__construct()

__construct($options = null

Parameters

$options

Constructor

__construct(mixed $options = null) : void
Inherited

Registers form view helper as decorator

Parameters

$options

mixed

activateBootstrap()

activateBootstrap() 
Inherited

Activate JQuery for this form

activateJQuery() : \MUtil_Form
Inherited

Returns

\MUtil_Form(continuation pattern)

Add a new element

addElement(string|\Zend_Form_Element $element, string $name = null, array|\Zend_Config $options = null) : \Zend_Form
Inherited

$element may be either a string element type, or an object of type \Zend_Form_Element. If a string element type is provided, $name must be provided, and $options may be optionally provided for configuring the element.

If a \Zend_Form_Element is provided, $name may be optionally provided, and any provided $options will be ignored.

Parameters

$element

string\Zend_Form_Element

$name

string

$options

array\Zend_Config

Exceptions

\Zend_Form_Exception on invalid element

Returns

\Zend_Form(continuation pattern)

Called after the check that all required registry values have been set correctly has run.

afterRegistry() : void
Inherited

Get the autosubmit arguments (if any)

getAutoSubmit() : array
Inherited

Returns

arrayor null

Returns the organization id that should currently be used for this form.

getCurrentOrganizationId() : integer
Inherited

Returns

integerReturns the current organization id, if any

When true all elements are loaded after initiation.

getLoadDefault($loadDefault = true) : boolean
Inherited

Parameters

$loadDefault

Returns

boolean$loadDefault

Returns a list with the organizations the user can select for login.

getLoginOrganizations() : array
Inherited

Returns

arrayorgId => Name

Returns/sets a link to the reset password page

getLostPasswordElement() : \MUtil_Form_Element_Html

Returns

\MUtil_Form_Element_Html

Returns/sets an element for determining / selecting the organization.

getOrganizationElement() : \Zend_Form_Element_Xhtml
Inherited

Returns

\Zend_Form_Element_Xhtml

Returns true when the organization element is visible to the user.

getOrganizationIsVisible() : boolean
Inherited

Returns

boolean

Returns/sets a password element.

getPasswordElement() : \Zend_Form_Element_Password

Returns

\Zend_Form_Element_Password

Return the Request object

getRequest() : \Zend_Controller_Request_Abstract
Inherited

Returns

\Zend_Controller_Request_Abstract

Returns/sets a submit button.

getSubmitButton() : \Zend_Form_Element_Submit
Inherited

Returns

\Zend_Form_Element_Submit

Returns the label for the submitbutton

getSubmitButtonLabel() : string

Returns

string

Returns the label for the submitbutton

getSubmitButtonLabel() : string
Inherited

Returns

string

Returns/sets a link for the token input page.

getTokenElement() : \MUtil_Form_Element_Html

Returns

\MUtil_Form_Element_Html

Returns a user

getUser() : \Gems_User_User
Inherited
inherited_from \Gems_User_Validate_GetUserInterface::getUser()

Returns

\Gems_User_User

Returns/sets a login name element.

getUserNameElement() : \Zend_Form_Element_Text
Inherited

Returns

\Zend_Form_Element_Text

Is this a form that autosubmits?

isAutoSubmit() : boolean
Inherited

Returns

boolean

Validate the form

isValid(array $data, boolean $disableTranslateValidators = null) : boolean
Inherited

As it is better for translation utilities to set the labels etc. translated, the MUtil default is to disable translation.

However, this also disables the translation of validation messages, which we cannot set translated. The MUtil form is extended so it can make this switch.

Parameters

$data

array

$disableTranslateValidators

boolean

Extra switch

Returns

boolean

The function that determines the element load order

loadDefaultElements() : \Gems_User_Form_LoginForm

Returns

\Gems_User_Form_LoginForm(continuation pattern)

The function loads the elements for this form

loadDefaultElements() : \Gems_Form_AutoLoadFormAbstract
Inherited

Returns

\Gems_Form_AutoLoadFormAbstract(continuation pattern)

Change the form into an autosubmit form

setAutoSubmit(mixed $submitUrl, mixed $targetId, $selective = false
Inherited

Parameters

$submitUrl

mixed

Url as \MUtil_Html_UrlArrayAttribute, array or string

$targetId

mixed

Id of html element whose content is replaced by the submit result: \MUtil_Html_ElementInterface or string

$selective

When true all elements are loaded after initiation.

setLoadDefault(boolean $loadDefault = true) : \Gems_User_Form_LoginForm
Inherited

Enables loading of parameter through \Zend_Form::__construct()

Parameters

$loadDefault

boolean

Returns

\Gems_User_Form_LoginForm(continuation pattern)

For small numbers of organizations a multiline selectbox will be nice. This setting handles how many lines will display at once. Use 1 for the normal dropdown selectbox

setOrganizationMaxLines(integer $organizationMaxLines) : \Gems_User_Form_LoginForm
Inherited

Enables loading of parameter through \Zend_Form::__construct()

Parameters

$organizationMaxLines

integer

Returns

\Gems_User_Form_LoginForm(continuation pattern)

The behaviour for showing a lost password button

setShowPasswordLost(boolean $showPasswordLost = true) : \Gems_User_Form_LoginForm

Enables loading of parameter through \Zend_Form::__construct()

Parameters

$showPasswordLost

boolean

Returns

\Gems_User_Form_LoginForm(continuation pattern)

The default behaviour for showing an 'ask token' button

setShowToken(boolean $showToken = true) : \Gems_User_Form_LoginForm

Enables loading of parameter through \Zend_Form::__construct()

Parameters

$showToken

boolean

Returns

\Gems_User_Form_LoginForm(continuation pattern)

True when this form was submitted.

wasSubmitted() : boolean
Inherited

Returns

boolean

_activateJQueryView()

_activateJQueryView(\Zend_View_Interface $view = null
Inherited

Parameters

$view

Change all elements into an autosubmit element

_enableAutoSubmitElement(mixed $element) 
Inherited

Call only when $_autoSubmit is set

Parameters

$element

mixed

 Properties

 

The field name for the organization element.

$organizationFieldName : string

Default

'organization'
 

The field name for the password element.

$passwordFieldName : string

Default

'password'
 

The field name for the username element.

$usernameFieldName : string

Default

'userlogin'
 

If set this holds the url and targetid for the autosubmit

$_autosubmit : array

Default

null
 

The field name for the lost password element.

$_lostPasswordFieldName : string

Default

'lost_password'
 

When true the organization was derived from the the url

$_organizationFromUrl : boolean

Default

false
 

The field name for the submit element.

$_submitFieldName : string

Default

'button'
 

The field name for the token element.

$_tokenFieldName : string

Default

'token_link'
 

$_user

$_user : \Gems_User_User

Default

 

When true all elements are loaded after initiation.

$loadDefault : boolean

Default

true
 

$loader

$loader : \Gems_Loader

Default

 

For small numbers of organizations a multiline selectbox will be nice. This setting handles how many lines will display at once. Use 1 for the normal dropdown selectbox

$organizationMaxLines : integer

Default

6
 

$request

$request : \Zend_Controller_Request_Abstract

Default

 

The default behaviour for showing a lost password button

$showPasswordLost : boolean

Default

true
 

The default behaviour for showing an 'ask token' button

$showToken : boolean

Default

true
 

$translate

$translate : \Zend_Translate

Default

 

$util

$util : \Zend_Util

Default