WPDK  1.5.0
WordPress Development Kit
 All Data Structures Files Functions Variables Pages
WPDKUIModalDialog Class Reference
Inheritance diagram for WPDKUIModalDialog:
WPDKHTMLTag WPDKObject

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...
 

Detailed Description

Useful Modal dialog.

Overview

You can create in a simple way a standard dialog.

Create a simple modal 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...';
  }
}
Author
=undo= info@.nosp@m.wpxt.nosp@m.re.me
Date
2014-02-13
Version
1.0.0
Since
1.4.21
Note
Updated HTML markup and CSS to Bootstrap v3.1.0

Definition at line 54 of file wpdk-ui-modal-dialog.php.

Constructor & Destructor Documentation

__construct (   $id,
  $title,
  $content = '' 
)

Construct.

Create an instance of WPDKUIModalDialog class

Parameters
string$idID for this modal
string$titleThe modal title
string$contentOptional. An HTML content for dialog
Returns
WPDKUIModalDialog

Definition at line 178 of file wpdk-ui-modal-dialog.php.

Member Function Documentation

add_buttons (   $id,
  $label,
  $dismiss = true,
  $class = '' 
)
Deprecated:
Sice 1.0.0.b4 - Use addButton() instead

Definition at line 473 of file wpdk-ui-modal-dialog.php.

add_data (   $key,
  $value 
)
Deprecated:
Sice 1.0.0.b4 - Use addData() instead

Definition at line 483 of file wpdk-ui-modal-dialog.php.

addButton (   $id,
  $label,
  $dismiss = true,
  $class = '' 
)

Add button.

Add a footer button

Parameters
string$idUnique id for button
string$labelText label
bool$dismissOptional. True for data-dismiss
string$classOptional. Addition CSS class

Definition at line 444 of file wpdk-ui-modal-dialog.php.

button_open_modal (   $label,
  $class = '' 
)
Deprecated:
Since 1.0.0.b4 - Use buttonOpenModal() instead

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

Parameters
string$labelText button label
string$classOptional. Additional class
Returns
string

Definition at line 427 of file wpdk-ui-modal-dialog.php.

buttons ( )

Buttons.

Return a list of button

Returns
array

Definition at line 288 of file wpdk-ui-modal-dialog.php.

content ( )

Content.

Content

Returns
string

Definition at line 301 of file wpdk-ui-modal-dialog.php.

hide ( )

Hide.

Hide immediately

Definition at line 405 of file wpdk-ui-modal-dialog.php.

html ( )

Get HTML.

Return the HTML markup for modal dialog

Returns
string

Definition at line 327 of file wpdk-ui-modal-dialog.php.

modal (   $echo = true)
Deprecated:
Use display() or html() instead

Definition at line 460 of file wpdk-ui-modal-dialog.php.

open ( )

Open.

Display and open dialog

Since
1.4.9

Definition at line 314 of file wpdk-ui-modal-dialog.php.

show ( )

Show.

Display immediately

Definition at line 368 of file wpdk-ui-modal-dialog.php.

toggle ( )

Toggle.

Toggle modal

Definition at line 388 of file wpdk-ui-modal-dialog.php.

Field Documentation

$__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

Deprecated:
Since 1.0.0.b4 - Use dismissButton instead

Definition at line 109 of file wpdk-ui-modal-dialog.php.

string $content = ''

Content.

HTML content

Definition at line 81 of file wpdk-ui-modal-dialog.php.

string $dismiss_button_glyph = '×'

Dismiss button glyph icon.

Glyph used like dismiss button

Since
1.4.22

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 = ''

Height.

Height

Definition at line 99 of file wpdk-ui-modal-dialog.php.

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

Static.

Render as static. Default is FALSE

Definition at line 155 of file wpdk-ui-modal-dialog.php.

string $title = ''

Title.

Title of modal (window)

Definition at line 72 of file wpdk-ui-modal-dialog.php.

int $width = ''

Width.

Width

Definition at line 90 of file wpdk-ui-modal-dialog.php.


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