Element Class Reference

Inheritance diagram for Element:
ActivitySummaryElement AddressElement ArchivedEmailMatchingElement AttributeTypeElement AvatarTypeAndEmailElement BackgroundTextureElement BorderPositionElement ByTimeWorkflowInQueueSummaryElement CalculatedNumberElement CampaignItemStageFilterRadioElement CheckBoxElement CloseTaskCheckBoxElement CollectionElement CommentsElement ConversationLatestElement ConversationOpenCloseElement CustomColorElement CustomThemeColorArrayElement DateElement DateTimeElement DateTimeUserElement DerivedUserStatusElement DesktopNotificationElement DropDownDependencyElement DropDownElement DurationElement EditableDropDownCollectionElement EmailAddressInformationElement EmailMessageAllRecipientTypesElement EmailMessageBccRecipientsElement EmailMessageCcRecipientsElement EmailMessageContentElement EmailMessageSenderElement EmailMessageToRecipientsElement EmailSignatureElement EmailTemplateBuiltTypeElement EmailTemplateHtmlAndTextContentElement ExplicitReadWriteModelPermissionsElement FancyDividerStyleRadioElement FilterByRadioElement FullNameElement ImportFileUploadElement ImportResultsFilterRadioElement ImportRulesTypeRadioDropDownElement JobLogStatusElement JobLogTypeElement KanbanBoardOptionsElement LabelElement LatestActivitiesMashableFilterRadioElement LatestActivitiesOwnedByFilterRadioElement LatestActivitiesRollUpFilterRadioElement LeaderboardPointsElement LeaderboardRankElement LeaderboardUserElement LeadsConvertToAccountRadioElement ListAttributesSelectionElement MarketingListMemberSelectRadioElement MarketingListsSubscriptionTypeFilterRadioElement MarketingMetricsGroupByRadioElement MashableInboxOptionsByModelRadioElement MashableInboxStatusRadioElement MashableInboxSummaryElement MeetingDaySummaryElement MenuItemsSelectionElement MissionLatestElement MissionsListTypeFilterRadioElement MissionStatusElement MixedAttributeTypesForWorkflowActionAttributeElement MixedChartRangeAndSeriesElement MixedDateTypesElement MixedNumberTypesElement ModelElement ModelsElement ModuleForWizardModelRadioDropDownElement ModuleGlobalSearchAttributesElement MultiSelectRelatedModelsAutoCompleteElement NullElement PolicyIntegerAndStaticDropDownElement PolicyPasswordExpiryElement ProductStageFilterRadioElement ReadOnlyElement RedactorElement SelectBaseTemplateElement SelectContactOrReportElement SellPriceFormulaInformationElement SendATestEmailToElement SettingsLogoFileUploadElement SocialItemAndCommentsElement SortableContactWebFormAttributesElement SuperAdministratorToUseElement TaskCheckListItemsListElement TestImapConnectionElement TestLdapConnectionElement TextAreaElement TextElement ThemeColorElement TitleFullNameElement UniqueIdentifierElement UpdateAccountLatestActivityDateTimeElement UpdateContactLatestActivityDateTimeElement WorkflowMessageInQueueSummaryElement

Public Member Functions

 __construct ($model, $attribute, $form=null, array $params=array())
 render ()
 getEditableNameIds ()
 getAttribute ()
 renderAsControlNonEditable ()

Static Public Member Functions

static getDisplayName ()
static isReadOnly ()
static resolveInputNameForEditableInput ($attributeName)
static resolveInputNamePrefixIntoString ($inputNamePrefix)
static resolveInputIdPrefixIntoString ($inputIdPrefix)

Data Fields

 $params
 $editableTemplate = '<th>{label}</th><td colspan="{colspan}">{content}{error}</td>'
 $nonEditableTemplate = '<th>{label}</th><td colspan="{colspan}">{content}</td>'

Protected Member Functions

 renderLabel ()
 resolveIdForLabel ()
 getFormattedAttributeLabel ()
 resolveNonActiveFormFormattedLabel ($label)
 renderError ()
 renderScopedErrorId ($inputNameIdPrefix, $attribute)
 renderEditable ()
 renderNonEditable ()
 renderControlEditable ()
 renderControlNonEditable ()
 getColumnSpan ()
 getDisabledValue ()
 getHtmlOptions ()
 resolveContentTemplate ($template, $data)
 getEditableInputId ($attributeName=null, $relationAttributeName=null)
 getEditableInputName ($attributeName=null, $relationAttributeName=null)
 resolveInputPrefix ()
 resolveInputIdPrefix ()
 resolveInputNamePrefix ()
 getListViewGridId ()

Protected Attributes

 $model
 $attribute
 $form

Detailed Description

Abstraction of the various view elements. Examples include Text fields, checkboxes, and date fields.

Element can render an editable or non-editable version and will populate information based on the provided attribute and model.

Definition at line 44 of file Element.php.


Constructor & Destructor Documentation

__construct ( model,
attribute,
form = null,
array $  params = array() 
)

Constructs the element specifying the model and attribute. In the case of needing to show editable information, a form is also provided.

