PluginProbe
Chartify – WordPress Chart Plugin / 3.2.7
Chartify – WordPress Chart Plugin v3.2.7
3.8.0 3.7.9 3.7.8 3.7.7 3.7.6 3.7.5 trunk 1.0.0 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 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.1.4 3.1.5 3.1.6 All 83 releases
chart-builder / admin / class-chart-builder-admin.php

class-chart-builder-admin.php in Chartify – WordPress Chart Plugin 3.2.7, at admin/class-chart-builder-admin.php

7,696 lines 551.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The admin-specific functionality of the plugin.
5 *
6 * @link https://ays-pro.com/
7 * @since 1.0.0
8 *
9 * @package Chart_Builder
10 * @subpackage Chart_Builder/admin
11 */
12
13 /**
14 * The admin-specific functionality of the plugin.
15 *
16 * Defines the plugin name, version, and two examples hooks for how to
17 * enqueue the admin-specific stylesheet and JavaScript.
18 *
19 * @package Chart_Builder
20 * @subpackage Chart_Builder/admin
21 * @author Chart Builder Team <info@ays-pro.com>
22 */
23 class Chart_Builder_Admin {
24
25 /**
26 * The ID of this plugin.
27 *
28 * @since 1.0.0
29 * @access private
30 * @var string $plugin_name The ID of this plugin.
31 */
32 private $plugin_name;
33
34 /**
35 * The version of this plugin.
36 *
37 * @since 1.0.0
38 * @access private
39 * @var string $version The current version of this plugin.
40 */
41 private $version;
42
43 /**
44 * The capability of this plugin.
45 *
46 * @since 1.0.0
47 * @access private
48 * @var string $capability The capability for users access to this plugin.
49 */
50 private $capability;
51
52 /**
53 * @var Chart_Builder_DB_Actions
54 */
55 private $db_obj;
56
57 /**
58 * @var Chart_Builder_Settings_DB_Actions
59 */
60 private $settings_obj;
61
62 /**
63 * Initialize the class and set its properties.
64 *
65 * @since 1.0.0
66 * @param string $plugin_name The name of this plugin.
67 * @param string $version The version of this plugin.
68 */
69 public function __construct( $plugin_name, $version ) {
70
71 $this->plugin_name = $plugin_name;
72 $this->version = $version;
73
74 add_filter('set-screen-option', array(__CLASS__, 'set_screen'), 10, 3);
75 add_filter('set_screen_option_cb_charts_per_page', array(__CLASS__, 'set_screen'), 10, 3);
76
77 }
78
79 /**
80 * Register the stylesheets for the admin area.
81 *
82 * @since 1.0.0
83 */
84 public function enqueue_styles($hook_suffix) {
85 wp_enqueue_style( $this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
86 // Not enqueue styles if they are not on the current plugin page
87 if (false === strpos($hook_suffix, $this->plugin_name)) return;
88 //
89 wp_enqueue_style( $this->plugin_name . '-normalize', plugin_dir_url( __FILE__ ) . 'css/normalize.css', array(), $this->version . time(), 'all' );
90 wp_enqueue_style( $this->plugin_name . '-admin-general', plugin_dir_url( __FILE__ ) . 'css/admin-general.css', array(), $this->version, 'all' );
91 wp_enqueue_style( $this->plugin_name . '-banner', plugin_dir_url( __FILE__ ) . 'css/banner.css', array(), $this->version, 'all' );
92 wp_enqueue_style( $this->plugin_name . '-chart-builder-banner.css', plugin_dir_url(__FILE__) . 'css/chart-builder-banner.css', array(), $this->version, 'all');
93 wp_enqueue_style( $this->plugin_name . '-animate', plugin_dir_url(__FILE__) . 'css/animate.css', array(), $this->version, 'all');
94 wp_enqueue_style( $this->plugin_name . '-font-awesome', plugin_dir_url(__FILE__) . 'css/ays-font-awesome.min.css', array(), $this->version, 'all');
95 wp_enqueue_style( $this->plugin_name . '-font-awesome-icons', plugin_dir_url(__FILE__) . 'css/ays-font-awesome-icons.css', array(), $this->version, 'all');
96 wp_enqueue_style( $this->plugin_name . '-select2', plugin_dir_url(__FILE__) . 'css/ays-select2.min.css', array(), $this->version, 'all');
97 wp_enqueue_style( $this->plugin_name . '-chosen', plugin_dir_url(__FILE__) . 'css/chosen.min.css', array(), $this->version, 'all');
98 wp_enqueue_style( $this->plugin_name . '-bootstrap', plugin_dir_url(__FILE__) . 'css/bootstrap.min.css', array(), $this->version, 'all');
99 wp_enqueue_style( $this->plugin_name . '-data-bootstrap', plugin_dir_url(__FILE__) . 'css/dataTables.bootstrap4.min.css', array(), $this->version, 'all');
100 wp_enqueue_style( $this->plugin_name . '-jquery-ui.min', plugin_dir_url(__FILE__) . 'css/jquery-ui.min.css', array(), $this->version, 'all');
101
102 wp_enqueue_style( $this->plugin_name . '-layer', plugin_dir_url( __FILE__ ) . 'css/chart-builder-admin-layer.css', array(), $this->version, 'all' );
103 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/chart-builder-admin.css', array(), $this->version . time(), 'all' );
104 wp_enqueue_style( $this->plugin_name . "-pro-features", plugin_dir_url( __FILE__ ) . 'css/chart-builder-pro-features.css', array(), $this->version . time(), 'all' );
105
106 }
107
108 /**
109 * Register the JavaScript for the admin area.
110 *
111 * @since 1.0.0
112 */
113 public function enqueue_scripts($hook_suffix) {
114 if (false !== strpos($hook_suffix, "plugins.php")){
115 wp_enqueue_script( $this->plugin_name . '-sweetalert-js', plugin_dir_url( __FILE__ ) . 'js/chart-builder-sweetalert2.all.min.js', array('jquery'), $this->version, true );
116 wp_enqueue_script($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'js/admin.js', array('jquery'), $this->version, true);
117 wp_localize_script($this->plugin_name . '-admin', 'chart_builder_admin_ajax', array('ajax_url' => admin_url('admin-ajax.php')));
118 }
119
120 // Not enqueue scripts if they are not on the current plugin page
121 if (false === strpos($hook_suffix, $this->plugin_name)) return;
122 //
123 global $wp_version;
124 $version1 = $wp_version;
125 $operator = '>=';
126 $version2 = '5.5';
127 $versionCompare = CBFunctions()->versionCompare( $version1, $operator, $version2 );
128
129 if ( $versionCompare ) {
130 wp_enqueue_script( $this->plugin_name.'-wp-load-scripts', plugin_dir_url(__FILE__) . 'js/load-scripts.js', array(), $this->version, true);
131 }
132
133 wp_enqueue_script( 'jquery' );
134
135 /*
136 ==========================================
137 * Bootstrap
138 * select2
139 * jQuery DataTables
140 ==========================================
141 */
142 wp_enqueue_script( $this->plugin_name . "-popper", plugin_dir_url(__FILE__) . 'js/popper.min.js', array( 'jquery' ), $this->version, true );
143 wp_enqueue_script( $this->plugin_name . "-bootstrap", plugin_dir_url(__FILE__) . 'js/bootstrap.min.js', array( 'jquery' ), $this->version, true );
144 wp_enqueue_script( $this->plugin_name . '-select2js', plugin_dir_url( __FILE__ ) . 'js/ays-select2.min.js', array('jquery'), $this->version, true);
145 wp_enqueue_script( $this->plugin_name . '-chosen', plugin_dir_url( __FILE__ ) . 'js/chosen.jquery.min.js', array('jquery'), $this->version, true);
146 wp_enqueue_script( $this->plugin_name . '-datatable-min', plugin_dir_url( __FILE__ ) . 'js/chart-builder-datatable.min.js', array('jquery'), $this->version, true);
147 wp_enqueue_script( $this->plugin_name . "-db4.min.js", plugin_dir_url( __FILE__ ) . 'js/dataTables.bootstrap4.min.js', array( 'jquery' ), $this->version, true );
148 wp_enqueue_script( $this->plugin_name . "-jquery-ui.min.js", plugin_dir_url( __FILE__ ) . 'js/jquery-ui.min.js', array( 'jquery' ), $this->version, true );
149 wp_enqueue_script( $this->plugin_name . '-sweetalert-js', plugin_dir_url( __FILE__ ) . 'js/chart-builder-sweetalert2.all.min.js', array('jquery'), $this->version, true );
150
151 wp_enqueue_script( $this->plugin_name . "-treeSortable", plugin_dir_url( __FILE__ ) . 'js/treeSortable.js', array( 'jquery' ), $this->version, true );
152 wp_enqueue_script( $this->plugin_name . "-tippy-bundle", plugin_dir_url( __FILE__ ) . 'js/tippy-bundle.umd.js', array( 'jquery' ), $this->version, true );
153
154 $table_col_mapping = CBFunctions()->get_all_db_tables_column_mapping( 1 );
155 $chart_banner_date = $this->ays_chart_update_banner_time();
156
157 wp_enqueue_code_editor(
158 array(
159 'type' => 'sql',
160 'codemirror' => array(
161 'autofocus' => true,
162 'lineWrapping' => true,
163 'dragDrop' => false,
164 'matchBrackets' => true,
165 'autoCloseBrackets' => true,
166 'extraKeys' => array( 'Ctrl-Space' => 'autocomplete' ),
167 'hintOptions' => array( 'tables' => $table_col_mapping ),
168 ),
169 )
170 );
171
172 wp_enqueue_script( $this->plugin_name . '-charts-google', plugin_dir_url(__FILE__) . 'js/google-chart.js', array('jquery'), $this->version, true);
173 wp_enqueue_script( $this->plugin_name . '-chart-js', plugin_dir_url(__FILE__) . 'js/chart-js.js', array('jquery'), $this->version, true);
174
175 wp_enqueue_script( $this->plugin_name . '-functions', plugin_dir_url( __FILE__ ) . 'js/functions.js', array( 'jquery' ), $this->version, true );
176
177 wp_register_script( $this->plugin_name . '-localized', '' , array('jquery'), $this->version, true);
178
179 wp_localize_script( $this->plugin_name . '-localized', 'aysChartBuilderAdmin', array(
180 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
181 'selectUser' => __( 'Select author', "chart-builder" ),
182 'pleaseEnterMore' => __( "Please enter 1 or more characters", "chart-builder" ),
183 'searching' => __( "Searching...", "chart-builder" ),
184 'chartBannerDate' => $chart_banner_date,
185 'selectUserRoles' => __( 'Select user roles', "chart-builder" ),
186 'delete' => __( 'Delete', "chart-builder" ),
187 'selectQuestionDefaultType' => __( 'Select question default type', "chart-builder" ),
188 'yes' => __( 'Yes', "chart-builder" ),
189 'cancel' => __( 'Cancel', "chart-builder" ),
190 'somethingWentWrong' => __( "Maybe something went wrong.", "chart-builder" ),
191 'failed' => __( 'Failed', "chart-builder" ),
192 'selectPage' => __( 'Select page', "chart-builder" ),
193 'selectPostType' => __( 'Select post type', "chart-builder" ),
194 'copied' => __( 'Copied!', "chart-builder"),
195 'clickForCopy' => __( 'Click to copy', "chart-builder"),
196 'selectForm' => __( 'Select form', "chart-builder"),
197 'addImage' => __( 'Add Image', "chart-builder"),
198 'editImage' => __( 'Edit Image', "chart-builder"),
199 'confirmDelete' => __( 'Are you sure you want to delete the chart(s)?', "chart-builder"),
200 'confirmRowDelete' => __( 'Are you sure you want to delete the row?', "chart-builder"),
201 'confirmColDelete' => __( 'Are you sure you want to delete the column?', "chart-builder"),
202 'minRowNotice' => __( 'Sorry, minimum count of rows should be 1', "chart-builder"),
203 'minColNotice' => __( 'Sorry, minimum count of columns should be 1', "chart-builder"),
204 'activated' => __( "Activated", "chart-builder" ),
205 'errorMsg' => __( "Error", "chart-builder" ),
206 'loadResource' => __( "Can't load resource.", "chart-builder" ),
207 'somethingWentWrong' => __( "Maybe something went wrong.", "chart-builder" ),
208 ) );
209
210 wp_localize_script( $this->plugin_name . '-localized', 'aysChartBuilderChartSettings', array(
211 'types' => CBFunctions()->getAllowedTypes(),
212 'max_selected_options' => 2,
213 'l10n' => array(
214 'invalid_source' => esc_html__( 'You have entered invalid URL. Please, insert proper URL.', "chart-builder" ),
215 'loading' => esc_html__( 'Loading...', "chart-builder" ),
216 'filter_config_error' => esc_html__( 'Please check the filters you have configured.', "chart-builder" ),
217 'select_columns' => esc_html__( 'Please select a few columns to include in the chart.', "chart-builder" ),
218 'save_settings' => __( 'You have modified the chart\'s settings. To modify the source/data again, you must save this chart and reopen it for editing. If you continue without saving the chart, you may lose your changes.', "chart-builder" ),
219 ),
220 'ajax' => array(
221 'url' => admin_url( 'admin-ajax.php' ),
222 'nonces' => array(
223 'filter_get_props' => wp_create_nonce( 'cbuilder-fetch-post-type-props' ),
224 'filter_get_data' => wp_create_nonce( 'cbuilder-fetch-post-type-data' ),
225 'quiz_maker_get_data' => wp_create_nonce( 'cbuilder-fetch-quiz-maker-data' ),
226 'quiz_maker_save_data' => wp_create_nonce( 'cbuilder-save-quiz-maker-data' ),
227 'author_user_search' => wp_create_nonce( 'cbuilder-author-user-search' ),
228 ),
229 'actions' => array(
230 'filter_get_props' => 'fetch_post_type_props',
231 'filter_get_data' => 'fetch_post_type_data',
232 'quiz_maker_get_data' => 'fetch_quiz_maker_data',
233 'quiz_maker_save_data' => 'save_quiz_maker_data',
234 'author_user_search' => 'author_user_search'
235 ),
236 ),
237 'db_query' => array(
238 'tables' => $table_col_mapping,
239 ),
240 ) );
241
242 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version . time(), true );
243 wp_enqueue_script( $this->plugin_name . '-google', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-google.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version . time(), true );
244 wp_enqueue_script( $this->plugin_name . '-chartjs', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-chartjs.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version . time(), true );
245 wp_enqueue_script( $this->plugin_name . '-general-js', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-general.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version, true );
246
247 if ( false !== strpos( $hook_suffix, 'settings' ) ) {
248 wp_enqueue_script( $this->plugin_name . '-settings', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-settings.js', array( 'jquery' ), $this->version, true );
249
250 wp_localize_script( $this->plugin_name . '-settings', 'aysChartBuilderAdminSettings', array(
251 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
252 'selectUserRoles' => __( 'Select user roles', 'chart-builder' ),
253 'delete' => __( 'Delete', 'chart-builder' ),
254 'selectQuestionDefaultType' => __( 'Select question default type', 'chart-builder' ),
255 'yes' => __( 'Yes', 'chart-builder' ),
256 'cancel' => __( 'Cancel', 'chart-builder' ),
257 'somethingWentWrong' => __( "Maybe something went wrong.", 'chart-builder' ),
258 'failed' => __( 'Failed', 'chart-builder' ),
259 'selectPage' => __( 'Select page', 'chart-builder' ),
260 'selectPostType' => __( 'Select post type', 'chart-builder' ),
261 'copied' => __( 'Copied!', 'chart-builder'),
262 'clickForCopy' => __( 'Click to copy', 'chart-builder'),
263 'selectForm' => __( 'Select form', 'chart-builder'),
264 ) );
265 }
266 }
267
268 /**
269 * De-register JavaScript files for the admin area.
270 *
271 * @since 1.0.0
272 */
273 public function disable_scripts($hook_suffix) {
274 if (false !== strpos($hook_suffix, $this->plugin_name)) {
275 if (is_plugin_active('ai-engine/ai-engine.php')) {
276 wp_deregister_script('mwai');
277 wp_deregister_script('mwai-vendor');
278 wp_dequeue_script('mwai');
279 wp_dequeue_script('mwai-vendor');
280 }
281 }
282 }
283
284 /**
285 * Register the administration menu for this plugin into the WordPress Dashboard menu.
286 *
287 * @since 1.0.0
288 */
289 public function add_plugin_admin_menu(){
290
291 /*
292 * Add a settings page for this plugin to the Settings menu.
293 *
294 * NOTE: Alternative menu locations are available via WordPress administration menu functions.
295 *
296 * Administration Menus: http://codex.wordpress.org/Administration_Menus
297 *
298 */
299 global $wpdb;
300 $menu_item = __( 'Chart Builder', "chart-builder" );
301 $this->capability = 'manage_options';
302
303 add_menu_page(
304 __( 'Chart Builder', "chart-builder" ),
305 $menu_item,
306 $this->capability,
307 $this->plugin_name,
308 array($this, 'display_plugin_charts_page'),
309 CHART_BUILDER_ADMIN_URL . '/images/icons/ays_chart_logo_icon_bw.svg',
310 '6.22'
311 );
312
313 }
314
315 public function add_plugin_charts_submenu(){
316 $hook_page_view = add_submenu_page(
317 $this->plugin_name,
318 __('All Charts', 'chart-builder'),
319 __('All Charts', 'chart-builder'),
320 'manage_options',
321 $this->plugin_name,
322 array($this, 'display_plugin_charts_page')
323 );
324
325 add_action( "load-$hook_page_view", array( $this, 'screen_option_charts' ) );
326 }
327
328 public function add_plugin_add_new_submenu(){
329 $hook_charts = add_submenu_page(
330 $this->plugin_name,
331 __('Add New', 'chart-builder'),
332 __('Add New', 'chart-builder'),
333 'manage_options',
334 $this->plugin_name."&action=add",
335 array($this, 'display_plugin_addnew_page')
336 );
337 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
338 }
339
340 public function add_plugin_dashboard_submenu(){
341 $hook_charts = add_submenu_page(
342 $this->plugin_name,
343 __('How to use', 'chart-builder'),
344 __('How to use', 'chart-builder'),
345 'manage_options',
346 $this->plugin_name . '-dashboard',
347 array($this, 'display_plugin_setup_page')
348 );
349 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
350 }
351
352 public function add_plugin_general_settings_submenu(){
353 $hook_settings = add_submenu_page( $this->plugin_name,
354 __('General Settings', 'chart-builder'),
355 __('General Settings', 'chart-builder'),
356 'manage_options',
357 $this->plugin_name . '-settings',
358 array($this, 'display_plugin_settings_page')
359 );
360 add_action("load-$hook_settings", array($this, 'screen_option_settings'));
361 }
362
363 public function add_plugin_featured_plugins_submenu(){
364 $hook_our_products = add_submenu_page( $this->plugin_name,
365 __('Our products', 'chart-builder'),
366 __('Our products', 'chart-builder'),
367 'manage_options',
368 $this->plugin_name . '-featured-plugins',
369 array($this, 'display_plugin_featured_plugins_page')
370 );
371
372 add_action("load-$hook_our_products", array( $this, 'add_tabs' ));
373 }
374
375 public function add_plugin_chart_features_submenu(){
376 $hook_pro_features = add_submenu_page(
377 $this->plugin_name,
378 __('PRO Features', 'chart-builder'),
379 __('PRO Features', 'chart-builder'),
380 'manage_options',
381 $this->plugin_name . '-chart-features',
382 array($this, 'display_plugin_chart_features_page')
383 );
384
385 add_action("load-$hook_pro_features", array( $this, 'add_tabs' ));
386 }
387
388 public function screen_option_charts(){
389 $option = 'per_page';
390 $args = array(
391 'label' => __('Charts', "chart-builder"),
392 'default' => 5,
393 'option' => 'cb_charts_per_page'
394 );
395
396 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
397 if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
398 add_screen_option( $option, $args );
399 }
400
401 $this->db_obj = new Chart_Builder_DB_Actions( $this->plugin_name );
402 }
403
404 public function screen_option_settings(){
405 $this->settings_obj = new Chart_Builder_Settings_DB_Actions( $this->plugin_name );
406 }
407
408 public function add_tabs() {
409 $screen = get_current_screen();
410
411 if ( ! $screen) {
412 return;
413 }
414 }
415
416 public function display_plugin_charts_page(){
417 global $ays_chart_db_actions;
418
419 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
420 $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : '';
421 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
422 $id = (isset($_GET['id'])) ? absint( wp_unslash( $_GET['id'] ) ) : 0;
423 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
424 if (isset($_POST['bulk_delete_confirm'])) {
425 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
426 if (isset($_POST['bulk-delete']) && !empty($_POST['bulk-delete'])) {
427 $ids = wp_unslash( $_POST['bulk-delete'] );
428 $ids = array_map( 'absint', (array) $ids );
429 foreach ($ids as $id) {
430 if ($id > 0) {
431 $this->db_obj->delete_item( $id );
432 }
433 }
434 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
435 $url = esc_url_raw( add_query_arg( array(
436 "status" => 'all-deleted'
437 ), $url ) );
438 wp_redirect( $url );
439 exit;
440 }
441 }
442
443 switch ($action) {
444 case 'trash':
445 if( $id > 0 ){
446 $this->db_obj->trash_item( $id );
447 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
448 $url = esc_url_raw( add_query_arg( array(
449 "status" => 'trashed'
450 ), $url ) );
451 wp_redirect( $url );
452 exit;
453 }
454 break;
455 case 'restore':
456 if( $id > 0 ){
457 $this->db_obj->restore_item( $id );
458 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
459 $url = esc_url_raw( add_query_arg( array(
460 "status" => 'restored'
461 ), $url ) );
462 wp_redirect( $url );
463 exit;
464 }
465 break;
466 case 'delete':
467 if( $id > 0 ){
468 $this->db_obj->delete_item( $id );
469 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
470 $url = esc_url_raw( add_query_arg( array(
471 "status" => 'deleted'
472 ), $url ) );
473 wp_redirect( $url );
474 exit;
475 }
476 break;
477 case 'publish':
478 if( $id > 0 ){
479 $this->db_obj->publish_item( $id );
480 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
481 $url = esc_url_raw( add_query_arg( array(
482 "status" => 'published'
483 ), $url ) );
484 wp_redirect( $url );
485 exit;
486 }
487 break;
488 case 'unpublish':
489 if( $id > 0 ){
490 $this->db_obj->restore_item( $id );
491 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
492 $url = esc_url_raw( add_query_arg( array(
493 "status" => 'unpublished'
494 ), $url ) );
495 wp_redirect( $url );
496 exit;
497 }
498 break;
499 case 'duplicate':
500 if( $id > 0 ){
501 $this->db_obj->duplicate_item( $id );
502 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
503 $url = esc_url_raw( add_query_arg( array(
504 "status" => 'duplicated'
505 ), $url ) );
506 wp_redirect( $url );
507 exit;
508 }
509 break;
510 case 'add':
511 include_once('partials/charts/actions/chart-builder-charts-actions.php');
512 break;
513 case 'edit':
514 include_once('partials/charts/actions/chart-builder-charts-actions.php');
515 break;
516 default:
517 include_once('partials/charts/chart-builder-charts-display.php');
518 }
519 }
520 public static function chart_builder_svg_sanitize_allowed_properties(){
521
522 $allowed_properties = array(
523 'div' => array(
524 'id' => true,
525 'class' => true,
526 'style' => true,
527 ),
528 'svg' => array(
529 'class' => true,
530 'version' => true,
531 'overflow' => true,
532 'preserveAspectRatio' => true,
533 'preserveaspectratio' => true,
534 'fill' => true,
535 'viewBox' => true,
536 'viewbox' => true,
537 'height' => true,
538 'width' => true,
539 'xmlns' => true,
540 'xmlns:xlink' => true,
541 'id' => true,
542 'title' => true,
543 ),
544 'g' => array(
545 'id' => true,
546 'class' => true,
547 'stroke-width' => true,
548 'stroke-linecap' => true,
549 'stroke-linejoin' => true,
550 ),
551 'path' => array(
552 'id' => true,
553 'class' => true,
554 'd' => true,
555 'fill' => true,
556 'vector-effect' => true,
557 'xmlns:default' => true,
558 ),
559 'span' => array(
560 'class' => true,
561 ),
562 'img' => array(
563 'src' => true,
564 'alt' => true,
565 ),
566 );
567
568 return $allowed_properties;
569 }
570
571 public static function get_allowed_tags_for_loader() {
572 return array(
573 'span' => array('class' => array()),
574 'img' => array('src' => array(), 'alt' => array()),
575 );
576 }
577
578 public function display_plugin_setup_page(){
579 include_once('partials/chart-builder-admin-display.php');
580 }
581
582 public function display_plugin_addnew_page(){
583
584 // $url = remove_query_arg( array('action', 'id', '_wpnonce') );
585 // $url = esc_url_raw( add_query_arg( array(
586 // "action" => 'add'
587 // ), $url ) );
588 // wp_redirect( $url );
589 }
590
591 public function display_plugin_settings_page(){
592 include_once('partials/settings/chart-builder-settings.php');
593 }
594
595 public function display_plugin_featured_plugins_page(){
596 include_once('partials/features/chart-builder-plugin-featured-display.php');
597 }
598
599 public function display_plugin_chart_features_page(){
600 include_once('partials/features/chart-builder-features-display.php');
601 }
602
603 /**
604 * Add settings action link to the plugins page.
605 *
606 * @since 1.0.0
607 */
608 public function add_action_links( $links ){
609
610 $chart_ajax_deactivate_plugin_nonce = wp_create_nonce( 'chart-ajax-deactivate-plugin-nonce' );
611
612 /*
613 * Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name)
614 */
615 $settings_link = array(
616 '<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' . __('Settings', "chart-builder") . '</a>',
617 '<a href="https://ays-demo.com/chart-builder-demo/" target="_blank">' . __('Demo', "chart-builder") . '</a>',
618 // '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-plugins-page&utm_campaign=chart-buy-now" id="ays-chart-plugins-buy-now-button" target="_blank">' . __('Upgrade', "chart-builder") . '</a>',
619 '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-plugins-page&utm_campaign=chart-buy-now" id="ays-chart-plugins-buy-now-button" target="_blank">' . __('Upgrade 30% Sale', "chart-builder") . '</a>
620 <input type="hidden" id="chart_ajax_deactivate_plugin_nonce" name="chart_ajax_deactivate_plugin_nonce" value="' . $chart_ajax_deactivate_plugin_nonce .'">',
621 );
622 return array_merge( $settings_link, $links );
623
624 }
625
626
627 public static function set_screen($status, $option, $value){
628 return $value;
629 }
630
631 public function ays_admin_ajax(){
632 global $wpdb;
633
634 $response = array(
635 "status" => false
636 );
637
638 $function = isset( $_REQUEST['function'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['function'] ) ) : null;
639
640 if($function !== null){
641 $response = array();
642 if( is_callable( array( $this, $function ) ) ){
643 $response = $this->$function();
644
645 ob_end_clean();
646 $ob_get_clean = ob_get_clean();
647 echo json_encode( $response );
648 wp_die();
649 }
650
651 }
652
653 ob_end_clean();
654 $ob_get_clean = ob_get_clean();
655 echo json_encode( $response );
656 wp_die();
657 }
658
659 public function deactivate_plugin_option(){
660 // Run a security check.
661 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
662 check_ajax_referer( 'chart-ajax-deactivate-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
663 } else {
664 wp_die();
665 }
666
667 // Check for permissions.
668 if ( ! current_user_can( 'manage_options' ) ) {
669 ob_end_clean();
670 $ob_get_clean = ob_get_clean();
671 echo json_encode(array(
672 'option' => ''
673 ));
674 wp_die();
675 }
676
677 if( is_user_logged_in() ) {
678 $request_value = isset( $_REQUEST['upgrade_plugin'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['upgrade_plugin'] ) ) : '';
679 $upgrade_option = get_option( 'ays_chart_builder_upgrade_plugin', '' );
680
681 if ( $upgrade_option === '' ) {
682 add_option( 'ays_chart_builder_upgrade_plugin', $request_value );
683 } else {
684 update_option( 'ays_chart_builder_upgrade_plugin', $request_value );
685 }
686
687 $response = array(
688 'option' => get_option( 'ays_chart_builder_upgrade_plugin', '' ),
689 );
690
691 wp_send_json_success( $response );
692 } else {
693 ob_end_clean();
694 $ob_get_clean = ob_get_clean();
695 echo json_encode(array(
696 'option' => ''
697 ));
698 wp_die();
699 }
700 }
701
702 public function chart_builder_admin_footer($a){
703 if(isset($_REQUEST['page'])){
704 if(false !== strpos( sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ), $this->plugin_name)){
705 ?>
706 <div class="ays-chart-footer-support-box">
707 <span class="ays-chart-footer-link-row"><a href="https://wordpress.org/support/plugin/chart-builder" target="_blank"><?php echo esc_html__( "Support", "chart-builder"); ?></a></span>
708 <span class="ays-chart-footer-slash-row">/</span>
709 <span class="ays-chart-footer-link-row"><a href="https://ays-pro.com/wordpress-chart-builder-plugin-user-manual" target="_blank"><?php echo esc_html__( "Docs", "chart-builder"); ?></a></span>
710 <span class="ays-chart-footer-slash-row">/</span>
711 <span class="ays-chart-footer-link-row"><a href="https://ays-demo.com/chart-builder-plugin-suggestion-box" target="_blank"><?php echo esc_html__( "Suggest a Feature", "chart-builder"); ?></a></span>
712 </div>
713 <p style="font-size:13px;text-align:center;font-style:italic;">
714 <span style="margin-left:0px;margin-right:10px;" class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
715 <span><?php echo esc_html(__( "If you love our plugin, please do big favor and rate us on", "chart-builder")); ?></span>
716 <a target="_blank" href='https://wordpress.org/support/plugin/chart-builder/reviews/'>WordPress.org</a>
717 <span class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
718 </p>
719 <?php
720 }
721 }
722 }
723
724 // Chart Builder Elementor widget init
725 public function chart_builder_el_widgets_registered() {
726 // We check if the Elementor plugin has been installed / activated.
727 if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
728 // get our own widgets up and running:
729 // copied from widgets-manager.php
730 if ( class_exists( 'Elementor\Plugin' ) ) {
731 if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
732 $elementor = Elementor\Plugin::instance();
733 if ( isset( $elementor->widgets_manager ) ) {
734 if ( method_exists( $elementor->widgets_manager, 'register_widget_type' ) ) {
735 wp_enqueue_style($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
736 $widget_file = 'plugins/elementor/chart-builder-elementor.php';
737 $template_file = locate_template( $widget_file );
738 if ( !$template_file || !is_readable( $template_file ) ) {
739 $template_file = CHART_BUILDER_DIR . 'pb_templates/chart-builder-elementor.php';
740 }
741 if ( $template_file && is_readable( $template_file ) ) {
742 require_once $template_file;
743 Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Elementor\Widget_Chart_Builder_Elementor() );
744 }
745 }
746 }
747 }
748 }
749 }
750 }
751
752 public function fetch_post_type_props(){
753 $nonce = isset( $_POST['nonce'] ) ? wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'cbuilder-fetch-post-type-props' ) : '';
754 if ( $nonce ) {
755 $results = CBFunctions()->get_post_type_properties( sanitize_text_field( wp_unslash($_POST['post_type']) ) );
756
757 return array(
758 'success' => true,
759 'fields' => $results,
760 );
761 }
762
763 return array(
764 'success' => false,
765 );
766 }
767
768 public static function get_max_id( $table ) {
769 global $wpdb;
770 $db_table = $wpdb->prefix . CHART_BUILDER_DB_PREFIX . $table;
771
772 $sql = "SELECT MAX(id) FROM {$db_table}";
773
774 $result = intval( $wpdb->get_var( $sql ) );
775
776 return $result;
777 }
778
779 public static function ays_restriction_string($type, $x, $length){
780 $output = "";
781 switch($type){
782 case "char":
783 if(strlen($x)<=$length){
784 $output = $x;
785 } else {
786 $output = substr($x,0,$length) . '...';
787 }
788 break;
789 case "word":
790 $res = explode(" ", $x);
791 if(count($res)<=$length){
792 $output = implode(" ",$res);
793 } else {
794 $res = array_slice($res,0,$length);
795 $output = implode(" ",$res) . '...';
796 }
797 break;
798 }
799 return $output;
800 }
801
802 public function ays_chart_sale_banner(){
803 // if(isset($_POST['ays_chart_sale_btn']) && (isset( $_POST[CHART_BUILDER_NAME . '-sale-banner'] ) && wp_verify_nonce( $_POST[CHART_BUILDER_NAME . '-sale-banner'], CHART_BUILDER_NAME . '-sale-banner' )) && current_user_can( 'manage_options' )) {
804 // update_option('ays_chart_sale_btn', 1);
805 // update_option('ays_chart_sale_date', current_time( 'mysql' ));
806 // }
807
808 $ays_chart_sale_date = get_option('ays_chart_sale_date');
809
810 $val = 60*60*24*5;
811
812 $current_date = current_time( 'mysql' );
813 $date_diff = strtotime($current_date) - intval(strtotime($ays_chart_sale_date)) ;
814
815 $days_diff = $date_diff / $val;
816
817 if(intval($days_diff) > 0 ){
818 update_option('ays_chart_sale_btn', 0);
819 }
820
821 $ays_chart_builder_flag = intval(get_option('ays_chart_sale_btn'));
822 if( $ays_chart_builder_flag == 0 ){
823 if ( isset( $_GET['page'] ) && strpos( sanitize_text_field( wp_unslash( $_GET['page'] ) ), CHART_BUILDER_NAME ) !== false ) {
824 if( !(Chart_Builder_Admin::get_max_id('charts') <= 1) ){
825 // $this->ays_chart_sale_message_30_emma($ays_chart_builder_flag);
826 $this->ays_chart_sale_message20($ays_chart_builder_flag);
827 // $this->ays_chart_helloween_message($ays_chart_builder_flag);
828 // $this->ays_chart_christmas_message($ays_chart_builder_flag);
829 // $this->ays_chart_silver_bundle_message($ays_chart_builder_flag);
830 // $this->ays_chart_black_friday_message_2024($ays_chart_builder_flag);
831 // $this->ays_chart_christmas_message_2024($ays_chart_builder_flag);
832 }
833 }
834 }
835 }
836
837 public function ays_chart_dismiss_button(){
838
839 $data = array(
840 'status' => false,
841 );
842
843 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_chart_dismiss_button') {
844 if ( isset( $_REQUEST['_ajax_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['_ajax_nonce'] ) ), $this->plugin_name . '-sale-banner' ) && current_user_can( 'manage_options' ) ) {
845 update_option('ays_chart_sale_btn', 1);
846 update_option('ays_chart_sale_date', current_time( 'mysql' ));
847 $data['status'] = true;
848 }
849 }
850
851 ob_end_clean();
852 $ob_get_clean = ob_get_clean();
853 echo json_encode($data);
854 wp_die();
855
856 }
857
858 // 30% Sale Emma
859 public function ays_chart_sale_message_30_emma($ishmar){
860 if($ishmar == 0 ){
861 $content = array();
862 $content[] = '<div id="ays-chart-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_chart_dicount_info">';
863 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
864
865 $content[] = '<div class="ays-chart-discount-box-sale-image"></div>';
866 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
867
868 $content[] = '<div class="ays-chart-dicount-wrap-text-box-texts">';
869 $content[] = '<div>
870 <a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=chart-sale-plugin-name" target="_blank" style="color:#30499B;">
871 <span class="ays-chart-new-mega-bundle-limited-text">Limited</span> Offer for Chart Builder </a> <br>
872 </div>';
873 $content[] = '</div>';
874
875 $content[] = '<div style="font-size: 17px;">';
876 $content[] = '<img style="width: 24px;height: 24px;" src="' . esc_attr(CHART_BUILDER_ADMIN_URL) . '/images/icons/guarantee-new.png">';
877 $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>';
878
879 $content[] = '</div>';
880
881
882
883 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
884
885 $content[] = '<form action="" method="POST">';
886 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
887 if( current_user_can( 'manage_options' ) ){
888 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B;
889 ">Dismiss ad</button>';
890 $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
891 }
892 $content[] = '</div>';
893 $content[] = '</form>';
894
895 $content[] = '</div>';
896
897 $content[] = '</div>';
898
899 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
900
901 $content[] = '<div id="ays-chart-countdown-main-container">';
902 $content[] = '<div class="ays-chart-countdown-container">';
903
904 $content[] = '<div id="ays-chart-countdown">';
905
906 $content[] = '<div style="font-weight: 500;">';
907 $content[] = __( "Offer ends in:", "chart-builder" );
908 $content[] = '</div>';
909
910 $content[] = '<ul>';
911 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
912 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
913 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
914 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
915 $content[] = '</ul>';
916 $content[] = '</div>';
917
918 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
919 $content[] = '<span>🚀</span>';
920 $content[] = '<span>⌛</span>';
921 $content[] = '<span>🔥</span>';
922 $content[] = '<span>💣</span>';
923 $content[] = '</div>';
924
925 $content[] = '</div>';
926 $content[] = '</div>';
927
928 $content[] = '</div>';
929
930 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
931 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=chart-sale-button" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now !', "chart-builder" ) . '</a>';
932 $content[] = '<span >One-time payment</span>';
933 $content[] = '</div>';
934 $content[] = '</div>';
935 $content[] = '</div>';
936
937 $content = implode( '', $content );
938 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
939
940 }
941 }
942
943 // Self 20% sale
944 public static function ays_chart_sale_message20($ishmar){
945 if($ishmar == 0 ){
946 $content = array();
947
948 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
949 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
950 // $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-chart-sale-banner-link"><img src="' . CHART_BUILDER_ADMIN_URL . '/images/ays_chart_logo.png"></a>';
951
952 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
953
954 $content[] = '<div class="ays-chart-dicount-sale-name-discount-box">';
955 $content[] = '<span class="ays-chart-new-chart-pro-title">';
956 // Translators: %s is the URL to the Chart Builder plugin page.
957 $content[] = sprintf(
958 /* translators: %s is the Chart Builder plugin URL. */
959 __(
960 "<span><a href='%s' target='_blank' style='color:#ffffff; text-decoration: underline;'>Chart Builder</a></span>",
961 'chart-builder'
962 ),
963 "https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=chart-sale-plugin-name" . CHART_BUILDER_VERSION
964 );
965 $content[] = '</span>';
966 $content[] = '<div>';
967 $content[] = '<img src="' . CHART_BUILDER_ADMIN_URL . '/images/ays-chart-banner-sale-30.svg" style="width: 70px;">';
968 $content[] = '</div>';
969 $content[] = '</div>';
970
971 $content[] = '<span class="ays-chart-new-chart-pro-desc">';
972 $content[] = '<img class="ays-chart-new-chart-pro-guaranteeicon" src="' . CHART_BUILDER_ADMIN_URL . '/images/chart-builder-guaranteeicon.webp" style="width: 30px;">';
973 $content[] = esc_html__( "30 Days Money Back Guarantee", 'chart-builder' );
974 $content[] = '</span>';
975
976 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
977 $content[] = '<form method="POST">';
978 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
979 if (current_user_can( 'manage_options' )) {
980 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
981 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
982 }
983 $content[] = '</div>';
984 $content[] = '</form>';
985 $content[] = '</div>';
986
987 $content[] = '</div>';
988
989 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
990
991 $content[] = '<div id="ays-chart-countdown-main-container">';
992 $content[] = '<div class="ays-chart-countdown-container">';
993 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
994 $content[] = esc_html__( "Offer ends in:", 'chart-builder' );
995
996 $content[] = '<ul style="padding: 0">';
997 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . esc_html__( 'Days', 'chart-builder' ) . '</li>';
998 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . esc_html__( 'Hours', 'chart-builder' ) . '</li>';
999 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . esc_html__( 'Minutes', 'chart-builder' ) . '</li>';
1000 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . esc_html__( 'Seconds', 'chart-builder' ) . '</li>';
1001 $content[] = '</ul>';
1002 $content[] = '</div>';
1003
1004 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1005 $content[] = '<span>🚀</span>';
1006 $content[] = '<span>⌛</span>';
1007 $content[] = '<span>🔥</span>';
1008 $content[] = '<span>💣</span>';
1009 $content[] = '</div>';
1010 $content[] = '</div>';
1011 $content[] = '</div>';
1012
1013 $content[] = '</div>';
1014
1015 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1016 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=chart-sale-button'.CHART_BUILDER_VERSION.'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank" style="" >' . esc_html__( 'Buy Now', 'chart-builder' ) . '</a>';
1017 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1018 $content[] = esc_html__( "One-time payment", 'chart-builder' );
1019 $content[] = '</span>';
1020 $content[] = '</div>';
1021
1022 $content[] = '</div>';
1023
1024 $content[] = '</div>';
1025
1026 $content = implode( '', $content );
1027 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1028 }
1029 }
1030
1031 // Helloween banner
1032 public static function ays_chart_helloween_message($ishmar){
1033 if($ishmar == 0 ){
1034 $content = array();
1035
1036 $content[] = '<div id="ays-chart-dicount-month-main-helloween" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1037 $content[] = '<div id="ays-chart-dicount-month-helloween" class="ays_chart_dicount_month_helloween">';
1038 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-limited">';
1039
1040 $content[] = '<p>';
1041 $content[] = __( "Limited Time
1042 <span class='ays-chart-dicount-wrap-color-helloween' style='color:#b2ff00;'>30%</span>
1043 <span>
1044 SALE on
1045 </span>
1046 <br>
1047 <span style='' class='ays-chart-helloween-bundle'>
1048 <a href='https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=helloween-sale-banner' target='_blank' class='ays-chart-dicount-wrap-color-helloween ays-chart-dicount-wrap-text-decoration-helloween' style='display:block; color:#b2ff00;margin-right:6px;'>
1049 Chart Builder
1050 </a>
1051 </span>", 'chart-builder' );
1052 $content[] = '</p>';
1053 $content[] = '<p>';
1054 $content[] = __( "Hurry up!
1055 <a href='https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=helloween-sale-banner' target='_blank' style='color:#ffc700;'>
1056 Check it out!
1057 </a>", 'chart-builder' );
1058 $content[] = '</p>';
1059
1060 $content[] = '</div>';
1061
1062
1063 $content[] = '<div class="ays-chart-helloween-bundle-buy-now-timer">';
1064 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-timer">';
1065 $content[] = '<div id="ays-chart-countdown-main-container" class="ays-chart-countdown-main-container-helloween">';
1066 $content[] = '<div class="ays-chart-countdown-container-helloween">';
1067 $content[] = '<div id="ays-chart-countdown">';
1068 $content[] = '<ul>';
1069 $content[] = '<li><p><span id="ays-chart-countdown-days"></span><span>days</span></p></li>';
1070 $content[] = '<li><p><span id="ays-chart-countdown-hours"></span><span>Hours</span></p></li>';
1071 $content[] = '<li><p><span id="ays-chart-countdown-minutes"></span><span>Mins</span></p></li>';
1072 $content[] = '<li><p><span id="ays-chart-countdown-seconds"></span><span>Secs</span></p></li>';
1073 $content[] = '</ul>';
1074 $content[] = '</div>';
1075
1076 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1077 $content[] = '<span>🚀</span>';
1078 $content[] = '<span>⌛</span>';
1079 $content[] = '<span>🔥</span>';
1080 $content[] = '<span>💣</span>';
1081 $content[] = '</div>';
1082
1083 $content[] = '</div>';
1084
1085 $content[] = '</div>';
1086
1087 $content[] = '</div>';
1088 $content[] = '<div class="ays-chart-dicount-wrap-box ays-buy-now-button-box-helloween">';
1089 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=helloween-sale-banner" class="button button-primary ays-buy-now-button-helloween" id="ays-button-top-buy-now-helloween" target="_blank" style="" >' . __( 'Buy Now !', 'chart-builder' ) . '</a>';
1090 $content[] = '</div>';
1091 $content[] = '</div>';
1092
1093 $content[] = '</div>';
1094
1095 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-helloween">';
1096 $content[] = '<form method="POST">';
1097 $content[] = '<div id="ays-chart-dismiss-buttons-content-helloween">';
1098 if( current_user_can( 'manage_options' ) ){
1099 $content[] = '<button class="btn btn-link ays-button-helloween" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
1100 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1101 }
1102 $content[] = '</div>';
1103 $content[] = '</form>';
1104
1105 $content[] = '</div>';
1106 // $content[] = '<button type="button" class="notice-dismiss">';
1107 // $content[] = '</button>';
1108 $content[] = '</div>';
1109
1110 $content = implode( '', $content );
1111
1112 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1113 }
1114 }
1115
1116 // Black Friday banner
1117 public static function ays_chart_black_friday_message($ishmar){
1118 if($ishmar == 0 ){
1119 $content = array();
1120
1121 $content[] = '<div id="ays-chart-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1122 $content[] = '<div id="ays-chart-dicount-black-friday-month" class="ays_chart_dicount_month">';
1123 $content[] = '<div class="ays-chart-dicount-black-friday-box">';
1124 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-box-80" style="width: 70%;">';
1125 $content[] = '<div class="ays-chart-dicount-black-friday-title-row">' . __( 'Limited Time', "chart-builder" ) .' '. '<a href="https://ays-pro.com/wordpress/chart-builder?utm_medium=chart-free&utm_campaign=black-friday-sale-banner" class="ays-chart-dicount-black-friday-button-sale" target="_blank">' . __( 'Sale', "chart-builder" ) . '</a>' . '</div>';
1126 $content[] = '<div class="ays-chart-dicount-black-friday-title-row">' . __( 'Chart Builder plugin', "chart-builder" ) . '</div>';
1127 $content[] = '</div>';
1128
1129 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-text-box">';
1130 $content[] = '<div class="ays-chart-dicount-black-friday-text-row">' . __( '20% off', "chart-builder" ) . '</div>';
1131 $content[] = '</div>';
1132
1133 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1134 $content[] = '<div id="ays-chart-countdown-main-container">';
1135 $content[] = '<div class="ays-chart-countdown-container">';
1136 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1137 $content[] = '<ul>';
1138 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . __( 'Days', "chart-builder" ) . '</li>';
1139 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . __( 'Hours', "chart-builder" ) . '</li>';
1140 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . __( 'Minutes', "chart-builder" ) . '</li>';
1141 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . __( 'Seconds', "chart-builder" ) . '</li>';
1142 $content[] = '</ul>';
1143 $content[] = '</div>';
1144 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1145 $content[] = '<span>🚀</span>';
1146 $content[] = '<span>⌛</span>';
1147 $content[] = '<span>🔥</span>';
1148 $content[] = '<span>💣</span>';
1149 $content[] = '</div>';
1150 $content[] = '</div>';
1151 $content[] = '</div>';
1152 $content[] = '</div>';
1153
1154 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1155 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_medium=chart-free&utm_campaign=black-friday-sale-banner" class="ays-chart-dicount-black-friday-button-buy-now" target="_blank">' . __( 'Get Your Deal', "chart-builder" ) . '</a>';
1156 $content[] = '</div>';
1157 $content[] = '</div>';
1158 $content[] = '</div>';
1159
1160 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-black-friday">';
1161 $content[] = '<form method="POST">';
1162 $content[] = '<div id="ays-chart-dismiss-buttons-content-black-friday">';
1163 if( current_user_can( 'manage_options' ) ){
1164 $content[] = '<button class="btn btn-link ays-button-black-friday" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', "chart-builder" ) . '</button>';
1165 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1166 }
1167 $content[] = '</div>';
1168 $content[] = '</form>';
1169 $content[] = '</div>';
1170 $content[] = '</div>';
1171
1172 $content = implode( '', $content );
1173
1174 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1175 }
1176 }
1177
1178 // Christmas banner
1179 public static function ays_chart_christmas_message($ishmar){
1180 if($ishmar == 0 ){
1181 $content = array();
1182
1183 $content[] = '<div id="ays-chart-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1184 $content[] = '<div id="ays-chart-dicount-christmas-month" class="ays_chart_dicount_month">';
1185 $content[] = '<div class="ays-chart-dicount-christmas-box">';
1186 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box ays-chart-dicount-christmas-wrap-box-80">';
1187 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Limited Time', 'chart-builder' ) .' '. '<a href="https://ays-pro.com/wordpress/chart-builder" class="ays-chart-dicount-christmas-button-sale" target="_blank">' . __( '40%', 'chart-builder' ) . '</a>' . ' SALE</div>';
1188 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Chart Builder Plugin', 'chart-builder' ) . '</div>';
1189 $content[] = '</div>';
1190
1191 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1192 $content[] = '<div id="ays-chart-countdown-main-container">';
1193 $content[] = '<div class="ays-chart-countdown-container">';
1194 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1195 $content[] = '<ul>';
1196 $content[] = '<li><span id="ays-chart-countdown-days"></span>' . __( 'Days', 'chart-builder' ) . '</li>';
1197 $content[] = '<li><span id="ays-chart-countdown-hours"></span>' . __( 'Hours', 'chart-builder' ) . '</li>';
1198 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>' . __( 'Minutes', 'chart-builder' ) . '</li>';
1199 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>' . __( 'Seconds', 'chart-builder' ) . '</li>';
1200 $content[] = '</ul>';
1201 $content[] = '</div>';
1202 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1203 $content[] = '<span>🚀</span>';
1204 $content[] = '<span>⌛</span>';
1205 $content[] = '<span>🔥</span>';
1206 $content[] = '<span>💣</span>';
1207 $content[] = '</div>';
1208 $content[] = '</div>';
1209 $content[] = '</div>';
1210 $content[] = '</div>';
1211
1212 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1213 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder" class="ays-chart-dicount-christmas-button-buy-now" target="_blank">' . __( 'BUY NOW!', 'chart-builder' ) . '</a>';
1214 $content[] = '</div>';
1215 $content[] = '</div>';
1216 $content[] = '</div>';
1217
1218 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-christmas">';
1219 $content[] = '<form method="POST">';
1220 $content[] = '<div id="ays-chart-dismiss-buttons-content-christmas">';
1221 $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', 'chart-builder' ) . '</button>';
1222 $content[] = '</div>';
1223 $content[] = '</form>';
1224 $content[] = '</div>';
1225 $content[] = '</div>';
1226
1227 $content = implode( '', $content );
1228
1229 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1230 }
1231 }
1232
1233 // Silver Bundle
1234 public function ays_chart_silver_bundle_message($ishmar){
1235 if($ishmar == 0 ){
1236 $content = array();
1237
1238 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1239 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1240 $content[] = '<a href="https://ays-pro.com/silver-bundle" target="_blank" class="ays-chart-sale-banner-link"><img src="' . CHART_BUILDER_ADMIN_URL . '/images/silver_bundle_logo_box.png"></a>';
1241
1242 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1243
1244 $content[] = '<strong style="font-weight: bold;">';
1245 $content[] = __( "Limited Time <span style='color:#E85011;'>50%</span> SALE on <br><span><a href='https://ays-pro.com/silver-bundle' target='_blank' style='color:#E85011; text-decoration: underline;'>Silver Bundle</a></span> (Quiz + Chart + Form)!", 'chart-builder' );
1246 $content[] = '</strong>';
1247
1248 $content[] = '<br>';
1249
1250 $content[] = '<strong>';
1251 $content[] = __( "Hurry up! <a href='https://ays-pro.com/silver-bundle' target='_blank'>Check it out!</a>", 'chart-builder' );
1252 $content[] = '</strong>';
1253
1254 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1255
1256 $content[] = '<form method="POST">';
1257 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1258 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
1259 $content[] = '</div>';
1260 $content[] = '</form>';
1261
1262 $content[] = '</div>';
1263
1264 $content[] = '</div>';
1265
1266 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1267
1268 $content[] = '<div id="ays-chart-countdown-main-container">';
1269 $content[] = '<div class="ays-chart-countdown-container">';
1270
1271 $content[] = '<div id="ays-chart-countdown">';
1272 $content[] = '<ul>';
1273 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
1274 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
1275 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
1276 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
1277 $content[] = '</ul>';
1278 $content[] = '</div>';
1279
1280 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1281 $content[] = '<span>🚀</span>';
1282 $content[] = '<span>⌛</span>';
1283 $content[] = '<span>🔥</span>';
1284 $content[] = '<span>💣</span>';
1285 $content[] = '</div>';
1286
1287 $content[] = '</div>';
1288 $content[] = '</div>';
1289
1290 $content[] = '</div>';
1291
1292 $content[] = '<a href="https://ays-pro.com/silver-bundle" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank" style="height: 32px; display: flex; align-items: center; font-weight: 500; " >' . __( 'Buy Now !', 'chart-builder' ) . '</a>';
1293 $content[] = '</div>';
1294 $content[] = '</div>';
1295
1296 $content = implode( '', $content );
1297 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1298 }
1299 }
1300
1301 // Black Friday 2024
1302 public function ays_chart_black_friday_message_2024($ishmar){
1303 if($ishmar == 0 ){
1304 $content = array();
1305
1306 $content[] = '<div id="ays-chart-black-friday-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1307 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1308
1309 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1310
1311 $content[] = '<div id="ays-chart-countdown-main-container">';
1312 $content[] = '<div class="ays-chart-countdown-container">';
1313
1314 $content[] = '<div id="ays-chart-countdown">';
1315
1316 $content[] = '<div>';
1317 $content[] = __( "Offer ends in:", 'chart-builder' );
1318 $content[] = '</div>';
1319
1320 $content[] = '<ul>';
1321 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1322 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1323 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1324 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1325 $content[] = '</ul>';
1326 $content[] = '</div>';
1327
1328 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1329 $content[] = '<span>🚀</span>';
1330 $content[] = '<span>⌛</span>';
1331 $content[] = '<span>🔥</span>';
1332 $content[] = '<span>💣</span>';
1333 $content[] = '</div>';
1334
1335 $content[] = '</div>';
1336 $content[] = '</div>';
1337
1338 $content[] = '</div>';
1339
1340 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1341 $content[] = '<div>';
1342
1343 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1344 $content[] = __( "<span><a href='https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner' class='ays-chart-black-friday-bundle-title-link' target='_blank'>Black Friday Sale</a></span>", 'chart-builder' );
1345 $content[] = '</span>';
1346
1347 $content[] = '</br>';
1348
1349 $content[] = '<span class="ays-chart-black-friday-bundle-desc">';
1350 $content[] = '<a class="ays-chart-black-friday-bundle-desc" href="https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner" class="ays-chart-black-friday-bundle-title-link" target="_blank">';
1351 $content[] = __( "50% OFF", 'chart-builder' );
1352 $content[] = '</a>';
1353 $content[] = '</span>';
1354 $content[] = '</div>';
1355
1356 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1357
1358 $content[] = '<form action="" method="POST">';
1359 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1360 if( current_user_can( 'manage_options' ) ){
1361 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", 'chart-builder' ) .'</button>';
1362 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1363 }
1364 $content[] = '</div>';
1365 $content[] = '</form>';
1366
1367 $content[] = '</div>';
1368
1369 $content[] = '</div>';
1370
1371 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1372 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1373 $content[] = '<a class="ays-chart-black-friday-bundle-title-link" href="https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner" target="_blank">';
1374 $content[] = __( 'Silver Bundle', 'chart-builder' );
1375 $content[] = '</a>';
1376 $content[] = '</span>';
1377 $content[] = '</div>';
1378
1379 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1380 $content[] = '<a href="https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', 'chart-builder' ) . '</a>';
1381 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1382 $content[] = __( "One-time payment", 'chart-builder' );
1383 $content[] = '</span>';
1384 $content[] = '</div>';
1385 $content[] = '</div>';
1386 $content[] = '</div>';
1387
1388 $content = implode( '', $content );
1389 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1390 }
1391 }
1392
1393 // Christmas Top Banner 2024
1394 public function ays_chart_christmas_message_2024($ishmar){
1395 if($ishmar == 0 ){
1396 $content = array();
1397
1398 $content[] = '<div id="ays-chart-christmas-top-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1399 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1400
1401 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1402
1403 $content[] = '<div id="ays-chart-countdown-main-container">';
1404 $content[] = '<div class="ays-chart-countdown-container">';
1405
1406 $content[] = '<div id="ays-chart-countdown">';
1407
1408 $content[] = '<div>';
1409 $content[] = __( "Offer ends in:", 'chart-builder' );
1410 $content[] = '</div>';
1411
1412 $content[] = '<ul style="padding-left: 0;">';
1413 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1414 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1415 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1416 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1417 $content[] = '</ul>';
1418 $content[] = '</div>';
1419
1420 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1421 $content[] = '<span>🚀</span>';
1422 $content[] = '<span>⌛</span>';
1423 $content[] = '<span>🔥</span>';
1424 $content[] = '<span>💣</span>';
1425 $content[] = '</div>';
1426
1427 $content[] = '</div>';
1428 $content[] = '</div>';
1429
1430 $content[] = '</div>';
1431
1432 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1433 $content[] = '<div>';
1434
1435 $content[] = '<span class="ays-chart-christmas-top-bundle-title">';
1436 $content[] = sprintf(
1437 /* translators: %s is the Chart Builder plugin URL with version parameter. */
1438 __(
1439 "<span><a href='%s' class='ays-chart-christmas-top-bundle-title-link' target='_blank'>Christmas Sale</a></span>",
1440 'chart-builder'
1441 ),
1442 "https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner" . CHART_BUILDER_VERSION
1443 );
1444 $content[] = '</span>';
1445
1446 $content[] = '</br>';
1447
1448 $content[] = '<span class="ays-chart-christmas-top-bundle-desc">';
1449 $content[] = '<a class="ays-chart-christmas-top-bundle-desc" href="https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner'.CHART_BUILDER_VERSION.'" class="ays-chart-christmas-top-bundle-title-link" target="_blank">';
1450 $content[] = __( "20% Extra OFF", 'chart-builder' );
1451 $content[] = '</a>';
1452 $content[] = '</span>';
1453 $content[] = '</div>';
1454
1455 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1456
1457 $content[] = '<form action="" method="POST">';
1458 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1459 if( current_user_can( 'manage_options' ) ){
1460 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", 'chart-builder' ) .'</button>';
1461 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1462 }
1463 $content[] = '</div>';
1464 $content[] = '</form>';
1465
1466 $content[] = '</div>';
1467
1468 $content[] = '</div>';
1469
1470 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-christmas-top-bundle-coupon-text-box">';
1471 $content[] = '<div class="ays-chart-christmas-top-bundle-coupon-row">';
1472 $content[] = 'xmas20off';
1473 $content[] = '</div>';
1474 $content[] = '<div class="ays-chart-christmas-top-bundle-text-row">';
1475 $content[] = __( '20% Extra Discount Coupon', 'chart-builder' );
1476 $content[] = '</div>';
1477 $content[] = '</div>';
1478
1479 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1480 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner'.CHART_BUILDER_VERSION.'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', 'chart-builder' ) . '</a>';
1481 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1482 $content[] = __( "One-time payment", 'chart-builder' );
1483 $content[] = '</span>';
1484 $content[] = '</div>';
1485 $content[] = '</div>';
1486 $content[] = '</div>';
1487
1488 $content = implode( '', $content );
1489 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1490 }
1491 }
1492
1493 public function ays_chart_update_banner_time(){
1494
1495 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
1496 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
1497 $next_3_days = gmdate('M d, Y H:i:s', $date);
1498
1499 $ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1500
1501 if ( !$ays_chart_banner_time || is_null( $ays_chart_banner_time ) ) {
1502 update_option('ays_chart_20_bundle_banner_time', $next_3_days );
1503 }
1504
1505 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1506
1507 $val = 60*60*24*0.5; // half day
1508 // $val = 60; // for testing | 1 min
1509
1510 $current_date = current_time( 'mysql' );
1511 $date_diff = strtotime($current_date) - intval(strtotime($get_ays_chart_banner_time));
1512
1513 $days_diff = $date_diff / $val;
1514 if(intval($days_diff) > 0 ){
1515 update_option('ays_chart_20_bundle_banner_time', $next_3_days);
1516 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1517 }
1518
1519 return $get_ays_chart_banner_time;
1520 }
1521
1522 public function author_user_search() {
1523 check_ajax_referer( 'cbuilder-author-user-search', 'security' );
1524 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
1525 $search = isset($params['search']) && $params['search'] != '' ? sanitize_text_field( $params['search'] ) : null;
1526 $checked = isset($params['val']) && $params['val'] !='' ? sanitize_text_field( $params['val'] ) : null;
1527 $args = 'search=';
1528 if ($search !== null) {
1529 $args .= '*';
1530 $args .= $search;
1531 $args .= '*';
1532 }
1533
1534 $users = get_users($args);
1535
1536 $content_text = array(
1537 'results' => array()
1538 );
1539
1540 foreach ($users as $key => $value) {
1541 if ($checked !== null) {
1542 if ( !is_array( $checked ) ) {
1543 $checked2 = $checked;
1544 $checked = array();
1545 $checked[] = absint($checked2);
1546 }
1547 if (in_array($value->ID, $checked)) {
1548 continue;
1549 } else {
1550 $content_text['results'][] = array(
1551 'id' => $value->ID,
1552 'text' => $value->data->display_name,
1553 );
1554 }
1555 } else {
1556 $content_text['results'][] = array(
1557 'id' => $value->ID,
1558 'text' => $value->data->display_name,
1559 );
1560 }
1561 }
1562
1563 ob_end_clean();
1564 echo json_encode($content_text);
1565 wp_die();
1566 }
1567
1568 /**
1569 * Determine if the plugin/addon installations are allowed.
1570 *
1571 * @since 6.4.0.4
1572 *
1573 * @param string $type Should be `plugin` or `addon`.
1574 *
1575 * @return bool
1576 */
1577 public static function ays_chart_can_install( $type ) {
1578
1579 return self::ays_chart_can_do( 'install', $type );
1580 }
1581
1582 /**
1583 * Determine if the plugin/addon activations are allowed.
1584 *
1585 * @since 6.4.0.4
1586 *
1587 * @param string $type Should be `plugin` or `addon`.
1588 *
1589 * @return bool
1590 */
1591 public static function ays_chart_can_activate( $type ) {
1592
1593 return self::ays_chart_can_do( 'activate', $type );
1594 }
1595
1596 /**
1597 * Determine if the plugin/addon installations/activations are allowed.
1598 *
1599 * @since 6.4.0.4
1600 *
1601 * @param string $what Should be 'activate' or 'install'.
1602 * @param string $type Should be `plugin` or `addon`.
1603 *
1604 * @return bool
1605 */
1606 public static function ays_chart_can_do( $what, $type ) {
1607
1608 if ( ! in_array( $what, array( 'install', 'activate' ), true ) ) {
1609 return false;
1610 }
1611
1612 if ( ! in_array( $type, array( 'plugin', 'addon' ), true ) ) {
1613 return false;
1614 }
1615
1616 $capability = $what . '_plugins';
1617
1618 if ( ! current_user_can( $capability ) ) {
1619 return false;
1620 }
1621
1622 // Determine whether file modifications are allowed and it is activation permissions checking.
1623 if ( $what === 'install' && ! wp_is_file_mod_allowed( 'ays_chart_can_install' ) ) {
1624 return false;
1625 }
1626
1627 // All plugin checks are done.
1628 if ( $type === 'plugin' ) {
1629 return true;
1630 }
1631 return false;
1632 }
1633
1634 /**
1635 * Activate plugin.
1636 *
1637 * @since 1.0.0
1638 * @since 6.4.0.4 Updated the permissions checking.
1639 */
1640 public function ays_chart_activate_plugin() {
1641
1642 // Run a security check.
1643 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
1644 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1645 }
1646
1647 // Check for permissions.
1648 if ( ! current_user_can( 'activate_plugins' ) ) {
1649 wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', 'chart-builder' ) );
1650 }
1651
1652 $type = 'addon';
1653
1654 if ( isset( $_POST['plugin'] ) ) {
1655
1656 if ( ! empty( $_POST['type'] ) ) {
1657 $type = sanitize_key( $_POST['type'] );
1658 }
1659
1660 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
1661 $activate = activate_plugins( $plugin );
1662
1663 if ( ! is_wp_error( $activate ) ) {
1664 if ( $type === 'plugin' ) {
1665 wp_send_json_success( esc_html__( 'Plugin activated.', 'chart-builder' ) );
1666 } else {
1667 ( esc_html__( 'Addon activated.', 'chart-builder' ) );
1668 }
1669 }
1670 }
1671
1672 if ( $type === 'plugin' ) {
1673 wp_send_json_error( esc_html__( 'Could not activate the plugin. Please activate it on the Plugins page.', 'chart-builder' ) );
1674 }
1675
1676 wp_send_json_error( esc_html__( 'Could not activate the addon. Please activate it on the Plugins page.', 'chart-builder' ) );
1677 }
1678
1679 /**
1680 * Install addon.
1681 *
1682 * @since 1.0.0
1683 * @since 6.4.0.4 Updated the permissions checking.
1684 */
1685 public function ays_chart_install_plugin() {
1686
1687 // Run a security check.
1688 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
1689 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1690 }
1691
1692 $generic_error = esc_html__( 'There was an error while performing your request.', 'chart-builder' );
1693 $type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
1694
1695 // Check if new installations are allowed.
1696 if ( ! self::ays_chart_can_install( $type ) ) {
1697 wp_send_json_error( $generic_error );
1698 }
1699
1700 $error = $type === 'plugin'
1701 ? esc_html__( 'Could not install the plugin. Please download and install it manually.', 'chart-builder' )
1702 : "";
1703
1704 $plugin_url = ! empty( $_POST['plugin'] ) ? esc_url_raw( wp_unslash( $_POST['plugin'] ) ) : '';
1705
1706 if ( empty( $plugin_url ) ) {
1707 wp_send_json_error( $error );
1708 }
1709
1710 // Prepare variables.
1711 $url = esc_url_raw(
1712 add_query_arg(
1713 [
1714 'page' => 'chart-builder-featured-plugins',
1715 ],
1716 admin_url( 'admin.php' )
1717 )
1718 );
1719
1720 ob_start();
1721 $creds = request_filesystem_credentials( $url, '', false, false, null );
1722
1723 // Hide the filesystem credentials form.
1724 ob_end_clean();
1725
1726 // Check for file system permissions.
1727 if ( $creds === false ) {
1728 wp_send_json_error( $error );
1729 }
1730
1731 if ( ! WP_Filesystem( $creds ) ) {
1732 wp_send_json_error( $error );
1733 }
1734
1735 /*
1736 * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
1737 */
1738 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-upgrader.php';
1739 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-install-skin.php';
1740 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-skin.php';
1741
1742
1743 // Do not allow WordPress to search/download translations, as this will break JS output.
1744 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1745
1746 // Create the plugin upgrader with our custom skin.
1747 $installer = new ChartBuilder\Helpers\ChartBuilderPluginSilentUpgrader( new Chart_Builder_Install_Skin() );
1748
1749 // Error check.
1750 if ( ! method_exists( $installer, 'install' ) ) {
1751 wp_send_json_error( $error );
1752 }
1753
1754 $installer->install( $plugin_url );
1755
1756 // Flush the cache and return the newly installed plugin basename.
1757 wp_cache_flush();
1758
1759 $plugin_basename = $installer->plugin_info();
1760
1761 if ( empty( $plugin_basename ) ) {
1762 wp_send_json_error( $error );
1763 }
1764
1765 $result = array(
1766 'msg' => $generic_error,
1767 'is_activated' => false,
1768 'basename' => $plugin_basename,
1769 );
1770
1771 // Check for permissions.
1772 if ( ! current_user_can( 'activate_plugins' ) ) {
1773 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed.', 'chart-builder' ) : "";
1774
1775 wp_send_json_success( $result );
1776 }
1777
1778 // Activate the plugin silently.
1779 $activated = activate_plugin( $plugin_basename );
1780 remove_action( 'activated_plugin', array( 'ays_sccp_activation_redirect_method', 'gallery_p_gallery_activation_redirect_method', 'poll_maker_activation_redirect_method' ), 100 );
1781
1782 if ( ! is_wp_error( $activated ) ) {
1783
1784 $result['is_activated'] = true;
1785 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed and activated.', 'chart-builder' ) : esc_html__( 'Addon installed and activated.', 'chart-builder' );
1786
1787 wp_send_json_success( $result );
1788 }
1789
1790 // Fallback error just in case.
1791 wp_send_json_error( $result );
1792 }
1793
1794 /**
1795 * List of AM plugins that we propose to install.
1796 *
1797 * @since 6.4.0.4
1798 *
1799 * @return array
1800 */
1801 protected function get_am_plugins() {
1802 if ( !isset( $_SESSION ) ) {
1803 session_start();
1804 }
1805
1806 $images_url = CHART_BUILDER_ADMIN_URL . '/images/icons/';
1807
1808 $plugin_slug = array(
1809 'quiz-maker',
1810 'survey-maker',
1811 'poll-maker',
1812 'ays-popup-box',
1813 'secure-copy-content-protection',
1814 'gallery-photo-gallery',
1815 'ays-chatgpt-assistant',
1816 'easy-form',
1817 );
1818
1819 $plugin_url_arr = array();
1820 foreach ($plugin_slug as $key => $slug) {
1821 if ( isset( $_SESSION['ays_chart_our_product_links'] ) && !empty( $_SESSION['ays_chart_our_product_links'] )
1822 && isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && !empty( $_SESSION['ays_chart_our_product_links'][$slug] ) ) {
1823 $plugin_url = (isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && $_SESSION['ays_chart_our_product_links'][$slug] != "") ? esc_url( $_SESSION['ays_chart_our_product_links'][$slug] ) : "";
1824 } else {
1825 $latest_version = $this->ays_chart_get_latest_plugin_version($slug);
1826 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.zip';
1827 if ( $latest_version != '' ) {
1828 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.'. $latest_version .'.zip';
1829 $_SESSION['ays_chart_our_product_links'][$slug] = $plugin_url;
1830 }
1831 }
1832
1833 $plugin_url_arr[$slug] = $plugin_url;
1834 }
1835
1836 $plugins_array = array(
1837 'quiz-maker/quiz-maker.php' => array(
1838 'icon' => $images_url . 'icon-quiz-128x128.png',
1839 'name' => __( 'Quiz Maker', 'chart-builder' ),
1840 'desc' => __( 'Create powerful and engaging quizzes, tests, and exams in minutes.', 'chart-builder' ),
1841 'desc_hidden' => __( 'Build an unlimited number of quizzes and questions.', 'chart-builder' ),
1842 'wporg' => 'https://wordpress.org/plugins/quiz-maker/',
1843 'buy_now' => 'https://ays-pro.com/wordpress/quiz-maker/',
1844 'url' => $plugin_url_arr['quiz-maker'],
1845 ),
1846 'survey-maker/survey-maker.php' => array(
1847 'icon' => $images_url . 'icon-survey-128x128.png',
1848 'name' => __( 'Survey Maker', 'chart-builder' ),
1849 'desc' => __( 'Make amazing online surveys and get real-time feedback quickly and easily.', 'chart-builder' ),
1850 'desc_hidden' => __( 'Learn what your website visitors want, need, and expect with the help of Survey Maker. Build surveys without limiting your needs.', 'chart-builder' ),
1851 'wporg' => 'https://wordpress.org/plugins/survey-maker/',
1852 'buy_now' => 'https://ays-pro.com/wordpress/survey-maker',
1853 'url' => $plugin_url_arr['survey-maker'],
1854 ),
1855 'poll-maker/poll-maker-ays.php' => array(
1856 'icon' => $images_url . 'icon-poll-128x128.png',
1857 'name' => __( 'Poll Maker', 'chart-builder' ),
1858 'desc' => __( 'Create amazing online polls for your WordPress website super easily.', 'chart-builder' ),
1859 'desc_hidden' => __( 'Build up various types of polls in a minute and get instant feedback on any topic or product.', 'chart-builder' ),
1860 'wporg' => 'https://wordpress.org/plugins/poll-maker/',
1861 'buy_now' => 'https://ays-pro.com/wordpress/poll-maker/',
1862 'url' => $plugin_url_arr['poll-maker'],
1863 ),
1864 'ays-popup-box/ays-pb.php' => array(
1865 'icon' => $images_url . 'icon-popup-128x128.png',
1866 'name' => __( 'Popup Box', 'chart-builder' ),
1867 'desc' => __( 'Popup everything you want! Create informative and promotional popups all in one plugin.', 'chart-builder' ),
1868 'desc_hidden' => __( 'Attract your visitors and convert them into email subscribers and paying customers.', 'chart-builder' ),
1869 'wporg' => 'https://wordpress.org/plugins/ays-popup-box/',
1870 'buy_now' => 'https://ays-pro.com/wordpress/popup-box/',
1871 'url' => $plugin_url_arr['ays-popup-box'],
1872 ),
1873 'secure-copy-content-protection/secure-copy-content-protection.php' => array(
1874 'icon' => $images_url . 'icon-sccp-128x128.png',
1875 'name' => __( 'Secure Copy Content Protection', 'chart-builder' ),
1876 'desc' => __( 'Disable the right click, copy paste, content selection and copy shortcut keys on your website.', 'chart-builder' ),
1877 'desc_hidden' => __( 'Protect web content from being plagiarized. Prevent plagiarism from your website with this easy to use plugin.', 'chart-builder' ),
1878 'wporg' => 'https://wordpress.org/plugins/secure-copy-content-protection/',
1879 'buy_now' => 'https://ays-pro.com/wordpress/secure-copy-content-protection/',
1880 'url' => $plugin_url_arr['secure-copy-content-protection'],
1881 ),
1882 'gallery-photo-gallery/gallery-photo-gallery.php' => array(
1883 'icon' => $images_url . 'icon-gallery-128x128.jpg',
1884 'name' => __( 'Gallery Photo Gallery', 'chart-builder' ),
1885 'desc' => __( 'Create unlimited galleries and include unlimited images in those galleries.', 'chart-builder' ),
1886 'desc_hidden' => __( 'Represent images in an attractive way. Attract people with your own single and multiple free galleries from your photo library.', 'chart-builder' ),
1887 'wporg' => 'https://wordpress.org/plugins/gallery-photo-gallery/',
1888 'buy_now' => 'https://ays-pro.com/wordpress/photo-gallery/',
1889 'url' => $plugin_url_arr['gallery-photo-gallery'],
1890 ),
1891 'ays-chatgpt-assistant/ays-chatgpt-assistant.php' => array(
1892 'icon' => $images_url . 'icon-chatgpt-128x128.png',
1893 'name' => __( 'AI Assistant with ChatGPT', 'chart-builder' ),
1894 'desc' => __( 'ChatGPT AI Assistant plugin gives you the ability to automate various tasks related to content creation and programming.', 'chart-builder' ),
1895 'desc_hidden' => __( 'The ChatGPT AI Assistant plugin is here to empower your WordPress website. Have your personal chatbot, content generator right on your front end and backend.', 'chart-builder' ),
1896 'wporg' => 'https://wordpress.org/plugins/ays-chatgpt-assistant/',
1897 'buy_now' => 'https://ays-pro.com/wordpress/chatgpt-assistant',
1898 'url' => $plugin_url_arr['ays-chatgpt-assistant'],
1899 ),
1900 'easy-form/easy-form.php' => array(
1901 'icon' => $images_url . 'icon-form-128x128.png',
1902 'name' => __( 'Easy Form', 'chart-builder' ),
1903 'desc' => __( 'Choose the best WordPress form builder plugin. ', 'chart-builder' ),
1904 'desc_hidden' => __( 'Create contact forms, payment forms, surveys, and many more custom forms. Build forms easily with us.', 'chart-builder' ),
1905 'wporg' => 'https://wordpress.org/plugins/easy-form/',
1906 'buy_now' => 'https://ays-pro.com/wordpress/easy-form',
1907 'url' => $plugin_url_arr['easy-form'],
1908 ),
1909 );
1910
1911 return $plugins_array;
1912 }
1913
1914 protected function ays_chart_get_latest_plugin_version( $slug ){
1915
1916 if ( is_null( $slug ) || empty($slug) ) {
1917 return "";
1918 }
1919
1920 $version_latest = "";
1921
1922 if ( ! function_exists( 'plugins_api' ) ) {
1923 require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
1924 }
1925
1926 // set the arguments to get latest info from repository via API ##
1927 $args = array(
1928 'slug' => $slug,
1929 'fields' => array(
1930 'version' => true,
1931 )
1932 );
1933
1934 /** Prepare our query */
1935 $call_api = plugins_api( 'plugin_information', $args );
1936
1937 /** Check for Errors & Display the results */
1938 if ( is_wp_error( $call_api ) ) {
1939 $api_error = $call_api->get_error_message();
1940 } else {
1941
1942 //echo $call_api;
1943 // everything ##
1944 if ( ! empty( $call_api->version ) ) {
1945 $version_latest = $call_api->version;
1946 }
1947 }
1948
1949 return $version_latest;
1950 }
1951
1952 /**
1953 * Get AM plugin data to display in the Addons section of About tab.
1954 *
1955 * @since 6.4.0.4
1956 *
1957 * @param string $plugin Plugin slug.
1958 * @param array $details Plugin details.
1959 * @param array $all_plugins List of all plugins.
1960 *
1961 * @return array
1962 */
1963 protected function get_plugin_data( $plugin, $details, $all_plugins ) {
1964
1965 $have_pro = ( ! empty( $details['pro'] ) && ! empty( $details['pro']['plug'] ) );
1966 $show_pro = false;
1967
1968 $plugin_data = array();
1969
1970 if ( $have_pro ) {
1971 if ( array_key_exists( $plugin, $all_plugins ) ) {
1972 if ( is_plugin_active( $plugin ) ) {
1973 $show_pro = true;
1974 }
1975 }
1976 if ( array_key_exists( $details['pro']['plug'], $all_plugins ) ) {
1977 $show_pro = true;
1978 }
1979 if ( $show_pro ) {
1980 $plugin = $details['pro']['plug'];
1981 $details = $details['pro'];
1982 }
1983 }
1984
1985 if ( array_key_exists( $plugin, $all_plugins ) ) {
1986 if ( is_plugin_active( $plugin ) ) {
1987 // Status text/status.
1988 $plugin_data['status_class'] = 'status-active';
1989 $plugin_data['status_text'] = esc_html__( 'Active', 'chart-builder' );
1990 // Button text/status.
1991 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info disabled';
1992 $plugin_data['action_text'] = esc_html__( 'Activated', 'chart-builder' );
1993 $plugin_data['plugin_src'] = esc_attr( $plugin );
1994 } else {
1995 // Status text/status.
1996 $plugin_data['status_class'] = 'status-installed';
1997 $plugin_data['status_text'] = esc_html__( 'Inactive', 'chart-builder' );
1998 // Button text/status.
1999 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
2000 $plugin_data['action_text'] = esc_html__( 'Activate', 'chart-builder' );
2001 $plugin_data['plugin_src'] = esc_attr( $plugin );
2002 }
2003 } else {
2004 // Doesn't exist, install.
2005 // Status text/status.
2006 $plugin_data['status_class'] = 'status-missing';
2007
2008 if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) {
2009 $plugin_data['status_class'] = 'status-go-to-url';
2010 }
2011 $plugin_data['status_text'] = esc_html__( 'Not Installed', 'chart-builder' );
2012 // Button text/status.
2013 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
2014 $plugin_data['action_text'] = esc_html__( 'Install Plugin', 'chart-builder' );
2015 $plugin_data['plugin_src'] = esc_url( $details['url'] );
2016 }
2017
2018 $plugin_data['details'] = $details;
2019
2020 return $plugin_data;
2021 }
2022
2023 /**
2024 * Display the Addons section of About tab.
2025 *
2026 * @since 6.4.0.4
2027 */
2028 public function output_about_addons() {
2029
2030 if ( ! function_exists( 'get_plugins' ) ) {
2031 require_once ABSPATH . 'wp-admin/includes/plugin.php';
2032 }
2033
2034 $all_plugins = get_plugins();
2035 $am_plugins = $this->get_am_plugins();
2036 $can_install_plugins = self::ays_chart_can_install( 'plugin' );
2037 $can_activate_plugins = self::ays_chart_can_activate( 'plugin' );
2038
2039 $content = '';
2040 $content.= '<div class="ays-chart-cards-block">';
2041 foreach ( $am_plugins as $plugin => $details ){
2042
2043 $plugin_data = $this->get_plugin_data( $plugin, $details, $all_plugins );
2044 $plugin_ready_to_activate = $can_activate_plugins
2045 && isset( $plugin_data['status_class'] )
2046 && $plugin_data['status_class'] === 'status-installed';
2047 $plugin_not_activated = ! isset( $plugin_data['status_class'] )
2048 || $plugin_data['status_class'] !== 'status-active';
2049
2050 $plugin_action_class = ( isset( $plugin_data['action_class'] ) && esc_attr( $plugin_data['action_class'] ) != "" ) ? esc_attr( $plugin_data['action_class'] ) : "";
2051
2052 $plugin_action_class_disbaled = "";
2053 if ( strpos($plugin_action_class, 'status-active') !== false ) {
2054 $plugin_action_class_disbaled = "disbaled='true'";
2055 }
2056
2057 $content .= '
2058 <div class="ays-chart-card">
2059 <div class="ays-chart-card__content flexible">
2060 <div class="ays-chart-card__content-img-box">
2061 <img class="ays-chart-card__img" src="'. esc_url( $plugin_data['details']['icon'] ) .'" alt="'. esc_attr( $plugin_data['details']['name'] ) .'">
2062 </div>
2063 <div class="ays-chart-card__text-block">
2064 <h5 class="ays-chart-card__title">'. esc_html( $plugin_data['details']['name'] ) .'</h5>
2065 <p class="ays-chart-card__text">'. wp_kses_post( $plugin_data['details']['desc'] ) .'
2066 <span class="ays-chart-card__text-hidden">
2067 '. wp_kses_post( $plugin_data['details']['desc_hidden'] ) .'
2068 </span>
2069 </p>
2070 </div>
2071 </div>
2072 <div class="ays-chart-card__footer">';
2073 if ( $can_install_plugins || $plugin_ready_to_activate || ! $details['wporg'] ) {
2074 $content .= '<button class="'. esc_attr( $plugin_data['action_class'] ) .'" data-plugin="'. esc_attr( $plugin_data['plugin_src'] ) .'" data-type="plugin" '. $plugin_action_class_disbaled .'>
2075 '. wp_kses_post( $plugin_data['action_text'] ) .'
2076 </button>';
2077 }
2078 elseif ( $plugin_not_activated ) {
2079 $content .= '<a href="'. esc_url( $details['wporg'] ) .'" target="_blank" rel="noopener noreferrer">
2080 '. esc_html_e( 'WordPress.org', 'chart-builder' ) .'
2081 <span aria-hidden="true" class="dashicons dashicons-external"></span>
2082 </a>';
2083 }
2084 $content .='
2085 <a target="_blank" href="'. esc_url( $plugin_data['details']['buy_now'] ) .'" class="ays-chart-card__btn-primary">'. __('Buy Now', 'chart-builder') .'</a>
2086 </div>
2087 </div>';
2088 }
2089 $install_plugin_nonce = wp_create_nonce( $this->plugin_name . '-install-plugin-nonce' );
2090 $content.= '<input type="hidden" id="ays_chart_ajax_install_plugin_nonce" name="ays_chart_ajax_install_plugin_nonce" value="'. $install_plugin_nonce .'">';
2091 $content.= '</div>';
2092
2093 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
2094 }
2095
2096 /**
2097 * Returns the data from Quiz maker.
2098 *
2099 * @access public
2100 */
2101 public function fetch_quiz_maker_data(){
2102 check_ajax_referer( 'cbuilder-fetch-quiz-maker-data', 'security' );
2103
2104 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
2105 if ( !isset($params) || empty($params) ) {
2106 return array(
2107 'success' => false,
2108 'data' => array(
2109 'msg' => __( "Something went wrong.", "chart-builder" )
2110 )
2111 );
2112 }
2113
2114 $query = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2115 if ( $query == '' ) {
2116 return array(
2117 'success' => false,
2118 'data' => array(
2119 'msg' => __( "No data given.", "chart-builder" )
2120 )
2121 );
2122 }
2123 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : null;
2124 $user_id = get_current_user_id();
2125
2126 $return_results = CBFunctions()->get_quiz_query($query, $quiz_id, $user_id);
2127
2128 if (empty($return_results)) {
2129 return array(
2130 'success' => false,
2131 'data' => array(
2132 'msg' => __( "Something went wrong.", "chart-builder" )
2133 )
2134 );
2135 }
2136
2137 $result_values = $return_results['result'];
2138 $query = $return_results['query'];
2139
2140 if (empty($result_values)) {
2141 return array(
2142 'success' => false,
2143 'data' => array(
2144 'msg' => $return_results['message']
2145 )
2146 );
2147 }
2148
2149 if (count($return_results['result'][0]) != 1 ) {
2150 $results = array();
2151 $headers = array();
2152 if ( $result_values ) {
2153 $row_num = 0;
2154 foreach ( $result_values as $row ) {
2155 $result = array();
2156 foreach ( $row as $k => $v ) {
2157 $result[] = $v;
2158 if ( $row_num === 0 ) {
2159 $headers[] = $k;
2160 }
2161 }
2162 $results[] = $result;
2163 $row_num++;
2164 }
2165 }
2166 } else if (count($return_results['result'][0]) == 1) {
2167 $results = array();
2168 $headers = array();
2169 if ( $result_values ) {
2170 $row_num = 0;
2171 foreach ( $result_values as $index => $row ) {
2172 $result = array();
2173 foreach ( $row as $k => $v ) {
2174 $result[] = strval($index) + 1;
2175 $result[] = $v;
2176 if ( $row_num === 0 ) {
2177 $headers[] = 'Quiz';
2178 $headers[] = $k;
2179 }
2180 }
2181 $results[] = $result;
2182 $row_num++;
2183 }
2184 }
2185 }
2186
2187 if (empty($results)) {
2188 return array(
2189 'success' => false,
2190 'data' => array(
2191 'msg' => $return_results['message']
2192 )
2193 );
2194 }
2195
2196 foreach ($results as $key => $value) {
2197 if (!isset($value) || count($value) <= 1 && $key != 0) {
2198 unset($results[$key]);
2199 }
2200 }
2201
2202 array_unshift($results, $headers);
2203 $results = array_values( $results );
2204 $data = $results;
2205
2206 $headers = $results[0];
2207 unset( $results[0] );
2208
2209 $html = CBFunctions()->get_table_html( $headers, $results );
2210
2211 return array(
2212 'success' => true,
2213 'data' => array(
2214 'table' => $html,
2215 'data' => $data
2216 )
2217 );
2218 }
2219
2220 /**
2221 * Saves the Quiz maker data.
2222 *
2223 * @access public
2224 */
2225 public function save_quiz_maker_data() {
2226 check_ajax_referer( 'cbuilder-save-quiz-maker-data', 'security' );
2227
2228 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
2229 if ( !isset($params) || empty($params) ) {
2230 return array(
2231 'success' => false,
2232 'data' => array(
2233 'msg' => __( "Something went wrong.", "chart-builder" )
2234 )
2235 );
2236 }
2237
2238 $query_id = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2239 if ( $query_id == '' ) {
2240 return array(
2241 'success' => false,
2242 'data' => array(
2243 'msg' => __( "No data given.", "chart-builder" )
2244 )
2245 );
2246 }
2247
2248 $chart_id = isset( $params['chart_id'] ) ? absint( $params['chart_id'] ) : 0;
2249 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : 0;
2250 $user_id = get_current_user_id();
2251
2252 if ( $chart_id >= 0 ) {
2253
2254 $return_results = CBFunctions()->get_quiz_query($query_id, $quiz_id, $user_id);
2255
2256 if (empty($return_results)) {
2257 return array(
2258 'success' => false,
2259 'data' => array(
2260 'msg' => __( "Something went wrong.", "chart-builder" )
2261 )
2262 );
2263 }
2264
2265 $result_values = $return_results['result'];
2266 $query = $return_results['query'];
2267
2268 if (empty($result_values)) {
2269 return array(
2270 'success' => false,
2271 'data' => array(
2272 'msg' => $return_results['message']
2273 )
2274 );
2275 }
2276
2277 if ( !empty($result_values) && count($return_results['result'][0]) != 1 ) {
2278 $results = array();
2279 $headers = array();
2280 if ( $result_values ) {
2281 $row_num = 0;
2282 foreach ( $result_values as $row ) {
2283 $result = array();
2284 foreach ( $row as $k => $v ) {
2285 $result[] = $v;
2286 if ( $row_num === 0 ) {
2287 $headers[] = $k;
2288 }
2289 }
2290 $results[] = $result;
2291 $row_num++;
2292 }
2293 }
2294 } else if (count($return_results['result'][0]) == 1) {
2295 $results = array();
2296 $headers = array();
2297 if ( $result_values ) {
2298 $row_num = 0;
2299 foreach ( $result_values as $index => $row ) {
2300 $result = array();
2301 foreach ( $row as $k => $v ) {
2302 $result[] = strval($index) + 1;
2303 $result[] = $v;
2304 if ( $row_num === 0 ) {
2305 $headers[] = 'Quiz';
2306 $headers[] = $k;
2307 }
2308 }
2309 $results[] = $result;
2310 $row_num++;
2311 }
2312 }
2313 }
2314
2315 $source_type = 'quiz_maker';
2316 $option_name_for_data = $chart_id == 0 ? 'ays_chart_quiz_maker_results_temp' : 'ays_chart_quiz_maker_results_' . $chart_id;
2317 $option_name_for_quiz = $chart_id == 0 ? 'ays_chart_quiz_maker_quiz_data_temp' : 'ays_chart_quiz_maker_quiz_data_' . $chart_id;
2318
2319 update_option( $option_name_for_data, array(
2320 'source_type' => $source_type,
2321 'source' => $query,
2322 'data' => $results,
2323 ) );
2324 update_option( $option_name_for_quiz, array(
2325 'quiz_query' => $query_id,
2326 'quiz_id' => $quiz_id
2327 ) );
2328
2329 } else {
2330 return array(
2331 'success' => false,
2332 'data' => array(
2333 'msg' => __( 'Given incorrect Chart ID.', "chart-builder")
2334 )
2335 );
2336 }
2337
2338 return array(
2339 'success' => true,
2340 'data' => array(
2341 'msg' => __( 'Data was successfully saved.', "chart-builder" )
2342 )
2343 );
2344 }
2345
2346 /**
2347 * Chart page action hooks
2348 */
2349
2350 /**
2351 * Chart page sources contents
2352 * @param $args
2353 */
2354 public function ays_chart_page_source_contents( $args ){
2355 $chart_source_type = $args['chart_source_type'];
2356
2357 if ($chart_source_type === 'chart-js') {
2358 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings_chartjs', array(), $args );
2359 } else {
2360 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings', array(), $args );
2361 }
2362
2363 $source_type = $args['source_type'];
2364
2365 $sources = array();
2366 foreach ( $sources_contents as $key => $sources_content ) {
2367 $collapsed = $key == $source_type ? 'false' : 'true';
2368
2369 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="'. $collapsed .'">';
2370 if( isset( $sources_content['title'] ) ){
2371 $content .= '<legend class="ays-accordion-options-header">';
2372 $content .= '<svg class="ays-accordion-arrow '. ( $key == $source_type ? 'ays-accordion-arrow-down' : 'ays-accordion-arrow-right' ) .'" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
2373 <g>
2374 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: '. ( $key == $source_type ? '#008cff' : '#c4c4c4' ) .';" vector-effect="non-scaling-stroke" />
2375 </g>
2376 </svg>';
2377
2378 $content .= '<span>'. $sources_content['title'] .'</span></legend>';
2379 }
2380
2381 $content .= '<div class="ays-accordion-options-content">';
2382 $content .= $sources_content['content'];
2383 $content .= '</div>';
2384
2385 $content .= '</fieldset>';
2386
2387 $sources[] = $content;
2388 }
2389 $content_for_escape = implode('' , $sources );
2390 echo html_entity_decode( esc_html($content_for_escape) );
2391 }
2392
2393 public function source_contents_import_from_csv_settings( $sources, $args ){
2394 $html_class_prefix = $args['html_class_prefix'];
2395 $html_name_prefix = $args['html_name_prefix'];
2396
2397 ob_start();
2398 ?>
2399 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2400 <div class="ays-pro-features-v2-big-buttons-box">
2401 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2402 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
2403 <div class="ays-pro-features-v2-video-text">
2404 <?php echo esc_html__("Watch Video" , "chart-builder"); ?>
2405 </div>
2406 </a>
2407 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2408 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
2409 <div class="ays-pro-features-v2-upgrade-text">
2410 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2411 </div>
2412 </a>
2413 </div>
2414 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main ays-accordion-data-main-wrap">
2415 <div class="<?php echo esc_attr($html_class_prefix) ?>file-import-form">
2416 <h6><?php echo esc_html__("Choose what kind of data would you like to upload.", "chart-builder"); ?></h6>
2417 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>import-files-file-type">
2418 <option value="csv">CSV File</option>
2419 </select>
2420 <span style="display: block; font-style: italic; color: gray; font-size: 12px; margin: 5px 0;" class="<?php echo esc_attr($html_class_prefix) ?>small-hint-text"><?php echo esc_html__("Choose the format of the file you are going to import.", "chart-builder"); ?></span>
2421 <p class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example" style="font-size: 15px; font-style: italic;">Example:
2422 <a class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example-link <?php echo esc_attr($html_class_prefix) ?>csv-export-example-link-other-types" style="cursor: pointer;">example.csv</a>
2423 </p>
2424 <div>
2425 <input style="padding: 0.5rem 1rem;" class="form-control form-control-md" id="<?php echo esc_attr($html_class_prefix) ?>import-files-input" name="<?php echo esc_attr($html_class_prefix) ?>import-files-input" type="file" accept=".csv" />
2426 </div>
2427 <div class='ays-chart-file-import-success'></div>
2428 <div class='ays-chart-file-import-error'></div>
2429 <div class="ays-chart-buttons-group">
2430 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-fetch">
2431 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2432 </button>
2433 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-show-on-chart">
2434 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
2435 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2436 </button>
2437 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-save">
2438 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2439 </button>
2440 </div>
2441 </div>
2442 </div>
2443 </div>
2444 <?php
2445 $content = ob_get_clean();
2446
2447 $title = __( 'Import data from file', "chart-builder" ) . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("With the help of this option, you can import a file in your chosen file format.","chart-builder") . '">
2448 <i class="ays_fa ays_fa_info_circle"></i>
2449 </a>';
2450
2451 $sources['file_import'] = array(
2452 'content' => $content,
2453 'title' => $title
2454 );
2455
2456 return $sources;
2457 }
2458
2459 public function source_contents_import_from_db_settings( $sources, $args ){
2460 $html_class_prefix = $args['html_class_prefix'];
2461 $html_name_prefix = $args['html_name_prefix'];
2462
2463 ob_start();
2464 ?>
2465 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2466 <div class="ays-pro-features-v2-big-buttons-box">
2467 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2468 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
2469 <div class="ays-pro-features-v2-video-text">
2470 <?php echo esc_html__("Watch Video" , "chart-builder"); ?>
2471 </div>
2472 </a>
2473 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2474 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
2475 <div class="ays-pro-features-v2-upgrade-text">
2476 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2477 </div>
2478 </a>
2479 </div>
2480 <div class="<?php echo esc_attr( $html_class_prefix ) ?>source-data-main-wrap ays-accordion-data-main-wrap ">
2481 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2482 <div id="ays-chart-db-query">
2483 <div class="<?php echo esc_attr($html_class_prefix) ?>-db-query-form">
2484 <div id="db-query-form">
2485 <input type="hidden" name="chart_id" value="1">
2486 <textarea name="query" class="<?php echo esc_attr($html_class_prefix) ?>db-query" placeholder="<?php echo esc_html__( "Add your query here.", 'chart-builder' ); ?>"></textarea>
2487 <div class='db-wizard-success'></div>
2488 <div class='db-wizard-error'></div>
2489 </div>
2490 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2491 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-fetch">
2492 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2493 </button>
2494 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-show-on-chart">
2495 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
2496 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2497 </button>
2498 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-save">
2499 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2500 </button>
2501 </div>
2502 </div>
2503 <div class="db-wizard-hints">
2504 <ul>
2505 <!-- <li><//?php echo sprintf( __( 'For examples of queries and links to resources that you can use with this feature, please click %1$shere%2$s', $this->plugin_name ), '<a href="' . '#' . '" target="_blank">', '</a>' ); ?></li> -->
2506 <li>
2507 <?php
2508 echo sprintf(
2509 /* translators: %1$s and %2$s are HTML span tags for styling. */
2510 esc_html__( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'chart-builder' ),
2511 '<span class="ays-chart-emboss">',
2512 '</span>'
2513 );
2514 ?>
2515 </li>
2516 </ul>
2517 </div>
2518 </div>
2519 </div>
2520 </div>
2521 </div>
2522 <?php
2523 $content = ob_get_clean();
2524
2525 $title = __( 'Connect to Database', 'chart-builder') . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("Insert the Database query and the appropriate information from your Database will be displayed in the chart.", 'chart-builder') . '">
2526 <i class="ays_fa ays_fa_info_circle"></i>
2527 </a>';
2528
2529 $sources['import_from_db'] = array(
2530 'content' => $content,
2531 'title' => $title
2532 );
2533
2534 return $sources;
2535 }
2536
2537 public function source_contents_import_from_external_db_settings( $sources, $args ){
2538 $html_class_prefix = $args['html_class_prefix'];
2539 $html_name_prefix = $args['html_name_prefix'];
2540
2541 ob_start();
2542 ?>
2543 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2544 <div class="ays-pro-features-v2-big-buttons-box">
2545 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2546 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
2547 <div class="ays-pro-features-v2-upgrade-text">
2548 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2549 </div>
2550 </a>
2551 </div>
2552 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap ays-accordion-data-main-wrap ">
2553 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2554 <div class="form-group row mb-2">
2555 <div class="col-sm-8 <?php echo esc_attr($html_class_prefix) ?>option-title">
2556 <label class="form-label">
2557 <?php echo esc_html(__('Use custom database settings for this chart', "chart-builder")); ?>
2558 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __(".","chart-builder") ); ?>">
2559 <i class="ays_fa ays_fa_info_circle"></i>
2560 </a>
2561 </label>
2562 </div>
2563 <div class="col-sm-3 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2564 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2565 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" type="checkbox" />
2566 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2567 </label>
2568 </div>
2569 </div>
2570 <div id="ays-chart-external-db-query">
2571 <div class="<?php echo esc_attr($html_class_prefix) ?>-db-query-form">
2572 <div id="external-db-query-form">
2573 <input type="hidden" name="chart_id" value="1">
2574 <textarea name="query" class="<?php echo esc_attr($html_class_prefix) ?>external-db-query" placeholder="<?php echo esc_html__( "Add your query here.", 'chart-builder' ); ?>"></textarea>
2575 <div class='db-wizard-success'></div>
2576 <div class='db-wizard-error'></div>
2577 </div>
2578 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2579 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-fetch">
2580 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2581 </button>
2582 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-show-on-chart">
2583 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
2584 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2585 </button>
2586 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-save">
2587 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2588 </button>
2589 </div>
2590 </div>
2591 <div class="db-wizard-hints">
2592 <ul>
2593 <!-- <li><//?php echo sprintf( __( 'For examples of queries and links to resources that you can use with this feature, please click %1$shere%2$s', $this->plugin_name ), '<a href="' . '#' . '" target="_blank">', '</a>' ); ?></li> -->
2594 <li>
2595 <?php
2596 echo sprintf(
2597 /* translators: %1$s and %2$s are HTML span tags for styling. */
2598 esc_html__( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'chart-builder' ),
2599 '<span class="ays-chart-emboss">',
2600 '</span>'
2601 );
2602 ?>
2603 </li>
2604 </ul>
2605 </div>
2606 </div>
2607 </div>
2608 </div>
2609 </div>
2610 <?php
2611 $content = ob_get_clean();
2612
2613 $title = __( 'Connect to External Database', 'chart-builder' ) . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("Insert the Database query and fetch data from an external database.", 'chart-builder') . '">
2614 <i class="ays_fa ays_fa_info_circle"></i>
2615 </a>';
2616
2617 $sources['import_from_external_db'] = array(
2618 'content' => $content,
2619 'title' => $title
2620 );
2621
2622 return $sources;
2623 }
2624
2625 public function source_contents_quiz_maker_integration_settings( $sources, $args ){
2626 global $wpdb;
2627 $chart_id = $args['chart_id'];
2628 $html_class_prefix = $args['html_class_prefix'];
2629 $html_name_prefix = $args['html_name_prefix'];
2630 $source = $args['source'];
2631 $settings = $args['settings'];
2632 $quiz_queries = $args['quiz_queries'];
2633 $quiz_query_tooltips = $args['quiz_query_tooltips'];
2634 $quiz_id = $args['quiz_id'];
2635 $quiz_query = $args['quiz_query'];
2636
2637 if ( !is_plugin_active('quiz-maker/quiz-maker.php') ) {
2638 // $title = sprintf( __( 'Get Quiz Maker data', "chart-builder" ) . ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' . __("By using this option, you can display the quiz statistics by charts.%s %sNote:%s The Quiz Maker plugin must be active.","chart-builder") . '">
2639 // <i class="ays_fa ays_fa_info_circle"></i>
2640 // </a>', '<br>', '<b>', '</b>');
2641 // $content = $this->blockquote_content_quiz;
2642 // $sources['quiz_maker'] = array(
2643 // 'content' => $content,
2644 // 'title' => $title
2645 // );
2646
2647 return $sources;
2648 }
2649 $quizes = $wpdb->get_results( // phpcs:ignore
2650 $wpdb->prepare(
2651 "SELECT `title`, `id` FROM {$wpdb->prefix}aysquiz_quizes
2652 WHERE `published` = %d AND `question_ids` <> %s",
2653 1,
2654 ''
2655 ),
2656 ARRAY_A
2657 );
2658
2659
2660 ob_start();
2661 ?>
2662 <div class="ays-accordion-data-main-wrap">
2663 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main cb-changable-tab cb-pie_chart-tab cb-donut_chart-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
2664 <div id="<?php echo esc_attr($html_class_prefix) ?>quiz-maker-form">
2665 <input type="hidden" class="<?php echo esc_attr($html_class_prefix) ?>chart-id" value="<?php echo esc_attr($chart_id) ?>">
2666 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-data-query-container" id="<?php echo esc_attr($html_class_prefix) ?>quiz-queries">
2667 <a class="ays_help <?php echo esc_attr($html_class_prefix) ?>quiz-query-tooltip" data-bs-toggle="tooltip" data-bs-html="true" title="<?php echo isset($quiz_query) ? esc_attr($quiz_query_tooltips[$quiz_query]) : esc_html__( 'Select a query to display quiz data.', 'chart-builder' ) ?>">
2668 <i class="ays_fa ays_fa_info_circle"></i>
2669 </a>
2670 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-data-query" name="<?php echo esc_attr($html_name_prefix) ?>quiz_query">
2671 <option value=""><?php echo esc_html__( "Select query", "chart-builder" ) ?></option>
2672 <?php foreach ( $quiz_queries as $id => $q):
2673 $disabled = preg_replace('/[^0-9]/', '', $id) <= 6 ? "false" : "true" ; ?>
2674 <option value="<?php echo esc_attr($id) ?>" <?php echo $quiz_query == $id ? 'selected' : '' ?> <?php echo 'is-pro="'.esc_attr($disabled).'"'; ?>><?php echo esc_attr($q) ?></option>
2675 <?php endforeach; ?>
2676 </select>
2677 </div>
2678 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz-container">
2679 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz" name="<?php echo esc_attr($html_name_prefix) ?>quiz_id">
2680 <option value="0"><?php echo esc_html__( "Select quiz", "chart-builder" ) ?></option>
2681 <?php foreach ( $quizes as $quiz): ?>
2682 <option value="<?php echo esc_attr($quiz['id']) ?>" <?php echo $quiz_id == $quiz['id'] ? 'selected' : '' ?> ><?php echo esc_html($quiz['title'] )?></option>
2683 <?php endforeach; ?>
2684 </select>
2685 </div>
2686 <div id="ays-chart-quiz-maker-success"></div>
2687 <div id="ays-chart-quiz-maker-error"></div>
2688 <div class="ays-chart-buttons-group">
2689 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-fetch">
2690 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2691 </button>
2692 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-show-on-chart">
2693 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
2694 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2695 </button>
2696 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-save">
2697 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2698 </button>
2699 </div>
2700 </div>
2701 <div>
2702 <a href="https://www.youtube.com/watch?v=vqx76dw6NC8" target="_blank" style="text-decoration:none;font-style:italic"><?php echo esc_html__('How to Connect Quizzes to Charts', 'chart-builder'); ?></a>
2703 </div>
2704 </div>
2705 </div>
2706 <?php
2707 $content = ob_get_clean();
2708
2709 $title = sprintf(
2710 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2711 __( 'Get Quiz Maker data', 'chart-builder' ) .
2712 ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' .
2713 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2714 __( 'By using this option, you can display the quiz statistics by charts.%1$s %2$sNote:%3$s The Quiz Maker plugin must be active.', 'chart-builder' ) . '">
2715 <i class="ays_fa ays_fa_info_circle"></i>
2716 </a>',
2717 '<br>', '<b>', '</b>'
2718 );
2719 $sources['quiz_maker'] = array(
2720 'content' => $content,
2721 'title' => $title
2722 );
2723
2724 return $sources;
2725 }
2726
2727 public function source_contents_woocommerce_integration_settings( $sources, $args ){
2728 if ( !is_plugin_active('woocommerce/woocommerce.php') ) {
2729 return $sources;
2730 }
2731
2732 $chart_id = $args['chart_id'];
2733 $html_class_prefix = $args['html_class_prefix'];
2734 $html_name_prefix = $args['html_name_prefix'];
2735 ob_start();
2736 ?>
2737 <div class="ays-accordion-data-main-wrap ays-accordion-data-main-wrap-woocommerce ays-pro-features-v2-main-box" style="padding:10px;">
2738 <div class="ays-pro-features-v2-big-buttons-box">
2739 <div class="ays-pro-features-v2-video-button"></div>
2740 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2741 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
2742 <div class="ays-pro-features-v2-upgrade-text">
2743 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2744 </div>
2745 </a>
2746 </div>
2747 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main ays-accordion-data-main-wrap ">
2748 <div id="ays-chart-woocommerce-datas">
2749 <div class="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-form">
2750 <div id="woocommerce-datas-form">
2751 <input type="hidden" name="chart_id" value="<?php echo esc_attr( $chart_id )?>">
2752 <div class="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-query-container" id="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-container-id" >
2753 <a class="ays_help <?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-tooltip" data-bs-toggle="tooltip" data-bs-html="true" title="<?php echo esc_html__( 'Select a query to display data.', 'chart-builder' ) ?>">
2754 <i class="ays_fa ays_fa_info_circle"></i>
2755 </a>
2756 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-select" name="<?php echo esc_attr($html_name_prefix); ?>settings[woocommerce_data_id]">
2757 <option value=""><?php echo esc_html__( 'Select query', 'chart-builder') ?></option>
2758 </select>
2759 </div>
2760 <div class='ays-chart-woocommerce-datas-success'></div>
2761 <div class='ays-chart-woocommerce-datas-error'></div>
2762 </div>
2763 <div class="ays-chart-buttons-group">
2764 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-fetch">
2765 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2766 </button>
2767 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-show-on-chart">
2768 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
2769 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2770 </button>
2771 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-save">
2772 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2773 </button>
2774 </div>
2775 </div>
2776 </div>
2777 </div>
2778 </div>
2779 <?php
2780 $content = ob_get_clean();
2781
2782 $title = sprintf(
2783 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2784 esc_html__( 'Get WooCommerce data', 'chart-builder' ) .
2785 ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' .
2786 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2787 __( 'By using this option, you can display the WooCommerce statistics by charts.%1$s %2$sNote:%3$s The WooCommerce plugin must be active.', 'chart-builder' ) . '">
2788 <i class="ays_fa ays_fa_info_circle"></i>
2789 </a>',
2790 '<br>', '<b>', '</b>'
2791 );
2792 $sources['woocommerce'] = array(
2793 'content' => $content,
2794 'title' => $title
2795 );
2796
2797 return $sources;
2798 }
2799
2800 public function source_contents_manual_settings( $sources, $args ){
2801 $html_class_prefix = $args['html_class_prefix'];
2802 $html_name_prefix = $args['html_name_prefix'];
2803 $source = $args['source'];
2804 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2805 $settings = $args['settings'];
2806 $source_chart_type = $args['source_chart_type'];
2807 $action = isset($_GET['action']) ? sanitize_text_field(wp_unslash($_GET['action'])) : 'add';
2808
2809 if (isset($source) && !empty($source)) {
2810 if ( !isset( $source[0] ) ) {
2811 if (count($source[1]) > 2) {
2812 $titles = array();
2813 for ($i = 0; $i < count($source[1]); $i++) {
2814 array_push($titles, __("Title", 'chart-builder').$i);
2815 }
2816 $source[0] = $titles;
2817 } else {
2818 $source[0] = array(
2819 __("Country", 'chart-builder'),
2820 __("Population", 'chart-builder'),
2821 );
2822 }
2823
2824 ksort($source);
2825 }
2826 }
2827
2828 if ($action == 'add') {
2829 foreach ($source as $key => $row) {
2830 $source[$key] = array_slice($row, 0, 2);
2831 }
2832 } else if ($action == 'edit') {
2833 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
2834 foreach ($source as $key => $row) {
2835 $source[$key] = array_slice($row, 0, 2);
2836 }
2837 }
2838 }
2839 ob_start();
2840 ?>
2841 <div class="ays-accordion-data-main-wrap">
2842 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2843 <?php if($source_chart_type != 'org_chart'): ?>
2844 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?php echo esc_attr( $html_class_prefix) ?>chart-source-data-manual cb-changable-manual cb-pie_chart-manual cb-bar_chart-manual cb-column_chart-manual cb-line_chart-manual cb-donut_chart-manual display_none">
2845 <!-- <div class="<//?= $html_class_prefix ?>icons-box">
2846 <img class="<//?= $html_class_prefix ?>add-new-row" src="<//?php echo CHART_BUILDER_ADMIN_URL; ?>/images/icons/add-circle-outline.svg">
2847 </div> -->
2848 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2849 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2850 <?php if(!empty($source)):
2851 foreach($source as $source_id => $source_value):
2852 if(!empty($source_value) ):
2853 if ($source_id == 0): ?>
2854 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2855 <div class="ays-chart-empty-data-table-cell"></div>
2856 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2857 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-title-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2858 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-col" data-trigger="hover" data-bs-toggle="tooltip" title="Delete column" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" width="10px">
2859 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
2860 </svg>
2861 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2862 <input type="text" class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(stripslashes($each_source_value)); ?>" <?php echo $each_source_id == 0 ? "style='min-width:100px'" : "" ?>>
2863 <?php if ($each_source_id !== 0): ?>
2864 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-sort" data-sort-order="asc" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 320 512">
2865 <path d="M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8H32c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z" style="fill: #b8b8b8;" />
2866 </svg>
2867 <?php endif; ?>
2868 </div>
2869 </div>
2870 <?php endforeach; ?>
2871 </div>
2872 <?php else: ?>
2873 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2874 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-row">
2875 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2876 <path d="M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z" style="fill: #b8b8b8;" />
2877 </svg>
2878 </div>
2879 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
2880 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-row" data-trigger="hover" data-bs-toggle="tooltip" title="Delete row" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
2881 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
2882 </svg>
2883 </div>
2884 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2885 <?php if ($each_source_id == 0): ?>
2886 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-name-input-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2887 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(htmlspecialchars($each_source_value)); ?>">
2888 </div>
2889 <?php else: ?>
2890 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-number" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2891 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(stripslashes($each_source_value)); ?>" step="any">
2892 </div>
2893 <?php endif; ?>
2894 <?php endforeach; ?>
2895 </div>
2896 <?php endif; ?>
2897 <?php endif; ?>
2898 <?php endforeach; ?>
2899 <?php else:?>
2900 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block">
2901 <div style="height: 63.11px; padding: 0 15px;"></div>
2902 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-title-box">
2903 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-col" data-trigger="hover" data-bs-toggle="tooltip" title="Delete column" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" width="10px">
2904 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
2905 </svg>
2906 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2907 <input type="text" class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[0][]" style='min-width:100px'>
2908 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-sort" data-sort-order="asc" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 320 512">
2909 <path d="M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8H32c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z" style="fill: #b8b8b8;" />
2910 </svg>
2911 </div>
2912 </div>
2913 </div>
2914 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
2915 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-row">
2916 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2917 <path d="M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z" />
2918 </svg>
2919 </div>
2920 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
2921 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-row" data-trigger="hover" data-bs-toggle="tooltip" title="Delete row" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
2922 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
2923 </svg>
2924 </div>
2925 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
2926 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
2927 </div>
2928 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-number">
2929 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
2930 </div>
2931 </div>
2932 <?php endif; ?>
2933 </div>
2934 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-column-box cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt display_none">
2935 <img class="<?php echo esc_attr($html_class_prefix) ?>add-new-column" src="<?php echo esc_url(CHART_BUILDER_ADMIN_URL); ?>/images/icons/add-circle-outline.svg">
2936 <?php echo esc_html__( 'Add column', "chart-builder" ); ?>
2937 </div>
2938 </div>
2939 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
2940 <img class="<?php echo esc_attr($html_class_prefix) ?>add-new-row" src="<?php echo esc_url(CHART_BUILDER_ADMIN_URL); ?>/images/icons/add-circle-outline.svg">
2941 <?php echo esc_html__( 'Add row', "chart-builder" ); ?>
2942 </div>
2943 <br>
2944 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2945 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
2946 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2947 </button>
2948 </div>
2949 <?php endif; ?>
2950 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main-org-type display_none cb-changable-manual cb-org_chart-manual">
2951 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-org-type">
2952 <ul id="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-tree-content">
2953 </ul>
2954 </div>
2955 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2956 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
2957 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2958 </button>
2959 </div>
2960 </div>
2961 </div>
2962 <?php
2963 $content = ob_get_clean();
2964
2965 $title = __( 'Manual data', "chart-builder" ) . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("Add the data manually. By clicking on the Add Row button you will be able to add as many rows as you need. While choosing the Line, Bar, Column Chart types you will be able to also add the columns.","chart-builder") . '">
2966 <i class="ays_fa ays_fa_info_circle"></i>
2967 </a>';
2968
2969 $sources['manual'] = array(
2970 'content' => $content,
2971 'title' => $title
2972 );
2973
2974 return $sources;
2975 }
2976
2977 public function source_contents_manual_settings_chartjs( $sources, $args ){
2978 $html_class_prefix = $args['html_class_prefix'];
2979 $html_name_prefix = $args['html_name_prefix'];
2980 $source = $args['source'];
2981 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2982 $settings = $args['settings'];
2983 $source_chart_type = $args['source_chart_type'];
2984 $action = isset($_GET['action']) ? sanitize_text_field((wp_unslash($_GET['action']))) : 'add';
2985
2986 ob_start();
2987 ?>
2988 <div class="ays-accordion-data-main-wrap">
2989 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2990 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?php echo esc_attr($html_class_prefix) ?>chart-source-data-manual">
2991 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2992 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2993 <?php if(!empty($source)):
2994 foreach($source as $source_id => $source_value):
2995 if(!empty($source_value) ):
2996 if ($source_id == 0): ?>
2997 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2998 <div class="ays-chart-empty-data-table-cell"></div>
2999 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
3000 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-title-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
3001 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-col" data-trigger="hover" data-bs-toggle="tooltip" title="Delete column" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" width="10px">
3002 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
3003 </svg>
3004 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
3005 <input type="text" class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(stripslashes($each_source_value)); ?>" <?php echo $each_source_id == 0 ? "style='min-width:100px'" : "" ?>>
3006 <?php if ($each_source_id !== 0): ?>
3007 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-sort" data-sort-order="asc" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 320 512">
3008 <path d="M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8H32c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z" style="fill: #b8b8b8;" />
3009 </svg>
3010 <?php endif; ?>
3011 </div>
3012 </div>
3013 <?php endforeach; ?>
3014 </div>
3015 <?php else: ?>
3016 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
3017 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-row">
3018 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3019 <path d="M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z" style="fill: #b8b8b8;" />
3020 </svg>
3021 </div>
3022 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
3023 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-row" data-trigger="hover" data-bs-toggle="tooltip" title="Delete row" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
3024 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
3025 </svg>
3026 </div>
3027 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
3028 <?php if ($each_source_id == 0): ?>
3029 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-name-input-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
3030 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(htmlspecialchars($each_source_value)); ?>">
3031 </div>
3032 <?php else: ?>
3033 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-number" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
3034 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[<?php echo esc_attr($source_id); ?>][]" value="<?php echo esc_attr(stripslashes($each_source_value)); ?>" step="any">
3035 </div>
3036 <?php endif; ?>
3037 <?php endforeach; ?>
3038 </div>
3039 <?php endif; ?>
3040 <?php endif; ?>
3041 <?php endforeach; ?>
3042 <?php else:?>
3043 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block">
3044 <div style="height: 63.11px; padding: 0 15px;"></div>
3045 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-title-box">
3046 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-col" data-trigger="hover" data-bs-toggle="tooltip" title="Delete column" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" width="10px">
3047 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
3048 </svg>
3049 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
3050 <input type="text" class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[0][]" style='min-width:100px'>
3051 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-sort" data-sort-order="asc" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 320 512">
3052 <path d="M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8H32c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z" style="fill: #b8b8b8;" />
3053 </svg>
3054 </div>
3055 </div>
3056 </div>
3057 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
3058 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-move-row">
3059 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3060 <path d="M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z" />
3061 </svg>
3062 </div>
3063 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
3064 <svg class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-block <?php echo esc_attr($html_class_prefix) ?>chart-source-data-remove-row" data-trigger="hover" data-bs-toggle="tooltip" title="Delete row" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
3065 <path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" style="fill: #b8b8b8;" />
3066 </svg>
3067 </div>
3068 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
3069 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
3070 </div>
3071 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box <?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-number">
3072 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
3073 </div>
3074 </div>
3075 <?php endif; ?>
3076 </div>
3077 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-column-box cb-changable-opt cb-bar_chart-opt cb-line_chart-opt display_none">
3078 <img class="<?php echo esc_attr($html_class_prefix) ?>add-new-column" src="<?php echo esc_url(CHART_BUILDER_ADMIN_URL); ?>/images/icons/add-circle-outline.svg">
3079 <?php echo esc_html__( 'Add column', "chart-builder" ); ?>
3080 </div>
3081 </div>
3082 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
3083 <img class="<?php echo esc_attr($html_class_prefix) ?>add-new-row" src="<?php echo esc_url(CHART_BUILDER_ADMIN_URL); ?>/images/icons/add-circle-outline.svg">
3084 <?php echo esc_html__( 'Add row', "chart-builder" ); ?>
3085 </div>
3086 <br>
3087 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
3088 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
3089 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
3090 </button>
3091 </div>
3092 </div>
3093 </div>
3094 <?php
3095 $content = ob_get_clean();
3096
3097 $title = __( 'Manual data', "chart-builder" ) . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("Add the data manually. By clicking on the Add Row button you will be able to add as many rows as you need. While choosing the Line, Bar, Column Chart types you will be able to also add the columns.","chart-builder") . '">
3098 <i class="ays_fa ays_fa_info_circle"></i>
3099 </a>';
3100
3101 $sources['manual'] = array(
3102 'content' => $content,
3103 'title' => $title
3104 );
3105
3106 return $sources;
3107 }
3108
3109 /**
3110 * Chart page settings contents
3111 * @param $args
3112 */
3113 public function ays_chart_page_settings_contents( $args ){
3114 $chart_source_type = $args['chart_source_type'];
3115
3116 if ($chart_source_type === 'chart-js') {
3117 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings_chartjs', array(), $args );
3118 } else {
3119 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings', array(), $args );
3120 }
3121
3122 $sources = array();
3123 foreach ( $sources_contents as $key => $sources_content ) {
3124 $collapsed = $key == 'general_settings' ? 'false' : 'true';
3125
3126 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
3127 if(isset($sources_content['title'])){
3128 $content .= '<legend class="ays-accordion-options-header">';
3129 $content .= '<svg class="ays-accordion-arrow '. ( $key == 'general_settings' ? 'ays-accordion-arrow-down' : 'ays-accordion-arrow-right' ) .'" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
3130 <g>
3131 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: '. ( $key == 'general_settings' ? '#008cff' : '#c4c4c4' ) .';" vector-effect="non-scaling-stroke" />
3132 </g>
3133 </svg>';
3134
3135 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
3136 }
3137
3138 $content .= '<div class="ays-accordion-options-content">';
3139 $content .= $sources_content['content'];
3140 $content .= '</div>';
3141
3142 $content .= '</fieldset>';
3143
3144 $sources[] = $content;
3145 }
3146 $content_for_escape = implode('' , $sources );
3147 echo html_entity_decode( $content_for_escape );
3148 }
3149
3150 public function settings_contents_general_settings( $sources, $args ){
3151 $html_class_prefix = $args['html_class_prefix'];
3152 $html_name_prefix = $args['html_name_prefix'];
3153 $chart_description = $args['chart_description'];
3154 $create_author_data = $args['create_author_data'];
3155 $status = $args['status'];
3156 $settings = $args['settings'];
3157
3158 $show_title = $settings['show_title'];
3159 $show_description = $settings['show_description'];
3160 $enable_interactivity = $settings['enable_interactivity'];
3161 $maximized_view = $settings['maximized_view'];
3162
3163 ob_start();
3164 ?>
3165 <div class="ays-accordion-data-main-wrap">
3166 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3167 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3168 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3169 <label for="ays-status" class="form-label">
3170 <?php echo esc_html(__('Status', "chart-builder")); ?>
3171 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Decide whether the chart is active or not. If the chart is a draft, it won't be shown anywhere on your website (you don't need to remove shortcodes).","chart-builder") ); ?>">
3172 <i class="ays_fa ays_fa_info_circle"></i>
3173 </a>
3174 </label>
3175 </div>
3176 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3177 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3178 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-status" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>status" value="published" <?php echo $status == 'published' ? 'checked' : ''; ?> >
3179 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3180 </label>
3181 </div>
3182 </div> <!-- Status -->
3183 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3184 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3185 <label for="ays-chart-description" class="form-label">
3186 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3187 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3188 <i class="ays_fa ays_fa_info_circle"></i>
3189 </a>
3190 </label>
3191 </div>
3192 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3193 <textarea class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-textarea-input" id="ays-chart-description" type="text" name="<?php echo esc_attr($html_name_prefix); ?>description"><?php echo esc_attr($chart_description) ?></textarea>
3194 </div>
3195 </div> <!-- Chart description -->
3196 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3197 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3198 <label for="ays-chart-create-author" class="form-label">
3199 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3200 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_html(__('You can change the author who created the current chart to your preferred one. You need to write the User ID here. Please note, that in case you write an ID, by which there are no users found, the changes will not be applied and the previous author will remain the same.',"chart-builder")); ?>">
3201 <i class="ays_fa ays_fa_info_circle"></i>
3202 </a>
3203 </label>
3204 </div>
3205 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3206 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-create-author" name="<?php echo esc_attr($html_name_prefix); ?>create_author">
3207 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3208 <?php if (isset($create_author_data['ID'])) : ?>
3209 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3210 <?php endif; ?>
3211 </select>
3212 </div>
3213 </div> <!-- Change chart author -->
3214 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3215 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3216 <label for="ays-chart-show-title" class="form-label">
3217 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3218 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If you disable the toggle, the Chart title will not be displayed on the Front-end. By default, the toggle is enabled.","chart-builder") ); ?>">
3219 <i class="ays_fa ays_fa_info_circle"></i>
3220 </a>
3221 </label>
3222 </div>
3223 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3224 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3225 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-show-title" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_title]" value="on" <?php echo esc_attr($show_title); ?> >
3226 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3227 </label>
3228 </div>
3229 </div> <!-- Show title -->
3230 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3231 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3232 <label for="ays-chart-show-description" class="form-label">
3233 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3234 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If you disable the toggle, the Chart description will not be displayed on the Front-end. By default, the toggle is enabled.","chart-builder") ); ?>">
3235 <i class="ays_fa ays_fa_info_circle"></i>
3236 </a>
3237 </label>
3238 </div>
3239 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3240 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3241 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-show-description" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_description]" value="on" <?php echo esc_attr($show_description); ?> >
3242 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3243 </label>
3244 </div>
3245 </div> <!-- Show description -->
3246 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-pie_chart-opt cb-donut_chart-opt">
3247 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3248 <label for="ays-chart-option-enable-interactivity" class="form-label">
3249 <?php echo esc_html(__('Enable interactivity', "chart-builder")); ?>
3250 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Decide if the chart shows events based on user actions or responds to user interaction. If not, the chart won't generate 'select' or similar interaction-based events (but will generate ready or error events), and won't show hovertext or change based on user input.","chart-builder") ); ?>">
3251 <i class="ays_fa ays_fa_info_circle"></i>
3252 </a>
3253 </label>
3254 </div>
3255 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3256 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3257 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-enable-interactivity" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_interactivity]" value="on" <?php echo esc_attr($enable_interactivity); ?> >
3258 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3259 </label>
3260 </div>
3261 </div> <!-- Enable interactivity -->
3262 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt">
3263 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3264 <label for="ays-chart-option-maximized-view" class="form-label">
3265 <?php echo esc_html(__('Maximized view', "chart-builder")); ?>
3266 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, maximizes the area of the chart.","chart-builder") ); ?>">
3267 <i class="ays_fa ays_fa_info_circle"></i>
3268 </a>
3269 </label>
3270 </div>
3271 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3272 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3273 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-maximized-view" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[maximized_view]" value="on" <?php echo esc_attr($maximized_view); ?> >
3274 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3275 </label>
3276 </div>
3277 </div> <!-- Maximized view -->
3278 </div>
3279 </div>
3280 <?php
3281 $content = ob_get_clean();
3282
3283 $title = __( 'General Settings', "chart-builder" );
3284
3285 $sources['general_settings'] = array(
3286 'content' => $content,
3287 'title' => $title
3288 );
3289
3290 return $sources;
3291 }
3292
3293 public function settings_contents_general_settings_chartjs( $sources, $args ){
3294 $html_class_prefix = $args['html_class_prefix'];
3295 $html_name_prefix = $args['html_name_prefix'];
3296 $chart_description = $args['chart_description'];
3297 $create_author_data = $args['create_author_data'];
3298 $status = $args['status'];
3299 $settings = $args['settings'];
3300
3301 $show_title = $settings['show_title'];
3302 $show_description = $settings['show_description'];
3303
3304 ob_start();
3305 ?>
3306 <div class="ays-accordion-data-main-wrap">
3307 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3308 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3309 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3310 <label for="ays-status" class="form-label">
3311 <?php echo esc_html(__('Status', "chart-builder")); ?>
3312 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Decide whether the chart is active or not. If the chart is a draft, it won't be shown anywhere on your website (you don't need to remove shortcodes).","chart-builder") ); ?>">
3313 <i class="ays_fa ays_fa_info_circle"></i>
3314 </a>
3315 </label>
3316 </div>
3317 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3318 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3319 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-status" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>status" value="published" <?php echo $status == 'published' ? 'checked' : ''; ?> >
3320 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3321 </label>
3322 </div>
3323 </div> <!-- Status -->
3324 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3325 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3326 <label for="ays-chart-description" class="form-label">
3327 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3328 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3329 <i class="ays_fa ays_fa_info_circle"></i>
3330 </a>
3331 </label>
3332 </div>
3333 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3334 <textarea class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-textarea-input" id="ays-chart-description" type="text" name="<?php echo esc_attr($html_name_prefix); ?>description"><?php echo esc_attr($chart_description) ?></textarea>
3335 </div>
3336 </div> <!-- Chart description -->
3337 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3338 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3339 <label for="ays-chart-create-author" class="form-label">
3340 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3341 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_html(__('You can change the author who created the current chart to your preferred one. You need to write the User ID here. Please note, that in case you write an ID, by which there are no users found, the changes will not be applied and the previous author will remain the same.',"chart-builder")); ?>">
3342 <i class="ays_fa ays_fa_info_circle"></i>
3343 </a>
3344 </label>
3345 </div>
3346 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3347 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-create-author" name="<?php echo esc_attr($html_name_prefix); ?>create_author">
3348 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3349 <?php if (isset($create_author_data['ID'])) : ?>
3350 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3351 <?php endif; ?>
3352 </select>
3353 </div>
3354 </div> <!-- Change chart author -->
3355 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3356 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3357 <label for="ays-chart-show-title" class="form-label">
3358 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3359 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If you disable the toggle, the Chart title will not be displayed on the Front-end. By default, the toggle is enabled.","chart-builder") ); ?>">
3360 <i class="ays_fa ays_fa_info_circle"></i>
3361 </a>
3362 </label>
3363 </div>
3364 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3365 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3366 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-show-title" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_title]" value="on" <?php echo esc_attr($show_title); ?> >
3367 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3368 </label>
3369 </div>
3370 </div> <!-- Show title -->
3371 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3372 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3373 <label for="ays-chart-show-description" class="form-label">
3374 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3375 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If you disable the toggle, the Chart description will not be displayed on the Front-end. By default, the toggle is enabled.","chart-builder") ); ?>">
3376 <i class="ays_fa ays_fa_info_circle"></i>
3377 </a>
3378 </label>
3379 </div>
3380 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3381 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3382 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-show-description" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_description]" value="on" <?php echo esc_attr($show_description); ?> >
3383 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3384 </label>
3385 </div>
3386 </div> <!-- Show description -->
3387 </div>
3388 </div>
3389 <?php
3390 $content = ob_get_clean();
3391
3392 $title = __( 'General Settings', "chart-builder" );
3393
3394 $sources['general_settings'] = array(
3395 'content' => $content,
3396 'title' => $title
3397 );
3398
3399 return $sources;
3400 }
3401
3402 public function settings_contents_tooltip_settings( $sources, $args ){
3403 $html_class_prefix = $args['html_class_prefix'];
3404 $html_name_prefix = $args['html_name_prefix'];
3405 $settings = $args['settings'];
3406
3407 $tooltip_trigger_options = $settings['tooltip_trigger_options'];
3408 $tooltip_trigger = $settings['tooltip_trigger'];
3409 $show_color_code = $settings['show_color_code'];
3410 $tooltip_italic = $settings['tooltip_italic'];
3411 $tooltip_bold = $settings['tooltip_bold'];
3412 $tooltip_bold_options = $settings['tooltip_bold_options'];
3413 $tooltip_text_color = $settings['tooltip_text_color'];
3414 $tooltip_font_size = $settings['tooltip_font_size'];
3415
3416 ob_start();
3417 ?>
3418 <div class="ays-accordion-data-main-wrap cb-changable-tab cb-pie_chart-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab cb-donut_chart-tab">
3419 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3420 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3421 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3422 <label for="ays-chart-option-tooltip-trigger">
3423 <?php echo esc_html(__( "Trigger", "chart-builder" )); ?>
3424 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose when to display the results on the chart.","chart-builder") )); ?>">
3425 <i class="ays_fa ays_fa_info_circle"></i>
3426 </a>
3427 </label>
3428 </div>
3429 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3430 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-tooltip-trigger" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_trigger]">
3431 <?php
3432 foreach ( $tooltip_trigger_options as $option_slug => $option ):
3433 $selected = ( $tooltip_trigger == $option_slug ) ? 'selected' : '';
3434 ?>
3435 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3436 <?php
3437 endforeach;
3438 ?>
3439 </select>
3440 </div>
3441 </div> <!-- Trigger -->
3442 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3443 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3444 <label for="ays-chart-option-show-color-code">
3445 <?php echo esc_html(__( "Show Color Code", "chart-builder" )); ?>
3446 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color will be displayed while clicking on a particular part of the chart.","chart-builder") ); ?>">
3447 <i class="ays_fa ays_fa_info_circle"></i>
3448 </a>
3449 </label>
3450 </div>
3451 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3452 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3453 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-show-color-code" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[show_color_code]" value="on" <?php echo esc_attr($show_color_code); ?> >
3454 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3455 </label>
3456 </div>
3457 </div> <!-- Show Color Code -->
3458 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3459 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3460 <label for="ays-chart-option-tooltip-text-color">
3461 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
3462 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
3463 <i class="ays_fa ays_fa_info_circle"></i>
3464 </a>
3465 </label>
3466 </div>
3467 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3468 <input id="ays-chart-option-tooltip-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_text_color]" value="<?php echo esc_attr($tooltip_text_color) ?>">
3469 </div>
3470 </div> <!-- Text color -->
3471 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3472 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3473 <label for="ays-chart-option-tooltip-font-size" class="form-label">
3474 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3475 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("The font size for all text within the chart tooltip, specified in pixels. Please note that if an invalid value is entered, it will revert to the default global font size.","chart-builder") )); ?>">
3476 <i class="ays_fa ays_fa_info_circle"></i>
3477 </a>
3478 </label>
3479 </div>
3480 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3481 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-tooltip-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_font_size]" value="<?php echo esc_attr($tooltip_font_size) ?>">
3482 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3483 </div>
3484 </div> <!-- Font size -->
3485 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3486 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3487 <label for="ays-chart-option-tooltip-italic">
3488 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3489 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart tooltip text italic.","chart-builder") ); ?>">
3490 <i class="ays_fa ays_fa_info_circle"></i>
3491 </a>
3492 </label>
3493 </div>
3494 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3495 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3496 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-tooltip-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_italic]" value="on" <?php echo esc_attr($tooltip_italic); ?> >
3497 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3498 </label>
3499 </div>
3500 </div> <!-- Italic text -->
3501 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3502 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3503 <label for="ays-chart-option-tooltip-bold">
3504 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3505 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose when to display the results on the chart.","chart-builder") )); ?>">
3506 <i class="ays_fa ays_fa_info_circle"></i>
3507 </a>
3508 </label>
3509 </div>
3510 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3511 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-tooltip-bold" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_bold]">
3512 <?php
3513 foreach ( $tooltip_bold_options as $option_slug => $option ):
3514 $selected = ( $tooltip_bold == $option_slug ) ? 'selected' : '';
3515 ?>
3516 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3517 <?php
3518 endforeach;
3519 ?>
3520 </select>
3521 </div>
3522 </div> <!-- Bold text -->
3523 </div>
3524 </div>
3525 <?php
3526 $content = ob_get_clean();
3527
3528 $title = __( 'Tooltip', "chart-builder" );
3529
3530 $sources['tooltip'] = array(
3531 'content' => $content,
3532 'title' => $title
3533 );
3534
3535 return $sources;
3536 }
3537
3538 public function settings_contents_legend_settings( $sources, $args ){
3539 $html_class_prefix = $args['html_class_prefix'];
3540 $html_name_prefix = $args['html_name_prefix'];
3541 $settings = $args['settings'];
3542 $legend_positions = $settings['legend_positions'];
3543 $legend_position = $settings['legend_position'];
3544 $legend_alignments = $settings['legend_alignments'];
3545 $legend_alignment = $settings['legend_alignment'];
3546 $legend_color = $settings['legend_color'];
3547 $legend_font_size = $settings['legend_font_size'];
3548 $legend_bold = $settings['legend_bold'];
3549 $legend_italic = $settings['legend_italic'];
3550
3551 ob_start();
3552 ?>
3553 <div class="ays-accordion-data-main-wrap cb-changable-tab cb-pie_chart-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab cb-donut_chart-tab">
3554 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3555 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3556 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3557 <label for="ays-chart-option-legend-position">
3558 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3559 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") )); ?>">
3560 <i class="ays_fa ays_fa_info_circle"></i>
3561 </a>
3562 </label>
3563 </div>
3564 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3565 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-legend-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_position]">
3566 <?php
3567 foreach ( $legend_positions as $option_slug => $option ):
3568 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
3569
3570 $type_class = '';
3571 if ($option_slug == 'left') {
3572 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3573 } else if ($option_slug == 'in') {
3574 $type_class = ' cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt ';
3575 } else if ($option_slug == 'labeled') {
3576 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3577 }
3578
3579 ?>
3580
3581 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?> class="<?php echo esc_attr($type_class); ?>"><?php echo esc_html($option); ?></option>
3582 <?php
3583 endforeach;
3584 ?>
3585 </select>
3586 </div>
3587 </div> <!-- Legend position -->
3588 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3589 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3590 <label for="ays-chart-option-legend-alignment">
3591 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
3592 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") )); ?>">
3593 <i class="ays_fa ays_fa_info_circle"></i>
3594 </a>
3595 </label>
3596 </div>
3597 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3598 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-legend-alignment" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_alignment]">
3599 <?php
3600 foreach ( $legend_alignments as $option_slug => $option ):
3601 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
3602 ?>
3603 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3604 <?php
3605 endforeach;
3606 ?>
3607 </select>
3608 </div>
3609 </div> <!-- Legend alignment -->
3610 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3611 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3612 <label for="ays-chart-option-legend-font-color">
3613 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
3614 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the font color for the chart legend.","chart-builder") )); ?>">
3615 <i class="ays_fa ays_fa_info_circle"></i>
3616 </a>
3617 </label>
3618 </div>
3619 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3620 <input id="ays-chart-option-legend-font-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_color]" value="<?php echo esc_attr($legend_color) ?>">
3621 </div>
3622 </div> <!-- Legend font color -->
3623 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3624 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3625 <label for="ays-chart-option-legend-font-size" class="form-label">
3626 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3627 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("The font size for all text within the chart legend, specified in pixels. Please note that if an invalid value is entered, it will revert to the default global font size.","chart-builder") )); ?>">
3628 <i class="ays_fa ays_fa_info_circle"></i>
3629 </a>
3630 </label>
3631 </div>
3632 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3633 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-legend-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_font_size]" value="<?php echo esc_attr($legend_font_size) ?>">
3634 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3635 </div>
3636 </div> <!-- Font size -->
3637 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3638 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3639 <label for="ays-chart-option-legend-italic">
3640 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3641 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
3642 <i class="ays_fa ays_fa_info_circle"></i>
3643 </a>
3644 </label>
3645 </div>
3646 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3647 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3648 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-legend-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_italic]" value="on" <?php echo esc_attr($legend_italic); ?> >
3649 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3650 </label>
3651 </div>
3652 </div> <!-- Italic text -->
3653 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3654 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3655 <label for="ays-chart-option-legend-bold">
3656 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3657 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
3658 <i class="ays_fa ays_fa_info_circle"></i>
3659 </a>
3660 </label>
3661 </div>
3662 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3663 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3664 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-legend-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_bold]" value="on" <?php echo esc_attr($legend_bold); ?> >
3665 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3666 </label>
3667 </div>
3668 </div> <!-- Bold text -->
3669 </div>
3670 </div>
3671 <?php
3672 $content = ob_get_clean();
3673
3674 $title = __( 'Legend', "chart-builder" );
3675
3676 $sources['legend'] = array(
3677 'content' => $content,
3678 'title' => $title
3679 );
3680
3681 return $sources;
3682 }
3683
3684 public function settings_contents_horizontal_axis_settings( $sources, $args ){
3685 $html_class_prefix = $args['html_class_prefix'];
3686 $html_name_prefix = $args['html_name_prefix'];
3687 $settings = $args['settings'];
3688
3689 $haxis_title = $settings['haxis_title'];
3690 $axes_text_positions = $settings['axes_text_positions'];
3691 $haxis_text_position = $settings['haxis_text_position'];
3692 $haxis_direction = $settings['haxis_direction'];
3693 $haxis_text_color = $settings['haxis_text_color'];
3694 $haxis_baseline_color = $settings['haxis_baseline_color'];
3695 $haxis_slanted_options = $settings['haxis_slanted_options'];
3696 $haxis_slanted = $settings['haxis_slanted'];
3697 $haxis_slanted_text_angle = $settings['haxis_slanted_text_angle'];
3698 $haxis_show_text_every = $settings['haxis_show_text_every'];
3699 $haxis_format_options = $settings['axes_format_options'];
3700 $haxis_format = $settings['haxis_format'];
3701 $haxis_label_font_size = $settings['haxis_label_font_size'];
3702 $haxis_max_value = $settings['haxis_max_value'];
3703 $haxis_min_value = $settings['haxis_min_value'];
3704 $haxis_text_font_size = $settings['haxis_text_font_size'];
3705 $haxis_label_color = $settings['haxis_label_color'];
3706 $haxis_bold = $settings['haxis_bold'];
3707 $haxis_italic = $settings['haxis_italic'];
3708 $haxis_title_bold = $settings['haxis_title_bold'];
3709 $haxis_title_italic = $settings['haxis_title_italic'];
3710 $haxis_gridlines_count = $settings['haxis_gridlines_count'];
3711 $haxis_gridlines_color = $settings['haxis_gridlines_color'];
3712 $haxis_minor_gridlines_color = $settings['haxis_minor_gridlines_color'];
3713
3714 ob_start();
3715 ?>
3716 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-haxis-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
3717 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3718 <h6>Label</h6>
3719 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3720 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3721 <label for="ays-chart-option-haxis-title" class="form-label">
3722 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3723 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The title of the horizontal axis","chart-builder") ); ?>">
3724 <i class="ays_fa ays_fa_info_circle"></i>
3725 </a>
3726 </label>
3727 </div>
3728 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3729 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-title" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_title]" value="<?php echo esc_attr($haxis_title) ?>">
3730 </div>
3731 </div> <!-- Horizontal axis label -->
3732 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3733 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3734 <label for="ays-chart-option-haxis-label-font-size" class="form-label">
3735 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3736 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis label.","chart-builder") ); ?>">
3737 <i class="ays_fa ays_fa_info_circle"></i>
3738 </a>
3739 </label>
3740 </div>
3741 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3742 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-label-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_label_font_size]" value="<?php echo esc_attr($haxis_label_font_size) ?>">
3743 </div>
3744 </div> <!-- Horizontal axis label font size -->
3745 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3746 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3747 <label for="ays-chart-option-haxis-label-color">
3748 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3749 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
3750 <i class="ays_fa ays_fa_info_circle"></i>
3751 </a>
3752 </label>
3753 </div>
3754 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3755 <input id="ays-chart-option-haxis-label-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_label_color]" value="<?php echo esc_attr($haxis_label_color) ?>">
3756 </div>
3757 </div> <!-- Horizontal axis label color -->
3758 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3759 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3760 <label for="ays-chart-option-haxis-title-italic">
3761 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3762 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart horizontal axis label italic.","chart-builder") ); ?>">
3763 <i class="ays_fa ays_fa_info_circle"></i>
3764 </a>
3765 </label>
3766 </div>
3767 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3768 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3769 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-title-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_title_italic]" value="on" <?php echo esc_attr($haxis_title_italic); ?> >
3770 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3771 </label>
3772 </div>
3773 </div> <!-- Italic label -->
3774 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3775 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3776 <label for="ays-chart-option-haxis-title-bold">
3777 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3778 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart horizontal axis label bold.","chart-builder") ); ?>">
3779 <i class="ays_fa ays_fa_info_circle"></i>
3780 </a>
3781 </label>
3782 </div>
3783 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3784 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3785 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-title-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_title_bold]" value="on" <?php echo esc_attr($haxis_title_bold); ?> >
3786 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3787 </label>
3788 </div>
3789 </div> <!-- Bold label -->
3790 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-column_chart-opt cb-line_chart-opt">
3791 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3792 <label for="ays-chart-option-haxis-show-text-every" class="form-label">
3793 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
3794 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("How many horizontal axis labels to show, where 1 means show every label, 2 means show every other label, and so on. 0 is to try to show as many labels as possible without overlapping.","chart-builder") ); ?>">
3795 <i class="ays_fa ays_fa_info_circle"></i>
3796 </a>
3797 </label>
3798 </div>
3799 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3800 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-show-text-every" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_show_text_every]" value="<?php echo esc_attr($haxis_show_text_every) ?>" step="1" min="0">
3801 </div>
3802 </div> <!-- Label interval -->
3803
3804 <br>
3805 <h6>Text</h6>
3806 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3807 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3808 <label for="ays-chart-option-haxis-text-position" class="form-label">
3809 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3810 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Position of the horizontal axis text, relative to the chart area.","chart-builder") ); ?>">
3811 <i class="ays_fa ays_fa_info_circle"></i>
3812 </a>
3813 </label>
3814 </div>
3815 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3816 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-haxis-text-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_text_position]">
3817 <?php
3818 foreach ( $axes_text_positions as $option_slug => $option ):
3819 $selected = ( $haxis_text_position == $option_slug ) ? 'selected' : '';
3820 ?>
3821 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3822 <?php
3823 endforeach;
3824 ?>
3825 </select>
3826 </div>
3827 </div> <!-- Horizontal axis text position -->
3828 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3829 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3830 <label for="ays-chart-option-haxis-text-color">
3831 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3832 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis text.","chart-builder") ); ?>">
3833 <i class="ays_fa ays_fa_info_circle"></i>
3834 </a>
3835 </label>
3836 </div>
3837 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3838 <input id="ays-chart-option-haxis-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_text_color]" value="<?php echo esc_attr($haxis_text_color) ?>">
3839 </div>
3840 </div> <!-- Horizontal axis text color -->
3841 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3842 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3843 <label for="ays-chart-option-haxis-text-font-size" class="form-label">
3844 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3845 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
3846 <i class="ays_fa ays_fa_info_circle"></i>
3847 </a>
3848 </label>
3849 </div>
3850 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3851 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-text-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_text_font_size]" value="<?php echo esc_attr($haxis_text_font_size) ?>">
3852 </div>
3853 </div> <!-- Horizontal axis text font size -->
3854 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3855 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3856 <label for="ays-chart-option-haxis-text-direction">
3857 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
3858 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The direction in which the values grow along the horizontal axis. By default, low values are on the left of the chart.","chart-builder") ); ?>">
3859 <i class="ays_fa ays_fa_info_circle"></i>
3860 </a>
3861 </label>
3862 </div>
3863 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3864 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3865 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-text-direction" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_direction]" value="-1" <?php echo esc_attr($haxis_direction); ?> >
3866 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3867 </label>
3868 </div>
3869 </div> <!-- Horizontal axis text direction -->
3870 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3871 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3872 <label for="ays-chart-option-haxis-italic">
3873 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3874 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart horizontal axis text italic.","chart-builder") ); ?>">
3875 <i class="ays_fa ays_fa_info_circle"></i>
3876 </a>
3877 </label>
3878 </div>
3879 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3880 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3881 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_italic]" value="on" <?php echo esc_attr($haxis_italic); ?> >
3882 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3883 </label>
3884 </div>
3885 </div> <!-- Italic text -->
3886 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3887 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3888 <label for="ays-chart-option-haxis-bold">
3889 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3890 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart horizontal axis text bold.","chart-builder") ); ?>">
3891 <i class="ays_fa ays_fa_info_circle"></i>
3892 </a>
3893 </label>
3894 </div>
3895 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3896 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3897 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_bold]" value="on" <?php echo esc_attr($haxis_bold); ?> >
3898 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3899 </label>
3900 </div>
3901 </div> <!-- Bold text -->
3902 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3903 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3904 <label for="ays-chart-option-haxis-slanted-text" class="form-label">
3905 <?php echo esc_html(__( "Slanted text", "chart-builder" )); ?>
3906 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("By choosing true the text will be slanted. In false it will be horizontal. In Automatic based on the size, it will be displayed either in horizontal or slanted. Note: This option only works, if 'Text position' option is set to 'Outside the chart'","chart-builder") ); ?>">
3907 <i class="ays_fa ays_fa_info_circle"></i>
3908 </a>
3909 </label>
3910 </div>
3911 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3912 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-haxis-slanted-text" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_slanted]">
3913 <?php
3914 foreach ( $haxis_slanted_options as $option_slug => $option ):
3915 $selected = ( $haxis_slanted == $option_slug ) ? 'selected' : '';
3916 ?>
3917 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3918 <?php
3919 endforeach;
3920 ?>
3921 </select>
3922 </div>
3923 </div> <!-- Horizontal axis slanted text -->
3924 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section <?php echo ($haxis_slanted == 'false') ? 'display_none' : ''; ?>">
3925 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3926 <label for="ays-chart-option-haxis-slanted-text-angle" class="form-label">
3927 <?php echo esc_html(__( "Slanted text angle", "chart-builder" )); ?>
3928 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The slanted text angle will define the angle. It will tilt in between -90 from 90 (except 0).","chart-builder") ); ?>">
3929 <i class="ays_fa ays_fa_info_circle"></i>
3930 </a>
3931 </label>
3932 </div>
3933 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3934 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-slanted-text-angle" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_slanted_text_angle]" value="<?php echo esc_attr($haxis_slanted_text_angle) ?>" step="15" min="-90" max="90">
3935 </div>
3936 </div> <!-- Horizontal axis slanted text angle -->
3937
3938 <br>
3939 <h6>Gridlines</h6>
3940 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3941 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3942 <label for="ays-chart-option-haxis-gridlines-count" class="form-label">
3943 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
3944 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The approximate number of vertical gridlines inside the chart area. If you specify a positive number for gridlines count, it will be used to compute the min spacing between gridlines. You can specify a value of 1 to only draw one gridline, or 0 to draw no gridlines. Specify -1, which is the default, to automatically compute the number of gridlines based on other options. Note: This option will not work with 'Rotate vertical' option.","chart-builder") ); ?>">
3945 <i class="ays_fa ays_fa_info_circle"></i>
3946 </a>
3947 </label>
3948 </div>
3949 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3950 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-gridlines-count" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_gridlines_count]" value="<?php echo esc_attr($haxis_gridlines_count) ?>">
3951 </div>
3952 </div> <!-- Horizontal axis gridlines count -->
3953 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3954 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3955 <label for="ays-chart-option-haxis-gridlines-color">
3956 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3957 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis gridlines.","chart-builder") ); ?>">
3958 <i class="ays_fa ays_fa_info_circle"></i>
3959 </a>
3960 </label>
3961 </div>
3962 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3963 <input id="ays-chart-option-haxis-gridlines-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_gridlines_color]" value="<?php echo esc_attr($haxis_gridlines_color) ?>">
3964 </div>
3965 </div> <!-- Horizontal axis gridlines color -->
3966 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3967 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3968 <label for="ays-chart-option-haxis-minor-gridlines-color">
3969 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
3970 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis minor gridlines.","chart-builder") ); ?>">
3971 <i class="ays_fa ays_fa_info_circle"></i>
3972 </a>
3973 </label>
3974 </div>
3975 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3976 <input id="ays-chart-option-haxis-minor-gridlines-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_minor_gridlines_color]" value="<?php echo esc_attr($haxis_minor_gridlines_color) ?>">
3977 </div>
3978 </div> <!-- Horizontal axis minor gridlines color -->
3979 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-line_chart-opt">
3980 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3981 <label for="ays-chart-option-haxis-baseline-color">
3982 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
3983 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specifies the color of the baseline for the horizontal axis.","chart-builder") ); ?>">
3984 <i class="ays_fa ays_fa_info_circle"></i>
3985 </a>
3986 </label>
3987 </div>
3988 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3989 <input id="ays-chart-option-haxis-baseline-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_baseline_color]" value="<?php echo esc_attr($haxis_baseline_color) ?>">
3990 </div>
3991 </div> <!-- Horizontal axis baseline color -->
3992
3993 <br>
3994 <h6>Format</h6>
3995 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3996 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3997 <label for="ays-chart-option-haxis-format" class="form-label">
3998 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
3999 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4000 echo esc_attr( sprintf(
4001 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4002 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4003 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4004 __('%1$sNone:%2$s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4005 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4006 __('%1$sDecimal:%2$s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4007 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4008 __('%1$sScientific:%2$s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4009 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4010 __('%1$sCurrency:%2$s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4011 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4012 __('%1$sPercent:%2$s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4013 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4014 __('%1$sShort:%2$s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4015 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4016 __('%1$sLong:%2$s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4017 '<em>', '</em>',
4018 '<em>', '</em>',
4019 '<em>', '</em>',
4020 '<em>', '</em>',
4021 '<em>', '</em>',
4022 '<em>', '</em>',
4023 '<em>', '</em>'
4024 ));
4025 ?>">
4026 <i class="ays_fa ays_fa_info_circle"></i>
4027 </a>
4028 </label>
4029 </div>
4030 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4031 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-haxis-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_format]">
4032 <?php
4033 foreach ( $haxis_format_options as $option_slug => $option ):
4034 $selected = ( $haxis_format == $option_slug ) ? 'selected' : '';
4035 ?>
4036 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4037 <?php
4038 endforeach;
4039 ?>
4040 </select>
4041 </div>
4042 </div> <!-- Horizontal axis format -->
4043 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4044 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4045 <label for="ays-chart-option-haxis-max-value" class="form-label">
4046 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4047 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4048 <i class="ays_fa ays_fa_info_circle"></i>
4049 </a>
4050 </label>
4051 </div>
4052 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4053 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-max-value" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_max_value]" value="<?php echo esc_attr($haxis_max_value) ?>">
4054 </div>
4055 </div> <!-- Horizontal axis max value -->
4056 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4057 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4058 <label for="ays-chart-option-haxis-min-value" class="form-label">
4059 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4060 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4061 <i class="ays_fa ays_fa_info_circle"></i>
4062 </a>
4063 </label>
4064 </div>
4065 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4066 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-min-value" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_min_value]" value="<?php echo esc_attr($haxis_min_value) ?>">
4067 </div>
4068 </div> <!-- Horizontal axis min value -->
4069 </div>
4070 </div>
4071 <?php
4072 $content = ob_get_clean();
4073
4074 $title = __( 'Horizontal Axis Settings', "chart-builder" );
4075
4076 $sources['horizontal_axis'] = array(
4077 'content' => $content,
4078 'title' => $title
4079 );
4080
4081 return $sources;
4082 }
4083
4084 public function settings_contents_vertical_axis_settings( $sources, $args ){
4085 $html_class_prefix = $args['html_class_prefix'];
4086 $html_name_prefix = $args['html_name_prefix'];
4087 $settings = $args['settings'];
4088
4089 $vaxis_title = $settings['vaxis_title'];
4090 $axes_text_positions = $settings['axes_text_positions'];
4091 $vaxis_text_position = $settings['vaxis_text_position'];
4092 $vaxis_direction = $settings['vaxis_direction'];
4093 $vaxis_text_color = $settings['vaxis_text_color'];
4094 $vaxis_baseline_color = $settings['vaxis_baseline_color'];
4095 $vaxis_format_options = $settings['axes_format_options'];
4096 $vaxis_format = $settings['vaxis_format'];
4097 $vaxis_label_font_size = $settings['vaxis_label_font_size'];
4098 $vaxis_max_value = $settings['vaxis_max_value'];
4099 $vaxis_min_value = $settings['vaxis_min_value'];
4100 $vaxis_text_font_size = $settings['vaxis_text_font_size'];
4101 $vaxis_label_color = $settings['vaxis_label_color'];
4102 $vaxis_bold = $settings['vaxis_bold'];
4103 $vaxis_italic = $settings['vaxis_italic'];
4104 $vaxis_title_bold = $settings['vaxis_title_bold'];
4105 $vaxis_title_italic = $settings['vaxis_title_italic'];
4106 $vaxis_gridlines_count = $settings['vaxis_gridlines_count'];
4107 $vaxis_gridlines_color = $settings['vaxis_gridlines_color'];
4108 $vaxis_minor_gridlines_color = $settings['vaxis_minor_gridlines_color'];
4109
4110 ob_start();
4111 ?>
4112 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-vaxis-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
4113 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4114 <h6>Label</h6>
4115 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4116 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4117 <label for="ays-chart-option-vaxis-title" class="form-label">
4118 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
4119 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The title of the vertical axis","chart-builder") ); ?>">
4120 <i class="ays_fa ays_fa_info_circle"></i>
4121 </a>
4122 </label>
4123 </div>
4124 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4125 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-title" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_title]" value="<?php echo esc_attr($vaxis_title) ?>">
4126 </div>
4127 </div> <!-- Vertical axis label -->
4128 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4129 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4130 <label for="ays-chart-option-vaxis-label-font-size" class="form-label">
4131 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4132 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the vertical axis label.","chart-builder") ); ?>">
4133 <i class="ays_fa ays_fa_info_circle"></i>
4134 </a>
4135 </label>
4136 </div>
4137 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4138 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-label-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_label_font_size]" value="<?php echo esc_attr($vaxis_label_font_size) ?>">
4139 </div>
4140 </div> <!-- Vertical axis label font size -->
4141 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4142 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4143 <label for="ays-chart-option-vaxis-label-color">
4144 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4145 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
4146 <i class="ays_fa ays_fa_info_circle"></i>
4147 </a>
4148 </label>
4149 </div>
4150 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4151 <input id="ays-chart-option-vaxis-label-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_label_color]" value="<?php echo esc_attr($vaxis_label_color) ?>">
4152 </div>
4153 </div> <!-- Vertical axis label color -->
4154 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4155 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4156 <label for="ays-chart-option-vaxis-title-italic">
4157 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
4158 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart vertical axis label italic.","chart-builder") ); ?>">
4159 <i class="ays_fa ays_fa_info_circle"></i>
4160 </a>
4161 </label>
4162 </div>
4163 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4164 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4165 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-title-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_title_italic]" value="on" <?php echo esc_attr($vaxis_title_italic); ?> >
4166 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4167 </label>
4168 </div>
4169 </div> <!-- Italic label -->
4170 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4171 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4172 <label for="ays-chart-option-vaxis-title-bold">
4173 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
4174 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart vertical axis label bold.","chart-builder") ); ?>">
4175 <i class="ays_fa ays_fa_info_circle"></i>
4176 </a>
4177 </label>
4178 </div>
4179 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4180 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4181 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-title-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_title_bold]" value="on" <?php echo esc_attr($vaxis_title_bold); ?> >
4182 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4183 </label>
4184 </div>
4185 </div> <!-- Bold label -->
4186
4187 <br>
4188 <h6>Text</h6>
4189 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4190 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4191 <label for="ays-chart-option-vaxis-text-position" class="form-label">
4192 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4193 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Position of the vertical axis text, relative to the chart area.","chart-builder") ); ?>">
4194 <i class="ays_fa ays_fa_info_circle"></i>
4195 </a>
4196 </label>
4197 </div>
4198 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4199 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-vaxis-text-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_text_position]">
4200 <?php
4201 foreach ( $axes_text_positions as $option_slug => $option ):
4202 $selected = ( $vaxis_text_position == $option_slug ) ? 'selected' : '';
4203 ?>
4204 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4205 <?php
4206 endforeach;
4207 ?>
4208 </select>
4209 </div>
4210 </div> <!-- Vertical axis text position -->
4211 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4212 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4213 <label for="ays-chart-option-vaxis-text-color">
4214 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4215 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis text.","chart-builder") ); ?>">
4216 <i class="ays_fa ays_fa_info_circle"></i>
4217 </a>
4218 </label>
4219 </div>
4220 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4221 <input id="ays-chart-option-vaxis-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_text_color]" value="<?php echo esc_attr($vaxis_text_color) ?>">
4222 </div>
4223 </div> <!-- Vertical axis text color -->
4224 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4225 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4226 <label for="ays-chart-option-vaxis-text-font-size" class="form-label">
4227 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4228 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
4229 <i class="ays_fa ays_fa_info_circle"></i>
4230 </a>
4231 </label>
4232 </div>
4233 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4234 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-text-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_text_font_size]" value="<?php echo esc_attr($vaxis_text_font_size) ?>">
4235 </div>
4236 </div> <!-- Vertical axis text font size -->
4237 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4238 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4239 <label for="ays-chart-option-vaxis-text-direction">
4240 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
4241 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The direction in which the values along the vertical axis grow. By default, low values are on the bottom of the chart.","chart-builder") ); ?>">
4242 <i class="ays_fa ays_fa_info_circle"></i>
4243 </a>
4244 </label>
4245 </div>
4246 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4247 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4248 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-text-direction" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_direction]" value="-1" <?php echo esc_attr($vaxis_direction); ?> >
4249 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4250 </label>
4251 </div>
4252 </div> <!-- Vertical axis text direction -->
4253 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4254 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4255 <label for="ays-chart-option-vaxis-italic">
4256 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
4257 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart vertical axis text italic.","chart-builder") ); ?>">
4258 <i class="ays_fa ays_fa_info_circle"></i>
4259 </a>
4260 </label>
4261 </div>
4262 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4263 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4264 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_italic]" value="on" <?php echo esc_attr($vaxis_italic); ?> >
4265 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4266 </label>
4267 </div>
4268 </div> <!-- Italic text -->
4269 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4270 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4271 <label for="ays-chart-option-vaxis-bold">
4272 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
4273 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart vertical axis text bold.","chart-builder") ); ?>">
4274 <i class="ays_fa ays_fa_info_circle"></i>
4275 </a>
4276 </label>
4277 </div>
4278 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4279 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4280 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_bold]" value="on" <?php echo esc_attr($vaxis_bold); ?> >
4281 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4282 </label>
4283 </div>
4284 </div> <!-- Bold text -->
4285
4286 <br>
4287 <h6>Gridlines</h6>
4288 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4289 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4290 <label for="ays-chart-option-vaxis-gridlines-count" class="form-label">
4291 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
4292 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The approximate number of horizontal gridlines inside the chart area. If you specify a positive number for gridlines count, it will be used to compute the min spacing between gridlines. You can specify a value of 1 to only draw one gridline, or 0 to draw no gridlines. Specify -1, which is the default, to automatically compute the number of gridlines based on other options. Note: This option will not work with 'Rotate vertical' option.","chart-builder") ); ?>">
4293 <i class="ays_fa ays_fa_info_circle"></i>
4294 </a>
4295 </label>
4296 </div>
4297 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4298 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-gridlines-count" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_gridlines_count]" value="<?php echo esc_attr($vaxis_gridlines_count) ?>">
4299 </div>
4300 </div> <!-- Vertical axis gridlines count -->
4301 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4302 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4303 <label for="ays-chart-option-vaxis-gridlines-color">
4304 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4305 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis gridlines.","chart-builder") ); ?>">
4306 <i class="ays_fa ays_fa_info_circle"></i>
4307 </a>
4308 </label>
4309 </div>
4310 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4311 <input id="ays-chart-option-vaxis-gridlines-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_gridlines_color]" value="<?php echo esc_attr($vaxis_gridlines_color) ?>">
4312 </div>
4313 </div> <!-- Vertical axis gridlines color -->
4314 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4315 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4316 <label for="ays-chart-option-vaxis-minor-gridlines-color">
4317 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
4318 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis minor gridlines.","chart-builder") ); ?>">
4319 <i class="ays_fa ays_fa_info_circle"></i>
4320 </a>
4321 </label>
4322 </div>
4323 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4324 <input id="ays-chart-option-vaxis-minor-gridlines-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_minor_gridlines_color]" value="<?php echo esc_attr($vaxis_minor_gridlines_color) ?>">
4325 </div>
4326 </div> <!-- Vertical axis minor gridlines color -->
4327 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-column_chart-opt cb-line_chart-opt">
4328 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4329 <label for="ays-chart-option-vaxis-baseline-color">
4330 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4331 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specifies the color of the baseline for the vertical axis.","chart-builder") ); ?>">
4332 <i class="ays_fa ays_fa_info_circle"></i>
4333 </a>
4334 </label>
4335 </div>
4336 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4337 <input id="ays-chart-option-vaxis-baseline-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_baseline_color]" value="<?php echo esc_attr($vaxis_baseline_color) ?>">
4338 </div>
4339 </div> <!-- Vertical axis baseline color -->
4340
4341 <br>
4342 <h6>Format</h6>
4343 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4344 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4345 <label for="ays-chart-option-vaxis-format" class="form-label">
4346 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4347 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4348 echo esc_attr( sprintf(
4349 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4350 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4351 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4352 __('%1$sNone:%2$s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4353 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4354 __('%1$sDecimal:%2$s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4355 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4356 __('%1$sScientific:%2$s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4357 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4358 __('%1$sCurrency:%2$s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4359 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4360 __('%1$sPercent:%2$s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4361 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4362 __('%1$sShort:%2$s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4363 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4364 __('%1$sLong:%2$s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4365 '<em>', '</em>',
4366 '<em>', '</em>',
4367 '<em>', '</em>',
4368 '<em>', '</em>',
4369 '<em>', '</em>',
4370 '<em>', '</em>',
4371 '<em>', '</em>'
4372 ));
4373 ?>">
4374 <i class="ays_fa ays_fa_info_circle"></i>
4375 </a>
4376 </label>
4377 </div>
4378 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4379 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-vaxis-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_format]">
4380 <?php
4381 foreach ( $vaxis_format_options as $option_slug => $option ):
4382 $selected = ( $vaxis_format == $option_slug ) ? 'selected' : '';
4383 ?>
4384 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4385 <?php
4386 endforeach;
4387 ?>
4388 </select>
4389 </div>
4390 </div> <!-- Vertical axis format -->
4391 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4392 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4393 <label for="ays-chart-option-vaxis-max-value" class="form-label">
4394 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4395 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4396 <i class="ays_fa ays_fa_info_circle"></i>
4397 </a>
4398 </label>
4399 </div>
4400 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4401 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-max-value" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_max_value]" value="<?php echo esc_attr($vaxis_max_value) ?>">
4402 </div>
4403 </div> <!-- Vertical axis max value -->
4404 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4405 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4406 <label for="ays-chart-option-vaxis-min-value" class="form-label">
4407 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4408 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4409 <i class="ays_fa ays_fa_info_circle"></i>
4410 </a>
4411 </label>
4412 </div>
4413 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4414 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-vaxis-min-value" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_min_value]" value="<?php echo esc_attr($vaxis_min_value) ?>">
4415 </div>
4416 </div> <!-- Vertical axis min value -->
4417 </div>
4418 </div>
4419 <?php
4420 $content = ob_get_clean();
4421
4422 $title = __( 'Vertical Axis Settings', "chart-builder" );
4423
4424 $sources['vertical_axis'] = array(
4425 'content' => $content,
4426 'title' => $title
4427 );
4428
4429 return $sources;
4430 }
4431
4432 public function settings_contents_animation_settings( $sources, $args ) {
4433 $html_class_prefix = $args['html_class_prefix'];
4434 $html_name_prefix = $args['html_name_prefix'];
4435 $settings = $args['settings'];
4436
4437 $enable_animation = $settings['enable_animation'];
4438 $animation_duration = $settings['animation_duration'];
4439 $animation_startup = $settings['animation_startup'];
4440 $animation_easing_options = $settings['animation_easing_options'];
4441 $animation_easing = $settings['animation_easing'];
4442
4443 ob_start();
4444 ?>
4445 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-animation-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
4446 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4447 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4448 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4449 <label for="ays-chart-option-enable-animation">
4450 <?php echo esc_html(__( "Enable chart animation", "chart-builder" )); ?>
4451 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable chart animation.","chart-builder") ); ?>">
4452 <i class="ays_fa ays_fa_info_circle"></i>
4453 </a>
4454 </label>
4455 </div>
4456 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4457 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4458 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch <?php echo esc_attr($html_class_prefix) ?>toggle-hidden-option" id="ays-chart-option-enable-animation" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_animation]" value="on" <?php echo esc_attr($enable_animation); ?> >
4459 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4460 </label>
4461 </div>
4462 </div> <!-- Enable animation -->
4463 <div class="form-group row <?php echo esc_attr($html_class_prefix) ?>animation-options-section <?php echo esc_attr($html_class_prefix) ?>hidden-options-section <?php echo ($enable_animation == 'checked') ? '' : 'display_none'; ?>">
4464 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4465 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4466 <label for="ays-chart-option-animation-duration" class="form-label">
4467 <?php echo esc_html(__( "Duration", "chart-builder" )); ?>
4468 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The duration of the chart animation, in milliseconds.","chart-builder") ); ?>">
4469 <i class="ays_fa ays_fa_info_circle"></i>
4470 </a>
4471 </label>
4472 </div>
4473 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4474 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-animation-duration" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[animation_duration]" value="<?php echo esc_attr($animation_duration) ?>">
4475 </div>
4476 </div> <!-- Animation duration -->
4477 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4478 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4479 <label for="ays-chart-option-animation-startup">
4480 <?php echo esc_html(__( "Startup", "chart-builder" )); ?>
4481 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Determine if the chart will animate on the window load. If checked, the chart will start at the baseline and animate to its final state, else it will animate on size or data change.","chart-builder") ); ?>">
4482 <i class="ays_fa ays_fa_info_circle"></i>
4483 </a>
4484 </label>
4485 </div>
4486 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4487 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4488 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-animation-startup" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[animation_startup]" value="on" <?php echo esc_attr($animation_startup); ?> >
4489 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4490 </label>
4491 </div>
4492 </div> <!-- Animation startup -->
4493 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4494 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4495 <label for="ays-chart-option-animation-easing" class="form-label">
4496 <?php echo esc_html(__( "Easing", "chart-builder" )); ?>
4497 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4498 echo esc_attr( sprintf(
4499 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4500 "<p>" . __('The easing function applied to the chart animation. The following options are available:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4501 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4502 __('%1$sLinear:%2$s Constant speed.', "chart-builder") . "</li><li>" .
4503 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4504 __('%1$sEase in:%2$s Start slow and speed up.', "chart-builder") . "</li><li>" .
4505 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4506 __('%1$sEase out:%2$s Start fast and slow down.', "chart-builder") . "</li><li>" .
4507 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4508 __('%1$sEase in and out:%2$s Start slow, speed up, then slow down.', "chart-builder") . "</li></ul>",
4509 '<em>', '</em>',
4510 '<em>', '</em>',
4511 '<em>', '</em>',
4512 '<em>', '</em>'
4513 ));
4514 ?>">
4515 <i class="ays_fa ays_fa_info_circle"></i>
4516 </a>
4517 </label>
4518 </div>
4519 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4520 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-animation-easing" name="<?php echo esc_attr($html_name_prefix); ?>settings[animation_easing]">
4521 <?php
4522 foreach ( $animation_easing_options as $option_slug => $option ):
4523 $selected = ( $animation_easing == $option_slug ) ? 'selected' : '';
4524 ?>
4525 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4526 <?php
4527 endforeach;
4528 ?>
4529 </select>
4530 </div>
4531 </div> <!-- Animation easing -->
4532 <div>
4533 </div>
4534 </div>
4535 <?php
4536 $content = ob_get_clean();
4537
4538 $title = __( 'Chart animation', "chart-builder" );
4539
4540 $sources['animation'] = array(
4541 'content' => $content,
4542 'title' => $title
4543 );
4544
4545 return $sources;
4546 }
4547
4548 public function settings_contents_live_chart_settings( $sources, $args ) {
4549 $html_class_prefix = $args['html_class_prefix'];
4550 $html_name_prefix = $args['html_name_prefix'];
4551
4552 ob_start();
4553 ?>
4554 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-live-chart-settings-tab">
4555 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4556 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4557 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4558 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4559 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
4560 <div class="ays-pro-features-v2-video-text">
4561 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4562 </div>
4563 </a>
4564 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4565 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
4566 <div class="ays-pro-features-v2-upgrade-text">
4567 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4568 </div>
4569 </a>
4570 </div>
4571 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4572 <label for="ays-chart-option-enable-live-chart">
4573 <?php echo esc_html(__( "Enable live chart", "chart-builder" )); ?>
4574 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If you enable this option, the chart data will be dynamically updated on the front end. Note: If the option is enabled, the chart data will be periodically updated (e.g., once in 3 seconds) without refreshing the page..","chart-builder") ); ?>">
4575 <i class="ays_fa ays_fa_info_circle"></i>
4576 </a>
4577 </label>
4578 </div>
4579 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4580 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4581 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch <?php echo esc_attr($html_class_prefix) ?>toggle-hidden-option" id="ays-chart-option-enable-live-chart" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_live_chart]" value="on">
4582 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4583 </label>
4584 </div>
4585 </div> <!-- Enable live chart -->
4586 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4587 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4588 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4589 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
4590 <div class="ays-pro-features-v2-video-text">
4591 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4592 </div>
4593 </a>
4594 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4595 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
4596 <div class="ays-pro-features-v2-upgrade-text">
4597 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4598 </div>
4599 </a>
4600 </div>
4601 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4602 <label for="ays-chart-option-live-chart-interval" class="form-label">
4603 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
4604 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the time intervals to update the chart on the front end (e.g., once in 3 seconds). The option works via milliseconds. Note: The minimum interval must be 3000 milliseconds.","chart-builder") ); ?>">
4605 <i class="ays_fa ays_fa_info_circle"></i>
4606 </a>
4607 </label>
4608 </div>
4609 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4610 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-live-chart-interval" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[live_chart_interval]" value="" min="3000">
4611 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">ms</div>
4612 </div>
4613 </div> <!-- Live chart interval -->
4614 </div>
4615 </div>
4616 <?php
4617 $content = ob_get_clean();
4618
4619 $title = __( 'Live Chart', "chart-builder" );
4620
4621 $sources['live_chart'] = array(
4622 'content' => $content,
4623 'title' => $title
4624 );
4625
4626 return $sources;
4627
4628 }
4629
4630 public function settings_contents_export_options( $sources, $args ){
4631 $html_class_prefix = $args['html_class_prefix'];
4632 $html_name_prefix = $args['html_name_prefix'];
4633 $settings = $args['settings'];
4634
4635 $enable_img = $settings['enable_img'];
4636
4637 ob_start();
4638 ?>
4639 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-export-tab cb-changable-tab cb-pie_chart-tab cb-donut_chart-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
4640 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4641 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4642 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4643 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4644 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
4645 <div class="ays-pro-features-v2-video-text">
4646 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4647 </div>
4648 </a>
4649 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4650 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
4651 <div class="ays-pro-features-v2-upgrade-text">
4652 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4653 </div>
4654 </a>
4655 </div>
4656 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4657 <label for="ays-chart-option-export-print">
4658 <?php echo esc_html(__( "Print chart", "chart-builder" )); ?>
4659 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the toggle and the users can print the chart data.","chart-builder") ); ?>">
4660 <i class="ays_fa ays_fa_info_circle"></i>
4661 </a>
4662 </label>
4663 </div>
4664 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4665 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4666 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-print" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_print]" value="on">
4667 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4668 </label>
4669 </div>
4670 </div> <!-- Print option end -->
4671 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4672 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4673 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4674 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
4675 <div class="ays-pro-features-v2-video-text">
4676 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4677 </div>
4678 </a>
4679 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4680 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
4681 <div class="ays-pro-features-v2-upgrade-text">
4682 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4683 </div>
4684 </a>
4685 </div>
4686 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4687 <label for="ays-chart-option-export-Excel">
4688 <?php echo esc_html(__( "Excel download", "chart-builder" )); ?>
4689 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the toggle and the users can export the chart data in Excel file format.","chart-builder") ); ?>">
4690 <i class="ays_fa ays_fa_info_circle"></i>
4691 </a>
4692 </label>
4693 </div>
4694 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4695 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4696 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-excel" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_excel]" value="on">
4697 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4698 </label>
4699 </div>
4700 </div> <!-- Excel option end -->
4701 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4702 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4703 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4704 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
4705 <div class="ays-pro-features-v2-video-text">
4706 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4707 </div>
4708 </a>
4709 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4710 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
4711 <div class="ays-pro-features-v2-upgrade-text">
4712 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4713 </div>
4714 </a>
4715 </div>
4716 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4717 <label for="ays-chart-option-export-CSV">
4718 <?php echo esc_html(__( "CSV download", "chart-builder" )); ?>
4719 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the toggle and the users can export the chart data in CSV file format.","chart-builder") ); ?>">
4720 <i class="ays_fa ays_fa_info_circle"></i>
4721 </a>
4722 </label>
4723 </div>
4724 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4725 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4726 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-csv" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_csv]" value="on">
4727 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4728 </label>
4729 </div>
4730 </div> <!-- CSV option end -->
4731 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4732 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4733 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4734 <div class="ays-pro-features-v2-video-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Video_24x24_Hover.svg"></div>
4735 <div class="ays-pro-features-v2-video-text">
4736 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4737 </div>
4738 </a>
4739 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4740 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
4741 <div class="ays-pro-features-v2-upgrade-text">
4742 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4743 </div>
4744 </a>
4745 </div>
4746 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4747 <label for="ays-chart-option-export-Copy">
4748 <?php echo esc_html(__( "Copy chart data", "chart-builder" )); ?>
4749 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the toggle and the users can copy the chart data (CTRL+C, CTRL+V).","chart-builder") ); ?>">
4750 <i class="ays_fa ays_fa_info_circle"></i>
4751 </a>
4752 </label>
4753 </div>
4754 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4755 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4756 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-copy" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_copy]" value="on">
4757 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4758 </label>
4759 </div>
4760 </div> <!-- Copy option end -->
4761 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt cb-line_chart-opt cb-bar_chart-opt cb-column_chart-opt display_none">
4762 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4763 <label for="ays-chart-option-export-img">
4764 <?php echo esc_html(__( "Download chart image", "chart-builder" )); ?>
4765 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the toggle and the users can download the chart as an image.","chart-builder") ); ?>">
4766 <i class="ays_fa ays_fa_info_circle"></i>
4767 </a>
4768 </label>
4769 </div>
4770 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4771 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4772 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-img" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_img]" value="on" <?php echo esc_attr($enable_img)?> >
4773 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4774 </label>
4775 </div>
4776 </div> <!-- IMG option end -->
4777 </div>
4778 </div>
4779 <?php
4780
4781 $content = ob_get_clean();
4782
4783 $title = __( 'Frontend Actions', "chart-builder" );
4784
4785 $sources['export_options'] = array(
4786 'content' => $content,
4787 'title' => $title
4788 );
4789
4790 return $sources;
4791 }
4792
4793 /**
4794 * Chart page styles contents
4795 * @param $args
4796 */
4797 public function ays_chart_page_styles_contents( $args ){
4798 $chart_source_type = $args['chart_source_type'];
4799
4800 if ($chart_source_type === 'chart-js') {
4801 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings_chartjs', array(), $args );
4802 } else {
4803 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings', array(), $args );
4804 }
4805
4806 $sources = array();
4807 foreach ( $sources_contents as $key => $sources_content ) {
4808 $collapsed = $key == 'chart' ? 'false' : 'true';
4809
4810 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
4811 if(isset($sources_content['title'])){
4812 $content .= '<legend class="ays-accordion-options-header">';
4813 $content .= '<svg class="ays-accordion-arrow '. ( $key == 'chart' ? 'ays-accordion-arrow-down' : 'ays-accordion-arrow-right' ) .'" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
4814 <g>
4815 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: '. ( $key == 'chart' ? '#008cff' : '#c4c4c4' ) .';" vector-effect="non-scaling-stroke" />
4816 </g>
4817 </svg>';
4818
4819 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
4820 }
4821
4822 $content .= '<div class="ays-accordion-options-content">';
4823 $content .= $sources_content['content'];
4824 $content .= '</div>';
4825
4826 $content .= '</fieldset>';
4827
4828 $sources[] = $content;
4829 }
4830 $content_for_escape = implode('' , $sources );
4831 echo html_entity_decode( esc_html($content_for_escape) );
4832 }
4833
4834 public function settings_contents_chart_styles_settings( $sources, $args ){
4835 $html_class_prefix = $args['html_class_prefix'];
4836 $html_name_prefix = $args['html_name_prefix'];
4837 $settings = $args['settings'];
4838
4839 $width = $settings['width'];
4840 $width_format = $settings['width_format'];
4841 $title_positions = $settings['title_positions'];
4842 $position = $settings['position'];
4843 $width_format_options = $settings['width_format_options'];
4844 $responsive_width = $settings['responsive_width'];
4845 $height = $settings['height'];
4846 $height_format = $settings['height_format'];
4847 $font_size = $settings['font_size'];
4848 $org_chart_font_size_options = $settings['org_chart_font_size_options'];
4849 $org_chart_font_size = $settings['org_chart_font_size'];
4850 $background_color = $settings['background_color'];
4851 $transparent_background = $settings['transparent_background'];
4852 $border_width = $settings['border_width'];
4853 $border_width_with_title = $settings['border_width_with_title'];
4854 $border_radius_with_title = $settings['border_radius_with_title'];
4855 $border_color_with_title = $settings['border_color_with_title'];
4856 $border_style_with_title = $settings['border_style_with_title'];
4857 $border_style = $settings['border_style'];
4858 $border_styles = $settings['border_styles'];
4859 $border_radius = $settings['border_radius'];
4860 $border_color = $settings['border_color'];
4861 $box_shadow = $settings['box_shadow'];
4862 $box_shadow_color = $settings['box_shadow_color'];
4863 $padding_outer = $settings['padding_outer'];
4864 ob_start();
4865 ?>
4866 <div class="ays-accordion-data-main-wrap">
4867 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4868 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4869 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4870 <label for="ays-chart-option-width" class="form-label">
4871 <?php echo esc_html(__( "Width", "chart-builder" )); ?>
4872 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container, in percents.","chart-builder") ); ?>">
4873 <i class="ays_fa ays_fa_info_circle"></i>
4874 </a>
4875 </label>
4876 </div>
4877 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4878 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[width]" value="<?php echo esc_attr($width) ?>">
4879 <select class="<?php echo esc_attr($html_class_prefix) ?>option-width-format-change <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-width-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[width_format]">
4880 <?php
4881 foreach ( $width_format_options as $option_slug => $option ):
4882 $selected = ( $width_format == $option_slug ) ? 'selected' : '';
4883 ?>
4884 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4885 <?php
4886 endforeach;
4887 ?>
4888 </select>
4889 </div>
4890 </div> <!-- Width -->
4891 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4892 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4893 <label for="ays-chart-option-responsive-width" class="form-label">
4894 <?php echo esc_html(__( "Responsive Width", "chart-builder" )); ?>
4895 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to keep the chart's width fixed at 100%, no matter what is set for the Width option. This makes the chart more responsive.","chart-builder") ); ?>">
4896 <i class="ays_fa ays_fa_info_circle"></i>
4897 </a>
4898 </label>
4899 </div>
4900 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4901 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4902 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-responsive-width" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[responsive_width]" value="on" <?php echo esc_attr($responsive_width); ?> >
4903 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4904 </label>
4905 </div>
4906 </div> <!-- Responsive Width -->
4907 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4908 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4909 <label for="ays-chart-option-position">
4910 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4911 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart. Note: The changes will be visible when the width option is not set to 100%","chart-builder") ); ?>">
4912 <i class="ays_fa ays_fa_info_circle"></i>
4913 </a>
4914 </label>
4915 </div>
4916 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4917 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[position]">
4918 <?php
4919 foreach ( $title_positions as $option_slug => $option ):
4920 $selected = ( $position == $option_slug ) ? 'selected' : '';
4921 ?>
4922 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4923 <?php
4924 endforeach;
4925 ?>
4926 </select>
4927 </div>
4928 </div> <!-- Position -->
4929 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4930 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4931 <label for="ays-chart-option-height" class="form-label">
4932 <?php echo esc_html(__( "Height", "chart-builder" )); ?>
4933 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The height of the chart container, in pixels.","chart-builder") ); ?>">
4934 <i class="ays_fa ays_fa_info_circle"></i>
4935 </a>
4936 </label>
4937 </div>
4938 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4939 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-height" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[height]" value="<?php echo esc_attr($height) ?>">
4940 <select class="<?php echo esc_attr($html_class_prefix) ?>option-width-format-change <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-height-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[height_format]">
4941 <?php
4942 foreach ( $width_format_options as $option_slug => $option ):
4943 $selected = ( $height_format == $option_slug ) ? 'selected' : '';
4944 ?>
4945 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4946 <?php
4947 endforeach;
4948 ?>
4949 </select>
4950 </div>
4951 </div> <!-- Height -->
4952 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
4953 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4954 <label for="ays-chart-option-font-size" class="form-label">
4955 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4956 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart text.","chart-builder") ); ?>">
4957 <i class="ays_fa ays_fa_info_circle"></i>
4958 </a>
4959 </label>
4960 </div>
4961 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4962 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[font_size]" value="<?php echo esc_attr($font_size) ?>">
4963 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
4964 </div>
4965 </div> <!-- Font size -->
4966 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
4967 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4968 <label for="ays-chart-option-org-chart-font-size" class="form-label">
4969 <?php echo esc_html(__( "Element size", 'chart-builder' )); ?>
4970 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The size of the chart element.","chart-builder") ); ?>">
4971 <i class="ays_fa ays_fa_info_circle"></i>
4972 </a>
4973 </label>
4974 </div>
4975 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4976 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-org-chart-font-size" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_chart_font_size]">
4977 <?php
4978 foreach ( $org_chart_font_size_options as $option_slug => $option ):
4979 $selected = ( $org_chart_font_size == $option_slug ) ? 'selected' : '';
4980 ?>
4981 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_attr($option); ?></option>
4982 <?php
4983 endforeach;
4984 ?>
4985 </select>
4986 </div>
4987 </div> <!-- Font size for org type -->
4988 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
4989 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4990 <label for="ays-chart-option-background-color">
4991 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
4992 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The background color of the chart container.","chart-builder") ); ?>">
4993 <i class="ays_fa ays_fa_info_circle"></i>
4994 </a>
4995 </label>
4996 </div>
4997 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4998 <input id="ays-chart-option-background-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[background_color]" value="<?php echo esc_attr($background_color) ?>">
4999 </div>
5000 </div> <!-- Background color -->
5001 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5002 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5003 <label for="ays-chart-option-transparent-background" class="form-label">
5004 <?php echo esc_html(__( "Transparent background", "chart-builder" )); ?>
5005 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart's background transparent. When enabled, both Background Color and Chart Area Background Color options will not work","chart-builder") ); ?>">
5006 <i class="ays_fa ays_fa_info_circle"></i>
5007 </a>
5008 </label>
5009 </div>
5010 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5011 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5012 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-transparent-background" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[transparent_background]" value="on" <?php echo esc_attr($transparent_background); ?> >
5013 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5014 </label>
5015 </div>
5016 </div> <!-- Transparent background -->
5017 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5018 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5019 <label for="ays-chart-option-border-width">
5020 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5021 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border.","chart-builder") ); ?>">
5022 <i class="ays_fa ays_fa_info_circle"></i>
5023 </a>
5024 </label>
5025 </div>
5026 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5027 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_width]" value="<?php echo esc_attr($border_width) ?>">
5028 </div>
5029 </div> <!-- Border Width -->
5030 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5031 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5032 <label for="ays-chart-option-border-color">
5033 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5034 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart container.","chart-builder") ); ?>">
5035 <i class="ays_fa ays_fa_info_circle"></i>
5036 </a>
5037 </label>
5038 </div>
5039 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5040 <input id="ays-chart-option-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_color]" value="<?php echo esc_attr($border_color) ?>">
5041 </div>
5042 </div> <!-- Border color -->
5043 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5044 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5045 <label for="ays-chart-option-border-radius">
5046 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
5047 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border radius of the chart container.","chart-builder") ); ?>">
5048 <i class="ays_fa ays_fa_info_circle"></i>
5049 </a>
5050 </label>
5051 </div>
5052 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5053 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-radius" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_radius]" value="<?php echo esc_attr($border_radius) ?>">
5054 </div>
5055 </div> <!-- Border radius -->
5056 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5057 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5058 <label for="ays-chart-option-border-style">
5059 <?php echo esc_html(__( "Border Style", "chart-builder" )); ?>
5060 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border.","chart-builder") ); ?>">
5061 <i class="ays_fa ays_fa_info_circle"></i>
5062 </a>
5063 </label>
5064 </div>
5065 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5066 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-border-style" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_style]">
5067 <?php
5068 foreach ( $border_styles as $option_slug => $option ):
5069 $selected = ( $border_style == $option_slug ) ? 'selected' : '';
5070 ?>
5071 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5072 <?php
5073 endforeach;
5074 ?>
5075 </select>
5076 </div>
5077 </div> <!-- Border style -->
5078 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5079 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5080 <label for="ays-chart-option-box-shadow" class="form-label">
5081 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
5082 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add shadow to chart's container.","chart-builder") ); ?>">
5083 <i class="ays_fa ays_fa_info_circle"></i>
5084 </a>
5085 </label>
5086 </div>
5087 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5088 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5089 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-box-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[box_shadow]" value="on" <?php echo esc_attr($box_shadow); ?> >
5090 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5091 </label>
5092 </div>
5093 </div> <!-- box shadow -->
5094 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5095 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5096 <label for="ays-chart-option-box-shadow-color" class="form-label">
5097 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
5098 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
5099 <i class="ays_fa ays_fa_info_circle"></i>
5100 </a>
5101 </label>
5102 </div>
5103 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5104 <input id="ays-chart-option-box-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[box_shadow_color]" value="<?php echo esc_attr($box_shadow_color) ?>">
5105 </div>
5106 </div> <!-- box shadow color -->
5107 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5108 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5109 <label for="ays-chart-option-border-width-with-title">
5110 <?php echo esc_html(__( "Border Width (including title)", "chart-builder" )); ?>
5111 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border including chart title and description.","chart-builder") ); ?>">
5112 <i class="ays_fa ays_fa_info_circle"></i>
5113 </a>
5114 </label>
5115 </div>
5116 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5117 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-width-with-title" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_width_with_title]" value="<?php echo esc_attr($border_width_with_title) ?>">
5118 </div>
5119 </div> <!-- Border Width with title -->
5120 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5121 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5122 <label for="ays-chart-option-border-radius-with-title">
5123 <?php echo esc_html(__( "Border radius (including title)", "chart-builder" )); ?>
5124 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The radius of the chart container border including chart title and description.","chart-builder") ); ?>">
5125 <i class="ays_fa ays_fa_info_circle"></i>
5126 </a>
5127 </label>
5128 </div>
5129 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5130 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-radius-with-title" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_radius_with_title]" value="<?php echo esc_attr($border_radius_with_title) ?>">
5131 </div>
5132 </div> <!-- Border radius with title -->
5133 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5134 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5135 <label for="ays-chart-option-border-color-with-title">
5136 <?php echo esc_html(__( "Border Color (including title)", "chart-builder" )); ?>
5137 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart container border including chart title and description.","chart-builder") ); ?>">
5138 <i class="ays_fa ays_fa_info_circle"></i>
5139 </a>
5140 </label>
5141 </div>
5142 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5143 <input id="ays-chart-option-border-color-with-title" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_color_with_title]" value="<?php echo esc_attr($border_color_with_title) ?>">
5144 </div>
5145 </div> <!-- Border color with title -->
5146 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5147 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5148 <label for="ays-chart-option-border-style-with-title">
5149 <?php echo esc_html(__( "Border Style (including title)", "chart-builder" )); ?>
5150 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border including chart title and description.","chart-builder") ); ?>">
5151 <i class="ays_fa ays_fa_info_circle"></i>
5152 </a>
5153 </label>
5154 </div>
5155 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5156 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-border-style-with-title" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_style_with_title]">
5157 <?php
5158 foreach ( $border_styles as $option_slug => $option ):
5159 $selected = ( $border_style_with_title == $option_slug ) ? 'selected' : '';
5160 ?>
5161 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5162 <?php
5163 endforeach;
5164 ?>
5165 </select>
5166 </div>
5167 </div> <!-- Border style with title -->
5168 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt cb-donut_chart-opt">
5169 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5170 <label for="ays-chart-option-padding-outer">
5171 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
5172 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The padding of the chart container.","chart-builder") ); ?>">
5173 <i class="ays_fa ays_fa_info_circle"></i>
5174 </a>
5175 </label>
5176 </div>
5177 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5178 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-padding-outer" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[padding_outer]" value="<?php echo esc_attr($padding_outer) ?>">
5179 </div>
5180 </div> <!-- Padding outer -->
5181 </div>
5182 </div>
5183 <?php
5184 $content = ob_get_clean();
5185
5186 $title = __( 'Chart', "chart-builder" );
5187
5188 $sources['chart'] = array(
5189 'content' => $content,
5190 'title' => $title
5191 );
5192
5193 return $sources;
5194 }
5195
5196 public function settings_contents_chart_styles_settings_chartjs( $sources, $args ){
5197 $html_class_prefix = $args['html_class_prefix'];
5198 $html_name_prefix = $args['html_name_prefix'];
5199 $settings = $args['settings'];
5200
5201 $border_width = $settings['border_width'];
5202 $border_radius = $settings['border_radius'];
5203 $border_color = $settings['border_color'];
5204 $border_style = $settings['border_style'];
5205 $border_styles = $settings['border_styles'];
5206 $box_shadow = $settings['box_shadow'];
5207 ob_start();
5208 ?>
5209 <div class="ays-accordion-data-main-wrap">
5210 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5211 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5212 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5213 <label for="ays-chart-option-border-width">
5214 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5215 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border.","chart-builder") ); ?>">
5216 <i class="ays_fa ays_fa_info_circle"></i>
5217 </a>
5218 </label>
5219 </div>
5220 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5221 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_width]" value="<?php echo esc_attr($border_width) ?>">
5222 </div>
5223 </div> <!-- Border Width -->
5224 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5225 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5226 <label for="ays-chart-option-border-radius">
5227 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
5228 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The radius of the chart container border.","chart-builder") ); ?>">
5229 <i class="ays_fa ays_fa_info_circle"></i>
5230 </a>
5231 </label>
5232 </div>
5233 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5234 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-radius" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_radius]" value="<?php echo esc_attr($border_radius) ?>">
5235 </div>
5236 </div> <!-- Border Radius -->
5237 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5238 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5239 <label for="ays-chart-option-border-color">
5240 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5241 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart container.","chart-builder") ); ?>">
5242 <i class="ays_fa ays_fa_info_circle"></i>
5243 </a>
5244 </label>
5245 </div>
5246 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5247 <input id="ays-chart-option-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_color]" value="<?php echo esc_attr($border_color) ?>">
5248 </div>
5249 </div> <!-- Border color -->
5250 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5251 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5252 <label for="ays-chart-option-border-style">
5253 <?php echo esc_html(__( "Border Style", "chart-builder" )); ?>
5254 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border.","chart-builder") ); ?>">
5255 <i class="ays_fa ays_fa_info_circle"></i>
5256 </a>
5257 </label>
5258 </div>
5259 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5260 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-border-style" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_style]">
5261 <?php
5262 foreach ( $border_styles as $option_slug => $option ):
5263 $selected = ( $border_style == $option_slug ) ? 'selected' : '';
5264 ?>
5265 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5266 <?php
5267 endforeach;
5268 ?>
5269 </select>
5270 </div>
5271 </div> <!-- Border style -->
5272 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5273 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5274 <label for="ays-chart-option-box-shadow" class="form-label">
5275 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
5276 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add shadow to chart's container.","chart-builder") ); ?>">
5277 <i class="ays_fa ays_fa_info_circle"></i>
5278 </a>
5279 </label>
5280 </div>
5281 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5282 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5283 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-box-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[box_shadow]" value="on" <?php echo esc_attr($box_shadow); ?> >
5284 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5285 </label>
5286 </div>
5287 </div> <!-- box shadow -->
5288 </div>
5289 </div>
5290 <?php
5291 $content = ob_get_clean();
5292
5293 $title = __( 'Chart', "chart-builder" );
5294
5295 $sources['chart'] = array(
5296 'content' => $content,
5297 'title' => $title
5298 );
5299
5300 return $sources;
5301 }
5302
5303 public function settings_contents_chart_area_styles_settings( $sources, $args ){
5304 $html_class_prefix = $args['html_class_prefix'];
5305 $html_name_prefix = $args['html_name_prefix'];
5306 $settings = $args['settings'];
5307
5308 $chart_background_color = $settings['chart_background_color'];
5309 $chart_border_color = $settings['chart_border_color'];
5310 $chart_left_margin = $settings['chart_left_margin'];
5311 $chart_right_margin = $settings['chart_right_margin'];
5312 $chart_top_margin = $settings['chart_top_margin'];
5313 $chart_bottom_margin = $settings['chart_bottom_margin'];
5314 $chart_border_width = $settings['chart_border_width'];
5315 ob_start();
5316 ?>
5317 <div class="ays-accordion-data-main-wrap">
5318 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap cb-changable-tab cb-pie_chart-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab cb-donut_chart-tab">
5319 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt">
5320 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5321 <label for="ays-chart-option-chart-background-color">
5322 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
5323 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The background color of the chart area.","chart-builder") ); ?>">
5324 <i class="ays_fa ays_fa_info_circle"></i>
5325 </a>
5326 </label>
5327 </div>
5328 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5329 <input id="ays-chart-option-chart-background-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_background_color]" value="<?php echo esc_attr($chart_background_color) ?>">
5330 </div>
5331 </div> <!-- Chart Area background color -->
5332 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt">
5333 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5334 <label for="ays-chart-option-chart-border-width">
5335 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5336 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border width of the chart area.","chart-builder") ); ?>">
5337 <i class="ays_fa ays_fa_info_circle"></i>
5338 </a>
5339 </label>
5340 </div>
5341 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5342 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-chart-border-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_border_width]" value="<?php echo esc_attr($chart_border_width) ?>">
5343 </div>
5344 </div> <!-- Chart Area Border Width -->
5345 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt">
5346 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5347 <label for="ays-chart-option-chart-border-color">
5348 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5349 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart area.","chart-builder") ); ?>">
5350 <i class="ays_fa ays_fa_info_circle"></i>
5351 </a>
5352 </label>
5353 </div>
5354 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5355 <input id="ays-chart-option-chart-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_border_color]" value="<?php echo esc_attr($chart_border_color) ?>">
5356 </div>
5357 </div> <!-- Chart Area border color -->
5358 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5359 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5360 <label for="ays-chart-option-chart-left-margin">
5361 <?php echo esc_html(__( "Left Margin", "chart-builder" )); ?>
5362 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the chart's distance from the left border. Leave blank for auto-positioning.","chart-builder") ); ?>">
5363 <i class="ays_fa ays_fa_info_circle"></i>
5364 </a>
5365 </label>
5366 </div>
5367 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5368 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-chart-left-margin" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_left_margin]" value="<?php echo esc_attr($chart_left_margin) ?>">
5369 </div>
5370 </div> <!-- Chart Area Left Margin -->
5371 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5372 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5373 <label for="ays-chart-option-chart-right-margin">
5374 <?php echo esc_html(__( "Right Margin", "chart-builder" )); ?>
5375 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the chart's distance from the right border. Leave blank for auto-positioning.","chart-builder") ); ?>">
5376 <i class="ays_fa ays_fa_info_circle"></i>
5377 </a>
5378 </label>
5379 </div>
5380 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5381 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-chart-right-margin" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_right_margin]" value="<?php echo esc_attr($chart_right_margin) ?>">
5382 </div>
5383 </div> <!-- Chart Area Right Margin -->
5384 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5385 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5386 <label for="ays-chart-option-chart-top-margin">
5387 <?php echo esc_html(__( "Top Margin", "chart-builder" )); ?>
5388 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the chart's distance from the top border. Leave blank for auto-positioning.","chart-builder") ); ?>">
5389 <i class="ays_fa ays_fa_info_circle"></i>
5390 </a>
5391 </label>
5392 </div>
5393 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5394 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-chart-top-margin" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_top_margin]" value="<?php echo esc_attr($chart_top_margin) ?>">
5395 </div>
5396 </div> <!-- Chart Area Top Margin -->
5397 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5398 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5399 <label for="ays-chart-option-chart-bottom-margin">
5400 <?php echo esc_html(__( "Bottom Margin", "chart-builder" )); ?>
5401 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the chart's distance from the bottom border. Leave blank for auto-positioning.","chart-builder") ); ?>">
5402 <i class="ays_fa ays_fa_info_circle"></i>
5403 </a>
5404 </label>
5405 </div>
5406 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5407 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-chart-bottom-margin" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[chart_bottom_margin]" value="<?php echo esc_attr($chart_bottom_margin) ?>">
5408 </div>
5409 </div> <!-- Chart Area Bottom Margin -->
5410 </div>
5411 </div>
5412 <?php
5413 $content = ob_get_clean();
5414
5415 $title = __( 'Chart Area', "chart-builder" );
5416
5417 $sources['chart_area'] = array(
5418 'content' => $content,
5419 'title' => $title
5420 );
5421
5422 return $sources;
5423 }
5424
5425 public function settings_contents_title_styles_settings( $sources, $args ){
5426 $html_class_prefix = $args['html_class_prefix'];
5427 $html_name_prefix = $args['html_name_prefix'];
5428 $settings = $args['settings'];
5429
5430 $title_color = $settings['title_color'];
5431 $title_shadow_color = $settings['title_shadow_color'];
5432 $title_font_size = $settings['title_font_size'];
5433 $title_gap = $settings['title_gap'];
5434 $title_gap_description = $settings['title_gap_description'];
5435 $title_positions = $settings['title_positions'];
5436 $title_position = $settings['title_position'];
5437 $title_bold = $settings['title_bold'];
5438 $title_text_shadow = $settings['title_text_shadow'];
5439 $title_italic = $settings['title_italic'];
5440 $text_transforms = $settings['text_transforms'];
5441 $text_decorations = $settings['text_decorations'];
5442 $title_text_transform = $settings['title_text_transform'];
5443 $title_text_decoration = $settings['title_text_decoration'];
5444 $title_letter_spacing = $settings['title_letter_spacing'];
5445 ob_start();
5446 ?>
5447 <div class="ays-accordion-data-main-wrap">
5448 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5449 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5450 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5451 <label for="ays-chart-option-title-color">
5452 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5453 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart title.","chart-builder") ); ?>">
5454 <i class="ays_fa ays_fa_info_circle"></i>
5455 </a>
5456 </label>
5457 </div>
5458 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5459 <input id="ays-chart-option-title-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_color]" value="<?php echo esc_attr($title_color) ?>">
5460 </div>
5461 </div> <!-- Chart title color -->
5462 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5463 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5464 <label for="ays-chart-option-title-font-size" class="form-label">
5465 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5466 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart title.","chart-builder") ); ?>">
5467 <i class="ays_fa ays_fa_info_circle"></i>
5468 </a>
5469 </label>
5470 </div>
5471 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5472 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_font_size]" value="<?php echo esc_attr($title_font_size) ?>">
5473 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5474 </div>
5475 </div> <!-- Chart title font size -->
5476 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5477 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5478 <label for="ays-chart-option-title-bold" class="form-label">
5479 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5480 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
5481 <i class="ays_fa ays_fa_info_circle"></i>
5482 </a>
5483 </label>
5484 </div>
5485 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5486 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5487 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_bold]" value="on" <?php echo esc_attr($title_bold); ?> >
5488 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5489 </label>
5490 </div>
5491 </div> <!-- Title bold -->
5492 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5493 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5494 <label for="ays-chart-option-title-italic" class="form-label">
5495 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5496 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
5497 <i class="ays_fa ays_fa_info_circle"></i>
5498 </a>
5499 </label>
5500 </div>
5501 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5502 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5503 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_italic]" value="on" <?php echo esc_attr($title_italic); ?> >
5504 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5505 </label>
5506 </div>
5507 </div> <!-- Title italic -->
5508 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5509 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5510 <label for="ays-chart-option-title-position">
5511 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5512 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart title.","chart-builder") ); ?>">
5513 <i class="ays_fa ays_fa_info_circle"></i>
5514 </a>
5515 </label>
5516 </div>
5517 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5518 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_position]">
5519 <?php
5520 foreach ( $title_positions as $option_slug => $option ):
5521 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5522 ?>
5523 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5524 <?php
5525 endforeach;
5526 ?>
5527 </select>
5528 </div>
5529 </div> <!-- Title position -->
5530 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5531 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5532 <label for="ays-chart-option-title-gap" class="form-label">
5533 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5534 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title and the chart container.","chart-builder") ); ?>">
5535 <i class="ays_fa ays_fa_info_circle"></i>
5536 </a>
5537 </label>
5538 </div>
5539 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5540 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-gap" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_gap]" value="<?php echo esc_attr($title_gap) ?>">
5541 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5542 </div>
5543 </div> <!-- Chart title gap -->
5544 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5545 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5546 <label for="ays-chart-option-title-gap-description" class="form-label">
5547 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5548 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title and the chart description.","chart-builder") ); ?>">
5549 <i class="ays_fa ays_fa_info_circle"></i>
5550 </a>
5551 </label>
5552 </div>
5553 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5554 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-gap-description" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_gap_description]" value="<?php echo esc_attr($title_gap_description) ?>">
5555 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5556 </div>
5557 </div> <!-- Chart title gap -->
5558 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5559 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5560 <label for="ays-chart-option-title-text-transform">
5561 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5562 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5563 <i class="ays_fa ays_fa_info_circle"></i>
5564 </a>
5565 </label>
5566 </div>
5567 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5568 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-text-transform" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_transform]">
5569 <?php
5570 foreach ( $text_transforms as $option_slug => $option ):
5571 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5572 ?>
5573 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5574 <?php
5575 endforeach;
5576 ?>
5577 </select>
5578 </div>
5579 </div> <!-- Title text transform -->
5580 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5581 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5582 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5583 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5584 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5585 <i class="ays_fa ays_fa_info_circle"></i>
5586 </a>
5587 </label>
5588 </div>
5589 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5590 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-letter-spacing" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_letter_spacing]" value="<?php echo esc_attr($title_letter_spacing) ?>">
5591 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5592 </div>
5593 </div> <!-- Chart title letter spacing -->
5594 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5595 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5596 <label for="ays-chart-option-title-text-decoration">
5597 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5598 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5599 <i class="ays_fa ays_fa_info_circle"></i>
5600 </a>
5601 </label>
5602 </div>
5603 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5604 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-text-decoration" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_decoration]">
5605 <?php
5606 foreach ( $text_decorations as $option_slug => $option ):
5607 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5608 ?>
5609 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5610 <?php
5611 endforeach;
5612 ?>
5613 </select>
5614 </div>
5615 </div> <!-- Title text decoration -->
5616 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5617 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5618 <label for="ays-chart-option-title-text-shadow" class="form-label">
5619 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5620 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add a text shadow to chart title.","chart-builder") ); ?>">
5621 <i class="ays_fa ays_fa_info_circle"></i>
5622 </a>
5623 </label>
5624 </div>
5625 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5626 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5627 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-text-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_shadow]" value="on" <?php echo esc_attr($title_text_shadow); ?> >
5628 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5629 </label>
5630 </div>
5631 </div> <!-- Title bold -->
5632 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5633 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5634 <label for="ays-chart-option-title-shadow-color">
5635 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5636 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5637 <i class="ays_fa ays_fa_info_circle"></i>
5638 </a>
5639 </label>
5640 </div>
5641 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5642 <input id="ays-chart-option-title-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_shadow_color]" value="<?php echo esc_attr($title_shadow_color) ?>">
5643 </div>
5644 </div> <!-- Chart title color -->
5645 </div>
5646 </div>
5647 <?php
5648 $content = ob_get_clean();
5649
5650 $title = __( 'Title', "chart-builder" );
5651
5652 $sources['title'] = array(
5653 'content' => $content,
5654 'title' => $title
5655 );
5656
5657 return $sources;
5658 }
5659
5660 public function settings_contents_title_styles_settings_chartjs( $sources, $args ){
5661 $html_class_prefix = $args['html_class_prefix'];
5662 $html_name_prefix = $args['html_name_prefix'];
5663 $settings = $args['settings'];
5664
5665 $title_color = $settings['title_color'];
5666 $title_shadow_color = $settings['title_shadow_color'];
5667 $title_font_size = $settings['title_font_size'];
5668 $title_gap = $settings['title_gap'];
5669 $title_gap_description = $settings['title_gap_description'];
5670 $title_positions = $settings['title_positions'];
5671 $title_position = $settings['title_position'];
5672 $title_bold = $settings['title_bold'];
5673 $title_text_shadow = $settings['title_text_shadow'];
5674 $title_italic = $settings['title_italic'];
5675 $text_transforms = $settings['text_transforms'];
5676 $text_decorations = $settings['text_decorations'];
5677 $title_text_transform = $settings['title_text_transform'];
5678 $title_text_decoration = $settings['title_text_decoration'];
5679 $title_letter_spacing = $settings['title_letter_spacing'];
5680 ob_start();
5681 ?>
5682 <div class="ays-accordion-data-main-wrap">
5683 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5684 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5685 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5686 <label for="ays-chart-option-title-color">
5687 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5688 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart title.","chart-builder") ); ?>">
5689 <i class="ays_fa ays_fa_info_circle"></i>
5690 </a>
5691 </label>
5692 </div>
5693 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5694 <input id="ays-chart-option-title-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_color]" value="<?php echo esc_attr($title_color) ?>">
5695 </div>
5696 </div> <!-- Chart title color -->
5697 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5698 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5699 <label for="ays-chart-option-title-font-size" class="form-label">
5700 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5701 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart title.","chart-builder") ); ?>">
5702 <i class="ays_fa ays_fa_info_circle"></i>
5703 </a>
5704 </label>
5705 </div>
5706 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5707 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_font_size]" value="<?php echo esc_attr($title_font_size) ?>">
5708 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5709 </div>
5710 </div> <!-- Chart title font size -->
5711 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5712 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5713 <label for="ays-chart-option-title-bold" class="form-label">
5714 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5715 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
5716 <i class="ays_fa ays_fa_info_circle"></i>
5717 </a>
5718 </label>
5719 </div>
5720 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5721 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5722 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_bold]" value="on" <?php echo esc_attr($title_bold); ?> >
5723 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5724 </label>
5725 </div>
5726 </div> <!-- Title bold -->
5727 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5728 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5729 <label for="ays-chart-option-title-italic" class="form-label">
5730 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5731 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
5732 <i class="ays_fa ays_fa_info_circle"></i>
5733 </a>
5734 </label>
5735 </div>
5736 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5737 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5738 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_italic]" value="on" <?php echo esc_attr($title_italic); ?> >
5739 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5740 </label>
5741 </div>
5742 </div> <!-- Title italic -->
5743 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5744 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5745 <label for="ays-chart-option-title-position">
5746 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5747 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart title.","chart-builder") ); ?>">
5748 <i class="ays_fa ays_fa_info_circle"></i>
5749 </a>
5750 </label>
5751 </div>
5752 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5753 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_position]">
5754 <?php
5755 foreach ( $title_positions as $option_slug => $option ):
5756 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5757 ?>
5758 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5759 <?php
5760 endforeach;
5761 ?>
5762 </select>
5763 </div>
5764 </div> <!-- Title position -->
5765 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5766 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5767 <label for="ays-chart-option-title-gap" class="form-label">
5768 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5769 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title and the chart container.","chart-builder") ); ?>">
5770 <i class="ays_fa ays_fa_info_circle"></i>
5771 </a>
5772 </label>
5773 </div>
5774 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5775 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-gap" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_gap]" value="<?php echo esc_attr($title_gap) ?>">
5776 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5777 </div>
5778 </div> <!-- Chart title gap -->
5779 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5780 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5781 <label for="ays-chart-option-title-gap-description" class="form-label">
5782 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5783 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title and the chart description.","chart-builder") ); ?>">
5784 <i class="ays_fa ays_fa_info_circle"></i>
5785 </a>
5786 </label>
5787 </div>
5788 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5789 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-gap-description" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_gap_description]" value="<?php echo esc_attr($title_gap_description) ?>">
5790 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5791 </div>
5792 </div> <!-- Chart title gap -->
5793 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5794 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5795 <label for="ays-chart-option-title-text-transform">
5796 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5797 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5798 <i class="ays_fa ays_fa_info_circle"></i>
5799 </a>
5800 </label>
5801 </div>
5802 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5803 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-text-transform" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_transform]">
5804 <?php
5805 foreach ( $text_transforms as $option_slug => $option ):
5806 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5807 ?>
5808 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5809 <?php
5810 endforeach;
5811 ?>
5812 </select>
5813 </div>
5814 </div> <!-- Title text transform -->
5815 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5816 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5817 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5818 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5819 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5820 <i class="ays_fa ays_fa_info_circle"></i>
5821 </a>
5822 </label>
5823 </div>
5824 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5825 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-title-letter-spacing" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_letter_spacing]" value="<?php echo esc_attr($title_letter_spacing) ?>">
5826 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5827 </div>
5828 </div> <!-- Chart title letter spacing -->
5829 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5830 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5831 <label for="ays-chart-option-title-text-decoration">
5832 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5833 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5834 <i class="ays_fa ays_fa_info_circle"></i>
5835 </a>
5836 </label>
5837 </div>
5838 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5839 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-title-text-decoration" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_decoration]">
5840 <?php
5841 foreach ( $text_decorations as $option_slug => $option ):
5842 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5843 ?>
5844 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5845 <?php
5846 endforeach;
5847 ?>
5848 </select>
5849 </div>
5850 </div> <!-- Title text decoration -->
5851 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5852 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5853 <label for="ays-chart-option-title-text-shadow" class="form-label">
5854 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5855 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add a text shadow to chart title.","chart-builder") ); ?>">
5856 <i class="ays_fa ays_fa_info_circle"></i>
5857 </a>
5858 </label>
5859 </div>
5860 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5861 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5862 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-title-text-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_text_shadow]" value="on" <?php echo esc_attr($title_text_shadow); ?> >
5863 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5864 </label>
5865 </div>
5866 </div> <!-- Title bold -->
5867 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5868 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5869 <label for="ays-chart-option-title-shadow-color">
5870 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5871 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5872 <i class="ays_fa ays_fa_info_circle"></i>
5873 </a>
5874 </label>
5875 </div>
5876 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5877 <input id="ays-chart-option-title-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[title_shadow_color]" value="<?php echo esc_attr($title_shadow_color) ?>">
5878 </div>
5879 </div> <!-- Chart title color -->
5880 </div>
5881 </div>
5882 <?php
5883 $content = ob_get_clean();
5884
5885 $title = __( 'Title', "chart-builder" );
5886
5887 $sources['title'] = array(
5888 'content' => $content,
5889 'title' => $title
5890 );
5891
5892 return $sources;
5893 }
5894
5895 public function settings_contents_description_styles_settings( $sources, $args ){
5896 $html_class_prefix = $args['html_class_prefix'];
5897 $html_name_prefix = $args['html_name_prefix'];
5898 $settings = $args['settings'];
5899
5900 $description_color = $settings['description_color'];
5901 $description_font_size = $settings['description_font_size'];
5902 $title_positions = $settings['title_positions'];
5903 $description_position = $settings['description_position'];
5904 $description_bold = $settings['description_bold'];
5905 $description_text_shadow = $settings['description_text_shadow'];
5906 $description_shadow_color = $settings['description_shadow_color'];
5907 $description_italic = $settings['description_italic'];
5908 $text_transforms = $settings['text_transforms'];
5909 $text_decorations = $settings['text_decorations'];
5910 $description_text_transform = $settings['description_text_transform'];
5911 $description_text_decoration = $settings['description_text_decoration'];
5912 $description_letter_spacing = $settings['description_letter_spacing'];
5913
5914 ob_start();
5915 ?>
5916 <div class="ays-accordion-data-main-wrap">
5917 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5918 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5919 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5920 <label for="ays-chart-option-description-color">
5921 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5922 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart description.","chart-builder") ); ?>">
5923 <i class="ays_fa ays_fa_info_circle"></i>
5924 </a>
5925 </label>
5926 </div>
5927 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5928 <input id="ays-chart-option-description-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_color]" value="<?php echo esc_attr($description_color) ?>">
5929 </div>
5930 </div> <!-- Chart description color -->
5931 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5932 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5933 <label for="ays-chart-option-description-font-size" class="form-label">
5934 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5935 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart description.","chart-builder") ); ?>">
5936 <i class="ays_fa ays_fa_info_circle"></i>
5937 </a>
5938 </label>
5939 </div>
5940 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5941 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-description-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_font_size]" value="<?php echo esc_attr($description_font_size) ?>">
5942 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5943 </div>
5944 </div> <!-- Chart description font size -->
5945 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5946 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5947 <label for="ays-chart-option-description-bold" class="form-label">
5948 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5949 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
5950 <i class="ays_fa ays_fa_info_circle"></i>
5951 </a>
5952 </label>
5953 </div>
5954 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5955 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5956 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_bold]" value="on" <?php echo esc_attr($description_bold); ?> >
5957 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5958 </label>
5959 </div>
5960 </div> <!-- Description bold -->
5961 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5962 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5963 <label for="ays-chart-option-description-italic" class="form-label">
5964 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5965 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
5966 <i class="ays_fa ays_fa_info_circle"></i>
5967 </a>
5968 </label>
5969 </div>
5970 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5971 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5972 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_italic]" value="on" <?php echo esc_attr($description_italic); ?> >
5973 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5974 </label>
5975 </div>
5976 </div> <!-- Description italic -->
5977 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5978 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5979 <label for="ays-chart-option-description-position">
5980 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5981 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart description.","chart-builder") ); ?>">
5982 <i class="ays_fa ays_fa_info_circle"></i>
5983 </a>
5984 </label>
5985 </div>
5986 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5987 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_position]">
5988 <?php
5989 foreach ( $title_positions as $option_slug => $option ):
5990 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
5991 ?>
5992 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5993 <?php
5994 endforeach;
5995 ?>
5996 </select>
5997 </div>
5998 </div> <!-- Description position -->
5999 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6000 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6001 <label for="ays-chart-option-description-text-transform">
6002 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
6003 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
6004 <i class="ays_fa ays_fa_info_circle"></i>
6005 </a>
6006 </label>
6007 </div>
6008 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6009 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-text-transform" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_transform]">
6010 <?php
6011 foreach ( $text_transforms as $option_slug => $option ):
6012 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
6013 ?>
6014 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6015 <?php
6016 endforeach;
6017 ?>
6018 </select>
6019 </div>
6020 </div> <!-- description text transform -->
6021 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6022 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6023 <label for="ays-chart-option-description-letter-spacing" class="form-label">
6024 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6025 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
6026 <i class="ays_fa ays_fa_info_circle"></i>
6027 </a>
6028 </label>
6029 </div>
6030 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6031 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-description-letter-spacing" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_letter_spacing]" value="<?php echo esc_attr($description_letter_spacing) ?>">
6032 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6033 </div>
6034 </div> <!-- Chart description letter spacing -->
6035 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6036 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6037 <label for="ays-chart-option-description-text-decoration">
6038 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6039 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
6040 <i class="ays_fa ays_fa_info_circle"></i>
6041 </a>
6042 </label>
6043 </div>
6044 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6045 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-text-decoration" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_decoration]">
6046 <?php
6047 foreach ( $text_decorations as $option_slug => $option ):
6048 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
6049 ?>
6050 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6051 <?php
6052 endforeach;
6053 ?>
6054 </select>
6055 </div>
6056 </div> <!-- description text decoration -->
6057 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6058 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6059 <label for="ays-chart-option-description-text-shadow" class="form-label">
6060 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6061 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add a text shadow to chart description.","chart-builder") ); ?>">
6062 <i class="ays_fa ays_fa_info_circle"></i>
6063 </a>
6064 </label>
6065 </div>
6066 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6067 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6068 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-text-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_shadow]" value="on" <?php echo esc_attr($description_text_shadow); ?> >
6069 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6070 </label>
6071 </div>
6072 </div> <!-- description bold -->
6073 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6074 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6075 <label for="ays-chart-option-description-shadow-color">
6076 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6077 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart description.","chart-builder") ); ?>">
6078 <i class="ays_fa ays_fa_info_circle"></i>
6079 </a>
6080 </label>
6081 </div>
6082 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6083 <input id="ays-chart-option-description-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_shadow_color]" value="<?php echo esc_attr($description_shadow_color) ?>">
6084 </div>
6085 </div> <!-- Chart title color -->
6086 </div>
6087 </div>
6088 <?php
6089 $content = ob_get_clean();
6090
6091 $title = __( 'Description', "chart-builder" );
6092
6093 $sources['description'] = array(
6094 'content' => $content,
6095 'title' => $title
6096 );
6097
6098 return $sources;
6099 }
6100
6101 public function settings_contents_description_styles_settings_chartjs( $sources, $args ){
6102 $html_class_prefix = $args['html_class_prefix'];
6103 $html_name_prefix = $args['html_name_prefix'];
6104 $settings = $args['settings'];
6105
6106 $description_color = $settings['description_color'];
6107 $description_font_size = $settings['description_font_size'];
6108 $title_positions = $settings['title_positions'];
6109 $description_position = $settings['description_position'];
6110 $description_bold = $settings['description_bold'];
6111 $description_text_shadow = $settings['description_text_shadow'];
6112 $description_shadow_color = $settings['description_shadow_color'];
6113 $description_italic = $settings['description_italic'];
6114 $text_transforms = $settings['text_transforms'];
6115 $text_decorations = $settings['text_decorations'];
6116 $description_text_transform = $settings['description_text_transform'];
6117 $description_text_decoration = $settings['description_text_decoration'];
6118 $description_letter_spacing = $settings['description_letter_spacing'];
6119
6120 ob_start();
6121 ?>
6122 <div class="ays-accordion-data-main-wrap">
6123 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6124 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6125 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6126 <label for="ays-chart-option-description-color">
6127 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6128 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart description.","chart-builder") ); ?>">
6129 <i class="ays_fa ays_fa_info_circle"></i>
6130 </a>
6131 </label>
6132 </div>
6133 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6134 <input id="ays-chart-option-description-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_color]" value="<?php echo esc_attr($description_color) ?>">
6135 </div>
6136 </div> <!-- Chart description color -->
6137 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6138 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6139 <label for="ays-chart-option-description-font-size" class="form-label">
6140 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6141 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart description.","chart-builder") ); ?>">
6142 <i class="ays_fa ays_fa_info_circle"></i>
6143 </a>
6144 </label>
6145 </div>
6146 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6147 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-description-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_font_size]" value="<?php echo esc_attr($description_font_size) ?>">
6148 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6149 </div>
6150 </div> <!-- Chart description font size -->
6151 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6152 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6153 <label for="ays-chart-option-description-bold" class="form-label">
6154 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
6155 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
6156 <i class="ays_fa ays_fa_info_circle"></i>
6157 </a>
6158 </label>
6159 </div>
6160 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6161 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6162 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-bold" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_bold]" value="on" <?php echo esc_attr($description_bold); ?> >
6163 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6164 </label>
6165 </div>
6166 </div> <!-- Description bold -->
6167 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6168 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6169 <label for="ays-chart-option-description-italic" class="form-label">
6170 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
6171 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
6172 <i class="ays_fa ays_fa_info_circle"></i>
6173 </a>
6174 </label>
6175 </div>
6176 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6177 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6178 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-italic" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_italic]" value="on" <?php echo esc_attr($description_italic); ?> >
6179 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6180 </label>
6181 </div>
6182 </div> <!-- Description italic -->
6183 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6184 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6185 <label for="ays-chart-option-description-position">
6186 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
6187 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart description.","chart-builder") ); ?>">
6188 <i class="ays_fa ays_fa_info_circle"></i>
6189 </a>
6190 </label>
6191 </div>
6192 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6193 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-position" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_position]">
6194 <?php
6195 foreach ( $title_positions as $option_slug => $option ):
6196 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
6197 ?>
6198 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6199 <?php
6200 endforeach;
6201 ?>
6202 </select>
6203 </div>
6204 </div> <!-- Description position -->
6205 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6206 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6207 <label for="ays-chart-option-description-text-transform">
6208 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
6209 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
6210 <i class="ays_fa ays_fa_info_circle"></i>
6211 </a>
6212 </label>
6213 </div>
6214 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6215 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-text-transform" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_transform]">
6216 <?php
6217 foreach ( $text_transforms as $option_slug => $option ):
6218 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
6219 ?>
6220 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6221 <?php
6222 endforeach;
6223 ?>
6224 </select>
6225 </div>
6226 </div> <!-- description text transform -->
6227 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6228 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6229 <label for="ays-chart-option-description-letter-spacing" class="form-label">
6230 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6231 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
6232 <i class="ays_fa ays_fa_info_circle"></i>
6233 </a>
6234 </label>
6235 </div>
6236 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6237 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-description-letter-spacing" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_letter_spacing]" value="<?php echo esc_attr($description_letter_spacing) ?>">
6238 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6239 </div>
6240 </div> <!-- Chart description letter spacing -->
6241 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6242 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6243 <label for="ays-chart-option-description-text-decoration">
6244 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6245 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
6246 <i class="ays_fa ays_fa_info_circle"></i>
6247 </a>
6248 </label>
6249 </div>
6250 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6251 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-description-text-decoration" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_decoration]">
6252 <?php
6253 foreach ( $text_decorations as $option_slug => $option ):
6254 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
6255 ?>
6256 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6257 <?php
6258 endforeach;
6259 ?>
6260 </select>
6261 </div>
6262 </div> <!-- description text decoration -->
6263 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6264 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6265 <label for="ays-chart-option-description-text-shadow" class="form-label">
6266 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6267 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to add a text shadow to chart description.","chart-builder") ); ?>">
6268 <i class="ays_fa ays_fa_info_circle"></i>
6269 </a>
6270 </label>
6271 </div>
6272 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6273 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6274 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-description-text-shadow" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_text_shadow]" value="on" <?php echo esc_attr($description_text_shadow); ?> >
6275 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6276 </label>
6277 </div>
6278 </div> <!-- description bold -->
6279 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6280 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6281 <label for="ays-chart-option-description-shadow-color">
6282 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6283 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart description.","chart-builder") ); ?>">
6284 <i class="ays_fa ays_fa_info_circle"></i>
6285 </a>
6286 </label>
6287 </div>
6288 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6289 <input id="ays-chart-option-description-shadow-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[description_shadow_color]" value="<?php echo esc_attr($description_shadow_color) ?>">
6290 </div>
6291 </div> <!-- Chart title color -->
6292 </div>
6293 </div>
6294 <?php
6295 $content = ob_get_clean();
6296
6297 $title = __( 'Description', "chart-builder" );
6298
6299 $sources['description'] = array(
6300 'content' => $content,
6301 'title' => $title
6302 );
6303
6304 return $sources;
6305 }
6306
6307 /**
6308 * Chart page settings contents
6309 * @param $args
6310 */
6311 public function ays_chart_page_advanced_settings_contents( $args ){
6312 $chart_source_type = $args['chart_source_type'];
6313
6314 if ($chart_source_type === 'chart-js') {
6315 if ($args['source_chart_type'] !== 'pie_chart') {return;}
6316 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings_chartjs', array(), $args );
6317 } else {
6318 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings', array(), $args );
6319 }
6320
6321 $sources = array();
6322 foreach ( $sources_contents as $key => $sources_content ) {
6323 $collapsed = $key == 'advanced_settings' ? 'false' : 'true';
6324
6325 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
6326 if(isset($sources_content['title'])){
6327 $content .= '<legend class="ays-accordion-options-header">';
6328 $content .= '<svg class="ays-accordion-arrow '. ( $key == 'advanced_settings' ? 'ays-accordion-arrow-down' : 'ays-accordion-arrow-right' ) .'" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
6329 <g>
6330 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: '. ( $key == 'advanced_settings' ? '#008cff' : '#c4c4c4' ) .';" vector-effect="non-scaling-stroke" />
6331 </g>
6332 </svg>';
6333
6334 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
6335 }
6336
6337 $content .= '<div class="ays-accordion-options-content">';
6338 $content .= $sources_content['content'];
6339 $content .= '</div>';
6340
6341 $content .= '</fieldset>';
6342
6343 $sources[] = $content;
6344 }
6345 $content_for_escape = implode('' , $sources );
6346 echo html_entity_decode( esc_html($content_for_escape) );
6347 }
6348
6349 public function settings_contents_advanced_settings( $sources, $args ){
6350 $html_class_prefix = $args['html_class_prefix'];
6351 $html_name_prefix = $args['html_name_prefix'];
6352 $settings = $args['settings'];
6353 $tab_title = $args['tab_name'];
6354
6355 $rotation_degree = $settings['rotation_degree'];
6356 $reverse_categories = $settings['reverse_categories'];
6357 $slice_border_color = $settings['slice_border_color'];
6358 $slice_texts = $settings['slice_texts'];
6359 $slice_text = $settings['slice_text'];
6360 $tooltip_text_options = $settings['tooltip_text_options'];
6361 $tooltip_text = $settings['tooltip_text'];
6362 $is_stacked = $settings['is_stacked'];
6363 $focus_target_options = $settings['focus_target_options'];
6364 $focus_target = $settings['focus_target'];
6365 $multiple_data_format_options = $settings['multiple_data_format_options'];
6366 $multiple_data_format = $settings['multiple_data_format'];
6367 $opacity = $settings['opacity'];
6368 $group_width = $settings['group_width'];
6369 $group_width_format = $settings['group_width_format'];
6370 $group_width_format_options = $settings['group_width_format_options'];
6371 $line_width = $settings['line_width'];
6372 $data_grouping_limit = $settings['data_grouping_limit'];
6373 $data_grouping_label = $settings['data_grouping_label'];
6374 $data_grouping_color = $settings['data_grouping_color'];
6375 $multiple_selection = $settings['multiple_selection'];
6376 $point_shape_options = $settings['point_shape_options'];
6377 $point_shape = $settings['point_shape'];
6378 $crosshair_trigger_options = $settings['crosshair_trigger_options'];
6379 $crosshair_trigger = $settings['crosshair_trigger'];
6380 $crosshair_orientation_options = $settings['crosshair_orientation_options'];
6381 $crosshair_orientation = $settings['crosshair_orientation'];
6382 $crosshair_opacity = $settings['crosshair_opacity'];
6383 $dash_style = $settings['dash_style'];
6384 $point_size = $settings['point_size'];
6385 $donut_hole_size = $settings['donut_hole_size'];
6386 $orientation = $settings['orientation'];
6387 $fill_nulls = $settings['fill_nulls'];
6388 $allow_collapse = $settings['allow_collapse'];
6389 $org_classname = $settings['org_classname'];
6390 $org_node_background_color = $settings['org_node_background_color'];
6391 $org_node_padding = $settings['org_node_padding'];
6392 $org_node_border_radius = $settings['org_node_border_radius'];
6393 $org_node_border_width = $settings['org_node_border_width'];
6394 $org_node_border_color = $settings['org_node_border_color'];
6395 $org_node_text_color = $settings['org_node_text_color'];
6396 $org_node_text_font_size = $settings['org_node_text_font_size'];
6397 $org_node_description_font_color = $settings['org_node_description_font_color'];
6398 $org_node_description_font_size = $settings['org_node_description_font_size'];
6399 $org_selected_classname = $settings['org_selected_classname'];
6400 $org_selected_node_background_color = $settings['org_selected_node_background_color'];
6401 $org_selected_node_text_color = $settings['org_selected_node_text_color'];
6402
6403 ob_start();
6404 ?>
6405 <div class="ays-accordion-data-main-wrap">
6406 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
6407 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
6408 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6409 <label for="ays-chart-option-rotation-degree" class="form-label">
6410 <?php echo esc_html(__( "Degree of chart rotation", "chart-builder" )); ?>
6411 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The angle, in degrees, to rotate the chart by. The default of 0 will orient the leftmost edge of the first slice directly up.","chart-builder") ); ?>">
6412 <i class="ays_fa ays_fa_info_circle"></i>
6413 </a>
6414 </label>
6415 </div>
6416 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6417 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-rotation-degree" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[rotation_degree]" value="<?php echo esc_attr($rotation_degree) ?>">
6418 </div>
6419 </div> <!-- Rotation degree -->
6420 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
6421 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6422 <label for="ays-chart-option-reverse-categories">
6423 <?php echo esc_html(__( "Reverse Categories", "chart-builder" )); ?>
6424 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If this option is enabled, the pie slices will be drawn counterclockwise.","chart-builder") ); ?>">
6425 <i class="ays_fa ays_fa_info_circle"></i>
6426 </a>
6427 </label>
6428 </div>
6429 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6430 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6431 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-reverse-categories" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[reverse_categories]" value="on" <?php echo esc_attr($reverse_categories); ?> >
6432 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6433 </label>
6434 </div>
6435 </div> <!-- Reverse Categories -->
6436 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
6437 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6438 <label for="ays-chart-option-slice-border-color">
6439 <?php echo esc_html(__( "Slice Border Color", "chart-builder" )); ?>
6440 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
6441 <i class="ays_fa ays_fa_info_circle"></i>
6442 </a>
6443 </label>
6444 </div>
6445 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6446 <input id="ays-chart-option-slice-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_border_color]" value="<?php echo esc_attr($slice_border_color) ?>">
6447 </div>
6448 </div> <!-- Slice border color -->
6449 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
6450 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6451 <label for="ays-chart-option-slice-text">
6452 <?php echo esc_html(__( "Slice text", "chart-builder" )); ?>
6453 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose the content of the text to be displayed on the pie slice.","chart-builder") ); ?>">
6454 <i class="ays_fa ays_fa_info_circle"></i>
6455 </a>
6456 </label>
6457 </div>
6458 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6459 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-slice-text" name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text]">
6460 <?php
6461 foreach ( $slice_texts as $option_slug => $option ):
6462 $selected = ( $slice_text == $option_slug ) ? 'selected' : '';
6463 ?>
6464 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6465 <?php
6466 endforeach;
6467 ?>
6468 </select>
6469 </div>
6470 </div> <!-- Slice text -->
6471 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
6472 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6473 <label for="ays-chart-option-tooltip-text">
6474 <?php echo esc_html(__( "Slice tooltip text", "chart-builder" )); ?>
6475 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose how to display the text in the chart tooltip.","chart-builder") ); ?>">
6476 <i class="ays_fa ays_fa_info_circle"></i>
6477 </a>
6478 </label>
6479 </div>
6480 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6481 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-tooltip-text" name="<?php echo esc_attr($html_name_prefix); ?>settings[tooltip_text]">
6482 <?php
6483 foreach ( $tooltip_text_options as $option_slug => $option ):
6484 $selected = ( $tooltip_text == $option_slug ) ? 'selected' : '';
6485 ?>
6486 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6487 <?php
6488 endforeach;
6489 ?>
6490 </select>
6491 </div>
6492 </div> <!-- Slice tooltip Text -->
6493 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
6494 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6495 <label for="ays-chart-option-data-grouping-limit" class="form-label">
6496 <?php echo esc_html(__( "Chart Data Grouping Limit", "chart-builder" )); ?>
6497 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The percentage value of the pie, below which a slice will not show individually. All slices that have not passed this value will be combined to a single 'Other' slice, whose size is the sum of all their sizes. Default is not to show individually any slice which is smaller than half a degree.","chart-builder") ); ?>">
6498 <i class="ays_fa ays_fa_info_circle"></i>
6499 </a>
6500 </label>
6501 </div>
6502 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6503 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-data-grouping-limit" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[data_grouping_limit]" value="<?php echo esc_attr($data_grouping_limit) ?>" step=".1" min="0" max="360">
6504 </div>
6505 </div> <!-- Data Grouping Limit -->
6506 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
6507 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6508 <label for="ays-chart-option-data-grouping-label" class="form-label">
6509 <?php echo esc_html(__( "Chart Data Grouping Label", "chart-builder" )); ?>
6510 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("A label for the combination slice that holds all slices below chart data grouping limit.","chart-builder") ); ?>">
6511 <i class="ays_fa ays_fa_info_circle"></i>
6512 </a>
6513 </label>
6514 </div>
6515 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6516 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-data-grouping-label" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[data_grouping_label]" value="<?php echo esc_attr($data_grouping_label) ?>">
6517 </div>
6518 </div> <!-- Data Grouping Label -->
6519 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
6520 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6521 <label for="ays-chart-option-data-grouping-color">
6522 <?php echo esc_html(__( "Chart Data Grouping Color", "chart-builder" )); ?>
6523 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Color for the combination slice that holds all slices below chart data grouping limit.","chart-builder") ); ?>">
6524 <i class="ays_fa ays_fa_info_circle"></i>
6525 </a>
6526 </label>
6527 </div>
6528 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6529 <input id="ays-chart-option-data-grouping-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[data_grouping_color]" value="<?php echo esc_attr($data_grouping_color) ?>">
6530 </div>
6531 </div> <!-- Data Grouping Color -->
6532 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt display_none">
6533 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6534 <label for="ays-chart-option-is-stacked">
6535 <?php echo esc_html(__( "Is stacked", "chart-builder" )); ?>
6536 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Is stacked: If this option is enabled, the chart will be displayed in the proportional contribution of individual data points in comparison to a total.","chart-builder") ); ?>">
6537 <i class="ays_fa ays_fa_info_circle"></i>
6538 </a>
6539 </label>
6540 </div>
6541 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6542 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6543 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-is-stacked" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[is_stacked]" value="on" <?php echo esc_attr($is_stacked); ?> >
6544 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6545 </label>
6546 </div>
6547 </div> <!-- Is stacked -->
6548 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt cb-bar_chart-opt cb-column_chart-opt display_none">
6549 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6550 <label for="ays-chart-option-focus-target">
6551 <?php echo esc_html(__( "Focus target", "chart-builder" )); ?>
6552 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6553 echo esc_html( sprintf(
6554 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6555 "<p>" . __('There are two ways to focus the data table elements.', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6556 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6557 __('%1$sSingle data:%2$s If you choose the Single Data option, the focus will be on the single data point. By this, the particular cell of the data table will be focused.', "chart-builder") . "</li><li>" .
6558 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6559 __('%1$sGroup data:%2$s If you choose the Group Data option, the focus will be on the grouped data points. By this, a row of the data table will be focused.', "chart-builder") . "</li></ul>",
6560 '<em>', '</em>',
6561 '<em>', '</em>'
6562 ));
6563 ?>">
6564 <i class="ays_fa ays_fa_info_circle"></i>
6565 </a>
6566 </label>
6567 </div>
6568 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6569 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-focus-target" name="<?php echo esc_attr($html_name_prefix); ?>settings[focus_target]">
6570 <?php
6571 foreach ( $focus_target_options as $option_slug => $option ):
6572 $selected = ( $focus_target == $option_slug ) ? 'selected' : '';
6573 ?>
6574 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6575 <?php
6576 endforeach;
6577 ?>
6578 </select>
6579 </div>
6580 </div> <!-- Focus target -->
6581 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt cb-bar_chart-opt cb-column_chart-opt display_none">
6582 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6583 <label for="ays-chart-option-opacity" class="form-label">
6584 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
6585 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent. In bar and column charts, this refers to the visible data: rectangles. In charts where selecting data creates a dot, such as the line chart, this refers to the circles that appear upon hover or selection.","chart-builder") ); ?>">
6586 <i class="ays_fa ays_fa_info_circle"></i>
6587 </a>
6588 </label>
6589 </div>
6590 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6591 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-opacity" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[opacity]" value="<?php echo esc_attr($opacity) ?>" step=".1" min="0" max="1">
6592 </div>
6593 </div> <!-- Data opacity -->
6594 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt display_none">
6595 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6596 <label for="ays-chart-option-group-width">
6597 <?php echo esc_html(__( "Bar width", "chart-builder" )); ?>
6598 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6599 echo esc_html( sprintf(
6600 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6601 "<p>" . __('The width of the bars, specified in either of these formats:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6602 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6603 __('%1$sPixels:%2$s Set the width of the bars in pixels.', "chart-builder") . "</li><li>" .
6604 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6605 __('%1$sPercentage:%2$s Set the width of the bars in percentage.', "chart-builder") . "</li></ul>",
6606 '<em>', '</em>',
6607 '<em>', '</em>'
6608 ));
6609 ?>">
6610 <i class="ays_fa ays_fa_info_circle"></i>
6611 </a>
6612 </label>
6613 </div>
6614 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6615 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-group-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[group_width]" min="0" step=".1" value="<?php echo esc_attr($group_width) ?>">
6616 <select class="<?php echo esc_attr($html_class_prefix) ?>option-width-format-change <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-group-width-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[group_width_format]">
6617 <?php
6618 foreach ( $group_width_format_options as $option_slug => $option ):
6619 $selected = ( $group_width_format == $option_slug ) ? 'selected' : '';
6620 ?>
6621 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6622 <?php
6623 endforeach;
6624 ?>
6625 </select>
6626 </div>
6627 </div> <!-- Bars width -->
6628 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6629 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6630 <label for="ays-chart-option-line-width" class="form-label">
6631 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
6632 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Data line width in pixels. Set 0 for hiding all the lines and show only the point. Note: If a line width is specified for series, it will override this setting.","chart-builder") ); ?>">
6633 <i class="ays_fa ays_fa_info_circle"></i>
6634 </a>
6635 </label>
6636 </div>
6637 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6638 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-line-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[line_width]" value="<?php echo esc_attr($line_width) ?>">
6639 </div>
6640 </div> <!-- Line width -->
6641 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6642 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6643 <label for="ays-chart-option-multiple-selection">
6644 <?php echo esc_html(__( "Multiple data selection", "chart-builder" )); ?>
6645 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("When enabled, you may select multiple data points at once. To remove a data point from selection, click on it again. Note: This option works only when 'Tooltip trigger' option is set to 'When selected'.","chart-builder") ); ?>">
6646 <i class="ays_fa ays_fa_info_circle"></i>
6647 </a>
6648 </label>
6649 </div>
6650 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6651 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6652 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-multiple-selection" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[multiple_selection]" value="on" <?php echo esc_attr($multiple_selection); ?> >
6653 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6654 </label>
6655 </div>
6656 </div> <!-- Multiple data selection -->
6657 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6658 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6659 <label for="ays-chart-option-multiple-data-format">
6660 <?php echo esc_html(__( "Multiple data format", "chart-builder" )); ?>
6661 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6662 echo esc_html( sprintf(
6663 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6664 "<p>" . __('How multiple data selections are rolled up into tooltips:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6665 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6666 __('%1$sCategory:%2$s Group selected data by row titles.', "chart-builder") . "</li><li>" .
6667 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6668 __('%1$sSeries:%2$s Group selected data by column titles.', "chart-builder") . "</li><li>" .
6669 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6670 __('%1$sAuto:%2$s Group selected data by row titles, if they have the same titles or by column titles', "chart-builder") . "</li><li>" .
6671 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
6672 __('%1$sNone:%2$s Show only one tooltip per selection.', "chart-builder") . "</li></ul>",
6673 '<em>', '</em>',
6674 '<em>', '</em>',
6675 '<em>', '</em>',
6676 '<em>', '</em>'
6677 ));
6678 ?>">
6679 <i class="ays_fa ays_fa_info_circle"></i>
6680 </a>
6681 </label>
6682 </div>
6683 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6684 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-multiple-data-format" name="<?php echo esc_attr($html_name_prefix); ?>settings[multiple_data_format]">
6685 <?php
6686 foreach ( $multiple_data_format_options as $option_slug => $option ):
6687 $selected = ( $multiple_data_format == $option_slug ) ? 'selected' : '';
6688 ?>
6689 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6690 <?php
6691 endforeach;
6692 ?>
6693 </select>
6694 </div>
6695 </div> <!-- Multiple data format -->
6696 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6697 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6698 <label for="ays-chart-option-point-shape">
6699 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
6700 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The shape of individual data elements: 'Circle', 'Triangle', 'Square', 'Diamond', 'Star', or 'Polygon'.","chart-builder") ); ?>">
6701 <i class="ays_fa ays_fa_info_circle"></i>
6702 </a>
6703 </label>
6704 </div>
6705 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6706 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-point-shape" name="<?php echo esc_attr($html_name_prefix); ?>settings[point_shape]">
6707 <?php
6708 foreach ( $point_shape_options as $option_slug => $option ):
6709 $selected = ( $point_shape == $option_slug ) ? 'selected' : '';
6710 ?>
6711 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6712 <?php
6713 endforeach;
6714 ?>
6715 </select>
6716 </div>
6717 </div> <!-- Point shape -->
6718 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6719 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6720 <label for="ays-chart-option-point-size" class="form-label">
6721 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
6722 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Diameter of displayed points in pixels. Use zero to hide all points.","chart-builder") ); ?>">
6723 <i class="ays_fa ays_fa_info_circle"></i>
6724 </a>
6725 </label>
6726 </div>
6727 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6728 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-point-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[point_size]" value="<?php echo esc_attr($point_size) ?>">
6729 </div>
6730 </div> <!-- Point size -->
6731 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6732 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6733 <label for="ays-chart-option-orientation">
6734 <?php echo esc_html(__( "Rotate Vertical", "chart-builder" )); ?>
6735 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable the option, if you want to change the direction of the chart from horizontal to vertical.","chart-builder") ); ?>">
6736 <i class="ays_fa ays_fa_info_circle"></i>
6737 </a>
6738 </label>
6739 </div>
6740 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6741 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6742 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-orientation" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[orientation]" value="on" <?php echo esc_attr($orientation); ?> >
6743 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6744 </label>
6745 </div>
6746 </div> <!-- Orientation -->
6747 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6748 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6749 <label for="ays-chart-option-fill-nulls">
6750 <?php echo esc_html(__( "Autofill nulls", "chart-builder" )); ?>
6751 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Whether to guess and autofill the value of missing points when something goes wrong with the chart data. If checked, the chart will automatically fill the value of any missing data based on neighboring points. Else, it will leave a break in the line at the unknown point.","chart-builder") ); ?>">
6752 <i class="ays_fa ays_fa_info_circle"></i>
6753 </a>
6754 </label>
6755 </div>
6756 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6757 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6758 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-fill-nulls" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[fill_nulls]" value="on" <?php echo esc_attr($fill_nulls); ?> >
6759 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6760 </label>
6761 </div>
6762 </div> <!-- Autofill nulls -->
6763 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6764 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6765 <label for="ays-chart-option-crosshair-trigger">
6766 <?php echo esc_html(__( "Crosshair trigger", "chart-builder" )); ?>
6767 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose when to display crosshairs. Crosshairs are thin vertical and horizontal lines centered on a data point in a chart.","chart-builder") ); ?>">
6768 <i class="ays_fa ays_fa_info_circle"></i>
6769 </a>
6770 </label>
6771 </div>
6772 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6773 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-crosshair-trigger" name="<?php echo esc_attr($html_name_prefix); ?>settings[crosshair_trigger]">
6774 <?php
6775 foreach ( $crosshair_trigger_options as $option_slug => $option ):
6776 $selected = ( $crosshair_trigger == $option_slug ) ? 'selected' : '';
6777 ?>
6778 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6779 <?php
6780 endforeach;
6781 ?>
6782 </select>
6783 </div>
6784 </div> <!-- Crosshair trigger -->
6785 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6786 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6787 <label for="ays-chart-option-crosshair-orientation">
6788 <?php echo esc_html(__( "Crosshair orientation", "chart-builder" )); ?>
6789 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The crosshair orientation, which can be 'vertical' for vertical hairs only, 'horizontal' for horizontal hairs only, or 'both' for traditional crosshairs.","chart-builder") ); ?>">
6790 <i class="ays_fa ays_fa_info_circle"></i>
6791 </a>
6792 </label>
6793 </div>
6794 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6795 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-crosshair-orientation" name="<?php echo esc_attr($html_name_prefix); ?>settings[crosshair_orientation]">
6796 <?php
6797 foreach ( $crosshair_orientation_options as $option_slug => $option ):
6798 $selected = ( $crosshair_orientation == $option_slug ) ? 'selected' : '';
6799 ?>
6800 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6801 <?php
6802 endforeach;
6803 ?>
6804 </select>
6805 </div>
6806 </div> <!-- Crosshair orientation -->
6807 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6808 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6809 <label for="ays-chart-option-crosshair-opacity" class="form-label">
6810 <?php echo esc_html(__( "Crosshair opacity", "chart-builder" )); ?>
6811 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The crosshair opacity, with 0.0 being fully transparent and 1.0 fully opaque.","chart-builder") ); ?>">
6812 <i class="ays_fa ays_fa_info_circle"></i>
6813 </a>
6814 </label>
6815 </div>
6816 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6817 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-crosshair-opacity" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[crosshair_opacity]" value="<?php echo esc_attr($crosshair_opacity) ?>" step=".1" min="0" max="1">
6818 </div>
6819 </div> <!-- Crosshair opacity -->
6820 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
6821 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6822 <label for="ays-chart-option-dash-style" class="form-label">
6823 <?php echo esc_html(__( "Dash Pattern", "chart-builder" )); ?>
6824 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enter a sequence of numbers separated by commas to define the dash pattern. The first number specifies the length of the first dash, the second number specifies the length of the gap after it, and so on. For example, '4,4' will create a pattern of 4-length dashes followed by 4-length gaps, and '5,1,3' will create a pattern of a 5-length dash, a 1-length gap, a 3-length dash, a 5-length gap, and so on.","chart-builder") ); ?>">
6825 <i class="ays_fa ays_fa_info_circle"></i>
6826 </a>
6827 </label>
6828 </div>
6829 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6830 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-dash-style" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[dash_style]" value="<?php echo esc_attr($dash_style) ?>">
6831 </div>
6832 </div> <!-- Line dash pattern -->
6833 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-donut_chart-opt display_none">
6834 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6835 <label for="ays-chart-option-donut-hole-size">
6836 <?php echo esc_html(__( "Hole size", 'chart-builder' )); ?>
6837 </label>
6838 </div>
6839 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right <?php echo esc_attr($html_class_prefix) ?>option-input">
6840 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-donut-hole-size" type="number" min="0" max="1" step=".1" name="<?php echo esc_attr($html_name_prefix); ?>settings[donut_hole_size]" value="<?php echo esc_attr($donut_hole_size) ?>">
6841 </div>
6842 </div> <!-- Donut hole size -->
6843 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none ays-pro-features-v2-main-box">
6844 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
6845 <div class="ays-pro-features-v2-video-button"></div>
6846 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
6847 <div class="ays-pro-features-v2-upgrade-icon" style="background-image: url('<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg');" data-img-src="<?php echo esc_attr(CHART_BUILDER_ADMIN_URL); ?>/images/icons/pro-features-icons/Locked_24x24.svg"></div>
6848 <div class="ays-pro-features-v2-upgrade-text">
6849 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
6850 </div>
6851 </a>
6852 </div>
6853 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix )?>option-title">
6854 <label for="ays-chart-option-curve-type">
6855 <?php echo esc_html(__( "Line curve type", "chart-builder" )); ?>
6856 </label>
6857 </div>
6858 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6859 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-line-curve-type" name="<?php echo esc_attr($html_name_prefix); ?>settings[line_curve_type]">
6860 <option><?php echo esc_html(__( "Straight", "chart-builder" )); ?></option>
6861 </select>
6862 </div>
6863 </div> <!-- Line curve type -->
6864 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
6865 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6866 <label for="ays-chart-option-allow-collapse">
6867 <?php echo esc_html(__( "Allow collapse", "chart-builder" )); ?>
6868 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, double click on the node will collapse a node. Note: If the node has an Url option set in the source tab, this option will not work.","chart-builder") ); ?>">
6869 <i class="ays_fa ays_fa_info_circle"></i>
6870 </a>
6871 </label>
6872 </div>
6873 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6874 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6875 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-allow-collapse" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[allow_collapse]" value="on" <?php echo esc_attr($allow_collapse); ?> >
6876 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6877 </label>
6878 </div>
6879 </div> <!-- Allow collapse -->
6880 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
6881 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6882 <label for="ays-chart-option-org-node-description-font-color">
6883 <?php echo esc_html(__( "Description color", "chart-builder" )); ?>
6884 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description text color of the node.","chart-builder") ); ?>">
6885 <i class="ays_fa ays_fa_info_circle"></i>
6886 </a>
6887 </label>
6888 </div>
6889 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6890 <input id="ays-chart-option-org-node-description-font-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_description_font_color]" value="<?php echo esc_attr($org_node_description_font_color) ?>">
6891 </div>
6892 </div> <!-- Org Node Description color -->
6893 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
6894 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6895 <label for="ays-chart-option-org-node-description-font-size" class="form-label">
6896 <?php echo esc_html(__( "Description font size", "chart-builder" )); ?>
6897 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description font size of the node.","chart-builder") ); ?>">
6898 <i class="ays_fa ays_fa_info_circle"></i>
6899 </a>
6900 </label>
6901 </div>
6902 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6903 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-node-description-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_description_font_size]" value="<?php echo esc_attr($org_node_description_font_size) ?>">
6904 </div>
6905 </div> <!-- Org Node Description font size -->
6906 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
6907 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6908 <label for="ays-chart-option-org-classname" class="form-label">
6909 <?php echo esc_html(__( "Custom CSS class", "chart-builder" )); ?>
6910 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("A class name to assign to node elements to specify styles for the chart elements.","chart-builder") ); ?>">
6911 <i class="ays_fa ays_fa_info_circle"></i>
6912 </a>
6913 </label>
6914 </div>
6915 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6916 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-classname" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_classname]" placeholder="chart-builder-org-chart-tree-node" value="<?php echo esc_attr($org_classname) ?>">
6917 </div>
6918 </div> <!-- Org custom class -->
6919 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
6920 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none" style="background:transparent;box-shadow:unset;padding:10px 0">
6921 <br>
6922 <blockquote>
6923 <?php echo sprintf(
6924 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
6925 esc_html(__( '%1$sNote:%2$s Custom CSS class must be set for the options below to take effect.', 'chart-builder' )), '<strong>', '</strong>'); ?>
6926 </blockquote>
6927 <br>
6928 </div>
6929 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
6930 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6931 <label for="ays-chart-option-org-node-background-color">
6932 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
6933 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Background color of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
6934 <i class="ays_fa ays_fa_info_circle"></i>
6935 </a>
6936 </label>
6937 </div>
6938 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6939 <input id="ays-chart-option-org-node-background-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_background_color]" value="<?php echo esc_attr($org_node_background_color) ?>">
6940 </div>
6941 </div> <!-- Org Node Background color -->
6942 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
6943 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6944 <label for="ays-chart-option-org-node-padding" class="form-label">
6945 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
6946 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Padding of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
6947 <i class="ays_fa ays_fa_info_circle"></i>
6948 </a>
6949 </label>
6950 </div>
6951 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6952 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-node-padding" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_padding]" value="<?php echo esc_attr($org_node_padding) ?>">
6953 </div>
6954 </div> <!-- Org Node Padding -->
6955 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
6956 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6957 <label for="ays-chart-option-org-node-border-radius" class="form-label">
6958 <?php echo esc_html(__( "Border radius", "chart-builder" )); ?>
6959 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Border radius of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
6960 <i class="ays_fa ays_fa_info_circle"></i>
6961 </a>
6962 </label>
6963 </div>
6964 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6965 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-node-border-radius" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_border_radius]" value="<?php echo esc_attr($org_node_border_radius) ?>">
6966 </div>
6967 </div> <!-- Org Node Border radius -->
6968 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
6969 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6970 <label for="ays-chart-option-org-node-border-width" class="form-label">
6971 <?php echo esc_html(__( "Border width", "chart-builder" )); ?>
6972 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Border width of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
6973 <i class="ays_fa ays_fa_info_circle"></i>
6974 </a>
6975 </label>
6976 </div>
6977 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6978 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-node-border-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_border_width]" value="<?php echo esc_attr($org_node_border_width) ?>">
6979 </div>
6980 </div> <!-- Org Node Border width -->
6981 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
6982 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6983 <label for="ays-chart-option-org-node-border-color">
6984 <?php echo esc_html(__( "Border color", "chart-builder" )); ?>
6985 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Border color of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
6986 <i class="ays_fa ays_fa_info_circle"></i>
6987 </a>
6988 </label>
6989 </div>
6990 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6991 <input id="ays-chart-option-org-node-border-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_border_color]" value="<?php echo esc_attr($org_node_border_color) ?>">
6992 </div>
6993 </div> <!-- Org Node Background color -->
6994 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
6995 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6996 <label for="ays-chart-option-org-node-text-color">
6997 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6998 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Text color of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
6999 <i class="ays_fa ays_fa_info_circle"></i>
7000 </a>
7001 </label>
7002 </div>
7003 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7004 <input id="ays-chart-option-org-node-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_text_color]" value="<?php echo esc_attr($org_node_text_color) ?>">
7005 </div>
7006 </div> <!-- Org Node Text color -->
7007 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
7008 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7009 <label for="ays-chart-option-org-node-text-font-size" class="form-label">
7010 <?php echo esc_html(__( "Text font size", "chart-builder" )); ?>
7011 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Font size of the text of the node. Note: You need to set a Custom CSS class for this option to work.","chart-builder") ); ?>">
7012 <i class="ays_fa ays_fa_info_circle"></i>
7013 </a>
7014 </label>
7015 </div>
7016 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7017 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-node-text-font-size" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_node_text_font_size]" value="<?php echo esc_attr($org_node_text_font_size) ?>">
7018 </div>
7019 </div> <!-- Org Node Text font size -->
7020 </div> <!-- Org custom class options -->
7021 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
7022 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7023 <label for="ays-chart-option-org-selected-classname" class="form-label">
7024 <?php echo esc_html(__( "Selected node custom CSS class", "chart-builder" )); ?>
7025 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("A class name to assign to node elements to specify styles for the selected chart elements.","chart-builder") ); ?>">
7026 <i class="ays_fa ays_fa_info_circle"></i>
7027 </a>
7028 </label>
7029 </div>
7030 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7031 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-org-selected-classname" type="text" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_selected_classname]" placeholder="chart-builder-org-chart-tree-node-selected" value="<?php echo esc_attr($org_selected_classname) ?>">
7032 </div>
7033 </div> <!-- Org custom selected class -->
7034 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
7035 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none" style="background:transparent;box-shadow:unset;padding:10px 0">
7036 <br>
7037 <blockquote>
7038 <?php echo sprintf(
7039 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7040 esc_html(__( '%1$sNote:%2$s Selected node custom CSS class must be set for the options below to take effect.', 'chart-builder' )),
7041 '<strong>',
7042 '</strong>'
7043 ); ?>
7044 </blockquote>
7045 <br>
7046 </div>
7047 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
7048 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7049 <label for="ays-chart-option-org-selected-node-background-color">
7050 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
7051 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Background color of the selected node. Note: You need to set a Selected node custom CSS class for this option to work.","chart-builder") ); ?>">
7052 <i class="ays_fa ays_fa_info_circle"></i>
7053 </a>
7054 </label>
7055 </div>
7056 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7057 <input id="ays-chart-option-org-selected-node-background-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_selected_node_background_color]" value="<?php echo esc_attr($org_selected_node_background_color) ?>">
7058 </div>
7059 </div> <!-- Org selected Node Background color -->
7060 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-org_chart-opt display_none">
7061 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7062 <label for="ays-chart-option-org-selected-node-text-color">
7063 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7064 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Text color of the selected node. Note: You need to set a Selected node custom CSS class for this option to work.","chart-builder") ); ?>">
7065 <i class="ays_fa ays_fa_info_circle"></i>
7066 </a>
7067 </label>
7068 </div>
7069 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7070 <input id="ays-chart-option-org-selected-node-text-color" class="form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker" type="color" name="<?php echo esc_attr($html_name_prefix); ?>settings[org_selected_node_text_color]" value="<?php echo esc_attr($org_selected_node_text_color) ?>">
7071 </div>
7072 </div> <!-- Org selected Node text color -->
7073 </div> <!-- Org custom selected class options -->
7074 </div>
7075 </div>
7076 <?php
7077 $content = ob_get_clean();
7078
7079 $sources['advanced_settings'] = array(
7080 'content' => $content,
7081 'title' => $tab_title
7082 );
7083
7084 return $sources;
7085 }
7086
7087 public function settings_contents_advanced_settings_chartjs( $sources, $args ){
7088 $html_class_prefix = $args['html_class_prefix'];
7089 $html_name_prefix = $args['html_name_prefix'];
7090 $settings = $args['settings'];
7091 $tab_title = $args['tab_name'];
7092
7093 $outer_radius = $settings['outer_radius'];
7094 $slice_spacing = $settings['slice_spacing'];
7095 $circumference = $settings['circumference'];
7096 $start_angle = $settings['start_angle'];
7097 // $index_axis = $settings['index_axis'];
7098
7099 ob_start();
7100 ?>
7101 <div class="ays-accordion-data-main-wrap">
7102 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
7103 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt display_none">
7104 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7105 <label for="ays-chart-option-outer-radius" class="form-label">
7106 <?php echo esc_html(__( "Outer Radius", "chart-builder" )); ?>
7107 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The outer radius of the chart.","chart-builder") ); ?>">
7108 <i class="ays_fa ays_fa_info_circle"></i>
7109 </a>
7110 </label>
7111 </div>
7112 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7113 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-outer-radius" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[outer_radius]" value="<?php echo esc_attr($outer_radius) ?>">
7114 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
7115 </div>
7116 </div> <!-- Outer Radius -->
7117 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt display_none">
7118 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7119 <label for="ays-chart-option-slice-spacing" class="form-label">
7120 <?php echo esc_html(__( "Slices Spacing", "chart-builder" )); ?>
7121 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Fixed arc offset (in pixels).","chart-builder") ); ?>">
7122 <i class="ays_fa ays_fa_info_circle"></i>
7123 </a>
7124 </label>
7125 </div>
7126 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7127 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-slice-spacing" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_spacing]" value="<?php echo esc_attr($slice_spacing) ?>">
7128 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
7129 </div>
7130 </div> <!-- Slice Spacing -->
7131 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt display_none">
7132 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7133 <label for="ays-chart-option-circumference" class="form-label">
7134 <?php echo esc_html(__( "Arc Coverage", "chart-builder" )); ?>
7135 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Adjust the sweep angle to define the arc's coverage area along the circumference.","chart-builder") ); ?>">
7136 <i class="ays_fa ays_fa_info_circle"></i>
7137 </a>
7138 </label>
7139 </div>
7140 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7141 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-circumference" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[circumference]" value="<?php echo esc_attr($circumference) ?>">
7142 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
7143 </div>
7144 </div> <!-- Arc Coverage -->
7145 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt display_none">
7146 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7147 <label for="ays-chart-option-start-angle" class="form-label">
7148 <?php echo esc_html(__( "Start Angle", "chart-builder" )); ?>
7149 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Starting angle to draw arcs from.","chart-builder") ); ?>">
7150 <i class="ays_fa ays_fa_info_circle"></i>
7151 </a>
7152 </label>
7153 </div>
7154 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7155 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-start-angle" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[start_angle]" value="<?php echo esc_attr($start_angle) ?>">
7156 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
7157 </div>
7158 </div> <!-- Start Angle -->
7159 <!-- <div class="form-group row mb-2 <?php // echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt display_none">
7160 <div class="col-sm-5 d-flex align-items-center <?php // echo esc_attr($html_class_prefix) ?>option-title">
7161 <label for="ays-chart-option-index-axis">
7162 <?php // echo esc_html(__( "Horizontal ", "chart-builder" )); ?>
7163 <a class="ays_help" data-bs-toggle="tooltip" title="<?php // echo esc_attr( __("If this option is enabled, the pie slices will be drawn counterclockwise.","chart-builder") ); ?>">
7164 <i class="ays_fa ays_fa_info_circle"></i>
7165 </a>
7166 </label>
7167 </div>
7168 <div class="col-sm-7 py-1 <?php // echo esc_attr($html_class_prefix) ?>input-align-right">
7169 <label class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7170 <input class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-index-axis" type="checkbox" name="<?php // echo esc_attr($html_name_prefix); ?>settings[index_axis]" value="on" <?php // echo esc_attr($index_axis); ?> >
7171 <span class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php // echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7172 </label>
7173 </div>
7174 </div> Reverse Categories -->
7175 </div>
7176 </div>
7177 <?php
7178 $content = ob_get_clean();
7179
7180 $sources['advanced_settings'] = array(
7181 'content' => $content,
7182 'title' => $tab_title
7183 );
7184
7185 return $sources;
7186 }
7187
7188 public function settings_contents_slices_settings( $sources, $args ){
7189 $html_class_prefix = $args['html_class_prefix'];
7190 $html_name_prefix = $args['html_name_prefix'];
7191 $settings = $args['settings'];
7192 $source = $args['source'];
7193 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7194 $source_chart_type = $args['source_chart_type'];
7195 $settings = $args['settings'];
7196 $title_row = array_shift($source);
7197
7198 if (isset($source) && !empty($source)) {
7199 if ( !isset( $source[0] ) ) {
7200 if (count($source[1]) > 2) {
7201 $titles = array();
7202 for ($i = 0; $i < count($source[1]); $i++) {
7203 array_push($titles, __("Title", 'chart-builder').$i);
7204 }
7205 $source[0] = $titles;
7206 } else {
7207 $source[0] = array(
7208 __("Country", 'chart-builder'),
7209 __("Population", 'chart-builder'),
7210 );
7211 }
7212
7213 ksort($source);
7214 }
7215 }
7216
7217 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7218 foreach ($source as $key => $row) {
7219 $source[$key] = array_slice($row, 0, 2);
7220 }
7221 }
7222
7223 ob_start();
7224 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7225 $slice_color = $settings['slice_color'];
7226 $slice_colors_default = $settings['slice_colors_default'];
7227 $slice_offset = $settings['slice_offset'];
7228 $slice_text_color = $settings['slice_text_color'];
7229
7230 ?>
7231 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-slices-settings-tab cb-changable-tab cb-pie_chart-tab cb-donut_chart-tab">
7232 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7233 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
7234 <?php
7235 foreach ( $source as $key => $val ):
7236 ?>
7237 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
7238 <legend class="ays-slices-accordion-options-header">
7239 <svg class="ays-slices-accordion-arrow ays-slices-accordion-arrow-right" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
7240 <g>
7241 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: #c4c4c4;" vector-effect="non-scaling-stroke" />
7242 </g>
7243 </svg>
7244 <span><?php echo esc_html($val[0]); ?></span>
7245 </legend>
7246 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
7247 <div class="ays-slices-accordion-data-main-wrap">
7248 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7249 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7250 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7251 <label for="ays-chart-option-slice-color">
7252 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7253 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color to use for this slice.","chart-builder") ); ?>">
7254 <i class="ays_fa ays_fa_info_circle"></i>
7255 </a>
7256 </label>
7257 </div>
7258 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7259 <input type="color"
7260 id="ays-chart-option-slice-color-<?php echo esc_attr($key); ?>"
7261 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7262 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo esc_attr($key); ?>]"
7263 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : esc_attr($slice_colors_default[$key]); ?>"
7264 data-slice-id="<?php echo esc_attr($key); ?>">
7265 </div>
7266 </div> <!-- Slice color -->
7267 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7268 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7269 <label for="ays-chart-option-slice-offset" class="form-label">
7270 <?php echo esc_html(__( "Offset", "chart-builder" )); ?>
7271 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the chart's radius).","chart-builder") ); ?>">
7272 <i class="ays_fa ays_fa_info_circle"></i>
7273 </a>
7274 </label>
7275 </div>
7276 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7277 <input type="number"
7278 id="ays-chart-option-slice-offset-<?php echo esc_attr($key); ?>"
7279 class="ays-chart-option-slice-offset ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7280 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_offset][<?php echo esc_attr($key); ?>]"
7281 value="<?php echo isset($slice_offset[$key]) ? esc_attr($slice_offset[$key]) : 0 ; ?>"
7282 data-slice-id="<?php echo esc_attr($key); ?>"
7283 step=".01" min="0.0" max="1.0">
7284 </div>
7285 </div> <!-- Slice offset -->
7286 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7287 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7288 <label for="ays-chart-option-slice-text-color">
7289 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7290 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color to use for the text of this slice.","chart-builder") ); ?>">
7291 <i class="ays_fa ays_fa_info_circle"></i>
7292 </a>
7293 </label>
7294 </div>
7295 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7296 <input type="color"
7297 id="ays-chart-option-slice-text-color-<?php echo esc_attr($key); ?>"
7298 class="ays-chart-option-slice-text-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7299 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text_color][<?php echo esc_attr($key); ?>]"
7300 value="<?php echo isset($slice_text_color[$key]) ? esc_attr($slice_text_color[$key]) : '#ffffff'; ?>"
7301 data-slice-id="<?php echo esc_attr($key); ?>">
7302 </div>
7303 </div> <!-- Slice color -->
7304 </div>
7305 </div>
7306 </div>
7307 </fieldset>
7308 <?php
7309 endforeach;
7310 ?>
7311 </div>
7312 </div>
7313 <br>
7314 <blockquote>
7315 <?php echo esc_html(__( "Save the chart to update the data.", "chart-builder" )); ?>
7316 </blockquote>
7317 </div>
7318 <?php
7319
7320 } else {
7321 ?>
7322 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-slices-settings-tab cb-changable-tab cb-pie_chart-tab cb-donut_chart-tab"></div>
7323 <?php
7324 }
7325
7326 $content = ob_get_clean();
7327
7328 $title = esc_html(__( 'Slices settings', 'chart-builder' ));
7329
7330 $sources['slices_settings'] = array(
7331 'content' => $content,
7332 'title' => $title
7333 );
7334
7335 return $sources;
7336 }
7337
7338 public function settings_contents_series_settings( $sources, $args ){
7339 $html_class_prefix = $args['html_class_prefix'];
7340 $html_name_prefix = $args['html_name_prefix'];
7341 $settings = $args['settings'];
7342 $source = $args['source'];
7343 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7344 $source_chart_type = $args['source_chart_type'];
7345
7346 $line_width = $settings['line_width'];
7347 $point_size = $settings['point_size'];
7348 $point_shape_options = $settings['point_shape_options'];
7349 $point_shape = $settings['point_shape'];
7350
7351 if (isset($source) && !empty($source)) {
7352 if ( !isset( $source[0] ) ) {
7353 if (count($source[1]) > 2) {
7354 $titles = array();
7355 for ($i = 0; $i < count($source[1]); $i++) {
7356 array_push($titles, __("Title", "chart-builder").$i);
7357 }
7358 $source[0] = $titles;
7359 } else {
7360 $source[0] = array(
7361 __("Country", "chart-builder"),
7362 __("Population", "chart-builder"),
7363 );
7364 }
7365
7366 ksort($source);
7367 }
7368 }
7369
7370 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7371 foreach ($source as $key => $row) {
7372 $source[$key] = array_slice($row, 0, 2);
7373 }
7374 }
7375
7376 ob_start();
7377 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'line_chart' || $source_chart_type == 'bar_chart' || $source_chart_type == 'column_chart') {
7378 $series_row = array_shift($source);
7379 $title = array_shift($series_row);
7380 $series_color = $settings['series_color'];
7381 $series_colors_default = $settings['series_colors_default'];
7382 $series_visible_in_legend = $settings['series_visible_in_legend'];
7383 $series_line_width = $settings['series_line_width'];
7384 $series_point_size = $settings['series_point_size'];
7385 $series_point_shape = $settings['series_point_shape'];
7386
7387 ?>
7388 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-series-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
7389 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7390 <div class="<?php echo esc_attr($html_class_prefix) ?>series-settings">
7391 <?php
7392 foreach ( $series_row as $key => $val ):
7393 ?>
7394 <fieldset class="ays-series-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-series-<?php echo esc_attr($key); ?>" data-collapsed="true">
7395 <legend class="ays-series-accordion-options-header">
7396 <svg class="ays-series-accordion-arrow ays-series-accordion-arrow-right" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
7397 <g>
7398 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: #c4c4c4;" vector-effect="non-scaling-stroke" />
7399 </g>
7400 </svg>
7401 <span><?php echo esc_attr($val); ?></span>
7402 </legend>
7403 <div class="ays-series-accordion-options-content ays-series-accordion-options-content">
7404 <div class="ays-series-accordion-data-main-wrap">
7405 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7406 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7407 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7408 <label for="ays-chart-option-series-color">
7409 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7410 </label>
7411 </div>
7412 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7413 <input type="color"
7414 id="ays-chart-option-series-color-<?php echo esc_attr($key); ?>"
7415 class="ays-chart-option-series-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7416 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_color][<?php echo esc_attr($key); ?>]"
7417 value="<?php echo isset($series_color[$key]) ? esc_attr($series_color[$key]) : esc_attr($series_colors_default[$key]); ?>"
7418 data-series-id="<?php echo esc_attr($key); ?>">
7419 </div>
7420 </div> <!-- series color -->
7421 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7422 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7423 <label for="ays-chart-option-series-visible-in-legend">
7424 <?php echo esc_html(__( "Visible in legend", "chart-builder" )); ?>
7425 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Tick this option to have the series shown in the legend, otherwise it won`t be shown. If the chart has only one column, disabling this option will not work. If you don't want any of the labels to be shown in the legend, change the 'Legend position' option to 'Hide' to entirely hide the legend .","chart-builder") ); ?>">
7426 <i class="ays_fa ays_fa_info_circle"></i>
7427 </a>
7428 </label>
7429 </div>
7430 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7431 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7432 <input type="checkbox"
7433 id="ays-chart-option-series-visible-in-legend-<?php echo esc_attr($key); ?>"
7434 class="ays-chart-option-series-visible-in-legend <?php echo esc_attr($html_class_prefix) ?>toggle-switch"
7435 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_visible_in_legend][<?php echo esc_attr($key); ?>]"
7436 value="on"
7437 data-series-id="<?php echo esc_attr($key); ?>"
7438 <?php echo isset($series_visible_in_legend[$key]) && $series_visible_in_legend[$key] == 'on' ? 'checked' : (!isset($series_color[$key]) ? 'checked' : ''); ?> >
7439 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7440 </label>
7441 </div>
7442 </div> <!-- Series visible in legend -->
7443 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
7444 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7445 <label for="ays-chart-option-series-line-width">
7446 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
7447 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Line width in pixels. Set 0 for hiding all the lines and show only the point.","chart-builder") ); ?>">
7448 <i class="ays_fa ays_fa_info_circle"></i>
7449 </a>
7450 </label>
7451 </div>
7452 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7453 <input type="number"
7454 id="ays-chart-option-series-line-width-<?php echo esc_attr($key); ?>"
7455 class="ays-chart-option-series-line-width ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7456 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_line_width][<?php echo esc_attr($key); ?>]"
7457 value="<?php echo isset($series_line_width[$key]) ? esc_attr($series_line_width[$key]) : esc_attr($line_width); ?>"
7458 data-series-id="<?php echo esc_attr($key); ?>">
7459 </div>
7460 </div> <!-- Line width -->
7461 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
7462 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7463 <label for="ays-chart-option-series-point-size">
7464 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
7465 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Point size in pixels. Set 0 for hiding all points.","chart-builder") ); ?>">
7466 <i class="ays_fa ays_fa_info_circle"></i>
7467 </a>
7468 </label>
7469 </div>
7470 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7471 <input type="number"
7472 id="ays-chart-option-series-point-size-<?php echo esc_attr($key); ?>"
7473 class="ays-chart-option-series-point-size ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7474 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_size][<?php echo esc_attr($key); ?>]"
7475 value="<?php echo isset($series_point_size[$key]) ? esc_attr($series_point_size[$key]) : esc_attr($point_size); ?>"
7476 data-series-id="<?php echo esc_attr($key); ?>">
7477 </div>
7478 </div> <!-- Point size -->
7479 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-line_chart-opt display_none">
7480 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7481 <label for="ays-chart-option-series-point-shape">
7482 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
7483 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The shape of individual data elements: 'Circle', 'Triangle', 'Square', 'Diamond', 'Star', or 'Polygon'.","chart-builder") ); ?>">
7484 <i class="ays_fa ays_fa_info_circle"></i>
7485 </a>
7486 </label>
7487 </div>
7488 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7489 <select
7490 id="ays-chart-option-series-point-shape-<?php echo esc_attr($key); ?>"
7491 class="ays-chart-option-series-point-shape <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select"
7492 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_shape][<?php echo esc_attr($key); ?>]"
7493 data-series-id="<?php echo esc_attr($key); ?>">
7494 >
7495 <?php
7496 $value = isset($series_point_shape[$key]) ? esc_attr($series_point_shape[$key]) : $point_shape;
7497 foreach ( $point_shape_options as $option_slug => $option ):
7498 $selected = ( $value === $option_slug ) ? 'selected' : '';
7499 ?>
7500 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7501 <?php
7502 endforeach;
7503 ?>
7504 </select>
7505 </div>
7506 </div> <!-- Point shape -->
7507 </div>
7508 </div>
7509 </div>
7510 </fieldset>
7511 <?php
7512 endforeach;
7513 ?>
7514 </div>
7515 </div>
7516 <br>
7517 <blockquote>
7518 <?php echo esc_html(__( "Save the chart to update the data.", 'chart-builder' )); ?>
7519 <br>
7520 <?php echo sprintf(
7521 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7522 esc_html(__( '%1$sNote:%2$s If you are not able to set the options, disable the row settings feature.', 'chart-builder' )),
7523 '<strong>',
7524 '</strong>'
7525 ); ?>
7526 </blockquote>
7527 </div>
7528 <?php
7529
7530 } else {
7531 ?>
7532 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-series-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab"></div>
7533 <?php
7534 }
7535
7536 $content = ob_get_clean();
7537
7538 $title = __( 'Series settings', "chart-builder" );
7539
7540 $sources['series_settings'] = array(
7541 'content' => $content,
7542 'title' => $title
7543 );
7544
7545 return $sources;
7546 }
7547
7548 public function settings_contents_row_settings( $sources, $args ){
7549 $html_class_prefix = $args['html_class_prefix'];
7550 $html_name_prefix = $args['html_name_prefix'];
7551 $settings = $args['settings'];
7552 $source = $args['source'];
7553 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7554 $source_chart_type = $args['source_chart_type'];
7555
7556 if (isset($source) && !empty($source)) {
7557 if ( !isset( $source[0] ) ) {
7558 if (count($source[1]) > 2) {
7559 $titles = array();
7560 for ($i = 0; $i < count($source[1]); $i++) {
7561 array_push($titles, __("Title", 'chart-builder').$i);
7562 }
7563 $source[0] = $titles;
7564 } else {
7565 $source[0] = array(
7566 __("Country", 'chart-builder'),
7567 __("Population", 'chart-builder'),
7568 );
7569 }
7570
7571 ksort($source);
7572 }
7573 }
7574
7575 array_shift($source);
7576 $rows = array_column($source, 0);
7577
7578 $enable_row_settings = $settings['enable_row_settings'];
7579 $series_color = $settings['series_color'][0] ?? '#3366cc';
7580 $rows_color = $settings['rows_color'];
7581 $rows_opacity = $settings['rows_opacity'];
7582
7583 ob_start();
7584 ?>
7585 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-row-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
7586 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7587 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt">
7588 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7589 <label for="ays-chart-option-enable-row-settings">
7590 <?php echo esc_html(__( "Enable row settings", "chart-builder" )); ?>
7591 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to be able to choose the row settings. If this option is disabled, you will be able to set the general color form the series settings.","chart-builder") ); ?>">
7592 <i class="ays_fa ays_fa_info_circle"></i>
7593 </a>
7594 </label>
7595 </div>
7596 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7597 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7598 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch <?php echo esc_attr($html_class_prefix) ?>toggle-hidden-option" id="ays-chart-option-enable-row-settings" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_row_settings]" value="on" <?php echo esc_attr($enable_row_settings); ?> >
7599 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7600 </label>
7601 </div>
7602 </div> <!-- Enable row settings -->
7603 <div class="<?php echo esc_attr($html_class_prefix) ?>rows-settings <?php echo esc_attr($html_class_prefix) ?>hidden-options-section <?php echo $enable_row_settings === 'checked' ? '' : 'display_none'; ?>">
7604 <br>
7605 <?php
7606 foreach ( $rows as $key => $val ):
7607 ?>
7608 <fieldset class="ays-rows-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-rows-<?php echo esc_attr($key); ?>" data-collapsed="true">
7609 <legend class="ays-rows-accordion-options-header">
7610 <svg class="ays-rows-accordion-arrow ays-rows-accordion-arrow-right" version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 24 24" width="20" height="20">
7611 <g>
7612 <path xmlns:default="http://www.w3.org/2000/svg" d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" style="fill: #c4c4c4;" vector-effect="non-scaling-stroke" />
7613 </g>
7614 </svg>
7615 <span><?php echo esc_html($val); ?></span>
7616 </legend>
7617 <div class="ays-rows-accordion-options-content ays-rows-accordion-options-content">
7618 <div class="ays-rows-accordion-data-main-wrap">
7619 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7620 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7621 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7622 <label for="ays-chart-option-rows-color">
7623 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7624 </label>
7625 </div>
7626 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7627 <input type="color"
7628 id="ays-chart-option-rows-color-<?php echo esc_attr($key); ?>"
7629 class="ays-chart-option-rows-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7630 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_color][<?php echo esc_attr($key); ?>]"
7631 value="<?php echo isset($rows_color[$key]) && '' !== $rows_color[$key] ? esc_attr($rows_color[$key]) : esc_attr($series_color); ?>"
7632 data-rows-id="<?php echo esc_attr($key); ?>">
7633 </div>
7634 </div> <!-- color -->
7635 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7636 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7637 <label for="ays-chart-option-rows-color">
7638 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
7639 </label>
7640 </div>
7641 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7642 <input type="number"
7643 id="ays-chart-option-rows-opacity-<?php echo esc_attr($key); ?>"
7644 class="ays-chart-option-rows-opacity ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7645 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_opacity][<?php echo esc_attr($key); ?>]"
7646 value="<?php echo isset($rows_opacity[$key]) && '' !== $rows_opacity[$key] ? esc_attr($rows_opacity[$key]) : 1.0; ?>"
7647 data-rows-id="<?php echo esc_attr($key); ?>"
7648 step=".1" min="0" max="1">
7649 </div>
7650 </div> <!-- opacity -->
7651 </div>
7652 </div>
7653 </div>
7654 </fieldset>
7655 <?php
7656 endforeach;
7657 ?>
7658 <br>
7659 <blockquote>
7660 <?php echo esc_html(__( "Save the chart to update the data.", 'chart-builder' )); ?>
7661 <br>
7662 <?php echo sprintf(
7663 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7664 esc_html(__( '%1$sNote:%2$s The applied styles will work only if the chart has one column.', 'chart-builder' )),
7665 '<strong>',
7666 '</strong>'
7667 ); ?>
7668 </blockquote>
7669 </div>
7670 <div class="<?php echo esc_attr($html_class_prefix) ?>not-hidden-options-section <?php echo $enable_row_settings === 'checked' ? 'display_none' : ''; ?>">
7671 <br>
7672 <blockquote>
7673 <?php echo sprintf(
7674 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7675 esc_html(__( '%1$sNote:%2$s If this option is disabled, the general options will be set from the series settings.', 'chart-builder' )),
7676 '<strong>',
7677 '</strong>'
7678 ); ?>
7679 </blockquote>
7680 </div>
7681 </div>
7682 </div>
7683 <?php
7684 $content = ob_get_clean();
7685
7686 $title = __( 'Row settings', "chart-builder" );
7687
7688 $sources['row_settings'] = array(
7689 'content' => $content,
7690 'title' => $title
7691 );
7692
7693 return $sources;
7694 }
7695 }
7696