All Data Structures Functions Variables Pages
Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Static Protected Member Functions | Protected Attributes
BaseBuilderElement Class Reference
Inheritance diagram for BaseBuilderElement:
BaseBuilderTableWrappedElement BuilderImageElement BuilderTextElement BuilderButtonElement BuilderButtonWrapperElement BuilderContainerElement BuilderDividerElement BuilderExpanderElement BuilderSocialElement BuilderFooterElement BuilderPlainTextElement

Public Member Functions

 __construct ($renderForCanvas=false, $id=null, $properties=null, $content=null, $params=null)
 
 renderNonEditable ()
 
 renderEditable ()
 
 getId ()
 
 getContent ($serialized=false)
 
 getProperties ($serialized=false)
 
 getRenderForCanvas ()
 
 getParams ()
 
 validate ($attribute, $value)
 

Static Public Member Functions

static isUIAccessible ()
 
static resolveDroppableWidget ($widgetWrapper= 'li')
 
static isContainerType ()
 
static getModelClassName ()
 
static getPropertiesSuffixMappedArray ()
 

Data Fields

const OVERLAY_ACTION_MOVE = 'action-move'
 
const OVERLAY_ACTION_EDIT = 'action-edit'
 
const OVERLAY_ACTION_DELETE = 'action-delete'
 
const OVERLAY_ACTIONS_CONTAINER_CLASS = 'builder-element-toolbar'
 
const BUILDER_ELEMENT_CELL_DROPPABLE_CLASS = 'builder-element-cell-droppable'
 
const BUILDER_ELEMENT_SORTABLE_ELEMENTS_CLASS = 'sortable-elements'
 
const BUILDER_ELEMENT_SORTABLE_ROWS_CLASS = 'sortable-rows'
 

Protected Member Functions

 doesNotSupportEditable ()
 
 registerNonEditableSnippets ()
 
 registerNonEditableScripts ()
 
 registerNonEditableCss ()
 
 renderControlContentNonEditable ()
 
 renderControlWrapperNonEditable ($elementContent= '{{dummyContent}}')
 
 resolveWrapperNonEditable ($elementContent, array $customDataAttributes, $actionsOverlay)
 
 wrapNonEditableElementContent ($content)
 
 resolveNonEditableElementWrapperHtmlOptions ()
 
 resolveWrapperNonEditableByContentAndProperties ($content, array $customDataAttributes)
 
 resolveFrontendPropertiesNonEditable ()
 
 resolveInlineStylePropertiesNonEditable (array &$mergedProperties)
 
 resolveInlineStylesForNonEditable (array &$mergedProperties)
 
 resolveInlineStylesFromBackendPropertiesNonEditable (array &$mergedProperties)
 
 resolveInlineStylesForBorderDirectionNegationFromBackendPropertiesNonEditable (array &$mergedProperties)
 
 stringifyProperties (array $properties, $keyPrefix=null, $keySuffix=null, $valuePrefix=null, $valueSuffix=null)
 
 stringifyArray (array $array, $keyPrefix=null, $keySuffix=null, $valuePrefix=null, $valueSuffix=null)
 
 resolveCustomDataAttributesNonEditable ()
 
 resolveNonEditableActions ()
 
 resolveNonEditableActionsHtmlOptions ()
 
 resolveAvailableNonEditableActionLinkContent ()
 
 resolveAvailableNonEditableActionLinkSpan ($action)
 
 resolveAvailableNonEditableActionsArray ()
 
 resolveNonEditableWrapperHtmlOptions ()
 
 resolveNonEditableWrapperOptions (array $customDataAttributes)
 
 renderFormContent ()
 
 renderModalContainer ($form)
 
 renderFormInputsContent (ZurmoActiveForm $form)
 
 renderContentTab (ZurmoActiveForm $form)
 
 wrapEditableContentFormContentInTable ($content)
 
 resolveFormTitle ()
 
 resolveFormatterFormTitle ()
 
 resolveActiveFormClassName ()
 
 resolveActiveFormOptions ()
 
 resolveFormId ()
 
 resolveFormActionUrl ()
 
 renderHiddenFields (ZurmoActiveForm $form)
 
 renderHiddenField ($attributeName, $value)
 
 renderWrappedContentAndSettingsTab ($contentTab, $settingsTab)
 
 renderContentTabLabel ()
 
 renderSettingsTabLabel ()
 
 registerTabbedContentScripts ()
 
 renderFormActionLinks ()
 
 renderBackLink ()
 
 resolveBackLinkHtmlOptions ()
 
 resolveBackLinkId ()
 
 renderBackLinkLabel ()
 
 renderApplyLink ()
 
 resolveApplyLinkHtmlOptions ()
 
 resolveApplyLinkId ()
 
 renderApplyLinkLabel ()
 
 registerActiveFormScripts ()
 
 registerApplyClickScript ()
 
 getAjaxScriptForInitSortableElements ()
 
 registerBackScript ()
 
 registerHideFormScript ()
 
 resolveEnableAjaxValidation ()
 
 resolveFormClientOptions ()
 
 renderConfigSaveAjax ()
 
 resolveAjaxPostForApplyClickAjaxOptions ()
 
 resolveFormHtmlOptions ()
 
 resolveActiveFormCustomOptions ()
 
 renderBeforeFormLayout (ZurmoActiveForm $form)
 
 renderAfterFormLayout (ZurmoActiveForm $form)
 
 generateId ()
 
 resolveDefaultProperties ()
 
 resolveDefaultParams ()
 
 initId ($id=null)
 
 initProperties ($properties=null)
 
 cleanUpProperties ()
 
 initContent ($content=null)
 
 initParams ($params=null)
 
 initModel ()
 
 getModel ()
 
 renderContentElement (ZurmoActiveForm $form=null)
 
 resolveContentElementEditableTemplate (Element $element)
 
 resolveContentElementNonEditableTemplate (Element $element)
 
 resolveContentElementParams ()
 
 resolveDefaultElementParamsForEditableForm ($label= '')
 
 resolveDefaultContent ()
 
 renderSettingsTab (ZurmoActiveForm $form)
 
 resolveContentElementClassName ()
 
 resolveContentElementAttributeName ()
 
 getRules ()
 
 validateInteger ($value)
 
 validateUrl ($value)
 
 sanitizeProperties (array &$properties)
 