Parameters:
$form Optional. If supplied an editable element will be rendered.
$params Can have additional parameters for use. 'wide' true or false is an example parameter

Reimplemented in CommentsElement, ContactStateDropDownElement, ImportMappingRuleContactStatesDropDownElement, AttributeLabelElement, PluralModuleLabelElement, SingularModuleLabelElement, EmailMessageAllRecipientTypesElement, ImportMappingRuleDefaultModelNameIdElement, ImportMappingModelIdValueTypeDropDownElement, ImportMappingRelatedModelValueTypeDropDownElement, ImportMappingRuleDateFormatDropDownElement, ImportMappingRuleDateTimeFormatDropDownElement, ImportMappingRuleDefaultDropDownFormElement, ImportMappingRuleDefaultMultiSelectDropDownFormElement, ImportMappingUserValueTypeDropDownElement, MemcacheTextElement, ImportMappingRulePriceFrequencyDropDownElement, ImportMappingRuleProductTemplateStatusDropDownElement, ImportMappingRuleProductTemplateTypeDropDownElement, ImportMappingRuleSellPriceFormulaTypeDropDownElement, ImportMappingRuleProjectStatusDropDownElement, ChartTypeRadioStaticDropDownForReportElement, MixedDateTypesForReportElement, StaticDropDownForReportElement, ImportMappingRuleTaskStatusDropDownElement, ImportMappingRuleCurrencyStaticDropDownElement, ImportMappingRuleLanguageStaticDropDownElement, ImportMappingRuleLocaleStaticDropDownElement, ImportMappingRuleTimeZoneStaticDropDownElement, ImportMappingRuleUserStatusDropDownElement, MixedDateTypesForWorkflowElement, MultiSelectStaticDropDownForWorkflowElement, StaticDropDownForWorkflowElement, and ThemeColorConfigurationElement.

Definition at line 66 of file Element.php.


Member Function Documentation

render (  ) 

Generates the element content.

Returns:
A string containing the element's content.

Reimplemented in NoCellNullElement.

Definition at line 80 of file Element.php.

renderLabel (  )  [protected]

Generate the element label content

Returns:
A string containing the element's label

Reimplemented in AnyMixedAttributesSearchElement, DateTimeCreatedUserElement, DateTimeModifiedUserElement, DropDownDependencyElement, DurationElement, FullNameElement, MultiSelectRelatedModelsAutoCompleteElement, NameIdElement, TitleFullNameElement, UniqueIdentifierElement, KanbanBoardOptionsElement, ListAttributesSelectionElement, MenuItemsSelectionElement, MixedDateTypesElement, MixedNumberTypesElement, ModelElement, NullElement, RadioDropDownElement, ReadOnlyElement, RelatedAttributeArrayDropDownElement, RelatedItemsElement, UpdateAccountLatestActivityDateTimeElement, ActivitySummaryElement, LatestActivitiesMashableFilterRadioElement, LatestActivitiesOwnedByFilterRadioElement, LatestActivitiesRollUpFilterRadioElement, EnableTrackingCheckBoxElement, CampaignItemStageFilterRadioElement, SupportsRichTextCheckBoxElement, CommentsElement, AnyContactNameIdElement, UpdateContactLatestActivityDateTimeElement, DerivedExplicitReadWritePermissionsContactWebFormElement, SortableContactWebFormAttributesElement, ConversationLatestElement, ConversationOpenCloseElement, AttributeTypeElement, AttributeLabelElement, LabelElement, ModuleGlobalSearchAttributesElement, EmailMessageAllRecipientTypesElement, EmailMessageBccRecipientsElement, EmailMessageCcRecipientsElement, EmailMessageToRecipientsElement, OutgoingEmailMessageRecipientBaseElement, EmailAddressInformationElement, EmailMessageContentElement, EmailMessageSenderElement, EmailTemplateHtmlAndTextContentElement, EmailTemplateElement, EmailTemplateModelClassNameElement, FilterByRadioElement, ImportFileUploadElement, ImportResultsFilterRadioElement, ImportRulesTypeRadioDropDownElement, AllStatesContactElement, LeadElement, LeadsConvertToAccountRadioElement, MarketingMetricsGroupByRadioElement, MarketingListMemberSelectRadioElement, MarketingListsSubscriptionTypeFilterRadioElement, MashableInboxSummaryElement, MashableInboxSearchElement, MeetingDaySummaryElement, MissionStatusElement, MissionLatestElement, MissionsListTypeFilterRadioElement, ProductStageFilterRadioElement, ParentProductCategoryElement, SellPriceFormulaTypeDropDownElement, SocialItemAndCommentsElement, CloseTaskCheckBoxElement, TaskCheckListItemsListElement, DerivedExplicitReadWritePermissionsUserConfigElement, DerivedUserStatusElement, PolicyEffectivePasswordExpiryElement, PolicyPasswordExpiryElement, DesktopNotificationElement, HideFromSelectingElement, OutboundSettingsCheckBoxElement, CurrencyValueAndCurrencyIdForWorkflowActionAttributeElement, ByTimeWorkflowInQueueSummaryElement, WorkflowMessageInQueueSummaryElement, MixedAttributeTypesForWorkflowActionAttributeElement, AddressElement, AuditEventElement, BaseDomainElement, CurrencyValueElement, CustomThemeColorArrayElement, CalculatedNumberElement, DerivedExplicitReadWriteModelPermissionsElement, FilesElement, ModuleForWizardModelRadioDropDownElement, ExplicitReadWriteModelPermissionsElement, PolicyIntegerAndStaticDropDownElement, and SettingsLogoFileUploadElement.

