PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 2.0.3
Visualizer – Tables & Charts Manager with Built-in AI Generator v2.0.3
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 +108 -404 3.1.32.0.3 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +
2 3 // +----------------------------------------------------------------------+
3 4 // | Copyright 2013 Madpixels (email : visualizer@madpixels.net) |
4 5 // +----------------------------------------------------------------------+
5 6 // | This program is free software; you can redistribute it and/or modify |
@@ -39,23 +40,14 @@
39 40 protected function _renderContent() {
40 41 // Added by Ash/Upwork
41 42 if ( VISUALIZER_PRO ) {
42 43 global $Visualizer_Pro;
43 - $Visualizer_Pro->_addEditor( $this->chart->ID );
44 - if ( method_exists( $Visualizer_Pro, '_addFilterWizard' ) ) {
45 - $Visualizer_Pro->_addFilterWizard( $this->chart->ID );
46 - }
47 - } else {
48 - Visualizer_Render_Layout::show( 'faux-editor' );
44 + $Visualizer_Pro->_addEditor();
49 45 }
50 -
51 - $this->add_additional_content();
52 -
53 46 // Added by Ash/Upwork
54 47 echo '<div id="canvas">';
55 48 echo '<img src="', VISUALIZER_ABSURL, 'images/ajax-loader.gif" class="loader">';
56 49 echo '</div>';
57 - echo $this->custom_css;
58 50 }
59 51
60 52 /**
61 53 * Renders sidebar content.
@@ -64,42 +56,29 @@
64 56 *
65 57 * @access protected
66 58 */
67 59 protected function _renderSidebarContent() {
68 - $upload_link = add_query_arg(
69 - array(
70 - 'action' => Visualizer_Plugin::ACTION_UPLOAD_DATA,
71 - 'nonce' => wp_create_nonce(),
72 - 'chart' => $this->chart->ID,
73 - ),
74 - admin_url( 'admin-ajax.php' )
75 - );
60 + $upload_link = add_query_arg( array(
61 + 'action' => Visualizer_Plugin::ACTION_UPLOAD_DATA,
62 + 'nonce' => wp_create_nonce(),
63 + 'chart' => $this->chart->ID,
64 + ), admin_url( 'admin-ajax.php' ) );
76 65
77 - // this will allow us to open the correct source tab by default.
78 - $source_of_chart = strtolower( get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_SOURCE, true ) );
79 - // both import from wp and import from db have the same source so we need to differentiate.
80 - $filter_config = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_FILTER_CONFIG, true );
81 - // if filter config is present, then its import from wp.
82 - if ( ! empty( $filter_config ) ) {
83 - $source_of_chart .= '_wp';
84 - }
85 - $type = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
86 66 ?>
87 - <span id="visualizer-chart-id" data-id="<?php echo $this->chart->ID; ?>" data-chart-source="<?php echo $source_of_chart; ?>" data-chart-type="<?php echo $type; ?>"></span>
88 67 <iframe id="thehole" name="thehole"></iframe>
89 - <ul class="viz-group-wrapper full-height">
90 - <li class="viz-group viz-group-category open" id="vz-chart-source">
91 - <div class="viz-group-header">
92 - <h2 class="viz-group-title viz-main-group"><?php _e( 'Chart Data', 'visualizer' ); ?></h2>
68 + <ul class="group-wrapper full-height">
69 + <li class="group group-category open" id="vz-chart-source">
70 + <div class="group-header">
71 + <h2 class="group-title main-group"><?php _e( 'Chart Data', 'visualizer' ); ?></h2>
93 72 </div>
94 - <ul class="viz-group-content">
95 - <ul class="viz-group-wrapper">
96 - <li class="viz-group visualizer_source_csv">
97 - <h2 class="viz-group-title viz-sub-group visualizer-src-tab"><?php _e( 'Import data from file', 'visualizer' ); ?></h2>
98 - <div class="viz-group-content">
99 - <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>
100 - <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>
101 - <form id="vz-csv-file-form" action="<?php echo $upload_link; ?>" method="post"
73 + <ul class="group-content">
74 + <ul class="group-wrapper">
75 + <li class="group">
76 + <h2 class="group-title sub-group visualizer-src-tab"><?php _e( 'Import data from file', 'visualizer' ); ?></h2>
77 + <div class="group-content">
78 + <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>
79 + <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>
80 + <form id="vz-csv-file-form" action="<?php echo $upload_link ?>" method="post"
102 81 target="thehole" enctype="multipart/form-data">
103 82 <input type="hidden" id="remote-data" name="remote_data">
104 83 <div class="">
105 84 <input type="file" id="csv-file" name="local_data">
@@ -108,19 +87,19 @@
108 87 value="<?php _e( 'Import', 'visualizer' ); ?>">
109 88 </form>
110 89 </div>
111 90 </li>
112 - <li class="viz-group visualizer-import-url visualizer_source_csv_remote">
113 - <h2 class="viz-group-title viz-sub-group visualizer-src-tab"><?php _e( 'Import data from URL', 'visualizer' ); ?></h2>
114 - <ul class="viz-group-content">
115 - <li class="viz-subsection">
116 - <span class="viz-section-title"><?php _e( 'One time import', 'visualizer' ); ?></span>
91 + <li class="group visualizer-import-url">
92 + <h2 class="group-title sub-group visualizer-src-tab"><?php _e( 'Import data from URL', 'visualizer' ); ?></h2>
93 + <ul class="group-content">
94 + <li class="subsection">
95 + <span class="section-title"><?php _e( 'One time import', 'visualizer' ); ?></span>
117 96
118 - <div class="viz-section-items section-items">
119 - <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>
120 - <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>
121 - <p class="viz-group-description"> <?php _e( 'You can also import data from Google Spreadsheet, for more info check <a href="https://docs.themeisle.com/article/607-how-can-i-populate-data-from-google-spreadsheet" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
122 - <form id="vz-one-time-import" action="<?php echo $upload_link; ?>" method="post"
97 + <div class="section-items">
98 + <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>
99 + <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>
100 + <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>
101 + <form id="vz-one-time-import" action="<?php echo $upload_link ?>" method="post"
123 102 target="thehole" enctype="multipart/form-data">
124 103 <div class="remote-file-section">
125 104 <input type="url" id="remote-data" name="remote_data"
126 105 placeholder="<?php esc_html_e( 'Please enter the URL of CSV file', 'visualizer' ); ?>"
@@ -131,48 +110,44 @@
131 110 value="<?php _e( 'Import', 'visualizer' ); ?>">
132 111 </form>
133 112 </div>
134 113 </li>
135 - <li class="viz-subsection <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?>">
136 - <span class="viz-section-title visualizer-import-url-schedule"><?php _e( 'Schedule Import', 'visualizer' ); ?>
137 - <span
114 + <li class="subsection <?php echo apply_filters( 'visualizer_pro_upsell_class','only-pro-feature', 'schedule-chart' ); ?>">
115 + <span class="section-title visualizer-import-url-schedule"><?php _e( 'Schedule Import', 'visualizer' ); ?><span
138 116 class="dashicons dashicons-lock"></span></span>
139 - <div class="viz-section-items section-items">
140 - <p class="viz-group-description"><?php _e( 'You can choose here to synchronize your chart data with a remote CSV file.', 'visualizer' ); ?> </p>
141 - <p class="viz-group-description"> <?php _e( 'You can also synchronize with your Google Spreadsheet file, for more info check <a href="https://docs.themeisle.com/article/607-how-can-i-populate-data-from-google-spreadsheet" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
142 - <p class="viz-group-description"> <?php _e( 'We will update the chart data based on your time interval preference by overwriting the current data with the one from the URL.', 'visualizer' ); ?></p>
143 - <form id="vz-schedule-import" action="<?php echo $upload_link; ?>" method="post"
117 + <div class="section-items">
118 + <p class="group-description"><?php _e( 'You can choose here to synchronize your chart data with a remote CSV file.', 'visualizer' ); ?> </p>
119 + <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>
120 + <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>
121 + <form id="vz-schedule-import" action="<?php echo $upload_link ?>" method="post"
144 122 target="thehole" enctype="multipart/form-data">
145 123 <div class="remote-file-section">
146 - <input type="url" id="vz-schedule-url" name="remote_data"
147 - value="<?php echo get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_URL, true ); ?>"
124 + <input type="url" id="vz-schedule-url" name="remote_data" value="<?php echo get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_URL, true );?>"
148 125 placeholder="<?php esc_html_e( 'Please enter the URL of CSV file', 'visualizer' ); ?>"
149 126 class="visualizer-input visualizer-remote-url">
150 - <p class="viz-group-description"><?php _e( 'How often do you want to check the url', 'visualizer' ); ?></p>
151 - <select name="vz-import-time" id="vz-import-time"
152 - class="visualizer-select">
153 - <?php
154 - $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_SCHEDULE, true );
155 - $schedules = apply_filters(
156 - 'visualizer_chart_schedules', array(
157 - '1' => __( 'Each hour', 'visualizer' ),
158 - '12' => __( 'Each 12 hours', 'visualizer' ),
159 - '24' => __( 'Each day', 'visualizer' ),
160 - '72' => __( 'Each 3 days', 'visualizer' ),
161 - )
162 - );
163 - foreach ( $schedules as $num => $name ) {
164 - $extra = $num == $hours ? 'selected' : '';
165 - ?>
166 - <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
167 - <?php
168 - }
169 - ?>
127 + <p class="group-description"><?php _e( 'How often do you want to check the url', 'visualizer' ); ?></p>
128 + <select name="vz-import-time" id="vz-import-time" class="visualizer-select">
129 + <?php
130 + $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_SCHEDULE, true );
131 + $schedules = array(
132 + '1' => __( 'Each hour', 'visualizer' ),
133 + '12' => __( 'Each 12 hours', 'visualizer' ),
134 + '24' => __( 'Each day', 'visualizer' ),
135 + '36' => __( 'Each 3 days', 'visualizer' ),
136 + );
137 + foreach ( $schedules as $num => $name ) {
138 + $extra = $num == $hours ? 'selected' : '';
139 + ?>
140 + <option value="<?php echo $num;?>" <?php echo $extra;?>><?php echo $name;?></option>
141 + <?php
142 + }
143 + ?>
170 144 </select>
171 145 </div>
172 146 <input type="button" id="vz-save-schedule" class="button button-primary"
173 147 value="<?php _e( 'Save schedule', 'visualizer' ); ?>">
174 148
149 +
175 150 <?php echo apply_filters( 'visualizer_pro_upsell', '', 'schedule-chart' ); ?>
176 151 </form>
177 152 </div>
178 153 </li>
@@ -177,167 +152,60 @@
177 152 </div>
178 153 </li>
179 154 </ul>
180 155 </li>
181 - <li class="viz-group <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' ); ?>">
182 - <h2 class="viz-group-title viz-sub-group"
156 + <li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class','only-pro-feature' ); ?> ">
157 + <h2 class="group-title sub-group"
183 158 data-current="chart"><?php _e( 'Import from other chart', 'visualizer' ); ?><span
184 159 class="dashicons dashicons-lock"></span></h2>
185 - <div class="viz-group-content edit-data-content">
160 + <div class="group-content edit-data-content">
186 161 <div>
187 - <p class="viz-group-description"><?php _e( 'You can import here data from your previously created charts', 'visualizer' ); ?></p>
162 + <p class="group-description"><?php _e( 'You can import here data from your previously created charts', 'visualizer' ); ?></p>
188 163 <form>
189 164 <select name="vz-import-from-chart" id="chart-id" class="visualizer-select">
190 - <?php
191 - $fetch_link = add_query_arg(
192 - array(
193 - 'action' => ( VISUALIZER_PRO ) ? Visualizer_Pro::ACTION_FETCH_DATA : '',
194 - 'nonce' => wp_create_nonce(),
195 - ),
196 - admin_url( 'admin-ajax.php' )
197 - );
198 - $query_args_charts = array(
199 - 'post_type' => Visualizer_Plugin::CPT_VISUALIZER,
200 - 'posts_per_page' => 300,
201 - 'no_found_rows' => true,
202 - );
203 - $charts = array();
204 - $query = new WP_Query( $query_args_charts );
205 - while ( $query->have_posts() ) {
206 - $chart = $query->next_post();
207 - $settings = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SETTINGS, true );
208 - ?>
209 - <option value="<?php echo $chart->ID; ?>"><?php echo empty( $settings['title'] ) ? '#' . $chart->ID : $settings['title']; ?></option>
210 - <?php
211 - }
212 - ?>
165 + <?php
166 + $fetch_link = add_query_arg( array(
167 + 'action' => ( VISUALIZER_PRO ) ? Visualizer_Pro::ACTION_FETCH_DATA : '',
168 + 'nonce' => wp_create_nonce(),
169 + ), admin_url( 'admin-ajax.php' ) );
213 170
171 + $query_args_charts = array(
172 + 'post_type' => Visualizer_Plugin::CPT_VISUALIZER,
173 + 'posts_per_page' => 300,
174 + 'no_found_rows' => true,
175 + );
176 + $charts = array();
177 + $query = new WP_Query( $query_args_charts );
178 + while ( $query->have_posts() ) {
179 + $chart = $query->next_post();
180 + $settings = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SETTINGS, true );
181 + ?>
182 + <option value="<?php echo $chart->ID; ?>"><?php echo empty( $settings['title'] ) ? '#' . $chart->ID : $settings['title']; ?></option>
183 + <?php
184 + }
185 + ?>
186 +
214 187 </select>
215 188 </form>
216 - <input type="button" id="existing-chart" class="button button-primary"
217 - value="<?php _e( 'Import Chart', 'visualizer' ); ?>"
218 - data-viz-link="<?php echo $fetch_link; ?>">
189 + <input type="button" id="existing-chart" class="button button-primary"
190 + value="<?php _e( 'Import Chart', 'visualizer' ); ?>" data-viz-link="<?php echo $fetch_link;?>">
219 191 <?php echo apply_filters( 'visualizer_pro_upsell', '' ); ?>
220 192 </div>
221 193 </div>
222 194 </li>
223 -
224 - <?php
225 - $save_filter = add_query_arg(
226 - array(
227 - 'action' => Visualizer_Plugin::ACTION_SAVE_FILTER_QUERY,
228 - 'security' => wp_create_nonce( Visualizer_Plugin::ACTION_SAVE_FILTER_QUERY . Visualizer_Plugin::VERSION ),
229 - 'chart' => $this->chart->ID,
230 - ), admin_url( 'admin-ajax.php' )
231 - );
232 - ?>
233 - <li class="viz-group visualizer_source_query_wp <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?> ">
234 - <h2 class="viz-group-title viz-sub-group"><?php _e( 'Import from WordPress', 'visualizer' ); ?><span
195 + <li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class','only-pro-feature' ); ?>">
196 + <h2 class="group-title sub-group visualizer-editor-tab"
197 + data-current="chart"><?php _e( 'Edit current data', 'visualizer' ); ?><span
235 198 class="dashicons dashicons-lock"></span></h2>
236 - <div class="viz-group-content edit-data-content">
237 - <div>
238 - <p class="viz-group-description"><?php _e( 'You can import data from WordPress here.', 'visualizer' ); ?></p>
239 - <form id="vz-filter-wizard" action="<?php echo $save_filter; ?>" method="post" target="thehole">
240 - <p class="viz-group-description"><?php _e( 'How often do you want to refresh the data from WordPress.', 'visualizer' ); ?></p>
241 - <select name="refresh" id="vz-filter-import-time" class="visualizer-select">
242 - <?php
243 - $bttn_label = 'visualizer_source_query_wp' === $source_of_chart ? __( 'Modify Filter', 'visualizer' ) : __( 'Create Filter', 'visualizer' );
244 - $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_SCHEDULE, true );
245 - $schedules = apply_filters(
246 - 'visualizer_schedules', array(
247 - '0' => __( 'Live', 'visualizer' ),
248 - '1' => __( 'Each hour', 'visualizer' ),
249 - '12' => __( 'Each 12 hours', 'visualizer' ),
250 - '24' => __( 'Each day', 'visualizer' ),
251 - '72' => __( 'Each 3 days', 'visualizer' ),
252 - )
253 - );
254 - foreach ( $schedules as $num => $name ) {
255 - $extra = $num == $hours ? 'selected' : '';
256 - ?>
257 - <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
258 - <?php
259 - }
260 - ?>
261 - </select>
199 + <form id="editor-form" action="<?php echo $upload_link?>" method="post" target="thehole">
200 + <input type="hidden" id="chart-data" name="chart_data">
201 + </form>
262 202
263 - <input type="button" id="filter-chart-button" class="button button-secondary" value="<?php echo $bttn_label; ?>" data-current="chart" data-t-filter="<?php _e( 'Show Chart', 'visualizer' ); ?>" data-t-chart="<?php echo $bttn_label; ?>">
264 - <input type="button" id="db-filter-save-button" class="button button-primary" value="<?php _e( 'Save Schedule', 'visualizer' ); ?>">
265 - <?php echo apply_filters( 'visualizer_pro_upsell', '', 'db-query' ); ?>
266 - </form>
267 - <?php echo apply_filters( 'visualizer_pro_upsell', '', 'schedule-chart' ); ?>
268 - </div>
269 - </div>
270 - </li>
271 -
272 - <?php
273 - $save_query = add_query_arg(
274 - array(
275 - 'action' => Visualizer_Plugin::ACTION_SAVE_DB_QUERY,
276 - 'security' => wp_create_nonce( Visualizer_Plugin::ACTION_SAVE_DB_QUERY . Visualizer_Plugin::VERSION ),
277 - 'chart' => $this->chart->ID,
278 - ), admin_url( 'admin-ajax.php' )
279 - );
280 - ?>
281 - <li class="viz-group visualizer_source_query <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'db-query' ); ?>">
282 - <h2 class="viz-group-title viz-sub-group"><?php _e( 'Import from database', 'visualizer' ); ?><span
283 - class="dashicons dashicons-lock"></span></h2>
284 - <div class="viz-group-content edit-data-content">
285 - <div>
286 - <p class="viz-group-description"><?php _e( 'You can import data from the database here.', 'visualizer' ); ?></p>
287 - <form id="vz-db-wizard" action="<?php echo $save_query; ?>" method="post" target="thehole">
288 - <p class="viz-group-description"><?php _e( 'How often do you want to refresh the data from the database.', 'visualizer' ); ?></p>
289 - <select name="refresh" id="vz-db-import-time" class="visualizer-select">
290 - <?php
291 - $bttn_label = 'visualizer_source_query' === $source_of_chart ? __( 'Modify Query', 'visualizer' ) : __( 'Create Query', 'visualizer' );
292 - $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_SCHEDULE, true );
293 - $schedules = apply_filters(
294 - 'visualizer_schedules', array(
295 - '0' => __( 'Live', 'visualizer' ),
296 - '1' => __( 'Each hour', 'visualizer' ),
297 - '12' => __( 'Each 12 hours', 'visualizer' ),
298 - '24' => __( 'Each day', 'visualizer' ),
299 - '72' => __( 'Each 3 days', 'visualizer' ),
300 - )
301 - );
302 - foreach ( $schedules as $num => $name ) {
303 - $extra = $num == $hours ? 'selected' : '';
304 - ?>
305 - <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
306 - <?php
307 - }
308 - ?>
309 - </select>
310 - <input type="hidden" name="params" id="viz-db-wizard-params">
311 -
312 - <input type="button" id="db-chart-button" class="button button-secondary" value="<?php echo $bttn_label; ?>" data-current="chart" data-t-filter="<?php _e( 'Show Chart', 'visualizer' ); ?>" data-t-chart="<?php echo $bttn_label; ?>">
313 - <input type="button" id="db-chart-save-button" class="button button-primary" value="<?php _e( 'Save Schedule', 'visualizer' ); ?>">
314 - <?php echo apply_filters( 'visualizer_pro_upsell', '', 'db-query' ); ?>
315 - </form>
316 - </div>
317 - </div>
318 - </li>
319 -
320 - <?php
321 - // we will auto-open the manual data feature but only when pro is active and source is empty.
322 - $pro_class = apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' );
323 - ?>
324 - <li class="viz-group <?php echo $pro_class; ?> <?php echo empty( $source_of_chart ) && empty( $pro_class ) ? 'open' : ''; ?> ">
325 - <h2 class="viz-group-title viz-sub-group visualizer-editor-tab"
326 - data-current="chart"><?php _e( 'Manual Data', 'visualizer' ); ?><span
327 - class="dashicons dashicons-lock"></span></h2>
328 - <form id="editor-form" action="<?php echo $upload_link; ?>" method="post" target="thehole">
329 - <input type="hidden" id="chart-data" name="chart_data">
330 - <input type="hidden" id="chart-data-src" name="chart_data_src">
331 - </form>
332 -
333 - <div class="viz-group-content edit-data-content">
203 + <div class="group-content edit-data-content">
334 204 <div>
335 - <p class="viz-group-description"><?php _e( 'You can manually edit the chart data using the spreadsheet like editor.', 'visualizer' ); ?></p>
205 + <p class="group-description"><?php _e( 'You can manually edit the chart data using the spreadsheet like editor.', 'visualizer' ); ?></p>
336 206 <input type="button" id="editor-chart-button" class="button button-primary "
337 - value="<?php _e( 'View Editor', 'visualizer' ); ?>" data-current="chart"
338 - data-t-editor="<?php _e( 'Show Chart', 'visualizer' ); ?>"
339 - data-t-chart="<?php _e( 'View Editor', 'visualizer' ); ?>">
207 + value="<?php _e( 'View Editor', 'visualizer' ); ?>" data-current="chart" data-t-editor="<?php _e( 'Show Chart', 'visualizer' );?>" data-t-chart="<?php _e( 'View Editor', 'visualizer' );?>">
340 208
341 209 <?php echo apply_filters( 'visualizer_pro_upsell', '' ); ?>
342 210 </div>
343 211 </div>
@@ -344,33 +212,26 @@
344 212 </li>
345 213 </ul>
346 214 </li>
347 215 </ul>
348 - <li class="viz-group viz-group-category bottom-fixed sidebar-footer-link" id="vz-chart-settings">
349 - <h2><span class="dashicons dashicons-admin-tools"></span><?php _e( 'Advanced', 'visualizer' ); ?></h2>
350 - <div class="viz-group-header">
216 + <li class="group group-category bottom-fixed " id="vz-chart-settings">
217 + <h2><?php _e( 'Advanced Settings', 'visualizer' ); ?></h2>
218 + <div class="group-header">
351 219 <button class="customize-section-back" tabindex="0"></button>
352 - <h3 class="viz-group-title viz-main-group"><?php _e( 'Chart Settings', 'visualizer' ); ?></h3>
220 + <h3 class="group-title main-group"><?php _e( 'Chart Settings', 'visualizer' ); ?></h3>
353 221 </div>
354 - <ul class="viz-group-content">
222 + <ul class="group-content">
355 223 <form id="settings-form" action="<?php echo add_query_arg( 'nonce', wp_create_nonce() ); ?>"
356 224 method="post">
357 225 <?php echo $this->sidebar; ?>
358 - <input type="hidden" name="save" value="1">
359 226 </form>
360 - <form id="cancel-form" action="<?php echo add_query_arg( 'nonce', wp_create_nonce() ); ?>" method="post">
361 - <input type="hidden" name="cancel" value="1">
362 - </form>
363 227 </ul>
364 228 </li>
365 -
366 - <li class="viz-group viz-group-category bottom-fixed sidebar-footer-link" id="vz-chart-docs">
367 - <h2><span class="dashicons dashicons-editor-help"></span><a href="https://docs.themeisle.com/category/657-visualizer" target="_blank"><?php _e( 'Docs', 'visualizer' ); ?></a></h2>
229 + <li class=" group bottom-fixed" id="vz-chart-review">
230 + <a href="https://wordpress.org/support/plugin/visualizer/reviews/?filter=5#new-post"
231 + target="_blank"><?php _e( 'Rate our plugin', 'visualizer' ); ?></a>
368 232 </li>
369 -
370 - <?php $this->getPermissionsLink( $this->chart->ID ); ?>
371 -
372 - <li class="viz-group bottom-fixed" id="vz-chart-copyright">Visualizer &copy; <?php echo date( 'Y', current_time( 'timestamp' ) ); ?></li>
233 + <li class="group bottom-fixed" id="vz-chart-copyright">Visualizer &copy; 2014</li>
373 234 </ul>
374 235 <?php
375 236 // changed by Ash/Upwork
376 237 }
@@ -375,148 +236,8 @@
375 236 // changed by Ash/Upwork
376 237 }
377 238
378 239 /**
379 - * Generates the permissions link.
380 - *
381 - * @access private
382 - * @param int $id The chart id.
383 - */
384 - private function getPermissionsLink( $id ) {
385 - $permissions = apply_filters( 'visualizer_pro_get_permissions', null, $id );
386 - if ( $permissions ) {
387 - foreach ( $permissions as $k => $v ) {
388 - $this->$k = $v;
389 - }
390 - }
391 - ?>
392 - <li class="viz-group viz-group-category bottom-fixed sidebar-footer-link" id="vz-chart-permissions">
393 - <h2><span class="dashicons dashicons-admin-users"></span><?php _e( 'Permissions', 'visualizer' ); ?></h2>
394 - <div class="viz-group-header">
395 - <button class="customize-section-back" tabindex="0"></button>
396 - <h3 class="viz-group-title viz-main-group"><?php _e( 'Chart Settings', 'visualizer' ); ?></h3>
397 - </div>
398 - <ul class="viz-group-content">
399 - <form id="permissions-form" target="thehole" action="
400 - <?php
401 - echo add_query_arg(
402 - array(
403 - 'nonce' => wp_create_nonce(),
404 - 'tab' => 'permissions',
405 - ),
406 - remove_query_arg( 'tab', $_SERVER['REQUEST_URI'] )
407 - );
408 - ?>
409 -" method="post">
410 - <?php $this->permissionsSidebar(); ?>
411 - </form>
412 - </ul>
413 - </li>
414 - <?php
415 - }
416 -
417 - /**
418 - * Generates the permissions form.
419 - *
420 - * @access private
421 - */
422 - private function permissionsSidebar() {
423 - // ignore for unit tests because Travis throws the error "Indirect modification of overloaded property Visualizer_Render_Page_Data::$permissions has no effect".
424 - if ( defined( 'WP_TESTS_DOMAIN' ) ) {
425 - return;
426 - }
427 - Visualizer_Render_Sidebar::_renderGroupStart(
428 - esc_html__( 'Who can see this chart?', 'visualizer' ) . '<span
429 - class="dashicons dashicons-lock"></span>',
430 - '',
431 - apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'chart-permissions' )
432 - );
433 - Visualizer_Render_Sidebar::_renderSectionStart();
434 - Visualizer_Render_Sidebar::_renderSectionDescription( esc_html__( 'Select who can view the chart on the front-end.', 'visualizer' ) );
435 -
436 - if ( ! isset( $this->permissions['read'] ) ) {
437 - $this->permissions['read'] = 'all';
438 - }
439 -
440 - Visualizer_Render_Sidebar::_renderSelectItem(
441 - '',
442 - 'permissions[read]',
443 - $this->permissions['read'],
444 - array(
445 - 'all' => esc_html__( 'All Users', 'visualizer' ),
446 - 'users' => esc_html__( 'Select Users', 'visualizer' ),
447 - 'roles' => esc_html__( 'Select Roles', 'visualizer' ),
448 - ),
449 - '',
450 - false,
451 - array( 'visualizer-permission', 'visualizer-permission-type', 'visualizer-permission-read' ),
452 - array(
453 - 'permission-type' => 'read',
454 - )
455 - );
456 -
457 - $options = apply_filters( 'visualizer_pro_get_permissions_data', array(), isset( $this->permissions['read'] ) ? $this->permissions['read'] : 'roles' );
458 -
459 - Visualizer_Render_Sidebar::_renderSelectItem(
460 - '',
461 - 'permissions[read-specific][]',
462 - isset( $this->permissions['read-specific'] ) ? $this->permissions['read-specific'] : array(),
463 - $options,
464 - '',
465 - true,
466 - array( 'visualizer-permission', 'visualizer-permission-specific', 'visualizer-permission-read-specific' )
467 - );
468 - Visualizer_Render_Sidebar::_renderSectionEnd( apply_filters( 'visualizer_pro_upsell', 'only-pro-feature', 'chart-permissions' ) );
469 - Visualizer_Render_Sidebar::_renderGroupEnd();
470 -
471 - Visualizer_Render_Sidebar::_renderGroupStart(
472 - esc_html__( 'Who can edit this chart?', 'visualizer' ) . '<span
473 - class="dashicons dashicons-lock"></span>',
474 - '',
475 - apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'chart-permissions' )
476 - );
477 - Visualizer_Render_Sidebar::_renderSectionStart();
478 - Visualizer_Render_Sidebar::_renderSectionDescription( esc_html__( 'Select who can edit the chart on the front-end.', 'visualizer' ) );
479 -
480 - if ( ! isset( $this->permissions['edit'] ) ) {
481 - $this->permissions['edit'] = 'roles';
482 - $this->permissions['edit-specific'] = 'administrator';
483 - }
484 -
485 - Visualizer_Render_Sidebar::_renderSelectItem(
486 - '',
487 - 'permissions[edit]',
488 - $this->permissions['edit'],
489 - array(
490 - 'all' => esc_html__( 'All Users', 'visualizer' ),
491 - 'users' => esc_html__( 'Select Users', 'visualizer' ),
492 - 'roles' => esc_html__( 'Select Roles', 'visualizer' ),
493 - ),
494 - '',
495 - false,
496 - array( 'visualizer-permission', 'visualizer-permission-type', 'visualizer-permission-edit' ),
497 - array(
498 - 'permission-type' => 'edit',
499 - )
500 - );
501 -
502 - $options = apply_filters( 'visualizer_pro_get_permissions_data', array(), isset( $this->permissions['edit'] ) ? $this->permissions['edit'] : 'roles' );
503 -
504 - Visualizer_Render_Sidebar::_renderSelectItem(
505 - '',
506 - 'permissions[edit-specific][]',
507 - isset( $this->permissions['edit-specific'] ) ? $this->permissions['edit-specific'] : array(),
508 - $options,
509 - '',
510 - true,
511 - array( 'visualizer-permission', 'visualizer-permission-specific', 'visualizer-permission-edit-specific' )
512 - );
513 - Visualizer_Render_Sidebar::_renderSectionEnd( apply_filters( 'visualizer_pro_upsell', 'only-pro-feature', 'chart-permissions' ) );
514 - Visualizer_Render_Sidebar::_renderGroupEnd();
515 -
516 - }
517 -
518 - /**
519 240 * Renders toolbar content.
520 241 *
521 242 * @since 1.0.0
522 243 *
@@ -522,34 +243,17 @@
522 243 *
523 244 * @access protected
524 245 */
525 246 protected function _renderToolbar() {
526 - // don't show back button at all.
527 - // 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.
528 - if ( ! VISUALIZER_SKIP_CHART_TYPE_PAGE ) {
529 - echo '<div class="toolbar-div">';
530 - echo '<a class="button button-large" href="', add_query_arg( 'tab', 'types' ), '">';
531 - esc_html_e( 'Back', 'visualizer' );
532 - echo '</a>';
533 - echo '</div>';
534 - }
247 + // changed by Ash/Upwork
248 + echo '<div class="toolbar-div">';
249 + echo '<a class="button button-large" href="', add_query_arg( 'tab', 'types' ), '">';
250 + esc_html_e( 'Back', 'visualizer' );
251 + echo '</a>';
252 + echo '</div>';
535 253 echo '<input type="submit" id="settings-button" class="button button-primary button-large push-right" value="', $this->button, '">';
536 - if ( isset( $this->cancel_button ) ) {
537 - echo '<input type="submit" id="cancel-button" class="button button-secondary button-large push-left" value="', $this->cancel_button, '">';
538 - }
539 - }
540 254
541 - /**
542 - * Renders the additional content.
543 - *
544 - * @access private
545 - */
546 - private function add_additional_content() {
547 - $source = strtolower( get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_SOURCE, true ) );
548 - $query = '';
549 - if ( 'visualizer_source_query' === $source ) {
550 - $query = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_QUERY, true );
551 - }
552 - Visualizer_Render_Layout::show( 'db-query', $query );
255 + echo '</div>';
256 +
553 257 }
554 258
555 259 }