Static Protected Member Functions

static resolveLabel ()
 
static resolveThumbnailName ()
 
static resolveThumbnailHtmlOptions ()
 
static resolveWidgetHtmlOptions ()
 
static resolveWidgetClassesForHtmlOptions ()
 

Protected Attributes

 $id
 
 $properties
 
 $content
 
 $params
 
 $model
 
 $renderForCanvas = false
 

Detailed Description

Definition at line 37 of file BaseBuilderElement.php.

Constructor & Destructor Documentation

__construct (   $renderForCanvas = false,
  $id = null,
  $properties = null,
  $content = null,
  $params = null 
)
Parameters
bool$renderForCanvaswhether element is being rendered for canvas or not.
null$idthe html dom id.
null$propertiesproperties for this element, inlineStyles, and such.
null$contentcontent for this element.
null$params

Definition at line 203 of file BaseBuilderElement.php.

Member Function Documentation

static isUIAccessible ( )
static
Returns
bool If this element should be shown on the drag-n-drop sidebar.

Definition at line 110 of file BaseBuilderElement.php.

static resolveDroppableWidget (   $widgetWrapper = 'li')
staticfinal

Generate the widget html definition to be put on the left sidebar of drag-n-drop elements.

Parameters
string$widgetWrapperthe html wrapper tag to use for widget html. Defaults to li.
Returns
string

Definition at line 120 of file BaseBuilderElement.php.

static isContainerType ( )
static

Return true for container type elements

Returns
bool

Definition at line 133 of file BaseBuilderElement.php.

static getModelClassName ( )
staticfinal

Return the name of model to use with the form in editable representation

Returns
string

Definition at line 142 of file BaseBuilderElement.php.

static resolveLabel ( )
staticprotected

Return translated label for current Element.

Exceptions
NotImplementedException

Definition at line 151 of file BaseBuilderElement.php.

static resolveThumbnailName ( )
staticprotected

Returns the element thumbnail name.

Returns
string

Definition at line 160 of file BaseBuilderElement.php.

static resolveThumbnailHtmlOptions ( )
staticprotected

Returns html options to be applied to element thumbnail

Returns
array

Definition at line 172 of file BaseBuilderElement.php.

