Settings form class
| access | public |
|---|---|
| package | kocuj_internal_lib |
| inherited_from | \KocujIL\V12a\Classes\ComponentObject |
__construct(object $projectObj) : void
| access | public |
|---|---|
| inherited_from | \KocujIL\V12a\Classes\ComponentObject::__construct() |
object\KocujIL\V12a\Classes\Project object for current project
__construct(object $projectObj) : void
| access | public |
|---|
object\KocujIL\V12a\Classes\Project object for current project
actionAddFields() : void
| access | public |
|---|
actionController() : void
| todo | change adding settings options when it is data set, because when there is an error, main identifier for database table is increasing at any time when this controller is checking for errors; probably controllers should be divided into two types - first which only checks data and second which is saving data |
|---|---|
| access | public |
actionFormHeader() : void
| todo | add possibility to enable/disable selected columns of elements list |
|---|---|
| access | public |
addController(string $id, array|string $callbackController) : integer
| access | public |
|---|
stringController identifier
arraystringCallback function or method name for controller; can be global function or method from any class
integerPosition in controllers listaddDataSetController(string $id, string $title, array|string $callbackController= NULL, integer $nonceRequired= \KocujIL\V12a\Enums\Project\Components\Backend\SettingsForm\NonceRequired::NO, integer $redirectAfter= \KocujIL\V12a\Enums\Project\Components\Backend\SettingsForm\RedirectAfter::NO, integer $bulkAvailable= \KocujIL\V12a\Enums\Project\Components\Backend\SettingsForm\BulkAvailable::NO) : void
| todo | disallow $id = "add-new" |
|---|---|
| access | public |
stringController identifier
stringLink title
arraystringCallback function or method name for controller; can be global function or method from any class; can be set to NULL to make an edit controller - default: NULL
integerNonce is required or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsForm\NonceRequired: NO (when nonce are not required) or YES (when nonce are required) - default: \KocujIL\V12a\Enums\Project\Components\Backend\SettingsForm\NonceRequired::NO
integerRedirection after action is available or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsForm\RedirectAfter: NO (when redirection after action is not available) or YES (when redirection after action is available) - default: \KocujIL\V12a\Enums\Project\Components\Backend\SettingsForm\BulkAvailable::NO
integerBulk action is available or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsForm\BulkAvailable: NO (when bulk action is not available) or YES (when bulk action is available) - default: \KocujIL\V12a\Enums\Project\Components\Backend\SettingsForm\BulkAvailable::NO
addFieldToTab(string $formId, string $tabId, string $fieldType, string $fieldId, string $fieldValue, string $tipText= '', array $events= array(), array $additional= array()) : integer
| access | public |
|---|
stringForm identifier
stringForm tab identifier
stringField type
stringField identifier
stringField value
stringTooltip text - default: empty
arrayHTML events - default: empty
arrayAdditional settings; each field type can use different additional settings; there are the following additional settings which can be always used: "global_addinfo" (string type; text to add below field), "global_addlabel" (string type; text to add to label), "global_hidelabel" (bool type; if true, label will be hidden), "global_widgetobj" (object type; it must be set to widget object, when it is widget) - default: empty
integerIdentifieraddForm(string $id, string $optionsContainerId, array $settingsMenusIds= array(), array $defaultButtons= array(), array $buttons= array(), array $additional= array()) : void
| access | public |
|---|
stringForm identifier
stringOptions container identifier for form
arrayList of settings menus identifiers for which this form will be allowed to display - default: empty
arrayDefinition of default buttons to add below form; there are available the following attributes: "isrestore" (bool type; if true, restore button will be displayed), "issubmit" (bool type; if true, submit button will be displayed), "restorelabel" (string type; restore button label), "restoretooltip" (string type; restore button tooltip), "submitlabel" (string type; submit button label), "submittooltip" (string type; submit button tooltip) - default: empty
arrayDefinition of additional buttons to add below form; each button data identifier will be used as button identifier; each button data has the following fields: "events" (array type; HTML events), "isprimary" (bool type; if true, button is primary), "label" (string type; button label), "tooltip" (string type; button tooltip) - default: empty
arrayAdditional settings for form; there are the following additional settings which can be used: "global_datasetcontrollers" (array type; if it is a data set, it is list of data set controllers), "global_isdatasetadd" (bool type; if it is data set and it is set to true, there will be possibility to add new element to data set)
addHtmlToTab(string $formId, string $tabId, string $html, string $htmlLeft = '') : integer
| access | public |
|---|
stringForm identifier
stringForm tab identifier
stringHTML code to add in field area
stringHTML code to add in label area - default: empty
integerIdentifieraddOptionFieldToTab(string $formId, string $tabId, string $fieldType, string $fieldId, string $tipText= '', array $events= array(), array $additional= array()) : integer
| access | public |
|---|
stringForm identifier
stringForm tab identifier
stringField type
stringField identifier
stringTooltip text - default: empty
arrayHTML events - default: empty
arrayAdditional settings; each field type can use different additional settings; there are the following additional settings which can be always used: "global_addinfo" (string type; text to add below field), "global_addlabel" (string type; text to add to label), "global_displayonlist" (bool type; if true, field information will be displayed on list if this container is for data set), "global_displayonlistcallback" (array or string type; callback method or function for displaying on list if this container is for data set), "global_hidelabel" (bool type; if true, label will be hidden), "global_widgetobj" (object type; it must be set to widget object, when it is widget) - default: empty
integerIdentifieraddTab(string $formId, string $tabId, string $title = '') : void
| access | public |
|---|
stringForm identifier
stringTab identifier; must be unique in this project
stringTab title; if empty, default title will be used - default: empty
checkController(string $id) : boolean
| access | public |
|---|
stringController identifier
booleanController exists (true) or not (false)checkDataSetController(string $id) : boolean
| access | public |
|---|
stringController identifier
booleanController exists (true) or not (false)checkForm(string $id) : boolean
| access | public |
|---|
stringForm identifier
booleanForm exists (true) or not (false)checkTab(string $formId, string $tabId) : boolean
| access | public |
|---|
stringForm identifier
stringTab identifier
booleanTab exists (true) or not (false)filterSetScreenOption(string $status, string $option, float|integer|string $value) : float | integer | string
| access | public |
|---|
stringStatus
stringOption
floatintegerstringValue
floatintegerstringOutput valuegetArrayContainerId(object $componentObj, string $formId, string $fieldId) : string
| access | public |
|---|
objectComponent object
stringForm identifier
stringField identifier
stringArray container idgetButtonAddNewElementDataSetId(object $componentObj, string $id) : string
| access | public |
|---|
objectComponent object
stringForm identifier
stringHTML id for button for adding new element to data setgetComponent(string $type, integer $projectCategory= \KocujIL\V12a\Enums\ProjectCategory::CORE, string $fragment= '') : object
| access | public |
|---|
stringComponent type
integerComponent category; must be one of the following constants from \KocujIL\V12a\Enums\ProjectCategory: CORE (for "core" category), ALL (for "all" category), FRONTEND (for "frontend" category) or BACKEND (for "backend" category) - default: \KocujIL\V12a\Enums\ProjectCategory::CORE
stringComponent fragment - default: empty
objectObject of class type from componentgetController(string $id) : array | boolean
| access | public |
|---|
stringController identifier
arraybooleanController data or false if not exists; controller data have multiple callbacks for controllergetControllers() : array
| access | public |
|---|
arrayControllers data; each controller data has multiple callbacks for controllergetDataSetController(string $id) : array | boolean
| access | public |
|---|
stringController identifier
arraybooleanController data or false if not exists; controller data have the following fields: "bulkavailable" (int type; set if bulk action is available), "callback" (array or string type; callback for controller), "noncerequired" (int type; set if nonce is required by data set controller), "redirectafter" (int type; set if there should be redirection after action), "title" (string type; link title)getDataSetControllers() : array
| access | public |
|---|
arrayControllers data; each controller data has the following fields: "bulkavailable" (int type; set if bulk action is available), "callback" (array or string type; callback for controller), "noncerequired" (int type; set if nonce is required by data set controller), "redirectafter" (int type; set if there should be redirection after action), "title" (string type; link title)getDataSetNonceId(object $componentObj, string $id) : string
| access | public |
|---|
objectComponent object
stringContainer identifier
stringData set nonce identifiergetFieldId(object $componentObj, string $formId, string $fieldId) : string
| access | public |
|---|
objectComponent object
stringForm identifier
stringField identifier
stringField idgetFieldIdAction(object $componentObj, string $id) : string
| access | public |
|---|
objectComponent object
stringForm identifier
stringField HTML id for actiongetFieldIdButton(object $componentObj, string $formId, string $buttonId) : string
| access | public |
|---|
objectComponent object
stringForm identifier
stringButton identifier
stringField HTML id for buttongetFieldIdDataSet(object $componentObj) : string
| access | public |
|---|
objectComponent object
stringField HTML id with data setgetFieldIdDataSetElementId(object $componentObj, string $id) : string
| access | public |
|---|
objectComponent object
stringForm identifier
stringField HTML id for data set element identifiergetFieldIdDefaultButton(object $componentObj, string $formId, string $buttonId) : string
| access | public |
|---|
objectComponent object
stringForm identifier
stringButton identifier
stringField HTML id for default buttongetFieldIdTab(object $componentObj, string $formId, integer $number) : string
| access | public |
|---|
objectComponent object
stringForm identifier
integerPosition number
stringField HTML id for tabgetFieldIdTabDiv(object $componentObj, string $formId, integer $number) : string
| access | public |
|---|
objectComponent object
stringForm identifier
integerPosition number
stringField HTML id for tab divgetFieldNameAction(object $componentObj) : string
| access | public |
|---|
objectComponent object
stringField name for actiongetFieldNameDataSetElementId(object $componentObj) : string
| access | public |
|---|
objectComponent object
stringField name for data set element identifiergetFieldNameFormId(object $componentObj) : string
| access | public |
|---|
objectComponent object
stringField name for form idgetForm(string $id) : array | boolean
| access | public |
|---|
stringForm identifier
arraybooleanForm data or false if not exists; form data have the following fields: "additional" (array type; additional settings), "buttons" (array type; definition of buttons below form), "defaultbuttons" (array type; definition of default buttons below form), "optionscontainerid" (string type; identifier of options container for form), "settingsmenusids" (array type; list of settings menu pages where this form will be displayed), "tabs" (array type; tabs with form fields)getFormId(object $componentObj, string $id) : string
| access | public |
|---|
objectComponent object
stringForm identifier
stringForm idgetForms() : array
| access | public |
|---|
arrayForms data; each form data has the following fields: "additional" (array type; additional settings), "buttons" (array type; definition of buttons below form), "defaultbuttons" (array type; definition of default buttons below form), "optionscontainerid" (string type; identifier of options container for form), "settingsmenusids" (array type; list of settings menu pages where this form will be displayed), "tabs" (array type; tabs with form fields)getNonceId(object $componentObj, string $id) : string
| access | public |
|---|
objectComponent object
stringForm identifier
stringNonce identifiergetProjectObj() : object
| access | public |
|---|
objectObject of type \KocujIL\V12a\Classes\ProjectgetStrings(string $type, integer $projectCategory = \KocujIL\V12a\Enums\ProjectCategory::CORE) : object
| access | public |
|---|
stringComponent type
integerComponent category; must be one of the following constants from \KocujIL\V12a\Enums\ProjectCategory: CORE (for "core" category), ALL (for "all" category), FRONTEND (for "frontend" category) or BACKEND (for "backend" category) - default: \KocujIL\V12a\Enums\ProjectCategory::CORE
objectObject of class type for strings from componentgetTab(string $formId, string $tabId) : array | boolean
| access | public |
|---|
stringForm identifier
stringTab identifier
arraybooleanTab data or false if not exists; tab data have the following fields: "fields" (array type; fields data; each element contains text with field in HTML to display), "title" (string type; tab title)getTabs(string $id) : array
| access | public |
|---|
stringForm identifier
arrayTab data; each tab data has the following fields: "fields" (array type; fields data; each element contains text with field in HTML to display), "title" (string type; tab title)removeController(string $id) : void
| access | public |
|---|
stringController identifier
removeDataSetController(string $id) : void
| access | public |
|---|
stringController identifier
removeForm(string $id) : void
| access | public |
|---|
stringForm identifier
removeTab(string $formId, string $tabId) : void
| access | public |
|---|
stringForm identifier
stringTab identifier
showForm(string $formIdForWidget = '') : void
| access | public |
|---|
stringForm identifier to display for widget - default: empty
addFieldOrHtmlToTab(string $formId, string $tabId, string $fieldType, string $fieldId, boolean $forceFieldValue, string $fieldValue, string $tipText, string $html, string $htmlLeft, array $events, array $additional) : integer
| access | private |
|---|
stringForm identifier
stringForm tab identifier
stringField type
stringField identifier
booleanForce field value (true) or not (false)
stringField value
stringTooltip text
stringHTML code to add in field area
stringHTML code to add in label area
arrayHTML events
arrayAdditional settings; each field type can use different additional settings; there are the following additional settings which can be always used: "global_addinfo" (string type; text to add below field), "global_addlabel" (string type; text to add to label), "global_displayonlist" (bool type; if true, field information will be displayed on list if this container is for data set), "global_displayonlistcallback" (array or string type; callback method or function for displaying on list if this container is for data set), "global_hidelabel" (bool type; if true, label will be hidden), "global_widgetobj" (object type; it must be set to widget object, when it is widget)
integerIdentifiercheckDataSetActionAddNew() : boolean
| access | private |
|---|
booleanThere is parameter for action to add new element in data setcheckDataSetActionAndId(object $componentObj, string $containerToCheck, boolean $allowArrayOfIds) : boolean
| access | private |
|---|
objectComponent object
stringContainer identifier to check; if empty, no container identifier is checked
booleanAllow array of identifiers (true) or not (false)
booleanThere is parameter for action and identifier to select current element in data set (true) or not (false)controllerDataSetDelete(object $componentObj, string $containerId, integer $dataSetElementId, $outputText) : void
| access | private |
|---|
objectComponent object
stringContainer identifier
integerData set element identifier
controllerRestore(object $componentObj, string $formId, boolean $isDataSet, integer $dataSetElementId, $outputText) : boolean
| access | private |
|---|
objectComponent object
stringForm identifier
booleanContainer is for data set
integerData set element identifier if $isDataSet is set to true
booleanController has been executed correctly (true) or not (false)controllerSave(object $componentObj, string $formId, boolean $isDataSet, integer $dataSetElementId, $outputText) : boolean
| access | private |
|---|
objectComponent object
stringForm identifier
booleanContainer is for data set
integerData set element identifier if $isDataSet is set to true
booleanController has been executed correctly (true) or not (false)fieldToAddNow(string $formId, string $tabId, string $fieldType, string $fieldId, boolean $forceFieldValue, string $fieldValue, string $tipText, string $html, string $htmlLeft, array $events, array $additional) : integer
| access | private |
|---|
stringForm identifier
stringForm tab identifier
stringField type
stringField identifier
booleanForce field value (true) or not (false)
stringField value
stringTooltip text
stringHTML code to add in field area
stringHTML code to add in label area
arrayHTML events
arrayAdditional settings; each field type can use different additional settings; there are the following additional settings which can be always used: "global_addinfo" (string type; text to add below field), "global_addlabel" (string type; text to add to label), "global_displayonlist" (bool type; if true, field information will be displayed on list if this container is for data set), "global_displayonlistcallback" (array or string type; callback method or function for displaying on list if this container is for data set), "global_hidelabel" (bool type; if true, label will be hidden), "global_widgetobj" (object type; it must be set to widget object, when it is widget)
integerIdentifiersaveOrRestoreInController(object $componentObj, string $formId, boolean $isDataSet, integer $dataSetElementId, boolean $isRestore, $outputText) : boolean
| access | private |
|---|
objectComponent object
stringForm identifier
booleanContainer is for data set
integerData set element identifier if $isDataSet is set to true
booleanIt is controller for restore (true) or save (false)
booleanController has been executed correctly (true) or not (false)$activeFormsArrays : array
array()| access | private |
|---|
$controllers : array
array()| access | private |
|---|
$dataSetControllers : array
array()| access | private |
|---|
$displayFieldOnListCallback : array
array()| access | private |
|---|
$fieldsToAdd : array
array()| access | private |
|---|
$fieldsToDisplayOnList : array
array()| access | private |
|---|
$forms : array
array()| access | private |
|---|
$formsArrays : array
array()| access | private |
|---|
$formsTabs : array
array()| access | private |
|---|
$formsToDisplayOnCurrentScreen : array
array()| access | private |
|---|
$libArrayScriptAdded : boolean
false| access | private |
|---|
$orderFieldOnList : array
array()| access | private |
|---|
$projectObj : object
NULL| access | private |
|---|
$sortableFieldsOnList : array
array()| access | private |
|---|
ARRAY_DIV_CONTROLS = '<div data-type="####DATA_TYPE_CONTROLS####" style="float:left;">'
ARRAY_DIV_ELEMENT_CONTAINER = '<div data-type="####DATA_TYPE_ELEMENT_CONTAINER####" ####DATA_ATTRS#### style="padding-top:5px;padding-bottom:5px;">'
ARRAY_DIV_FIELD = '<div data-type="####DATA_TYPE_FIELD####" style="float:left;width:50%;">'