Settings fields class

access public
package kocuj_internal_lib
inherited_from \KocujIL\V12a\Classes\ComponentObject

 Methods

Constructor

__construct(object $projectObj) : void
access public
inherited_from \KocujIL\V12a\Classes\ComponentObject::__construct()

Parameters

$projectObj

object

\KocujIL\V12a\Classes\Project object for current project

Constructor

__construct(object $projectObj) : void
Inherited
access public

Parameters

$projectObj

object

\KocujIL\V12a\Classes\Project object for current project

Action for fields headers callbacks

actionFieldsHeaders() : void
access public

Add field type for current site

addFieldTypeForCurrentSite($fieldType) : void
todo throw an error \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\ExceptionCode::WRONG_ACTION_FOR_METHOD when this method is executed after "current_screen" action
access public

Parameters

$fieldType

Add field type

addType(string $type, array|string $callbackDisplay, array|string $callbackHeader = NULL, integer $allowInWidget = \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\AllowInWidget::NO, integer $orderInWidget = \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget::FIRST_LABEL) : void
access public

Parameters

$type

string

Field type

$callbackDisplay

arraystring

Callback function or method name for displaying field; can be global function or method from any class

$callbackHeader

arraystring

Callback function or method name for header on site with field; can be global function or method from any class - default: NULL

$allowInWidget

integer

Field type is allowed in widget or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\AllowInWidget: NO (field type is not allowed in widget) or YES (field type is allowed in widget) - default: \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\AllowInWidget::NO

$orderInWidget

integer

Label and HTML element order in widget; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget: FIRST_LABEL (first label, then element) or FIRST_ELEMENT (first element, then label) - default: \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget::FIRST_LABEL

Check if field type exists

checkType(string $id) : boolean
access public

Parameters

$id

string

Field type identifier

Returns

booleanField exists (true) or not (false)

Get object of class type from component

getComponent(string $type, integer $projectCategory = \KocujIL\V12a\Enums\ProjectCategory::CORE, string $fragment = '') : object
Inherited
access public

Parameters

$type

string

Component type

$projectCategory

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

$fragment

string

Component fragment - default: empty

Returns

objectObject of class type from component

Get field

getField(string $fieldType, string $fieldId, string $fieldHtmlId, string $fieldValue, string $tipText = '', array $classAndStyle = array(), integer $fieldForWidget = \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget::NO, integer $optionArray = \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray::NO, array $events = array(), array $additional = array()) : string
access public

Parameters

$fieldType

string

Field type

$fieldId

string

Field identifier

$fieldHtmlId

string

Field HTML id; if empty, HTML id will be the same as $fieldId

$fieldValue

string

Field value

$tipText

string

Tooltip text - default: empty

$classAndStyle

array

Class and style for element; class and style data must have the following fields: "all" (string type; HTML classes with "class" tag and HTML styles with "style" tag and space before), "class" (string type; HTML classes), "classwithtag" (string type; HTML classes with "class" tag and space before), "style" (string type; HTML styles), "stylewithtag" (string type; HTML styles with "style" tag and space before) - default: empty

$fieldForWidget

integer

This field is for widget or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget: NO (when field is not for widget) or YES (when field is for widget) - default: \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget::NO

$optionArray

integer

Option is array or standard; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray: NO (when it is standard option) or YES (when it is array option) - default: \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray::NO

$events

array

HTML events - default: empty

$additional

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_widgetobj" (object type; it must be set to widget object, when $fieldForWidget is set to \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget::YES)

Returns

stringField

Get object of type \KocujIL\V12a\Classes\Project

getProjectObj() : object
Inherited
access public

Returns

objectObject of type \KocujIL\V12a\Classes\Project

Get object of class type for strings from component

getStrings(string $type, integer $projectCategory = \KocujIL\V12a\Enums\ProjectCategory::CORE) : object
Inherited
access public

Parameters

$type

string

Component type

$projectCategory

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

Returns

objectObject of class type for strings from component

Get field type data by id

getType(string $id) : array | boolean
access public

Parameters

$id

string

Field type identifier

Returns

arraybooleanField type data or false if not exists; field type data have the following fields: "allowinwidget" (int type; field type is allowed in widget or not), "callbackdisplay" (array or string type; callback to function or method which will display this field), "callbackheader" (array or string type; callback to function or method which will add header for field), "orderinwidget" (int type; order of label and HTML element in widget)