static resolveWidgetHtmlOptions ( )
staticprotected

Returns html options to be applied to element's widget html.

Returns
array

Definition at line 181 of file BaseBuilderElement.php.

renderNonEditable ( )
final

Render current element as nonEditable with all the bells and whistles

Returns
string

Definition at line 218 of file BaseBuilderElement.php.

renderEditable ( )
final

Rending current element's editable representation

Returns
string

Definition at line 230 of file BaseBuilderElement.php.

doesNotSupportEditable ( )
protected

If this element should ever be rendered editable

Returns
bool

Definition at line 247 of file BaseBuilderElement.php.

registerNonEditableSnippets ( )
protected

Register snippets(javascript, css, etc) required for non-editable view of this element.

Definition at line 255 of file BaseBuilderElement.php.

registerNonEditableScripts ( )
protected

Register javascript snippets required for non-editable view of this element.

Definition at line 264 of file BaseBuilderElement.php.

registerNonEditableCss ( )
protected

Register css snippets required for non-editable view of this element.

Definition at line 271 of file BaseBuilderElement.php.

renderControlContentNonEditable ( )
protected

Returns the non-editable output for current element.

Returns
string

Definition at line 279 of file BaseBuilderElement.php.

renderControlWrapperNonEditable (   $elementContent = '{{dummyContent}}')
finalprotected

Render current element nonEditable with its wrapper including custom data attributes, properties and overlay actions.

Parameters
string$elementContent
Returns
string

Definition at line 290 of file BaseBuilderElement.php.

resolveWrapperNonEditable (   $elementContent,
array  $customDataAttributes,
  $actionsOverlay 
)
protected

Render the actual wrapper for nonEditable representation bundling provided information.

Parameters
$elementContent
array$customDataAttributes
$actionsOverlay
Returns
string

Definition at line 305 of file BaseBuilderElement.php.

wrapNonEditableElementContent (   $content)
protected

Wrap non-editable content of element into a wrapper

Parameters
$content
Returns
string

Definition at line 327 of file BaseBuilderElement.php.

resolveNonEditableElementWrapperHtmlOptions ( )
protected

Resolve and return html options of Element wrapper.

Returns
array

Definition at line 337 of file BaseBuilderElement.php.

resolveWrapperNonEditableByContentAndProperties (   $content,
array  $customDataAttributes 
)
protected

Resolve and return wrapper using provided content and html options for non-editable representation

Parameters
$content
array$customDataAttributes
Returns
string

Definition at line 348 of file BaseBuilderElement.php.

resolveFrontendPropertiesNonEditable ( )
protected

Resolve frontend properties for non-editable

Returns
array

Definition at line 359 of file BaseBuilderElement.php.

resolveInlineStylePropertiesNonEditable ( array &  $mergedProperties)
finalprotected

Resolve inline style properties to be applied to nonEditable representation's wrapper as inline style

Parameters
array$mergedProperties

Definition at line 377 of file BaseBuilderElement.php.

resolveInlineStylesForNonEditable ( array &  $mergedProperties)
protected
Parameters
array$mergedProperties
Returns
array|null

Definition at line 393 of file BaseBuilderElement.php.

resolveInlineStylesFromBackendPropertiesNonEditable ( array &  $mergedProperties)
protected

Resolve any inlineStyles we had to put in backend properties

Parameters
array$mergedProperties

Definition at line 402 of file BaseBuilderElement.php.

stringifyProperties ( array  $properties,
  $keyPrefix = null,
  $keySuffix = null,
  $valuePrefix = null,
  $valueSuffix = null 
)
finalprotected

Stringify properties by combing keys and values using a set of prefixes and suffices.

Parameters
array$properties
null$keyPrefix
null$keySuffix
null$valuePrefix
null$valueSuffix
Returns
null|string

Definition at line 429 of file BaseBuilderElement.php.

stringifyArray ( array  $array,
  $keyPrefix = null,
  $keySuffix = null,
  $valuePrefix = null,
  $valueSuffix = null 
)
finalprotected

Stringify an array by combining keys and value using a set of prefixes and suffices.

Parameters
array$array
null$keyPrefix
null$keySuffix
null$valuePrefix
null$valueSuffix
Returns
null|string

Definition at line 446 of file BaseBuilderElement.php.

