PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 2.2.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v2.2.0
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Render/Page/Data.php +58 -205 3.0.92.2.0 View file →
@@ -68,20 +68,20 @@
68 68 );
69 69 ?>
70 70 <span id="visualizer-chart-id" data-id="<?php echo $this->chart->ID; ?>"></span>
71 71 <iframe id="thehole" name="thehole"></iframe>
72 - <ul class="viz-group-wrapper full-height">
73 - <li class="viz-group viz-group-category open" id="vz-chart-source">
74 - <div class="viz-group-header">
75 - <h2 class="viz-group-title viz-main-group"><?php _e( 'Chart Data', 'visualizer' ); ?></h2>
72 + <ul class="group-wrapper full-height">
73 + <li class="group group-category open" id="vz-chart-source">
74 + <div class="group-header">
75 + <h2 class="group-title main-group"><?php _e( 'Chart Data', 'visualizer' ); ?></h2>
76 76 </div>
77 - <ul class="viz-group-content">
78 - <ul class="viz-group-wrapper">
79 - <li class="viz-group">
80 - <h2 class="viz-group-title viz-sub-group visualizer-src-tab"><?php _e( 'Import data from file', 'visualizer' ); ?></h2>
81 - <div class="viz-group-content">
82 - <p class="viz-group-description"><?php esc_html_e( 'Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?></p>
83 - <p class="viz-group-description"><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></p>
77 + <ul class="group-content">
78 + <ul class="group-wrapper">
79 + <li class="group">
80 + <h2 class="group-title sub-group visualizer-src-tab"><?php _e( 'Import data from file', 'visualizer' ); ?></h2>
81 + <div class="group-content">
82 + <p class="group-description"><?php esc_html_e( 'Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?></p>
83 + <p class="group-description"><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></p>
84 84 <form id="vz-csv-file-form" action="<?php echo $upload_link; ?>" method="post"
85 85 target="thehole" enctype="multipart/form-data">
86 86 <input type="hidden" id="remote-data" name="remote_data">
87 87 <div class="">
@@ -91,18 +91,18 @@
91 91 value="<?php _e( 'Import', 'visualizer' ); ?>">
92 92 </form>
93 93 </div>
94 94 </li>
95 - <li class="viz-group visualizer-import-url">
96 - <h2 class="viz-group-title viz-sub-group visualizer-src-tab"><?php _e( 'Import data from URL', 'visualizer' ); ?></h2>
97 - <ul class="viz-group-content">
98 - <li class="viz-subsection">
99 - <span class="viz-section-title"><?php _e( 'One time import', 'visualizer' ); ?></span>
95 + <li class="group visualizer-import-url">
96 + <h2 class="group-title sub-group visualizer-src-tab"><?php _e( 'Import data from URL', 'visualizer' ); ?></h2>
97 + <ul class="group-content">
98 + <li class="subsection">
99 + <span class="section-title"><?php _e( 'One time import', 'visualizer' ); ?></span>
100 100
101 - <div class="viz-section-items section-items">
102 - <p class="viz-group-description"><?php _e( 'You can use this to import data from a remote CSV file. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?> </p>
103 - <p class="viz-group-description"><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></p>
104 - <p class="viz-group-description"> <?php _e( 'You can also import data from Google Spreadsheet, for more info check <a href="https://github.com/Codeinwp/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
101 + <div class="section-items">
102 + <p class="group-description"><?php _e( 'You can use this to import data from a remote CSV file. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?> </p>
103 + <p class="group-description"><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></p>
104 + <p class="group-description"> <?php _e( 'You can also import data from Google Spreadsheet, for more info check <a href="https://github.com/Codeinwp/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
105 105 <form id="vz-one-time-import" action="<?php echo $upload_link; ?>" method="post"
106 106 target="thehole" enctype="multipart/form-data">
107 107 <div class="remote-file-section">
108 108 <input type="url" id="remote-data" name="remote_data"
@@ -114,16 +114,16 @@
114 114 value="<?php _e( 'Import', 'visualizer' ); ?>">
115 115 </form>
116 116 </div>
117 117 </li>
118 - <li class="viz-subsection <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?>">
119 - <span class="viz-section-title visualizer-import-url-schedule"><?php _e( 'Schedule Import', 'visualizer' ); ?>
118 + <li class="subsection <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?>">
119 + <span class="section-title visualizer-import-url-schedule"><?php _e( 'Schedule Import', 'visualizer' ); ?>
120 120 <span
121 121 class="dashicons dashicons-lock"></span></span>
122 - <div class="viz-section-items section-items">
123 - <p class="viz-group-description"><?php _e( 'You can choose here to synchronize your chart data with a remote CSV file.', 'visualizer' ); ?> </p>
124 - <p class="viz-group-description"> <?php _e( 'You can also synchronize with your Google Spreadsheet file, for more info check <a href="https://github.com/Codeinwp/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
125 - <p class="viz-group-description"> <?php _e( 'We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.', 'visualizer' ); ?></p>
122 + <div class="section-items">
123 + <p class="group-description"><?php _e( 'You can choose here to synchronize your chart data with a remote CSV file.', 'visualizer' ); ?> </p>
124 + <p class="group-description"> <?php _e( 'You can also synchronize with your Google Spreadsheet file, for more info check <a href="https://github.com/Codeinwp/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
125 + <p class="group-description"> <?php _e( 'We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.', 'visualizer' ); ?></p>
126 126 <form id="vz-schedule-import" action="<?php echo $upload_link; ?>" method="post"
127 127 target="thehole" enctype="multipart/form-data">
128 128 <div class="remote-file-section">
129 129 <input type="url" id="vz-schedule-url" name="remote_data"
@@ -129,9 +129,9 @@
129 129 <input type="url" id="vz-schedule-url" name="remote_data"
130 130 value="<?php echo get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_URL, true ); ?>"
131 131 placeholder="<?php esc_html_e( 'Please enter the URL of CSV file', 'visualizer' ); ?>"
132 132 class="visualizer-input visualizer-remote-url">
133 - <p class="viz-group-description"><?php _e( 'How often do you want to check the url', 'visualizer' ); ?></p>
133 + <p class="group-description"><?php _e( 'How often do you want to check the url', 'visualizer' ); ?></p>
134 134 <select name="vz-import-time" id="vz-import-time"
135 135 class="visualizer-select">
136 136 <?php
137 137 $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_SCHEDULE, true );
@@ -158,15 +158,15 @@
158 158 </div>
159 159 </li>
160 160 </ul>
161 161 </li>
162 - <li class="viz-group <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' ); ?>">
163 - <h2 class="viz-group-title viz-sub-group"
162 + <li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class', '' ); ?> ">
163 + <h2 class="group-title sub-group"
164 164 data-current="chart"><?php _e( 'Import from other chart', 'visualizer' ); ?><span
165 165 class="dashicons dashicons-lock"></span></h2>
166 - <div class="viz-group-content edit-data-content">
166 + <div class="group-content edit-data-content">
167 167 <div>
168 - <p class="viz-group-description"><?php _e( 'You can import here data from your previously created charts', 'visualizer' ); ?></p>
168 + <p class="group-description"><?php _e( 'You can import here data from your previously created charts', 'visualizer' ); ?></p>
169 169 <form>
170 170 <select name="vz-import-from-chart" id="chart-id" class="visualizer-select">
171 171 <?php
172 172 $fetch_link = add_query_arg(
@@ -200,14 +200,14 @@
200 200 </div>
201 201 </div>
202 202 </li>
203 203
204 - <li class="viz-group <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?> ">
205 - <h2 class="viz-group-title viz-sub-group"><?php _e( 'Import from WordPress', 'visualizer' ); ?><span
204 + <li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?> ">
205 + <h2 class="group-title sub-group"><?php _e( 'Import from WordPress', 'visualizer' ); ?><span
206 206 class="dashicons dashicons-lock"></span></h2>
207 - <div class="viz-group-content edit-data-content">
207 + <div class="group-content edit-data-content">
208 208 <div>
209 - <p class="viz-group-description"><?php _e( 'You can import here data from WordPress', 'visualizer' ); ?></p>
209 + <p class="group-description"><?php _e( 'You can import here data from WordPress', 'visualizer' ); ?></p>
210 210 <input type="button" id="filter-chart-button" class="button button-primary "
211 211 value="<?php _e( 'Create Filters', 'visualizer' ); ?>" data-current="chart"
212 212 data-t-filter="<?php _e( 'Show Chart', 'visualizer' ); ?>"
213 213 data-t-chart="<?php _e( 'Create Filters', 'visualizer' ); ?>">
@@ -215,24 +215,19 @@
215 215 </div>
216 216 </div>
217 217 </li>
218 218
219 - <?php
220 - // we will auto-open the manual data feature but only when pro is active.
221 - $pro_class = apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' );
222 - ?>
223 - <li class="viz-group <?php echo $pro_class; ?> <?php echo empty( $pro_class ) ? 'open' : ''; ?> ">
224 - <h2 class="viz-group-title viz-sub-group visualizer-editor-tab"
225 - data-current="chart"><?php _e( 'Manual Data', 'visualizer' ); ?><span
219 + <li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' ); ?>">
220 + <h2 class="group-title sub-group visualizer-editor-tab"
221 + data-current="chart"><?php _e( 'Add data manually', 'visualizer' ); ?><span
226 222 class="dashicons dashicons-lock"></span></h2>
227 223 <form id="editor-form" action="<?php echo $upload_link; ?>" method="post" target="thehole">
228 224 <input type="hidden" id="chart-data" name="chart_data">
229 - <input type="hidden" id="chart-data-src" name="chart_data_src">
230 225 </form>
231 226
232 - <div class="viz-group-content edit-data-content">
227 + <div class="group-content edit-data-content">
233 228 <div>
234 - <p class="viz-group-description"><?php _e( 'You can manually edit the chart data using the spreadsheet like editor.', 'visualizer' ); ?></p>
229 + <p class="group-description"><?php _e( 'You can manually edit the chart data using the spreadsheet like editor.', 'visualizer' ); ?></p>
235 230 <input type="button" id="editor-chart-button" class="button button-primary "
236 231 value="<?php _e( 'View Editor', 'visualizer' ); ?>" data-current="chart"
237 232 data-t-editor="<?php _e( 'Show Chart', 'visualizer' ); ?>"
238 233 data-t-chart="<?php _e( 'View Editor', 'visualizer' ); ?>">
@@ -243,29 +238,26 @@
243 238 </li>
244 239 </ul>
245 240 </li>
246 241 </ul>
247 - <li class="viz-group viz-group-category bottom-fixed sidebar-footer-link" id="vz-chart-settings">
248 - <h2><span class="dashicons dashicons-admin-tools"></span><?php _e( 'Advanced', 'visualizer' ); ?></h2>
249 - <div class="viz-group-header">
242 + <li class="group group-category bottom-fixed " id="vz-chart-settings">
243 + <h2><?php _e( 'Advanced Settings', 'visualizer' ); ?></h2>
244 + <div class="group-header">
250 245 <button class="customize-section-back" tabindex="0"></button>
251 - <h3 class="viz-group-title viz-main-group"><?php _e( 'Chart Settings', 'visualizer' ); ?></h3>
246 + <h3 class="group-title main-group"><?php _e( 'Chart Settings', 'visualizer' ); ?></h3>
252 247 </div>
253 - <ul class="viz-group-content">
248 + <ul class="group-content">
254 249 <form id="settings-form" action="<?php echo add_query_arg( 'nonce', wp_create_nonce() ); ?>"
255 250 method="post">
256 251 <?php echo $this->sidebar; ?>
257 - <input type="hidden" name="save" value="1">
258 252 </form>
259 - <form id="cancel-form" action="<?php echo add_query_arg( 'nonce', wp_create_nonce() ); ?>" method="post">
260 - <input type="hidden" name="cancel" value="1">
261 - </form>
262 253 </ul>
263 254 </li>
264 -
265 - <?php $this->getPermissionsLink( $this->chart->ID ); ?>
266 -
267 - <li class="viz-group bottom-fixed" id="vz-chart-copyright">Visualizer &copy; <?php echo date( 'Y', current_time( 'timestamp' ) ); ?></li>
255 + <li class=" group bottom-fixed" id="vz-chart-review">
256 + <a href="https://wordpress.org/support/plugin/visualizer/reviews/?filter=5#new-post"
257 + target="_blank"><?php _e( 'Rate our plugin', 'visualizer' ); ?></a>
258 + </li>
259 + <li class="group bottom-fixed" id="vz-chart-copyright">Visualizer &copy; <?php echo date( 'Y', current_time( 'timestamp' ) ); ?></li>
268 260 </ul>
269 261 <?php
270 262 // changed by Ash/Upwork
271 263 }
@@ -270,143 +262,8 @@
270 262 // changed by Ash/Upwork
271 263 }
272 264
273 265 /**
274 - * Generates the permissions link.
275 - *
276 - * @access private
277 - * @param int $id The chart id.
278 - */
279 - private function getPermissionsLink( $id ) {
280 - $permissions = apply_filters( 'visualizer_pro_get_permissions', null, $id );
281 - if ( $permissions ) {
282 - foreach ( $permissions as $k => $v ) {
283 - $this->$k = $v;
284 - }
285 - }
286 -?>
287 - <li class="viz-group viz-group-category bottom-fixed sidebar-footer-link" id="vz-chart-permissions">
288 - <h2><span class="dashicons dashicons-admin-users"></span><?php _e( 'Permissions', 'visualizer' ); ?></h2>
289 - <div class="viz-group-header">
290 - <button class="customize-section-back" tabindex="0"></button>
291 - <h3 class="viz-group-title viz-main-group"><?php _e( 'Chart Settings', 'visualizer' ); ?></h3>
292 - </div>
293 - <ul class="viz-group-content">
294 - <form id="permissions-form" target="thehole" action="
295 - <?php
296 - echo add_query_arg(
297 - array(
298 - 'nonce' => wp_create_nonce(),
299 - 'tab' => 'permissions',
300 - ), remove_query_arg( 'tab', $_SERVER['REQUEST_URI'] )
301 - );
302 -?>
303 -" method="post">
304 - <?php $this->permissionsSidebar(); ?>
305 - </form>
306 - </ul>
307 - </li>
308 -<?php
309 - }
310 -
311 - /**
312 - * Generates the permissions form.
313 - *
314 - * @access private
315 - */
316 - private function permissionsSidebar() {
317 - // ignore for unit tests because Travis throws the error "Indirect modification of overloaded property Visualizer_Render_Page_Data::$permissions has no effect".
318 - if ( defined( 'WP_TESTS_DOMAIN' ) ) {
319 - return;
320 - }
321 - Visualizer_Render_Sidebar::_renderGroupStart(
322 - esc_html__( 'Who can see this chart?', 'visualizer' ) . '<span
323 - class="dashicons dashicons-lock"></span>', '', apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'chart-permissions' )
324 - );
325 - Visualizer_Render_Sidebar::_renderSectionStart();
326 - Visualizer_Render_Sidebar::_renderSectionDescription( esc_html__( 'Select who can view the chart on the front-end.', 'visualizer' ) );
327 -
328 - if ( ! isset( $this->permissions['read'] ) ) {
329 - $this->permissions['read'] = 'all';
330 - }
331 -
332 - Visualizer_Render_Sidebar::_renderSelectItem(
333 - '',
334 - 'permissions[read]',
335 - $this->permissions['read'],
336 - array(
337 - 'all' => esc_html__( 'All Users', 'visualizer' ),
338 - 'users' => esc_html__( 'Select Users', 'visualizer' ),
339 - 'roles' => esc_html__( 'Select Roles', 'visualizer' ),
340 - ),
341 - '',
342 - false,
343 - array( 'visualizer-permission', 'visualizer-permission-type', 'visualizer-permission-read' ),
344 - array(
345 - 'permission-type' => 'read',
346 - )
347 - );
348 -
349 - $options = apply_filters( 'visualizer_pro_get_permissions_data', array(), isset( $this->permissions['read'] ) ? $this->permissions['read'] : 'roles' );
350 -
351 - Visualizer_Render_Sidebar::_renderSelectItem(
352 - '',
353 - 'permissions[read-specific][]',
354 - isset( $this->permissions['read-specific'] ) ? $this->permissions['read-specific'] : array(),
355 - $options,
356 - '',
357 - true,
358 - array( 'visualizer-permission', 'visualizer-permission-specific', 'visualizer-permission-read-specific' )
359 - );
360 - Visualizer_Render_Sidebar::_renderSectionEnd( apply_filters( 'visualizer_pro_upsell', 'only-pro-feature', 'chart-permissions' ) );
361 - Visualizer_Render_Sidebar::_renderGroupEnd();
362 -
363 - Visualizer_Render_Sidebar::_renderGroupStart(
364 - esc_html__( 'Who can edit this chart?', 'visualizer' ) . '<span
365 - class="dashicons dashicons-lock"></span>', '', apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'chart-permissions' )
366 - );
367 - Visualizer_Render_Sidebar::_renderSectionStart();
368 - Visualizer_Render_Sidebar::_renderSectionDescription( esc_html__( 'Select who can edit the chart on the front-end.', 'visualizer' ) );
369 -
370 - if ( ! isset( $this->permissions['edit'] ) ) {
371 - $this->permissions['edit'] = 'roles';
372 - $this->permissions['edit-specific'] = 'administrator';
373 - }
374 -
375 - Visualizer_Render_Sidebar::_renderSelectItem(
376 - '',
377 - 'permissions[edit]',
378 - $this->permissions['edit'],
379 - array(
380 - 'all' => esc_html__( 'All Users', 'visualizer' ),
381 - 'users' => esc_html__( 'Select Users', 'visualizer' ),
382 - 'roles' => esc_html__( 'Select Roles', 'visualizer' ),
383 - ),
384 - '',
385 - false,
386 - array( 'visualizer-permission', 'visualizer-permission-type', 'visualizer-permission-edit' ),
387 - array(
388 - 'permission-type' => 'edit',
389 - )
390 - );
391 -
392 - $options = apply_filters( 'visualizer_pro_get_permissions_data', array(), isset( $this->permissions['edit'] ) ? $this->permissions['edit'] : 'roles' );
393 -
394 - Visualizer_Render_Sidebar::_renderSelectItem(
395 - '',
396 - 'permissions[edit-specific][]',
397 - isset( $this->permissions['edit-specific'] ) ? $this->permissions['edit-specific'] : array(),
398 - $options,
399 - '',
400 - true,
401 - array( 'visualizer-permission', 'visualizer-permission-specific', 'visualizer-permission-edit-specific' )
402 - );
403 - Visualizer_Render_Sidebar::_renderSectionEnd( apply_filters( 'visualizer_pro_upsell', 'only-pro-feature', 'chart-permissions' ) );
404 - Visualizer_Render_Sidebar::_renderGroupEnd();
405 -
406 - }
407 -
408 - /**
409 266 * Renders toolbar content.
410 267 *
411 268 * @since 1.0.0
412 269 *
@@ -412,20 +269,16 @@
412 269 *
413 270 * @access protected
414 271 */
415 272 protected function _renderToolbar() {
416 - // don't show back button at all.
417 - // NOTE: We can't be selective on the post_status here because when a new chart reaches the settings screen, its status changes to publish.
418 - if ( ! VISUALIZER_SKIP_CHART_TYPE_PAGE ) {
419 - echo '<div class="toolbar-div">';
420 - echo '<a class="button button-large" href="', add_query_arg( 'tab', 'types' ), '">';
421 - esc_html_e( 'Back', 'visualizer' );
422 - echo '</a>';
423 - echo '</div>';
424 - }
273 + // changed by Ash/Upwork
274 + echo '<div class="toolbar-div">';
275 + echo '<a class="button button-large" href="', add_query_arg( 'tab', 'types' ), '">';
276 + esc_html_e( 'Back', 'visualizer' );
277 + echo '</a>';
278 + echo '</div>';
425 279 echo '<input type="submit" id="settings-button" class="button button-primary button-large push-right" value="', $this->button, '">';
426 - if ( isset( $this->cancel_button ) ) {
427 - echo '<input type="submit" id="cancel-button" class="button button-secondary button-large push-right" value="', $this->cancel_button, '">';
428 - }
280 + echo '</div>';
281 +
429 282 }
430 283
431 284 }