@@ -77,7 +77,7 @@ public function enqueue_gutenberg_scripts() {
77
77
} else {
78
78
$ version = $ this ->version ;
79
79
}
80
-
80
+
81
81
// Enqueue the bundled block JS file
82
82
wp_enqueue_script ( 'handsontable ' , $ handsontableJS );
83
83
wp_enqueue_script ( 'visualizer-gutenberg-block ' , $ blockPath , array ( 'wp-api ' , 'handsontable ' ), $ version );
@@ -92,9 +92,9 @@ public function enqueue_gutenberg_scripts() {
92
92
}
93
93
94
94
$ translation_array = array (
95
- 'isPro ' => $ type ,
95
+ 'isPro ' => $ type ,
96
96
'proTeaser ' => Visualizer_Plugin::PRO_TEASER_URL ,
97
- 'absurl ' => VISUALIZER_ABSURL ,
97
+ 'absurl ' => VISUALIZER_ABSURL ,
98
98
);
99
99
wp_localize_script ( 'visualizer-gutenberg-block ' , 'visualizerLocalize ' , $ translation_array );
100
100
@@ -213,15 +213,15 @@ public function get_visualizer_data( $post ) {
213
213
214
214
$ schedule = get_post_meta ( $ post_id , Visualizer_Plugin::CF_CHART_SCHEDULE , true );
215
215
216
- if ( ! empty ( $ import ) && ! empty ( $ schedule ) ) {
216
+ if ( ! empty ( $ import ) && ! empty ( $ schedule ) ) {
217
217
$ data ['visualizer-chart-url ' ] = $ import ;
218
218
$ data ['visualizer-chart-schedule ' ] = $ schedule ;
219
219
}
220
220
221
221
if ( VISUALIZER_PRO ) {
222
222
$ permissions = get_post_meta ( $ post_id , Visualizer_PRO::CF_PERMISSIONS , true );
223
-
224
- if ( ! empty ( $ permissions ) ) {
223
+
224
+ if ( ! empty ( $ permissions ) ) {
225
225
$ data ['visualizer-permissions ' ] = $ permissions ;
226
226
}
227
227
}
@@ -288,7 +288,6 @@ public function update_chart_data( $data ) {
288
288
public function format_chart_data ( $ data , $ series ) {
289
289
foreach ( $ series as $ i => $ row ) {
290
290
// if no value exists for the seires, then add null
291
-
292
291
if ( ! isset ( $ series [ $ i ] ) ) {
293
292
$ series [ $ i ] = null ;
294
293
}
@@ -297,19 +296,19 @@ public function format_chart_data( $data, $series ) {
297
296
continue ;
298
297
}
299
298
300
- if ( $ row ['type ' ] == 'number ' ) {
299
+ if ( $ row ['type ' ] == 'number ' ) {
301
300
foreach ( $ data as $ o => $ col ) {
302
301
$ data [ $ o ][ $ i ] = ( is_numeric ( $ col [ $ i ] ) ) ? floatval ( $ col [ $ i ] ) : ( is_numeric ( str_replace ( ', ' , '' , $ col [ $ i ] ) ) ? floatval ( str_replace ( ', ' , '' , $ col [ $ i ] ) ) : null );
303
302
}
304
303
}
305
304
306
- if ( $ row ['type ' ] == 'boolean ' ) {
305
+ if ( $ row ['type ' ] == 'boolean ' ) {
307
306
foreach ( $ data as $ o => $ col ) {
308
307
$ data [ $ o ][ $ i ] = ! empty ( $ col [ $ i ] ) ? filter_validate ( $ col [ $ i ], FILTER_VALIDATE_BOOLEAN ) : null ;
309
308
}
310
309
}
311
310
312
- if ( $ row ['type ' ] == 'timeofday ' ) {
311
+ if ( $ row ['type ' ] == 'timeofday ' ) {
313
312
foreach ( $ data as $ o => $ col ) {
314
313
$ date = new DateTime ( '1984-03-16T ' . $ col [ $ i ] );
315
314
if ( $ date ) {
@@ -323,9 +322,9 @@ public function format_chart_data( $data, $series ) {
323
322
}
324
323
}
325
324
326
- if ( $ row ['type ' ] == 'string ' ) {
325
+ if ( $ row ['type ' ] == 'string ' ) {
327
326
foreach ( $ data as $ o => $ col ) {
328
- $ data [ $ o ][ $ i ] = $ this ->toUTF8 ( $ col [ $ i ] );
327
+ $ data [ $ o ][ $ i ] = $ this ->toUTF8 ( $ col [ $ i ] );
329
328
}
330
329
}
331
330
}
@@ -385,8 +384,8 @@ public function get_permission_data( $data ) {
385
384
if ( ! empty ( $ users ) ) {
386
385
$ i = 0 ;
387
386
foreach ( $ users as $ user ) {
388
- $ options [$ i ]['value ' ] = $ user ->ID ;
389
- $ options [$ i ]['label ' ] = $ user ->display_name ;
387
+ $ options [ $ i ]['value ' ] = $ user ->ID ;
388
+ $ options [ $ i ]['label ' ] = $ user ->display_name ;
390
389
$ i ++;
391
390
}
392
391
}
@@ -399,8 +398,8 @@ public function get_permission_data( $data ) {
399
398
if ( ! empty ( $ roles ) ) {
400
399
$ i = 0 ;
401
400
foreach ( get_editable_roles () as $ name => $ info ) {
402
- $ options [$ i ]['value ' ] = $ name ;
403
- $ options [$ i ]['label ' ] = $ name ;
401
+ $ options [ $ i ]['value ' ] = $ name ;
402
+ $ options [ $ i ]['label ' ] = $ name ;
404
403
$ i ++;
405
404
}
406
405
}
0 commit comments