resolveCustomDataAttributesNonEditable ( )
finalprotected

Resolve the custom data attributes for nonEditable representation wrapper.

Returns
null|string

Definition at line 461 of file BaseBuilderElement.php.

resolveNonEditableActions ( )
finalprotected

Resolve the nonEditable representation's overlay actions for wrapper.

Returns
null|string

Definition at line 482 of file BaseBuilderElement.php.

resolveNonEditableActionsHtmlOptions ( )
protected

Resolve html options for the nonEditable representation's overlay actions container.

Returns
array

Definition at line 497 of file BaseBuilderElement.php.

resolveAvailableNonEditableActionLinkContent ( )
finalprotected

Resolve the nonEditable representation's overlay action items combined together.

Returns
null|string

Definition at line 507 of file BaseBuilderElement.php.

resolveAvailableNonEditableActionsArray ( )
protected

Return the available overlay actions for nonEditable representation

Returns
array

Definition at line 529 of file BaseBuilderElement.php.

resolveNonEditableWrapperHtmlOptions ( )
protected

Resolve default html options for nonEditable representation's wrapper

Returns
array

Definition at line 538 of file BaseBuilderElement.php.

resolveNonEditableWrapperOptions ( array  $customDataAttributes)
protected

Resolve options for non editable wrapper

Parameters
array$customDataAttributes
Returns
array|mixed

Definition at line 548 of file BaseBuilderElement.php.

renderFormContent ( )
finalprotected

Render Editable representation's Form content.

Returns
string

Definition at line 560 of file BaseBuilderElement.php.

renderFormInputsContent ( ZurmoActiveForm  $form)
protected

Returns string containing all form input fields properly wrapped in containers.

Parameters
ZurmoActiveForm$form
Returns
string

Definition at line 592 of file BaseBuilderElement.php.

renderContentTab ( ZurmoActiveForm  $form)
protected

Rendering and return content for Content tab.

Parameters
ZurmoActiveForm$form
Returns
string

Definition at line 621 of file BaseBuilderElement.php.

wrapEditableContentFormContentInTable (   $content)
protected

Wrap content inside a table. Useful for wrapping form content on Content and Settings tab.

Parameters
$content
Returns
string

Definition at line 632 of file BaseBuilderElement.php.

resolveFormTitle ( )
protected

Resolve form title.

Definition at line 640 of file BaseBuilderElement.php.

resolveFormatterFormTitle ( )
protected

Resolve form title with some formatting.

Returns
string

Definition at line 649 of file BaseBuilderElement.php.

resolveActiveFormClassName ( )
protected

Resolve Class name for Active Form

Returns
string

Definition at line 660 of file BaseBuilderElement.php.

resolveActiveFormOptions ( )
finalprotected

Resolve Active form options array

Returns
array

Definition at line 669 of file BaseBuilderElement.php.

resolveFormId ( )
protected

Resolve form id

Returns
string

Definition at line 685 of file BaseBuilderElement.php.

resolveFormActionUrl ( )
protected

Resolve form action url. This url is also used by the ajax post.

Returns
mixed

Definition at line 695 of file BaseBuilderElement.php.

renderHiddenFields ( ZurmoActiveForm  $form)
protected

Render and return any special hidden fields.

Parameters
ZurmoActiveForm$form
Returns
string

Definition at line 705 of file BaseBuilderElement.php.

renderHiddenField (   $attributeName,
  $value 
)
finalprotected

Render and return a hiddenField.

Parameters
$attributeName
$value
Returns
string

Definition at line 719 of file BaseBuilderElement.php.

renderWrappedContentAndSettingsTab (   $contentTab,
  $settingsTab 
)
finalprotected

Wrap content and settings tab into a tab container and return output.

Parameters
$contentTab
$settingsTab
Returns
string

Definition at line 732 of file BaseBuilderElement.php.

renderContentTabLabel ( )
protected

Render Content Tab Label

Returns
string

Definition at line 759 of file BaseBuilderElement.php.

renderSettingsTabLabel ( )
protected

Render Settings Tab Label

Returns
string

Definition at line 768 of file BaseBuilderElement.php.

registerTabbedContentScripts ( )
protected

Register Javascript to handle tab switches

Definition at line 776 of file BaseBuilderElement.php.

renderFormActionLinks ( )
protected

