29 $button_update = self::button();
30 $button_reset = self::button( __(
'Reset to default', WPDK_TEXTDOMAIN ), array(
31 'name' =>
'resetToDefault',
32 'classes' =>
'button-secondary'
34 return sprintf(
'<p>%s%s</p>', $button_reset, $button_update );
46 public static function submit( $args = array() )
48 $default_args = array(
49 'name' =>
'button-submit',
50 'class' =>
'button button-primary alignright',
51 'value' => __(
'Submit', WPDK_TEXTDOMAIN )
54 $item = wp_parse_args( $args, $default_args );
60 return $submit->html();
80 public static function button( $label =
'', $args = array() )
83 $default_args = array(
85 'name' =>
'button-update',
86 'classes' =>
' button button-primary alignright',
87 'additional_classes' =>
'',
91 $args = wp_parse_args( $args, $default_args );
94 if ( empty( $label ) ) {
95 $label = __(
'Update', WPDK_TEXTDOMAIN );
99 if ( empty( $args[
'name'] ) ) {
103 $name = sprintf(
'name="%s"', $args[
'name'] );
108 if ( !empty( $args[
'data'] ) ) {
110 foreach ( $args[
'data'] as $key => $value ) {
111 $stack[] = sprintf(
'data-%s="%s"', $key, htmlspecialchars( stripslashes( $value ) ) );
113 $data = implode(
',', $stack );
118 if ( !empty( $args[
'additional_classes'] ) ) {
119 if ( !is_array( $args[
'additional_classes'] ) ) {
120 $new = explode(
' ', $args[
'additional_classes'] );
121 if ( empty( $new ) ) {
122 $new = array( $args[
'additional_classes'] );
127 $default = explode(
' ', $args[
'classes'] );
128 $classes = implode(
' ', array_merge( $default, $new ) );
131 $classes .= $args[
'classes'];
135 <input type=
"<?php echo $args['type'] ?>" <?php echo $name ?>
137 class=
"<?php echo $classes ?>"
138 value=
"<?php echo $label ?>" />
141 $content = ob_get_contents();
153 public static function badged( $count = 0, $classes =
'', $tooltip =
'', $placement =
'' )
155 _deprecated_function( __METHOD__,
'1.0.0.b3',
'badge()' );
156 self::badge( $count, $classes, $tooltip, $placement );
171 public static function badge( $count = 0, $classes =
'', $tooltip =
'', $placement =
'' )
173 $classes = !empty( $classes ) ?
' ' . $classes :
'';
175 if ( !empty( $tooltip ) ) {
176 $classes .=
' wpdk-has-tooltip';
177 $placement = sprintf(
'data-placement="%s"', empty( $placement ) ?
'bottom' : $placement );
180 if ( !empty( $count ) ) {
181 $result = sprintf(
'<span title="%s" %s class="wpdk-badge update-plugins count-%s%s"><span class="plugin-count">%s</span></span>', $tooltip, $placement, $count, $classes, number_format_i18n( $count ) );
185 $result = sprintf(
'<span class="%s"></span>', $classes );
209 public static function view( $id, $title, $icon_class, $content )
213 <div
class=
"{$icon_class}"></div>
215 <div
class=
"wpdk-border-container {$id}">
242 $input_hidden_nonce->value = wp_create_nonce( $id );
243 return $input_hidden_nonce->html();
261 <div
class=
"wpdk-ui-truncate wpdk-ui-truncate-size_{$size}" title=
"{$value}">
262 <span>{$value}</span>