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 |
---|
string
Controller identifier
array
string
Callback function or method name for controller; can be global function or method from any class
integer
Position 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 |
string
Controller identifier
string
Link title
array
string
Callback 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
integer
Nonce 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
integer
Redirection 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
integer
Bulk 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 |
---|
string
Form identifier
string
Form tab identifier
string
Field type
string
Field identifier
string
Field value
string
Tooltip text - default: empty
array
HTML events - default: empty
array
Additional 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
integer
IdentifieraddForm(string $id, string $optionsContainerId, array $settingsMenusIds= array()
, array $defaultButtons= array()
, array $buttons= array()
, array $additional= array()
) : void
access | public |
---|
string
Form identifier
string
Options container identifier for form
array
List of settings menus identifiers for which this form will be allowed to display - default: empty
array
Definition 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
array
Definition 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
array
Additional 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 |
---|
string
Form identifier
string
Form tab identifier
string
HTML code to add in field area
string
HTML code to add in label area - default: empty
integer
IdentifieraddOptionFieldToTab(string $formId, string $tabId, string $fieldType, string $fieldId, string $tipText= ''
, array $events= array()
, array $additional= array()
) : integer
access | public |
---|
string
Form identifier
string
Form tab identifier
string
Field type
string
Field identifier
string
Tooltip text - default: empty
array
HTML events - default: empty
array
Additional 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
integer
IdentifieraddTab(string $formId, string $tabId, string $title = ''
) : void
access | public |
---|
string
Form identifier
string
Tab identifier; must be unique in this project
string
Tab title; if empty, default title will be used - default: empty
checkController(string $id) : boolean
access | public |
---|
string
Controller identifier
boolean
Controller exists (true) or not (false)checkDataSetController(string $id) : boolean
access | public |
---|
string
Controller identifier
boolean
Controller exists (true) or not (false)checkForm(string $id) : boolean
access | public |
---|
string
Form identifier
boolean
Form exists (true) or not (false)checkTab(string $formId, string $tabId) : boolean
access | public |
---|
string
Form identifier
string
Tab identifier
boolean
Tab exists (true) or not (false)filterSetScreenOption(string $status, string $option, float|integer|string $value) : float | integer | string
access | public |
---|
string
Status
string
Option
float
integer
string
Value
float
integer
string
Output valuegetArrayContainerId(object $componentObj, string $formId, string $fieldId) : string
access | public |
---|
object
Component object
string
Form identifier
string
Field identifier
string
Array container idgetButtonAddNewElementDataSetId(object $componentObj, string $id) : string
access | public |
---|
object
Component object
string
Form identifier
string
HTML id for button for adding new element to data setgetComponent(string $type, integer $projectCategory= \KocujIL\V12a\Enums\ProjectCategory::CORE
, string $fragment= ''
) : object
access | public |
---|
string
Component type
integer
Component 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
string
Component fragment - default: empty
object
Object of class type from componentgetController(string $id) : array | boolean
access | public |
---|
string
Controller identifier
array
boolean
Controller data or false if not exists; controller data have multiple callbacks for controllergetControllers() : array
access | public |
---|
array
Controllers data; each controller data has multiple callbacks for controllergetDataSetController(string $id) : array | boolean
access | public |
---|
string
Controller identifier
array
boolean
Controller 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 |
---|
array
Controllers 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 |
---|
object
Component object
string
Container identifier
string
Data set nonce identifiergetFieldId(object $componentObj, string $formId, string $fieldId) : string
access | public |
---|
object
Component object
string
Form identifier
string
Field identifier
string
Field idgetFieldIdAction(object $componentObj, string $id) : string
access | public |
---|
object
Component object
string
Form identifier
string
Field HTML id for actiongetFieldIdButton(object $componentObj, string $formId, string $buttonId) : string
access | public |
---|
object
Component object
string
Form identifier
string
Button identifier
string
Field HTML id for buttongetFieldIdDataSet(object $componentObj) : string
access | public |
---|
object
Component object
string
Field HTML id with data setgetFieldIdDataSetElementId(object $componentObj, string $id) : string
access | public |
---|
object
Component object
string
Form identifier
string
Field HTML id for data set element identifiergetFieldIdDefaultButton(object $componentObj, string $formId, string $buttonId) : string
access | public |
---|
object
Component object
string
Form identifier
string
Button identifier
string
Field HTML id for default buttongetFieldIdTab(object $componentObj, string $formId, integer $number) : string
access | public |
---|
object
Component object
string
Form identifier
integer
Position number
string
Field HTML id for tabgetFieldIdTabDiv(object $componentObj, string $formId, integer $number) : string
access | public |
---|
object
Component object
string
Form identifier
integer
Position number
string
Field HTML id for tab divgetFieldNameAction(object $componentObj) : string
access | public |
---|
object
Component object
string
Field name for actiongetFieldNameDataSetElementId(object $componentObj) : string
access | public |
---|
object
Component object
string
Field name for data set element identifiergetFieldNameFormId(object $componentObj) : string
access | public |
---|
object
Component object
string
Field name for form idgetForm(string $id) : array | boolean
access | public |
---|
string
Form identifier
array
boolean
Form 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 |
---|
object
Component object
string
Form identifier
string
Form idgetForms() : array
access | public |
---|
array
Forms 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 |
---|
object
Component object
string
Form identifier
string
Nonce identifiergetProjectObj() : object
access | public |
---|
object
Object of type \KocujIL\V12a\Classes\ProjectgetStrings(string $type, integer $projectCategory = \KocujIL\V12a\Enums\ProjectCategory::CORE
) : object
access | public |
---|
string
Component type
integer
Component 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
object
Object of class type for strings from componentgetTab(string $formId, string $tabId) : array | boolean
access | public |
---|
string
Form identifier
string
Tab identifier
array
boolean
Tab 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 |
---|
string
Form identifier
array
Tab 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 |
---|
string
Controller identifier
removeDataSetController(string $id) : void
access | public |
---|
string
Controller identifier
removeForm(string $id) : void
access | public |
---|
string
Form identifier
removeTab(string $formId, string $tabId) : void
access | public |
---|
string
Form identifier
string
Tab identifier
showForm(string $formIdForWidget = ''
) : void
access | public |
---|
string
Form 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 |
---|
string
Form identifier
string
Form tab identifier
string
Field type
string
Field identifier
boolean
Force field value (true) or not (false)
string
Field value
string
Tooltip text
string
HTML code to add in field area
string
HTML code to add in label area
array
HTML events
array
Additional 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)
integer
IdentifiercheckDataSetActionAddNew() : boolean
access | private |
---|
boolean
There is parameter for action to add new element in data setcheckDataSetActionAndId(object $componentObj, string $containerToCheck, boolean $allowArrayOfIds) : boolean
access | private |
---|
object
Component object
string
Container identifier to check; if empty, no container identifier is checked
boolean
Allow array of identifiers (true) or not (false)
boolean
There 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 |
---|
object
Component object
string
Container identifier
integer
Data set element identifier
controllerRestore(object $componentObj, string $formId, boolean $isDataSet, integer $dataSetElementId, $outputText) : boolean
access | private |
---|
object
Component object
string
Form identifier
boolean
Container is for data set
integer
Data set element identifier if $isDataSet is set to true
boolean
Controller has been executed correctly (true) or not (false)controllerSave(object $componentObj, string $formId, boolean $isDataSet, integer $dataSetElementId, $outputText) : boolean
access | private |
---|
object
Component object
string
Form identifier
boolean
Container is for data set
integer
Data set element identifier if $isDataSet is set to true
boolean
Controller 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 |
---|
string
Form identifier
string
Form tab identifier
string
Field type
string
Field identifier
boolean
Force field value (true) or not (false)
string
Field value
string
Tooltip text
string
HTML code to add in field area
string
HTML code to add in label area
array
HTML events
array
Additional 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)
integer
IdentifiersaveOrRestoreInController(object $componentObj, string $formId, boolean $isDataSet, integer $dataSetElementId, boolean $isRestore, $outputText) : boolean
access | private |
---|
object
Component object
string
Form identifier
boolean
Container is for data set
integer
Data set element identifier if $isDataSet is set to true
boolean
It is controller for restore (true) or save (false)
boolean
Controller 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%;">'