Render form action buttons.

Returns
string

Definition at line 805 of file BaseBuilderElement.php.

renderBackLink ( )
protected

Render Back Action Link

Returns
string

Definition at line 818 of file BaseBuilderElement.php.

resolveBackLinkHtmlOptions ( )
protected

Resolve Back Link html options

Returns
array

Definition at line 830 of file BaseBuilderElement.php.

resolveBackLinkId ( )
protected

Resolve link id for back Link

Returns
string

Definition at line 839 of file BaseBuilderElement.php.

renderBackLinkLabel ( )
protected

Render Label for Back Link

Returns
string

Definition at line 848 of file BaseBuilderElement.php.

renderApplyLink ( )
protected

Render Apply Action Link

Returns
string

Definition at line 857 of file BaseBuilderElement.php.

resolveApplyLinkHtmlOptions ( )
protected

Resolve html options for Apply link

Returns
array

Definition at line 871 of file BaseBuilderElement.php.

resolveApplyLinkId ( )
protected

Resolve link id for apply link

Returns
string

Definition at line 880 of file BaseBuilderElement.php.

renderApplyLinkLabel ( )
protected

Render label for for Apply Link

Returns
string

Definition at line 889 of file BaseBuilderElement.php.

registerActiveFormScripts ( )
protected

Register any additional Javascript snippets

Definition at line 897 of file BaseBuilderElement.php.

registerApplyClickScript ( )
protected

Register javascript snippet to handle clicking apply link

Definition at line 905 of file BaseBuilderElement.php.

getAjaxScriptForInitSortableElements ( )
protected

Return the script to init the sortable elements in case BuilderElement is a container

Returns
string

Definition at line 919 of file BaseBuilderElement.php.

registerBackScript ( )
protected

Register javascript snippet to handle clicking back link

Definition at line 934 of file BaseBuilderElement.php.

registerHideFormScript ( )
protected

Registers a function to hide the form overlay and empty it.

Definition at line 948 of file BaseBuilderElement.php.

resolveEnableAjaxValidation ( )
protected

If form should allow ajax validation or not.

Returns
bool

Definition at line 964 of file BaseBuilderElement.php.

resolveFormClientOptions ( )
protected

Resolve any special client options

Returns
array

Definition at line 973 of file BaseBuilderElement.php.

resolveAjaxPostForApplyClickAjaxOptions ( )
protected

Resolve Ajax options for when clicking apply on editable form.

Returns
array

Definition at line 993 of file BaseBuilderElement.php.

resolveFormHtmlOptions ( )
protected

Resolve html options for form.

Returns
array

Definition at line 1026 of file BaseBuilderElement.php.

resolveActiveFormCustomOptions ( )
protected

Resolve custom options for form

Returns
array

Definition at line 1035 of file BaseBuilderElement.php.

renderBeforeFormLayout ( ZurmoActiveForm  $form)
protected

Render and return content that should be part of form but added before any input are rendered.

Parameters
ZurmoActiveForm$form

Definition at line 1044 of file BaseBuilderElement.php.

renderAfterFormLayout ( ZurmoActiveForm  $form)
protected

Render and return content that should be part of form but added before action links are rendered.

Parameters
ZurmoActiveForm$form

Definition at line 1052 of file BaseBuilderElement.php.

generateId ( )
protected

Generate a unique id

Returns
string

Definition at line 1060 of file BaseBuilderElement.php.

resolveDefaultProperties ( )
protected

Resolve default properties

Returns
array

Definition at line 1069 of file BaseBuilderElement.php.

resolveDefaultParams ( )
protected

Resolve default parameters

Returns
array

Definition at line 1078 of file BaseBuilderElement.php.

initId (   $id = null)
protected

Initialize Id. Generate a new one if parameter is not set,

Parameters
null$id

Definition at line 1087 of file BaseBuilderElement.php.

initProperties (   $properties = null)
protected

Initialize properties. Set to default one if parameter is not set,

Parameters
null$properties

Definition at line 1100 of file BaseBuilderElement.php.

cleanUpProperties ( )
protected

Cleanup any empty indexes from properties

Definition at line 1112 of file BaseBuilderElement.php.

initContent (   $content = null)
protected

Initialize content. Set to default one if parameter is not set,

Parameters
null$content