Get field type data

getTypes() : array
access public

Returns

arrayFields types data; each field type data has the following fields: "allowinwidget" (int type; field type is allowed in widget or not), "callbackdisplay" (array or string type; callback to function or method which will display this field), "callbackheader" (array or string type; callback to function or method which will add header for field), "orderinwidget" (int type; order of label and HTML element in widget)

Remove field type

removeType(string $id) : void
access public

Parameters

$id

string

Field type identifier

Get field - button

fieldButton(object $componentObj, string $fieldHtmlId, string $fieldHtmlName, string $fieldValue, string $fieldAttrs, string $tipText, array $classAndStyle, integer $fieldForWidget, integer $optionArray, integer $orderInWidget, array $additional) : string
Static
access private

Parameters

$componentObj

object

Component object

$fieldHtmlId

string

Field HTML id

$fieldHtmlName

string

Field HTML name

$fieldValue

string

Field value

$fieldAttrs

string

Prepared text with field attributes "id", "name" and "title" and with space at beginning

$tipText

string

Tooltip text

$classAndStyle

array

Class and style for element; class and style data must have the following fields: "all" (string type; HTML classes with "class" tag and HTML styles with "style" tag and space before), "class" (string type; HTML classes), "classwithtag" (string type; HTML classes with "class" tag and space before), "style" (string type; HTML styles), "stylewithtag" (string type; HTML styles with "style" tag and space before)

$fieldForWidget

integer

This field is for widget or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget: NO (when field is not for widget) or YES (when field is for widget)

$optionArray

integer

Option is array or standard; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray: NO (when it is standard option) or YES (when it is array option)

$orderInWidget

integer

Label and HTML element order in widget; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget: FIRST_LABEL (first label, then element), FIRST_ELEMENT (first element, then label)

$additional

array

Additional settings; there are the following additional settings which can be used: "buttonlabel" (string type; label for button), "buttonprimary" (bool type; if it is set to true, it will be a primary button with different appearance than others)

Returns

stringField

Get field - checkbox

fieldCheckbox(object $componentObj, string $fieldHtmlId, string $fieldHtmlName, string $fieldValue, string $fieldAttrs, string $tipText, array $classAndStyle, integer $fieldForWidget, integer $optionArray, integer $orderInWidget, array $additional) : string
Static
access private

Parameters

$componentObj

object

Component object

$fieldHtmlId

string

Field HTML id

$fieldHtmlName

string

Field HTML name

$fieldValue

string

Field value

$fieldAttrs

string

Prepared text with field attributes "id", "name" and "title" and with space at beginning

$tipText

string

Tooltip text

$classAndStyle

array

Class and style for element; class and style data must have the following fields: "all" (string type; HTML classes with "class" tag and HTML styles with "style" tag and space before), "class" (string type; HTML classes), "classwithtag" (string type; HTML classes with "class" tag and space before), "style" (string type; HTML styles), "stylewithtag" (string type; HTML styles with "style" tag and space before)

$fieldForWidget

integer

This field is for widget or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget: NO (when field is not for widget) or YES (when field is for widget)

$optionArray

integer

Option is array or standard; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray: NO (when it is standard option) or YES (when it is array option)

$orderInWidget

integer

Label and HTML element order in widget; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget: FIRST_LABEL (first label, then element), FIRST_ELEMENT (first element, then label)

$additional

array

Additional settings; there are the following additional settings which can be used: "checkedvalue" (string type; value which will be used for checked checkbox; if empty or does not exist, "1" will be used)

Returns

stringField

Execute field header - image

fieldHeaderImage(object $componentObj) : void
Static
access private

Parameters

$componentObj

object

Component object

Get field - hidden

fieldHidden(object $componentObj, string $fieldHtmlId, string $fieldHtmlName, string $fieldValue, string $fieldAttrs, string $tipText, array $classAndStyle, integer $fieldForWidget, integer $optionArray, integer $orderInWidget, array $additional) : string
Static
access private

Parameters

$componentObj

object

Component object

$fieldHtmlId

string

Field HTML id

$fieldHtmlName

string

Field HTML name

$fieldValue

string

Field value

$fieldAttrs

string

Prepared text with field attributes "id", "name" and "title" and with space at beginning

$tipText

string

Tooltip text

$classAndStyle

array

Class and style for element; class and style data must have the following fields: "all" (string type; HTML classes with "class" tag and HTML styles with "style" tag and space before), "class" (string type; HTML classes), "classwithtag" (string type; HTML classes with "class" tag and space before), "style" (string type; HTML styles), "stylewithtag" (string type; HTML styles with "style" tag and space before)

$fieldForWidget

integer

This field is for widget or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget: NO (when field is not for widget) or YES (when field is for widget)

$optionArray

integer

Option is array or standard; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray: NO (when it is standard option) or YES (when it is array option)

$orderInWidget

integer

Label and HTML element order in widget; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget: FIRST_LABEL (first label, then element), FIRST_ELEMENT (first element, then label)

$additional

array

Additional settings

Returns

stringField

Get field - image

fieldImage(object $componentObj, string $fieldHtmlId, string $fieldHtmlName, string $fieldValue, string $fieldAttrs, string $tipText, array $classAndStyle, integer $fieldForWidget, integer $optionArray, integer $orderInWidget, array $additional) : string
Static
access private

Parameters

$componentObj

object

Component object

$fieldHtmlId

string

Field HTML id

$fieldHtmlName

string

Field HTML name

$fieldValue

string

Field value

$fieldAttrs

string

Prepared text with field attributes "id", "name" and "title" and with space at beginning

$tipText

string

Tooltip text

$classAndStyle

array

Class and style for element; class and style data must have the following fields: "all" (string type; HTML classes with "class" tag and HTML styles with "style" tag and space before), "class" (string type; HTML classes), "classwithtag" (string type; HTML classes with "class" tag and space before), "style" (string type; HTML styles), "stylewithtag" (string type; HTML styles with "style" tag and space before)

$fieldForWidget

integer

This field is for widget or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget: NO (when field is not for widget) or YES (when field is for widget)

$optionArray

integer

Option is array or standard; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray: NO (when it is standard option) or YES (when it is array option)

$orderInWidget

integer

Label and HTML element order in widget; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget: FIRST_LABEL (first label, then element), FIRST_ELEMENT (first element, then label)

$additional

array

Additional settings; there are the following additional settings which can be used: "buttonlabel" (string type; label for button), "buttonprimary" (bool type; if it is set to true, it will be a primary button with different appearance than others)

Returns

stringField

Get field - select

fieldSelect(object $componentObj, string $fieldHtmlId, string $fieldHtmlName, string $fieldValue, string $fieldAttrs, string $tipText, array $classAndStyle, integer $fieldForWidget, integer $optionArray, integer $orderInWidget, array $additional) : string
Static
access private

Parameters

$componentObj

object

Component object

$fieldHtmlId

string

Field HTML id

$fieldHtmlName

string

Field HTML name

$fieldValue

string

Field value

$fieldAttrs

string

Prepared text with field attributes "id", "name" and "title" and with space at beginning

$tipText

string

Tooltip text

$classAndStyle

array

Class and style for element; class and style data must have the following fields: "all" (string type; HTML classes with "class" tag and HTML styles with "style" tag and space before), "class" (string type; HTML classes), "classwithtag" (string type; HTML classes with "class" tag and space before), "style" (string type; HTML styles), "stylewithtag" (string type; HTML styles with "style" tag and space before)

$fieldForWidget

integer

This field is for widget or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget: NO (when field is not for widget) or YES (when field is for widget)

$optionArray

integer

Option is array or standard; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray: NO (when it is standard option) or YES (when it is array option)

$orderInWidget

integer

Label and HTML element order in widget; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget: FIRST_LABEL (first label, then element), FIRST_ELEMENT (first element, then label)

$additional

array

Additional settings; there are the following additional settings which can be used: "emptyoptionatbegin" (bool type; there will be an empty option at the beginning of options list), "options" (array type; options list; each array key will be an option value and each array value will be displayed text for option)

Returns

stringField

Get field - text

fieldText(object $componentObj, string $fieldHtmlId, string $fieldHtmlName, string $fieldValue, string $fieldAttrs, string $tipText, array $classAndStyle, integer $fieldForWidget, integer $optionArray, integer $orderInWidget, array $additional) : string
Static
access private

