WPDK
1.5.0
WordPress Development Kit
|
Public Member Functions | |
__construct ($id, $title, $content= '') | |
Construct. More... | |
buttons () | |
Buttons. More... | |
content () | |
Content. More... | |
open () | |
Open. More... | |
html () | |
Get HTML. More... | |
show () | |
Show. More... | |
toggle () | |
Toggle. More... | |
hide () | |
Hide. More... | |
buttonOpenModal ($label, $class= '') | |
Return a button for open this dialog. More... | |
addButton ($id, $label, $dismiss=true, $class= '') | |
Add button. More... | |
modal ($echo=true) | |
add_buttons ($id, $label, $dismiss=true, $class= '') | |
add_data ($key, $value) | |
button_open_modal ($label, $class= '') | |
Public Member Functions inherited from WPDKHTMLTag | |
__construct ($tag_name) | |
addData ($name, $value) | |
Add data attribute. More... | |
addClass ($class) | |
Add CSS Class. More... | |
display () | |
Display. More... | |
html () | |
Return the HTML markup for this tag. More... | |
draw () | |
Draw. More... | |
setPropertiesByArray ($properties=array()) | |
Set properties by array. More... | |
Public Member Functions inherited from WPDKObject | |
__className () | |
Returns the class object. More... | |
__parentClass () | |
Returns the class object for the receiver’s superclass. More... | |
__isClass ($class) | |
Brief. More... | |
__isSubclassOfClass ($class) | |
Return TRUE if the receiving class is a subclass of —or identical to— $class, otherwise FALSE. More... | |
Data Fields | |
$__version = '1.0.0' | |
$title = '' | |
Title. More... | |
$content = '' | |
Content. More... | |
$width = '' | |
Width. More... | |
$height = '' | |
Height. More... | |
$close_button = false | |
Dismiss button. More... | |
$dismissButton = true | |
Dismiss button. More... | |
$buttons = array() | |
Footer buttons list. More... | |
$keyboard = 'true' | |
Keyboard. More... | |
$backdrop = 'true' | |
Backdrop. More... | |
$static = false | |
Static. More... | |
$dismiss_button_glyph = '×' | |
Dismiss button glyph icon. More... | |
Data Fields inherited from WPDKHTMLTag | |
$__version = '1.1.1' | |
Version. More... | |
$accesskey = '' | |
$class = array() | |
$content = '' | |
Content. More... | |
$contenteditable | |
$contextmenu | |
$data = array() | |
Data attribute. More... | |
$dir | |
$draggable | |
$dropzone | |
$hidden | |
$id | |
$lang | |
$onclick | |
$spellcheck | |
$style | |
$tabindex | |
$tagName | |
Tag name. More... | |
$title | |
Data Fields inherited from WPDKObject | |
$__version = '1.0.0' | |
The version number assigned to the class. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from WPDKHTMLTag | |
static | sanitizeAttributes ($attributes) |
Sanitize attributes. More... | |
static | sanitizeData ($attributes) |
Sanitize data attributes. More... | |
static | sanitizeClasses ($classes) |
Sanitize CSS Classes list. More... | |
static | sanitizeStyles ($styles) |
Sanitize CSS Classes list. More... | |
static | attributeInline ($attributes, $additional_attributes=false) |
Inline Data attribute. More... | |
static | dataInline ($data, $additional_data=false) |
Inline Data attribute. More... | |
static | classInline ($classes, $additional_classes=false) |
Inline CSS class. More... | |
static | styleInline ($styles, $additional_styles=false) |
Inline CSS class. More... | |
static | mergeClasses ($class, $class2=null, $_=null) |
Merge. More... | |
Protected Member Functions inherited from WPDKHTMLTag | |
beforeContent () | |
Before content. More... | |
afterContent () | |
After content. More... | |
Protected Attributes inherited from WPDKHTMLTag | |
$attributes = array() | |
Attributes list. More... | |
$close | |
Close tag. More... | |
$open | |
Open tag. More... | |
Useful Modal dialog.
You can create in a simple way a standard dialog.
For do this just instance this class like:
$modal = new WPDKUIModalDialog( 'myDialog', 'Dialog title', 'The content' ); $modal->addButton( 'close', 'Close dialog' ); $modal->modal();
That's all, or since 1.4.9 you can extends this class
class MyDialog extends WPDKUIModalDialog { // Internal construct public function __construct() { parent::__construct( $id, $title ); } // Override buttons public function buttons() { $buttons = array( 'button_id' = array( 'label' => __( 'No, Thanks' ), 'dismiss' => true, ); ); return $buttons; // Filtrable? } // Override content public function content() { echo 'Hello...'; } }
Definition at line 54 of file wpdk-ui-modal-dialog.php.
__construct | ( | $id, | |
$title, | |||
$content = '' |
|||
) |
Construct.
Create an instance of WPDKUIModalDialog class
string | $id | ID for this modal |
string | $title | The modal title |
string | $content | Optional. An HTML content for dialog |
Definition at line 178 of file wpdk-ui-modal-dialog.php.
add_buttons | ( | $id, | |
$label, | |||
$dismiss = true , |
|||
$class = '' |
|||
) |
Definition at line 473 of file wpdk-ui-modal-dialog.php.
add_data | ( | $key, | |
$value | |||
) |
Definition at line 483 of file wpdk-ui-modal-dialog.php.
addButton | ( | $id, | |
$label, | |||
$dismiss = true , |
|||
$class = '' |
|||
) |
Add button.
Add a footer button
string | $id | Unique id for button |
string | $label | Text label |
bool | $dismiss | Optional. True for data-dismiss |
string | $class | Optional. Addition CSS class |
Definition at line 444 of file wpdk-ui-modal-dialog.php.
button_open_modal | ( | $label, | |
$class = '' |
|||
) |
Definition at line 493 of file wpdk-ui-modal-dialog.php.
buttonOpenModal | ( | $label, | |
$class = '' |
|||
) |
Return a button for open this dialog.
Return the HTML markup for button tag to open this modal dialog
string | $label | Text button label |
string | $class | Optional. Additional class |
Definition at line 427 of file wpdk-ui-modal-dialog.php.
buttons | ( | ) |
Buttons.
Return a list of button
Definition at line 288 of file wpdk-ui-modal-dialog.php.
content | ( | ) |
hide | ( | ) |
html | ( | ) |
Get HTML.
Return the HTML markup for modal dialog
Definition at line 327 of file wpdk-ui-modal-dialog.php.
modal | ( | $echo = true | ) |
Definition at line 460 of file wpdk-ui-modal-dialog.php.
open | ( | ) |
show | ( | ) |
toggle | ( | ) |
$__version = '1.0.0' |
Definition at line 63 of file wpdk-ui-modal-dialog.php.
bool $backdrop = 'true' |
Backdrop.
Includes a modal-backdrop element. Alternatively, specify static
for a backdrop which doesn't close the modal on click.
Definition at line 146 of file wpdk-ui-modal-dialog.php.
array $buttons = array() |
Footer buttons list.
List of buttons to display in footer
Definition at line 127 of file wpdk-ui-modal-dialog.php.
bool $close_button = false |
Dismiss button.
True for dismiss button [x] on top right
Definition at line 109 of file wpdk-ui-modal-dialog.php.
string $content = '' |
string $dismiss_button_glyph = '×' |
Dismiss button glyph icon.
Glyph used like dismiss button
Definition at line 165 of file wpdk-ui-modal-dialog.php.
bool $dismissButton = true |
Dismiss button.
True for dismiss button [x] on top right
Definition at line 118 of file wpdk-ui-modal-dialog.php.
int $height = '' |
bool $keyboard = 'true' |
Keyboard.
Closes the modal when escape key is pressed
Definition at line 136 of file wpdk-ui-modal-dialog.php.
bool $static = false |
string $title = '' |
int $width = '' |