Definition at line 1124 of file BaseBuilderElement.php.

initParams (   $params = null)
protected

init element params

Parameters
null$params

Definition at line 1137 of file BaseBuilderElement.php.

initModel ( )
protected

init element model

Definition at line 1154 of file BaseBuilderElement.php.

getModel ( )
protected

Return a model to be used on forms

Returns
BuilderElementEditableModelForm

Definition at line 1163 of file BaseBuilderElement.php.

renderContentElement ( ZurmoActiveForm  $form = null)
finalprotected

Render the content element using provided form

Parameters
ZurmoActiveForm$form
Returns
string

Definition at line 1174 of file BaseBuilderElement.php.

resolveContentElementEditableTemplate ( Element  $element)
protected

Resolve editable template for content element.

Parameters
Element$element

Definition at line 1196 of file BaseBuilderElement.php.

resolveContentElementNonEditableTemplate ( Element  $element)
protected

Resolve non editable template for content element.

Parameters
Element$element

Definition at line 1205 of file BaseBuilderElement.php.

resolveContentElementParams ( )
protected

Resolve params to send to Content element's construct

Definition at line 1214 of file BaseBuilderElement.php.

resolveDefaultElementParamsForEditableForm (   $label = '')
protected

Resolve and return default params for elements used on content and settings tab.

Parameters
string$label
Returns
array

Definition at line 1224 of file BaseBuilderElement.php.

resolveDefaultContent ( )
protected

Returns the default content for current element.

Returns
array

Definition at line 1234 of file BaseBuilderElement.php.

renderSettingsTab ( ZurmoActiveForm  $form)
protected

Render and Return content for Settings Tab. Returning null hides settings tab from appearing.

Parameters
ZurmoActiveForm$form
Exceptions
NotImplementedException

Definition at line 1244 of file BaseBuilderElement.php.

resolveContentElementClassName ( )
protected

Resolve the class name of the element to use to render content for editable and non editable representation

Exceptions
NotImplementedException

Definition at line 1253 of file BaseBuilderElement.php.

resolveContentElementAttributeName ( )
protected

Resolve the attribute name to use to render editable and non-editable representation of content element

Exceptions
NotImplementedException

Definition at line 1262 of file BaseBuilderElement.php.

getId ( )

Getter for $id

Returns
string

Definition at line 1271 of file BaseBuilderElement.php.

getContent (   $serialized = false)

Getter for $content

Parameters
bool$serialized
Returns
array|string

Definition at line 1281 of file BaseBuilderElement.php.

getProperties (   $serialized = false)

Getter for $properties

Parameters
bool$serialized
Returns
array|string

Definition at line 1295 of file BaseBuilderElement.php.

getRenderForCanvas ( )

Getter for $renderForCanvas

Returns
bool

Definition at line 1308 of file BaseBuilderElement.php.

getParams ( )

Getter for $params

Returns
array

Definition at line 1317 of file BaseBuilderElement.php.

Field Documentation

const OVERLAY_ACTION_MOVE = 'action-move'

class name for move action link

Definition at line 42 of file BaseBuilderElement.php.

const OVERLAY_ACTION_EDIT = 'action-edit'

class name for edit action link

Definition at line 47 of file BaseBuilderElement.php.

const OVERLAY_ACTION_DELETE = 'action-delete'

class name for delete action link

Definition at line 52 of file BaseBuilderElement.php.

const OVERLAY_ACTIONS_CONTAINER_CLASS = 'builder-element-toolbar'

class used for overlay actions container

Definition at line 57 of file BaseBuilderElement.php.

const BUILDER_ELEMENT_CELL_DROPPABLE_CLASS = 'builder-element-cell-droppable'

class used for builder elements that can be dropped in cells

Definition at line 62 of file BaseBuilderElement.php.

const BUILDER_ELEMENT_SORTABLE_ELEMENTS_CLASS = 'sortable-elements'

class used for builder placeholder of sortable cells

Definition at line 67 of file BaseBuilderElement.php.

const BUILDER_ELEMENT_SORTABLE_ROWS_CLASS = 'sortable-rows'

class used for builder placeholder for sortable rows

Definition at line 72 of file BaseBuilderElement.php.


The documentation for this class was generated from the following file:
Generated on Sun Jan 26 2020 07:10:27