Parameters

$componentObj

object

Component object

$fieldHtmlId

string

Field HTML id

$fieldHtmlName

string

Field HTML name

$fieldValue

string

Field value

$fieldAttrs

string

Prepared text with field attributes "id", "name" and "title" and with space at beginning

$tipText

string

Tooltip text

$classAndStyle

array

Class and style for element; class and style data must have the following fields: "all" (string type; HTML classes with "class" tag and HTML styles with "style" tag and space before), "class" (string type; HTML classes), "classwithtag" (string type; HTML classes with "class" tag and space before), "style" (string type; HTML styles), "stylewithtag" (string type; HTML styles with "style" tag and space before)

$fieldForWidget

integer

This field is for widget or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget: NO (when field is not for widget) or YES (when field is for widget)

$optionArray

integer

Option is array or standard; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray: NO (when it is standard option) or YES (when it is array option)

$orderInWidget

integer

Label and HTML element order in widget; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget: FIRST_LABEL (first label, then element), FIRST_ELEMENT (first element, then label)

$additional

array

Additional settings

Returns

stringField

Get field - text disabled

fieldTextDisabled(object $componentObj, string $fieldHtmlId, string $fieldHtmlName, string $fieldValue, string $fieldAttrs, string $tipText, array $classAndStyle, integer $fieldForWidget, integer $optionArray, integer $orderInWidget, array $additional) : string
Static
access private

Parameters

$componentObj

object

Component object

$fieldHtmlId

string

Field HTML id

$fieldHtmlName

string

Field HTML name

$fieldValue

string

Field value

$fieldAttrs

string

Prepared text with field attributes "id", "name" and "title" and with space at beginning

$tipText

string

Tooltip text

$classAndStyle

array

Class and style for element; class and style data must have the following fields: "all" (string type; HTML classes with "class" tag and HTML styles with "style" tag and space before), "class" (string type; HTML classes), "classwithtag" (string type; HTML classes with "class" tag and space before), "style" (string type; HTML styles), "stylewithtag" (string type; HTML styles with "style" tag and space before)

$fieldForWidget

integer

This field is for widget or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget: NO (when field is not for widget) or YES (when field is for widget)

$optionArray

integer

Option is array or standard; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray: NO (when it is standard option) or YES (when it is array option)

$orderInWidget

integer

Label and HTML element order in widget; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget: FIRST_LABEL (first label, then element), FIRST_ELEMENT (first element, then label)

$additional

array

Additional settings

Returns

stringField

Get field - textarea

fieldTextarea(object $componentObj, string $fieldHtmlId, string $fieldHtmlName, string $fieldValue, string $fieldAttrs, string $tipText, array $classAndStyle, integer $fieldForWidget, integer $optionArray, integer $orderInWidget, array $additional) : string
Static
access private

Parameters

$componentObj

object

Component object

$fieldHtmlId

string

Field HTML id

$fieldHtmlName

string

Field HTML name

$fieldValue

string

Field value

$fieldAttrs

string

Prepared text with field attributes "id", "name" and "title" and with space at beginning

$tipText

string

Tooltip text

$classAndStyle

array

Class and style for element; class and style data must have the following fields: "all" (string type; HTML classes with "class" tag and HTML styles with "style" tag and space before), "class" (string type; HTML classes), "classwithtag" (string type; HTML classes with "class" tag and space before), "style" (string type; HTML styles), "stylewithtag" (string type; HTML styles with "style" tag and space before)

$fieldForWidget

integer

This field is for widget or not; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\FieldForWidget: NO (when field is not for widget) or YES (when field is for widget)

$optionArray

integer

Option is array or standard; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OptionArray: NO (when it is standard option) or YES (when it is array option)

$orderInWidget

integer

Label and HTML element order in widget; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\SettingsFields\OrderInWidget: FIRST_LABEL (first label, then element), FIRST_ELEMENT (first element, then label)

$additional

array

Additional settings

Returns

stringField

 Properties

 

Fields types for current site

$fieldsTypesForCurrentSite : array

Default

array()
access private
 

\KocujIL\V12a\Classes\Project object for current project

$projectObj : object

Default

NULL
access private
 

Fields types list

$types : array

Default

array()
access private