Definition at line 94 of file Element.php.

renderError (  )  [protected]

Generate the error content. Used by editable content

Returns:
error content

Reimplemented in DropDownDependencyElement, DurationElement, MultiSelectRelatedModelsAutoCompleteElement, NameIdElement, TitleFullNameElement, DropDownElement, MixedDateTypesElement, MixedNumberTypesElement, MultiSelectDropDownElement, RelatedAttributeArrayDropDownElement, RelatedItemsElement, StaticDropDownElement, UpdateAccountLatestActivityDateTimeElement, ContactStateDropDownElement, UpdateContactLatestActivityDateTimeElement, SortableContactWebFormAttributesElement, LabelElement, EmailMessageAllRecipientTypesElement, EmailMessageBccRecipientsElement, EmailMessageCcRecipientsElement, EmailMessageToRecipientsElement, OutgoingEmailMessageRecipientBaseElement, EmailAddressInformationElement, EmailMessageSenderElement, SendATestEmailToElement, TestImapConnectionElement, EmailTemplateHtmlAndTextContentElement, EmailTemplateElement, ImportFileUploadElement, SellPriceFormulaInformationElement, MixedChartRangeAndSeriesElement, TaskModalUserElement, TaskStatusDropDownElement, DerivedUserStatusElement, PolicyPasswordExpiryElement, SuperAdministratorToUseElement, CurrencyValueAndCurrencyIdForWorkflowActionAttributeElement, MixedAttributeTypesForWorkflowActionAttributeElement, AddressElement, CurrencyDropDownElement, CurrencyDropDownFormElement, CurrencyIdForAModelsRelatedCurrencyValueDropDownElement, CurrencyValueElement, CalculatedNumberElement, FilesElement, ExplicitReadWriteModelPermissionsElement, SettingsLogoFileUploadElement, and TestLdapConnectionElement.

Definition at line 139 of file Element.php.

renderScopedErrorId ( inputNameIdPrefix,
attribute 
) [protected]

For related models such as Email, Address, and CurrencyValue, a scoped error id is required. This is because we treat those related attributes effectively on the base model for showing validation errors.

Parameters:
string $inputNameIdPrefix
string $attribute
Returns:
string

Definition at line 152 of file Element.php.

renderNonEditable (  )  [protected]

Generate non-editable version of the element includes label and control elements

Returns:
A string containing the element's content.

Reimplemented in DropDownDependencyElement, ProjectForTaskElement, and CalculatedNumberElement.

Definition at line 179 of file Element.php.

getColumnSpan (  )  [protected]

Determines correct column span based on params 'wide' value

Definition at line 195 of file Element.php.

getEditableNameIds (  ) 

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

Reimplemented in DropDownElement, and ModelElement.

Definition at line 229 of file Element.php.

resolveContentTemplate ( template,
data 
) [protected]

Resolves the editable or non-editable template with data.

Returns:
string. resolved $template

Definition at line 253 of file Element.php.

getEditableInputId ( attributeName = null,
relationAttributeName = null 
) [protected]

An input Id is typically formed like: modelClassName_attributeName or modelClassName_attributeName_relationAttributeName. This method resolves the input Id string.

Parameters:
string $attributeName
string $relationAttributeName
Returns:
string representing the content of the input id.

Reimplemented in MultiSelectRelatedModelsAutoCompleteElement, and TagCloudElement.

Definition at line 277 of file Element.php.

getEditableInputName ( attributeName = null,
relationAttributeName = null 
) [protected]

An input name is typically formed like: modelClassName[attributeName] or modelClassName[attributeName][relationAttributeName]. This method resolves the input name string. Also handles scenarios where attributeName has something like abc[def]. This method will properly account for that.

Parameters:
string $attributeName
string $relationAttributeName
Returns:
string representing the content of the input name.

Reimplemented in MultiSelectRelatedModelsAutoCompleteElement, and TagCloudElement.

Definition at line 303 of file Element.php.

static resolveInputNameForEditableInput ( attributeName  )  [static]
See also:
$this->getEditableInputName()
Parameters:
string $attributeName

Definition at line 325 of file Element.php.

resolveInputPrefix (  )  [protected]

An input Id or name is typically constructed like: modelClassName[attributeName]. The 'modelClassName' is considered the prefix of the input. Any inputPrefix specified in the parameters coming into the element will be used, otherwise the model class name will be utilized.

Returns:
string representing the content of the input prefix.

Definition at line 340 of file Element.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sun Nov 19 07:10:24 2017