ModelElement Class Reference

Inheritance diagram for ModelElement:
Element ElementActionTypeInterface AccountElement AuditEventElement ContactElement EmailTemplateElement GroupElement MarketingListElement NameIdElement OpportunityElement ProductCategoryElement ProductElement ProductTemplateElement ProjectElement ProjectForTaskElement ReadOnlyModelElement RoleElement UserElement

Public Member Functions

 doNotHideSelectLinkWhenDisabled ()
 setIdAttributeId ($idAttributeId)
 getEditableNameIds ()

Static Public Member Functions

static getModuleId ()
static getEditableActionType ()
static getNonEditableActionType ()

Data Fields

const MODAL_CONTAINER_PREFIX = 'modalContainer'

Protected Member Functions

 renderControlEditable ()
 renderEditableContent ()
 getIdInputHtmlOptions ()
 renderTextField ($idInputName)
 getAutoCompleteUrlParams ()
 getAutoCompleteControllerId ()
 renderSelectLink ()
 getSelectLinkUrlParams ()
 resolveAjaxOptionsForSelectingModel ($formId)
 getModalTitleForSelectingModel ()
 getModalContainerId ()
 getSelectLinkControllerId ()
 renderControlNonEditable ()
 makeNonEditableLink ()
 makeNonEditableLinkUrl ()
 renderLabel ()
 getIdForHiddenField ()
 getNameForHiddenField ()
 getIdForTextField ()
 getNameForTextField ()
 getIdForSelectLink ()
 getName ()
 getId ()
 getResolvedModel ()
 getModalTransferInformation ()
 resolveSourceModelIdForModalTransferInformation ()
 getSelectLinkStartingStyle ()
 showLinkOnNonEditable ()
 showOnlyHiddenInputForEditable ()
 resolveModuleId ()
 registerScriptForAutoCompleteTextField ()
 getOnSelectOptionForAutoComplete ($idInputName)
 renderExtraHtmlContent ()

Protected Attributes

 $controllerId = 'default'
 $idAttributeId = 'id'
 $hideSelectLinkWhenDisabled = true

Static Protected Attributes

static $moduleId
static $autoCompleteActionId = 'autoComplete'
static $modalActionId = 'modalList'
static $editableActionType = 'ModalList'
static $nonEditableActionType = 'Details'

Detailed Description

Display the model selection. This is a combination of a type-ahead input text field and a selection button which renders a modal list view to search on whichever model element extends this class. Also includes a hidden input for the model id.

Definition at line 44 of file ModelElement.php.


Member Function Documentation

renderEditableContent (  )  [protected]

Render a hidden input, a text input with an auto-complete event, and a select button. These three items together form the Model Editable Element

Returns:
The element's content as a string.

Definition at line 111 of file ModelElement.php.

renderTextField ( idInputName  )  [protected]

Render a auto-complete text input field. When the field is typed in, it will trigger ajax call to look up against the Model's name

Returns:
The element's content as a string.

Reimplemented in ParentProductCategoryElement, ParentGroupElement, and ParentRoleElement.

Definition at line 149 of file ModelElement.php.

renderSelectLink (  )  [protected]

Render a select link. This link calls a modal popup.

Returns:
The element's content as a string.

Definition at line 215 of file ModelElement.php.

renderControlNonEditable (  )  [protected]

Renders the attribute from the model.

Returns:
The element's content.

Reimplemented from Element.

Reimplemented in NameIdElement, ReadOnlyModelElement, AccountAccountAffiliationOppositeModelElement, and AuditEventElement.

Definition at line 267 of file ModelElement.php.

renderLabel (  )  [protected]

Override to support the module labels for the models.

Reimplemented from Element.

Reimplemented in NameIdElement, AnyContactNameIdElement, EmailTemplateElement, AllStatesContactElement, LeadElement, ParentProductCategoryElement, and AuditEventElement.

