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

Public Member Functions

 __construct ($id, $content= '', $type=WPDKUIAlertType::INFORMATION, $title= '')
 Construct. More...
 
 content ()
 Content. More...
 
 title ()
 Title. More...
 
 html ()
 Get HTML. More...
 
 toControl ()
 Brief. More...
 
 alert ($echo=true)
 
- 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

const USER_META_KEY_PERMANENT_DISMISS = '_wpdk_alert_dismiss'
 
 $dismissable = true
 Dismissable. More...
 
 $dismissToolTip = ''
 Tooltip. More...
 
 $title = ''
 Title. More...
 
 $dismissButton = true
 Dismiss button. More...
 
 $dismiss_button_glyph = '×'
 Dismiss button glyph icon. More...
 
 $content = ''
 Content. More...
 
 $type
 Alert type. More...
 
 $permanent_dismiss = false
 Permanent dismiss. More...
 
 $block
 Block layout. 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...
 

Protected Attributes

 $dismissed = array()
 Permanent dismissed. More...
 
- Protected Attributes inherited from WPDKHTMLTag
 $attributes = array()
 Attributes list. More...
 
 $close
 Close tag. More...
 
 $open
 Open tag. 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...
 

Detailed Description

Useful Alert

Create an Alert

To create and display an alert just coding:

$alert = new WPDKUIAlert( 'my-alert', 'Hello World!' );
$alert->display();

OR

class myAlert extends WPDKUIAlert {

  // Internal construct
  public function __construct()
  {
     parent::__construct( $id, false, $type, $title );
  }

  // 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 58 of file wpdk-ui-alert.php.

Constructor & Destructor Documentation

__construct (   $id,
  $content = '',
  $type = WPDKUIAlertType::INFORMATION,
  $title = '' 
)

Construct.

Create an instance of WPDKUIAlert class

Parameters
string$idThis alert id
string$contentOptional. An HTML content for this alert
string$typeOptional. See WPDKUIAlertType. Default WPDKUIAlertType::INFORMATION
string$titleOptional. Title of alert
Returns
WPDKUIAlert

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

Member Function Documentation

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

Definition at line 354 of file wpdk-ui-alert.php.

content ( )

Content.

Content

Returns
string

Definition at line 244 of file wpdk-ui-alert.php.

html ( )

Get HTML.

Return the HTML markup for a Twitter bootstrap alert

Returns
string

Definition at line 285 of file wpdk-ui-alert.php.

title ( )

Title.

Title

Returns
string

Definition at line 271 of file wpdk-ui-alert.php.

toControl ( )

Brief.

Return an array item description in Control Layout Array format

Since
1.0.0
Returns
array

Definition at line 321 of file wpdk-ui-alert.php.

Field Documentation

bool $block

Block layout.

Set TRUE for alert-block class style

Deprecated:
Since WPDK 1.3.1 and Bootstrap 3.0.0

Definition at line 146 of file wpdk-ui-alert.php.

string $content = ''

Content.

HTML content

Definition at line 117 of file wpdk-ui-alert.php.

string $dismiss_button_glyph = '×'

Dismiss button glyph icon.

Glyph used like dismiss button

Definition at line 108 of file wpdk-ui-alert.php.

bool $dismissable = true

Dismissable.

Add alert-dismissable class

Since
1.3.1

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

bool $dismissButton = true

Dismiss button.

True to display dismiss [x] button. Default true

Definition at line 99 of file wpdk-ui-alert.php.

array $dismissed = array()
protected

Permanent dismissed.

List of permanent dismissed alert id

Definition at line 155 of file wpdk-ui-alert.php.

string $dismissToolTip = ''

Tooltip.

Tooltip on dismiss button

Since
1.4.8

Definition at line 81 of file wpdk-ui-alert.php.

bool $permanent_dismiss = false

Permanent dismiss.

If TRUE this alert is permanet dismiss by a logged in user

Since
1.4.21

Definition at line 136 of file wpdk-ui-alert.php.

string $title = ''

Title.

Title

Definition at line 90 of file wpdk-ui-alert.php.

string $type

Alert type.

Use const in WPDKUIAlertType

Definition at line 126 of file wpdk-ui-alert.php.

const USER_META_KEY_PERMANENT_DISMISS = '_wpdk_alert_dismiss'

Definition at line 61 of file wpdk-ui-alert.php.


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