WPDK  1.5.0
WordPress Development Kit
 All Data Structures Files Functions Variables Pages
WPDKUIControl Class Reference
Inheritance diagram for WPDKUIControl:
WPDKUIControlAlert WPDKUIControlButton WPDKUIControlCheckbox WPDKUIControlCheckboxes WPDKUIControlChoose WPDKUIControlCustom WPDKUIControlDate WPDKUIControlDateTime WPDKUIControlEmail WPDKUIControlFile WPDKUIControlHidden WPDKUIControlLabel WPDKUIControlNumber WPDKUIControlPassword WPDKUIControlPhone WPDKUIControlRadio WPDKUIControlSection WPDKUIControlSelect WPDKUIControlSelectList WPDKUIControlSubmit WPDKUIControlSwipe WPDKUIControlSwitch WPDKUIControlText WPDKUIControlTextarea

Public Member Functions

 __construct ($item_control)
 Construct. More...
 
 display ()
 Display. More...
 
 draw ()
 Draw. More...
 
 html ()
 Get HTML. More...
 

Data Fields

const DEFAULT_SIZE_ATTRIBUTE = 30
 Attribute size. More...
 
const APPEND_SELECT_LIST_REMOVE = 'append_select_list_remove'
 
const APPEND_SELECT_LIST_ADD = 'append_select_list_add'
 

Protected Member Functions

 attrs ()
 Attributes. More...
 
 data ()
 Data attributes. More...
 
 classes ()
 CSS Class. More...
 
 contentWithKey ($key)
 Get content form array. More...
 
 inputType ($type=WPDKHTMLTagInputType::TEXT, $class= '')
 Common input control. More...
 
 label ()
 Standard label for controls. More...
 
 guide ()
 Guide. More...
 

Protected Attributes

 $attrs = array()
 Attributes. More...
 
 $class = array()
 CSS classes. More...
 
 $data = array()
 Data attributes. More...
 
 $id = ''
 Attribute ID. More...
 
 $item = ''
 WPDK UI Control array descriptor. More...
 
 $name = ''
 Name attribute. More...
 
 $style = ''
 CSS inline style. More...
 

Detailed Description

Definition at line 71 of file wpdk-ui-controls.php.

Constructor & Destructor Documentation

__construct (   $item_control)

Construct.

Create an instance of WPDKUIControl class

Parameters
array$item_controlControl array

Definition at line 169 of file wpdk-ui-controls.php.

Member Function Documentation

attrs ( )
protected

Attributes.

Return a string with complete list of generic attributes as title, id, etc...

Returns
string

Definition at line 207 of file wpdk-ui-controls.php.

classes ( )
protected

CSS Class.

Return a string with complete list of CSS class

Returns
string

Definition at line 255 of file wpdk-ui-controls.php.

contentWithKey (   $key)
protected

Get content form array.

Return the content by specific key. If the content is an instance of class WPDKUIControl then get the HTML. If the content is an array (Controls Layout array) porcess it as sub-control.

Parameters
string$keyString key in array
Returns
string

Definition at line 317 of file wpdk-ui-controls.php.

data ( )
protected

Data attributes.

Return a string with complete list of data attributes as data-name = "value". For example:

<div data-my_attribute="my_value"></div>

The data asttributes are readable and writeable from jQuery with:

$( 'div' ).data( 'my_attribute' );
Returns
string

Definition at line 239 of file wpdk-ui-controls.php.

display ( )

Display.

Display the control

Definition at line 269 of file wpdk-ui-controls.php.

draw ( )

Draw.

Drawing

Definition at line 279 of file wpdk-ui-controls.php.

guide ( )
protected

Guide.

Return the HTML markup for the guide engine

Since
1.0.0.b4
Returns
string

Definition at line 554 of file wpdk-ui-controls.php.

html ( )

Get HTML.

Return the HTML markup for control

Returns
string

Definition at line 291 of file wpdk-ui-controls.php.

inputType (   $type = WPDKHTMLTagInputType::TEXT,
  $class = '' 
)
protected

Common input control.

This is a utility method to display a common input type

Parameters
string | WPDKHTMLTagInputType$typeOptional. Type of input
string$classOptional. CSS additional class

Definition at line 387 of file wpdk-ui-controls.php.

label ( )
protected

Standard label for controls.

Return an instance of WPDKHTMLTagLabel class or null if no label provided.

Returns
null|WPDKHTMLTagLabel

Definition at line 447 of file wpdk-ui-controls.php.

Field Documentation

array string $attrs = array()
protected

Attributes.

A string with list of attributes

Definition at line 102 of file wpdk-ui-controls.php.

string array $class = array()
protected

CSS classes.

A string or an array with CSS classes

Definition at line 111 of file wpdk-ui-controls.php.

string array $data = array()
protected

Data attributes.

A string or an array with list of data attributes

Definition at line 119 of file wpdk-ui-controls.php.

string $id = ''
protected

Attribute ID.

A sanitize attribute id

Definition at line 127 of file wpdk-ui-controls.php.

array $item = ''
protected

WPDK UI Control array descriptor.

A key value pairs array with the WPDK ui control description

Definition at line 135 of file wpdk-ui-controls.php.

string $name = ''
protected

Name attribute.

The name attribute

Definition at line 143 of file wpdk-ui-controls.php.

string $style = ''
protected

CSS inline style.

A string with inlibe CSS styles

Definition at line 151 of file wpdk-ui-controls.php.

const APPEND_SELECT_LIST_ADD = 'append_select_list_add'

Useful constant to append a [Add] button on select list control

Since
1.4.8

Definition at line 93 of file wpdk-ui-controls.php.

const APPEND_SELECT_LIST_REMOVE = 'append_select_list_remove'

Useful constant to append a [Remove] button on select list control

Since
1.4.8

Definition at line 86 of file wpdk-ui-controls.php.

const DEFAULT_SIZE_ATTRIBUTE = 30

Attribute size.

Default attribute size for input tag

Since
1.0.0.b4

Definition at line 79 of file wpdk-ui-controls.php.


The documentation for this class was generated from the following file: