@@ -233,11 +233,20 @@ private function _renderLibrary() {
233
233
foreach ( $ this ->charts as $ placeholder_id => $ chart ) {
234
234
// show the sidebar after the first 3 charts.
235
235
$ count ++;
236
+ $ enable_controls = false ;
237
+ $ settings = isset ( $ chart ['settings ' ] ) ? $ chart ['settings ' ] : array ();
238
+ if ( ! empty ( $ settings ['controls ' ]['controlType ' ] ) ) {
239
+ $ column_index = $ settings ['controls ' ]['filterColumnIndex ' ];
240
+ $ column_label = $ settings ['controls ' ]['filterColumnLabel ' ];
241
+ if ( 'false ' !== $ column_index || 'false ' !== $ column_label ) {
242
+ $ enable_controls = true ;
243
+ }
244
+ }
236
245
if ( 3 === $ count ) {
237
246
$ this ->_renderSidebar ();
238
- $ this ->_renderChartBox ( $ placeholder_id , $ chart ['id ' ] );
247
+ $ this ->_renderChartBox ( $ placeholder_id , $ chart ['id ' ], $ enable_controls );
239
248
} else {
240
- $ this ->_renderChartBox ( $ placeholder_id , $ chart ['id ' ] );
249
+ $ this ->_renderChartBox ( $ placeholder_id , $ chart ['id ' ], $ enable_controls );
241
250
}
242
251
}
243
252
// show the sidebar if there are less than 3 charts.
@@ -282,7 +291,7 @@ private function _renderLibrary() {
282
291
* @param string $placeholder_id The placeholder's id for the chart.
283
292
* @param int $chart_id The id of the chart.
284
293
*/
285
- private function _renderChartBox ( $ placeholder_id , $ chart_id ) {
294
+ private function _renderChartBox ( $ placeholder_id , $ chart_id, $ with_filter = false ) {
286
295
$ settings = get_post_meta ( $ chart_id , Visualizer_Plugin::CF_SETTINGS );
287
296
$ title = '# ' . $ chart_id ;
288
297
if ( ! empty ( $ settings [0 ]['title ' ] ) ) {
@@ -336,14 +345,14 @@ private function _renderChartBox( $placeholder_id, $chart_id ) {
336
345
}
337
346
$ shortcode = sprintf ( '[visualizer id="%s" lazy="no" class=""] ' , $ chart_id );
338
347
echo '<div class="items"><div class="visualizer-chart"><div class="visualizer-chart-title"> ' , esc_html ( $ title ), '</div> ' ;
339
- if ( Visualizer_Module::is_pro () ) {
348
+ if ( Visualizer_Module::is_pro () && $ with_filter ) {
340
349
echo '<div id="chart_wrapper_ ' . $ placeholder_id . '"> ' ;
341
350
echo '<div id="control_wrapper_ ' . $ placeholder_id . '" class="vz-library-chart-filter"></div> ' ;
342
351
}
343
352
echo '<div id=" ' , $ placeholder_id , '" class="visualizer-chart-canvas"> ' ;
344
353
echo '<img src=" ' , VISUALIZER_ABSURL , 'images/ajax-loader.gif" class="loader"> ' ;
345
354
echo '</div> ' ;
346
- if ( Visualizer_Module::is_pro () ) {
355
+ if ( Visualizer_Module::is_pro () && $ with_filter ) {
347
356
echo '</div> ' ;
348
357
}
349
358
echo '<div class="visualizer-chart-footer visualizer-clearfix"> ' ;
0 commit comments