Definition at line 298 of file ModelElement.php.

getEditableNameIds (  ) 

Get the collection of id/names of inputs and other parts of the element.

Reimplemented from Element.

Definition at line 337 of file ModelElement.php.

getName (  )  [protected]
Returns:
stringified name if it exists or empty string to avoid (unnamed) being shown.

Reimplemented in NameIdElement, and EmailTemplateElement.

Definition at line 350 of file ModelElement.php.

getId (  )  [protected]
Returns:
id if a real model, otherwise an empty string to ensure the
See also:
ZurmoHtml::activeInputField works properly when resolving the id.

Reimplemented in NameIdElement, and EmailTemplateElement.

Definition at line 363 of file ModelElement.php.

getResolvedModel (  )  [protected]

In the case of attributes that are related, the attribute is returned, because that is a related model.

Reimplemented in NameIdElement.

Definition at line 376 of file ModelElement.php.

getModalTransferInformation (  )  [protected]
Returns:
array

Definition at line 384 of file ModelElement.php.

showLinkOnNonEditable (  )  [protected]

Determines if a link should be shown

Definition at line 413 of file ModelElement.php.

showOnlyHiddenInputForEditable (  )  [protected]

Determines if the editable content should only include the hidden input. This is utilized if there is a security edge case that needs to be gracefully handled.

Definition at line 426 of file ModelElement.php.

resolveModuleId (  )  [protected]

Gets the moduleId statically. You can override this method and get the moduleId in a non-static way since this method is called non-statically.

Reimplemented in ImportMappingRuleDefaultModelNameIdElement, and ImportMappingRuleRoleModelNameIdElement.

Definition at line 439 of file ModelElement.php.

static getEditableActionType (  )  [static]

Gets the action type for the related model's action that is called by the select button or the autocomplete feature in the Editable render.

Implements ElementActionTypeInterface.

Definition at line 454 of file ModelElement.php.

static getNonEditableActionType (  )  [static]

Gets the action type for the related model's action that is called by the link in the nonEditable render.

Implements ElementActionTypeInterface.

Definition at line 463 of file ModelElement.php.

registerScriptForAutoCompleteTextField (  )  [protected]

Registers scripts for autocomplete text field

Reimplemented in ProductTemplateElement.

Definition at line 471 of file ModelElement.php.

getOnSelectOptionForAutoComplete ( idInputName  )  [protected]

Gets on select option for the automcomplete text field

Parameters:
string $idInputName
Returns:
string

Reimplemented in ProductTemplateElement.

Definition at line 494 of file ModelElement.php.

renderExtraHtmlContent (  )  [protected]

Renders extra html content

Returns:
null

Reimplemented in AccountSelectOrCreateElement.

Definition at line 503 of file ModelElement.php.


Field Documentation

$controllerId = 'default' [protected]

Override in child element with a custom controllerId if needed

Reimplemented in ProductCategoryElement, ImportMappingRuleRoleModelNameIdElement, GroupElement, and RoleElement.

Definition at line 57 of file ModelElement.php.

$idAttributeId = 'id' [protected]
$autoCompleteActionId = 'autoComplete' [static, protected]

The auto complete search action id

Reimplemented in AnyContactNameIdElement, and AllStatesContactElement.

Definition at line 67 of file ModelElement.php.

$modalActionId = 'modalList' [static, protected]

The modal popup's action id

Reimplemented in AnyContactNameIdElement, AllStatesContactElement, ParentProductCategoryElement, and ParentRoleElement.

Definition at line 72 of file ModelElement.php.

$editableActionType = 'ModalList' [static, protected]

The action type of the related model for which the autocomplete/select popup are calling.

Reimplemented in UserElement.

Definition at line 78 of file ModelElement.php.

$nonEditableActionType = 'Details' [static, protected]

The action type of the related model for which the details link is calling.

Definition at line 84 of file ModelElement.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Mar 29 07:10:28 2017