WPDK  1.5.0
WordPress Development Kit
 All Data Structures Files Functions Variables Pages
wpdk-glyphicons.php
Go to the documentation of this file.
1 <?php
14 final class WPDKGlyphIcons extends WPDKObject {
15 
16  const ANGLE_DOWN = 'wpdk-icon-angle-down';
17  const UPDOWN_CIRCLE = 'wpdk-icon-updown-circle';
18  const ANGLE_LEFT = 'wpdk-icon-angle-left';
19  const ANGLE_RIGHT = 'wpdk-icon-angle-right';
20  const ANGLE_UP = 'wpdk-icon-angle-up';
21  const ARROWS_CW = 'wpdk-icon-arrows-cw';
22  const ATTENTION = 'wpdk-icon-attention';
23  const BUG = 'wpdk-icon-bug';
24  const CANCEL_CIRCLED2 = 'wpdk-icon-cancel-circled2';
25  const CCW = 'wpdk-icon-ccw';
26  const CHAT = 'wpdk-icon-chat';
27  const CLOCK = 'wpdk-icon-clock-1';
28  const COMMENT_EMPTY = 'wpdk-icon-comment-empty';
29  const CW = 'wpdk-icon-cw';
30  const DOWN_BIG = 'wpdk-icon-down-big';
31  const DOWN_OPEN = 'wpdk-icon-down-open';
32  const EMO_COFFEE = 'wpdk-icon-emo-coffee';
33  const EXPORT = 'wpdk-icon-export';
34  const GITHUB = 'wpdk-icon-github';
35  const HEART = 'wpdk-icon-heart';
36  const HEART_EMPTY = 'wpdk-icon-heart-empty';
37  const LEFT_OPEN = 'wpdk-icon-left-open';
38  const LOCK = 'wpdk-icon-lock';
39  const LOCK_OPEN = 'wpdk-icon-lock-open';
40  const LOCK_OPEN_ALT = 'wpdk-icon-lock-open-alt';
41  const MAIL = 'wpdk-icon-mail';
42  const MINUS_SQUARED = 'wpdk-icon-minus-squared';
43  const OK = 'wpdk-icon-ok';
44  const OK_CIRCLED = 'wpdk-icon-ok-circled';
45  const PENCIL = 'wpdk-icon-pencil';
46  const PLUS_SQUARED = 'wpdk-icon-plus-squared';
47  const RIGHT_OPEN = 'wpdk-icon-right-open';
48  const SEARCH = 'wpdk-icon-search';
49  const SPIN1 = 'wpdk-icon-spin1 animate-spin';
50  const SPIN2 = 'wpdk-icon-spin2 animate-spin';
51  const SPIN3 = 'wpdk-icon-spin3 animate-spin';
52  const SPIN4 = 'wpdk-icon-spin4 animate-spin';
53  const SPIN5 = 'wpdk-icon-spin5 animate-spin';
54  const SPIN6 = 'wpdk-icon-spin6 animate-spin';
55  const STAR = 'wpdk-icon-star';
56  const STAR_EMPTY = 'wpdk-icon-star-empty';
57  const STAR_HALF = 'wpdk-icon-star-half';
58  const STAR_HALF_ALT = 'wpdk-icon-star-half-alt';
59  const TRASH = 'wpdk-icon-trash';
60  const UP_OPEN = 'wpdk-icon-up-open';
61 
62  // since 1.4.5
63  const EMO_HAPPY = 'wpdk-icon-emo-happy';
64  const EMO_UNHAPPY = 'wpdk-icon-emo-unhappy';
65  const CANCEL_CIRCLED = 'wpdk-icon-cancel-circled';
66  const THUMBS_UP_ALT = 'wpdk-icon-thumbs-up-alt';
67  const THUMBS_DOWN_ALT = 'wpdk-icon-thumbs-down-alt';
68  const THUMBS_UP = 'wpdk-icon-thumbs-up';
69  const THUMBS_DOWN = 'wpdk-icon-thumbs-down';
70  const COG = 'wpdk-icon-cog';
71  const UP_BIG = 'wpdk-icon-up-big';
72  const LEFT_BIG = 'wpdk-icon-left-big';
73  const RIGHT_BIG = 'wpdk-icon-right-big';
74  const OFF = 'wpdk-icon-off';
75  const FACEBOOK = 'wpdk-icon-facebook';
76  const APPLE = 'wpdk-icon-apple';
77  const TWITTER = 'wpdk-icon-twitter';
78 
79  // since 1.4.7
80  const GOOGLE_PLUS = 'wpdk-icon-gplus';
81 
82  // since 1.4.21
83  const FIREFOX = 'wpdk-icon-firefox';
84  const CHROME = 'wpdk-icon-chrome';
85  const OPERA = 'wpdk-icon-opera';
86  const IE = 'wpdk-icon-ie';
87  const TAG = 'wpdk-icon-tag';
88  const TAGS = 'wpdk-icon-tags';
89  const DOC_INV = 'wpdk-icon-doc-inv';
90 
91  // since 1.5.0
92  const HELP_CIRCLED = 'wpdk-icon-help-circled';
93  const INFO_CIRCLED = 'wpdk-icon-info-circled';
94 
102  public $__version = '1.0.3';
103 
111  private function __construct()
112  {
113 
114  }
115 
123  public static function init()
124  {
125  static $instance = null;
126  if ( is_null( $instance ) ) {
127  $instance = new WPDKGlyphIcons();
128  }
129  return $instance;
130  }
131 
144  public static function html( $glypho, $size = '', $color = '', $tag = 'i' )
145  {
146  $stack = array();
147  $style = '';
148 
149  if ( !empty( $size ) ) {
150  $stack[] = sprintf( 'font-size:%s', $size );
151  }
152 
153  if ( !empty( $color ) ) {
154  $stack[] = sprintf( 'color:%s', $color );
155  }
156 
157  if( !empty( $stack ) ) {
158  $style = sprintf( 'style="%s"', implode(';', $stack ) );
159  }
160 
161  $result = sprintf( '<%s %s class="%s"></%s>', $tag, $style, $glypho, $tag );
162  return $result;
163  }
164 
177  public static function display( $glypho, $size = '', $color = '', $tag = 'i' )
178  {
179  echo self::html( $glypho, $size, $color, $tag );
180  }
181 
182 }