Meta boxes for settings class

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

 Methods

Constructor

__construct(object $projectObj) : void
Inherited
access public

Parameters

$projectObj

object

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

Action after form div element

actionAfterFormDiv() : void
access public

Action before form div element

actionBeforeFormDiv() : void
access public

Action for adding JavaScript scripts

actionEnqueueScripts() : void
access public

Add settings meta box

addSettingsMetaBox(string $id, string $title, string $content, array $pages = array()) : void
access public

Parameters

$id

string

Settings meta box id; must be unique in this project

$title

string

Settings meta box title

$content

string

Settings meta box content

$pages

array

Settings pages list for current project where settings meta box should be displayed; it should be identifiers from settings page for current project only; if it is empty, meta box will be displayed on all settings pages for current project - default: empty

Check if settings meta box exists

checkSettingsMetaBox(string $id) : boolean
access public

Parameters

$id

string

Settings meta box identifier

Returns

booleanSettings meta box 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 object of type \KocujIL\V12a\Classes\Project

getProjectObj() : object
Inherited
access public

Returns

objectObject of type \KocujIL\V12a\Classes\Project

Get settings meta box data by id

getSettingsMetaBox(string $id) : array
access public

Parameters

$id

string

Settings meta box identifier

Returns

arraySelected settings meta box data or false if not exists; meta box data have the following fields: "pages" (settings pages list for current project on which meta box is displayed or empty if it is displayed on all settings pages for current project), "title" (title of meta box), "content" (content of meta box)

Get settings meta boxes data

getSettingsMetaBoxes() : array
access public

Returns

arraySettings meta boxes data; each settings meta box data has the following fields: "pages" (settings pages list for current project on which meta box is displayed or empty if it is displayed on all settings pages for current project), "title" (title of meta box), "content" (content of meta box)

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

Show settings meta box

metaBoxShow(object $post, object $data) : void
access public

Parameters

$post

object

Post data; it is always set to NULL

$data

object

Data

Remove settings meta box

removeSettingsMetaBox(string $id) : void
access public

Parameters

$id

string

Settings meta box identifier

Check if any settings meta box should be displayed on current page

checkIfDisplayAnySettingsMetaBox() : boolean
access private

Returns

booleanThere should be displayed settings meta box on current page (true) or not (false)

Check if settings meta box with the selected identifier should be displayed on current page

checkIfDisplaySettingsMetaBox(string $id) : boolean
access private

Parameters

$id

string

Settings meta box identifier to check

Returns

booleanThere should be displayed settings meta box on current page (true) or not (false)

 Properties

 

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

$projectObj : object

Default

NULL
access private
 

Settings meta boxes data

$settingsMetaBoxes : array

Default

array()
access private