PluginProbe
Chartify – WordPress Chart Plugin / 3.5.2
Chartify – WordPress Chart Plugin v3.5.2
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.5.2, at admin/class-chart-builder-admin.php

8,314 lines 597.5 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 ),
230 'actions' => array(
231 'filter_get_props' => 'fetch_post_type_props',
232 'filter_get_data' => 'fetch_post_type_data',
233 'quiz_maker_get_data' => 'fetch_quiz_maker_data',
234 'quiz_maker_save_data' => 'save_quiz_maker_data',
235 'author_user_search' => 'author_user_search'
236 ),
237 ),
238 'db_query' => array(
239 'tables' => $table_col_mapping,
240 ),
241 ) );
242
243 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 );
244 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 );
245 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 );
246 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 . time(), true );
247
248 if ( false !== strpos( $hook_suffix, 'settings' ) ) {
249 wp_enqueue_script( $this->plugin_name . '-settings', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-settings.js', array( 'jquery' ), $this->version, true );
250
251 wp_localize_script( $this->plugin_name . '-settings', 'aysChartBuilderAdminSettings', array(
252 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
253 'selectUserRoles' => __( 'Select user roles', 'chart-builder' ),
254 'delete' => __( 'Delete', 'chart-builder' ),
255 'selectQuestionDefaultType' => __( 'Select question default type', 'chart-builder' ),
256 'yes' => __( 'Yes', 'chart-builder' ),
257 'cancel' => __( 'Cancel', 'chart-builder' ),
258 'somethingWentWrong' => __( "Maybe something went wrong.", 'chart-builder' ),
259 'failed' => __( 'Failed', 'chart-builder' ),
260 'selectPage' => __( 'Select page', 'chart-builder' ),
261 'selectPostType' => __( 'Select post type', 'chart-builder' ),
262 'copied' => __( 'Copied!', 'chart-builder'),
263 'clickForCopy' => __( 'Click to copy', 'chart-builder'),
264 'selectForm' => __( 'Select form', 'chart-builder'),
265 ) );
266 }
267 }
268
269 /**
270 * De-register JavaScript files for the admin area.
271 *
272 * @since 1.0.0
273 */
274 public function disable_scripts($hook_suffix) {
275 if (false !== strpos($hook_suffix, $this->plugin_name)) {
276 if (is_plugin_active('ai-engine/ai-engine.php')) {
277 wp_deregister_script('mwai');
278 wp_deregister_script('mwai-vendor');
279 wp_dequeue_script('mwai');
280 wp_dequeue_script('mwai-vendor');
281 }
282
283 if (is_plugin_active('html5-video-player/html5-video-player.php')) {
284 wp_dequeue_style('h5vp-admin');
285 wp_dequeue_style('fs_common');
286 }
287
288 if (is_plugin_active('panorama/panorama.php')) {
289 wp_dequeue_style('bppiv_admin_custom_css');
290 wp_dequeue_style('bppiv-custom-style');
291 }
292
293 if (is_plugin_active('wp-social/wp-social.php')) {
294 wp_dequeue_style('wp_social_select2_css');
295 wp_deregister_script('wp_social_select2_js');
296 wp_dequeue_script('wp_social_select2_js');
297 }
298
299 if (is_plugin_active('real-media-library-lite/index.php')) {
300 wp_dequeue_style('real-media-library-lite-rml');
301 }
302
303 // Theme | Phlox 2.17.6
304 wp_dequeue_style('auxin-admin-style');
305
306 // Theme | Pixel Ebook Store
307 wp_dequeue_style('pixel-ebook-store-free-demo-content-style');
308
309 // Theme | Interactive Education
310 wp_dequeue_style('interactive-education-free-demo-content-style');
311
312 }
313 }
314
315 /**
316 * Register the administration menu for this plugin into the WordPress Dashboard menu.
317 *
318 * @since 1.0.0
319 */
320 public function add_plugin_admin_menu(){
321
322 /*
323 * Add a settings page for this plugin to the Settings menu.
324 *
325 * NOTE: Alternative menu locations are available via WordPress administration menu functions.
326 *
327 * Administration Menus: http://codex.wordpress.org/Administration_Menus
328 *
329 */
330 global $wpdb;
331 $menu_item = __( 'Chart Builder', "chart-builder" );
332 $this->capability = 'manage_options';
333
334 add_menu_page(
335 __( 'Chart Builder', "chart-builder" ),
336 $menu_item,
337 $this->capability,
338 $this->plugin_name,
339 array($this, 'display_plugin_charts_page'),
340 CHART_BUILDER_ADMIN_URL . '/images/icons/ays_chart_logo_icon_bw.svg',
341 '6.22'
342 );
343
344 }
345
346 public function add_plugin_charts_submenu(){
347 $hook_page_view = add_submenu_page(
348 $this->plugin_name,
349 __('All Charts', 'chart-builder'),
350 __('All Charts', 'chart-builder'),
351 'manage_options',
352 $this->plugin_name,
353 array($this, 'display_plugin_charts_page')
354 );
355
356 add_action( "load-$hook_page_view", array( $this, 'screen_option_charts' ) );
357 }
358
359 public function add_plugin_add_new_submenu(){
360 $hook_charts = add_submenu_page(
361 $this->plugin_name,
362 __('Add New', 'chart-builder'),
363 __('Add New', 'chart-builder'),
364 'manage_options',
365 $this->plugin_name."&action=add",
366 array($this, 'display_plugin_addnew_page')
367 );
368 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
369 }
370
371 public function add_plugin_dashboard_submenu(){
372 $hook_charts = add_submenu_page(
373 $this->plugin_name,
374 __('How to use', 'chart-builder'),
375 __('How to use', 'chart-builder'),
376 'manage_options',
377 $this->plugin_name . '-dashboard',
378 array($this, 'display_plugin_setup_page')
379 );
380 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
381 }
382
383 public function add_plugin_general_settings_submenu(){
384 $hook_settings = add_submenu_page( $this->plugin_name,
385 __('General Settings', 'chart-builder'),
386 __('General Settings', 'chart-builder'),
387 'manage_options',
388 $this->plugin_name . '-settings',
389 array($this, 'display_plugin_settings_page')
390 );
391 add_action("load-$hook_settings", array($this, 'screen_option_settings'));
392 }
393
394 public function add_plugin_featured_plugins_submenu(){
395 $hook_our_products = add_submenu_page( $this->plugin_name,
396 __('Our products', 'chart-builder'),
397 __('Our products', 'chart-builder'),
398 'manage_options',
399 $this->plugin_name . '-featured-plugins',
400 array($this, 'display_plugin_featured_plugins_page')
401 );
402
403 add_action("load-$hook_our_products", array( $this, 'add_tabs' ));
404 }
405
406 public function add_plugin_chart_features_submenu(){
407 $hook_pro_features = add_submenu_page(
408 $this->plugin_name,
409 __('PRO Features', 'chart-builder'),
410 __('PRO Features', 'chart-builder'),
411 'manage_options',
412 $this->plugin_name . '-chart-features',
413 array($this, 'display_plugin_chart_features_page')
414 );
415
416 add_action("load-$hook_pro_features", array( $this, 'add_tabs' ));
417 }
418
419 public function screen_option_charts(){
420 $option = 'per_page';
421 $args = array(
422 'label' => __('Charts', "chart-builder"),
423 'default' => 5,
424 'option' => 'cb_charts_per_page'
425 );
426
427 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
428 if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
429 add_screen_option( $option, $args );
430 }
431
432 $this->db_obj = new Chart_Builder_DB_Actions( $this->plugin_name );
433 }
434
435 public function screen_option_settings(){
436 $this->settings_obj = new Chart_Builder_Settings_DB_Actions( $this->plugin_name );
437 }
438
439 public function add_tabs() {
440 $screen = get_current_screen();
441
442 if ( ! $screen) {
443 return;
444 }
445 }
446
447 public function display_plugin_charts_page(){
448 global $ays_chart_db_actions;
449
450 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
451 $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : '';
452 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
453 $id = (isset($_GET['id'])) ? absint( wp_unslash( $_GET['id'] ) ) : 0;
454 if (isset($_POST['bulk_delete_confirm'])) {
455 if (isset($_POST['bulk-delete']) && !empty($_POST['bulk-delete'])) {
456 $ids = wp_unslash( $_POST['bulk-delete'] );
457 $ids = array_map( 'absint', (array) $ids );
458 foreach ($ids as $id) {
459 if ($id > 0) {
460 $this->db_obj->delete_item( $id );
461 }
462 }
463 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
464 $url = esc_url_raw( add_query_arg( array(
465 "status" => 'all-deleted'
466 ), $url ) );
467 wp_redirect( $url );
468 exit;
469 }
470 }
471
472 switch ($action) {
473 case 'trash':
474 if( $id > 0 ){
475 $this->db_obj->trash_item( $id );
476 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
477 $url = esc_url_raw( add_query_arg( array(
478 "status" => 'trashed'
479 ), $url ) );
480 wp_redirect( $url );
481 exit;
482 }
483 break;
484 case 'restore':
485 if( $id > 0 ){
486 $this->db_obj->restore_item( $id );
487 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
488 $url = esc_url_raw( add_query_arg( array(
489 "status" => 'restored'
490 ), $url ) );
491 wp_redirect( $url );
492 exit;
493 }
494 break;
495 case 'delete':
496 if( $id > 0 ){
497 $this->db_obj->delete_item( $id );
498 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
499 $url = esc_url_raw( add_query_arg( array(
500 "status" => 'deleted'
501 ), $url ) );
502 wp_redirect( $url );
503 exit;
504 }
505 break;
506 case 'publish':
507 if( $id > 0 ){
508 $this->db_obj->publish_item( $id );
509 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
510 $url = esc_url_raw( add_query_arg( array(
511 "status" => 'published'
512 ), $url ) );
513 wp_redirect( $url );
514 exit;
515 }
516 break;
517 case 'unpublish':
518 if( $id > 0 ){
519 $this->db_obj->restore_item( $id );
520 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
521 $url = esc_url_raw( add_query_arg( array(
522 "status" => 'unpublished'
523 ), $url ) );
524 wp_redirect( $url );
525 exit;
526 }
527 break;
528 case 'duplicate':
529 if( $id > 0 ){
530 $this->db_obj->duplicate_item( $id );
531 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
532 $url = esc_url_raw( add_query_arg( array(
533 "status" => 'duplicated'
534 ), $url ) );
535 wp_redirect( $url );
536 exit;
537 }
538 break;
539 case 'add':
540 include_once('partials/charts/actions/chart-builder-charts-actions.php');
541 break;
542 case 'edit':
543 include_once('partials/charts/actions/chart-builder-charts-actions.php');
544 break;
545 default:
546 include_once('partials/charts/chart-builder-charts-display.php');
547 }
548 }
549 public static function chart_builder_svg_sanitize_allowed_properties(){
550
551 $allowed_properties = array(
552 'div' => array(
553 'id' => true,
554 'class' => true,
555 'style' => true,
556 ),
557 'svg' => array(
558 'class' => true,
559 'version' => true,
560 'overflow' => true,
561 'preserveAspectRatio' => true,
562 'preserveaspectratio' => true,
563 'fill' => true,
564 'viewBox' => true,
565 'viewbox' => true,
566 'height' => true,
567 'width' => true,
568 'xmlns' => true,
569 'xmlns:xlink' => true,
570 'id' => true,
571 'title' => true,
572 ),
573 'g' => array(
574 'id' => true,
575 'class' => true,
576 'stroke-width' => true,
577 'stroke-linecap' => true,
578 'stroke-linejoin' => true,
579 ),
580 'path' => array(
581 'id' => true,
582 'class' => true,
583 'd' => true,
584 'fill' => true,
585 'vector-effect' => true,
586 'xmlns:default' => true,
587 ),
588 'span' => array(
589 'class' => true,
590 ),
591 'img' => array(
592 'src' => true,
593 'alt' => true,
594 ),
595 );
596
597 return $allowed_properties;
598 }
599
600 public static function get_allowed_tags_for_loader() {
601 return array(
602 'span' => array('class' => array()),
603 'img' => array('src' => array(), 'alt' => array()),
604 );
605 }
606
607 public function display_plugin_setup_page(){
608 include_once('partials/chart-builder-admin-display.php');
609 }
610
611 public function display_plugin_addnew_page(){
612
613 // $url = remove_query_arg( array('action', 'id', '_wpnonce') );
614 // $url = esc_url_raw( add_query_arg( array(
615 // "action" => 'add'
616 // ), $url ) );
617 // wp_redirect( $url );
618 }
619
620 public function display_plugin_settings_page(){
621 include_once('partials/settings/chart-builder-settings.php');
622 }
623
624 public function display_plugin_featured_plugins_page(){
625 include_once('partials/features/chart-builder-plugin-featured-display.php');
626 }
627
628 public function display_plugin_chart_features_page(){
629 include_once('partials/features/chart-builder-features-display.php');
630 }
631
632 /**
633 * Add settings action link to the plugins page.
634 *
635 * @since 1.0.0
636 */
637 public function add_action_links( $links ){
638
639 $chart_ajax_deactivate_plugin_nonce = wp_create_nonce( 'chart-ajax-deactivate-plugin-nonce' );
640
641 /*
642 * Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name)
643 */
644 $settings_link = array(
645 '<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' . __('Settings', "chart-builder") . '</a>',
646 '<a href="https://ays-demo.com/chart-builder-demo/" target="_blank">' . __('Demo', "chart-builder") . '</a>',
647 // '<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>',
648 '<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>
649 <input type="hidden" id="chart_ajax_deactivate_plugin_nonce" name="chart_ajax_deactivate_plugin_nonce" value="' . $chart_ajax_deactivate_plugin_nonce .'">',
650 );
651 return array_merge( $settings_link, $links );
652
653 }
654
655
656 public static function set_screen($status, $option, $value){
657 return $value;
658 }
659
660 public function ays_admin_ajax(){
661 global $wpdb;
662
663 $response = array(
664 "status" => false
665 );
666 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
667 $function = isset( $_REQUEST['function'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['function'] ) ) : null;
668
669 if($function !== null){
670 $response = array();
671 if( is_callable( array( $this, $function ) ) ){
672 $response = $this->$function();
673
674 ob_end_clean();
675 $ob_get_clean = ob_get_clean();
676 echo json_encode( $response );
677 wp_die();
678 }
679
680 }
681
682 ob_end_clean();
683 $ob_get_clean = ob_get_clean();
684 echo json_encode( $response );
685 wp_die();
686 }
687
688 public function deactivate_plugin_option(){
689 // Run a security check.
690 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
691 check_ajax_referer( 'chart-ajax-deactivate-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
692 } else {
693 wp_die();
694 }
695
696 // Check for permissions.
697 if ( ! current_user_can( 'manage_options' ) ) {
698 ob_end_clean();
699 $ob_get_clean = ob_get_clean();
700 echo json_encode(array(
701 'option' => ''
702 ));
703 wp_die();
704 }
705
706 if( is_user_logged_in() ) {
707 $request_value = isset( $_REQUEST['upgrade_plugin'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['upgrade_plugin'] ) ) : '';
708 $upgrade_option = get_option( 'ays_chart_builder_upgrade_plugin', '' );
709
710 if ( $upgrade_option === '' ) {
711 add_option( 'ays_chart_builder_upgrade_plugin', $request_value );
712 } else {
713 update_option( 'ays_chart_builder_upgrade_plugin', $request_value );
714 }
715
716 $response = array(
717 'option' => get_option( 'ays_chart_builder_upgrade_plugin', '' ),
718 );
719
720 wp_send_json_success( $response );
721 } else {
722 ob_end_clean();
723 $ob_get_clean = ob_get_clean();
724 echo json_encode(array(
725 'option' => ''
726 ));
727 wp_die();
728 }
729 }
730
731 public function chart_builder_admin_footer($a){
732 if(isset($_REQUEST['page'])){// phpcs:ignore WordPress.Security.NonceVerification.Recommended
733 if(false !== strpos( sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ), $this->plugin_name)){// phpcs:ignore WordPress.Security.NonceVerification.Recommended
734 ?>
735 <div class="ays-chart-footer-support-box">
736 <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>
737 <span class="ays-chart-footer-slash-row">/</span>
738 <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>
739 <span class="ays-chart-footer-slash-row">/</span>
740 <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>
741 </div>
742 <p style="font-size:13px;text-align:center;font-style:italic;">
743 <span style="margin-left:0px;margin-right:10px;" class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
744 <span><?php echo esc_html(__( "If you love our plugin, please do big favor and rate us on", "chart-builder")); ?></span>
745 <a target="_blank" href='https://wordpress.org/support/plugin/chart-builder/reviews/'>WordPress.org</a>
746 <span class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
747 </p>
748 <?php
749 }
750 }
751 }
752
753 // Chart Builder Elementor widget init
754 public function chart_builder_el_widgets_registered() {
755 // We check if the Elementor plugin has been installed / activated.
756 if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
757 // get our own widgets up and running:
758 // copied from widgets-manager.php
759 if ( class_exists( 'Elementor\Plugin' ) ) {
760 if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
761 $elementor = Elementor\Plugin::instance();
762 if ( isset( $elementor->widgets_manager ) ) {
763 if ( method_exists( $elementor->widgets_manager, 'register_widget_type' ) ) {
764 wp_enqueue_style($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
765 $widget_file = 'plugins/elementor/chart-builder-elementor.php';
766 $template_file = locate_template( $widget_file );
767 if ( !$template_file || !is_readable( $template_file ) ) {
768 $template_file = CHART_BUILDER_DIR . 'pb_templates/chart-builder-elementor.php';
769 }
770 if ( $template_file && is_readable( $template_file ) ) {
771 require_once $template_file;
772 Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Elementor\Widget_Chart_Builder_Elementor() );
773 }
774 }
775 }
776 }
777 }
778 }
779 }
780
781 public function fetch_post_type_props(){
782 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
783 $nonce = isset( $_POST['nonce'] ) ? wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'cbuilder-fetch-post-type-props' ) : '';
784 if ( $nonce ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
785 $results = isset($_POST['post_type']) ? CBFunctions()->get_post_type_properties( sanitize_text_field( wp_unslash($_POST['post_type']) ) ) : '';
786
787 return array(
788 'success' => true,
789 'fields' => $results,
790 );
791 }
792
793 return array(
794 'success' => false,
795 );
796 }
797
798 public static function get_max_id( $table ) {
799 global $wpdb;
800 $db_table = $wpdb->prefix . CHART_BUILDER_DB_PREFIX . $table;
801
802 $sql = "SELECT MAX(id) FROM {$db_table}";
803
804 $result = intval( $wpdb->get_var( $sql ) );
805
806 return $result;
807 }
808
809 public static function ays_restriction_string($type, $x, $length){
810 $output = "";
811 switch($type){
812 case "char":
813 if(strlen($x)<=$length){
814 $output = $x;
815 } else {
816 $output = substr($x,0,$length) . '...';
817 }
818 break;
819 case "word":
820 $res = explode(" ", $x);
821 if(count($res)<=$length){
822 $output = implode(" ",$res);
823 } else {
824 $res = array_slice($res,0,$length);
825 $output = implode(" ",$res) . '...';
826 }
827 break;
828 }
829 return $output;
830 }
831
832 public function ays_chart_sale_banner(){
833 // 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' )) {
834 // update_option('ays_chart_sale_btn', 1);
835 // update_option('ays_chart_sale_date', current_time( 'mysql' ));
836 // }
837
838 $ays_chart_sale_date = get_option('ays_chart_sale_date');
839
840 $val = 60*60*24*5;
841
842 $current_date = current_time( 'mysql' );
843 $date_diff = strtotime($current_date) - intval(strtotime($ays_chart_sale_date)) ;
844
845 $days_diff = $date_diff / $val;
846
847 if(intval($days_diff) > 0 ){
848 update_option('ays_chart_sale_btn', 0);
849 }
850
851 $ays_chart_builder_flag = intval(get_option('ays_chart_sale_btn'));
852 if( $ays_chart_builder_flag == 0 ){
853 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
854 if ( isset( $_GET['page'] ) && strpos( sanitize_text_field( wp_unslash( $_GET['page'] ) ), CHART_BUILDER_NAME ) !== false ) {
855 if( !(Chart_Builder_Admin::get_max_id('charts') <= 1) ){
856 // $this->ays_chart_sale_message_30_emma($ays_chart_builder_flag);
857 $this->ays_chart_new_silver_bundle_message_2025($ays_chart_builder_flag);
858 // $this->ays_chart_helloween_message($ays_chart_builder_flag);
859 // $this->ays_chart_christmas_message($ays_chart_builder_flag);
860 // $this->ays_chart_silver_bundle_message($ays_chart_builder_flag);
861 // $this->ays_chart_black_friday_message_2024($ays_chart_builder_flag);
862 // $this->ays_chart_christmas_message_2024($ays_chart_builder_flag);
863 }
864 }
865 }
866 }
867
868 public function ays_chart_dismiss_button(){
869
870 $data = array(
871 'status' => false,
872 );
873
874 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_chart_dismiss_button') {
875 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' ) ) {
876 update_option('ays_chart_sale_btn', 1);
877 update_option('ays_chart_sale_date', current_time( 'mysql' ));
878 $data['status'] = true;
879 }
880 }
881
882 ob_end_clean();
883 $ob_get_clean = ob_get_clean();
884 echo json_encode($data);
885 wp_die();
886
887 }
888
889 // 30% Sale Emma
890 public function ays_chart_sale_message_30_emma($ishmar){
891 if($ishmar == 0 ){
892 $content = array();
893 $content[] = '<div id="ays-chart-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_chart_dicount_info">';
894 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
895
896 $content[] = '<div class="ays-chart-discount-box-sale-image"></div>';
897 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
898
899 $content[] = '<div class="ays-chart-dicount-wrap-text-box-texts">';
900 $content[] = '<div>
901 <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;">
902 <span class="ays-chart-new-mega-bundle-limited-text">Limited</span> Offer for Chart Builder </a> <br>
903 </div>';
904 $content[] = '</div>';
905
906 $content[] = '<div style="font-size: 17px;">';
907 $content[] = '<img style="width: 24px; height: 24px;" src="' . esc_url(plugins_url('admin/images/icons/guarantee-new.png', dirname(__FILE__))) . '">';// phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage
908 $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>';
909
910 $content[] = '</div>';
911
912
913
914 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
915
916 $content[] = '<form action="" method="POST">';
917 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
918 if( current_user_can( 'manage_options' ) ){
919 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B;
920 ">Dismiss ad</button>';
921 $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
922 }
923 $content[] = '</div>';
924 $content[] = '</form>';
925
926 $content[] = '</div>';
927
928 $content[] = '</div>';
929
930 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
931
932 $content[] = '<div id="ays-chart-countdown-main-container">';
933 $content[] = '<div class="ays-chart-countdown-container">';
934
935 $content[] = '<div id="ays-chart-countdown">';
936
937 $content[] = '<div style="font-weight: 500;">';
938 $content[] = __( "Offer ends in:", "chart-builder" );
939 $content[] = '</div>';
940
941 $content[] = '<ul>';
942 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
943 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
944 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
945 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
946 $content[] = '</ul>';
947 $content[] = '</div>';
948
949 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
950 $content[] = '<span>🚀</span>';
951 $content[] = '<span>⌛</span>';
952 $content[] = '<span>🔥</span>';
953 $content[] = '<span>💣</span>';
954 $content[] = '</div>';
955
956 $content[] = '</div>';
957 $content[] = '</div>';
958
959 $content[] = '</div>';
960
961 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
962 $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>';
963 $content[] = '<span >One-time payment</span>';
964 $content[] = '</div>';
965 $content[] = '</div>';
966 $content[] = '</div>';
967
968 $content = implode( '', $content );
969 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
970
971 }
972 }
973
974 // Self 20% sale
975 public static function ays_chart_sale_message20($ishmar){
976 if($ishmar == 0 ){
977 $content = array();
978
979 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
980 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
981 // $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>';
982
983 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
984
985 $content[] = '<div class="ays-chart-dicount-sale-name-discount-box">';
986 $content[] = '<span class="ays-chart-new-chart-pro-title">';
987 // Translators: %s is the URL to the Chart Builder plugin page.
988 $content[] = sprintf(
989 /* translators: %s is the Chart Builder plugin URL. */
990 __(
991 "<span><a href='%s' target='_blank' style='color:#ffffff; text-decoration: underline;'>Chart Builder</a></span>",
992 'chart-builder'
993 ),
994 "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
995 );
996 $content[] = '</span>';
997 $content[] = '<div>';
998 $content[] = '<img src="' . esc_url(plugins_url('admin/images/ays-chart-banner-sale-30.svg', dirname(__FILE__))) . '" style="width: 70px;">';// phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage
999 $content[] = '</div>';
1000 $content[] = '</div>';
1001
1002 $content[] = '<span class="ays-chart-new-chart-pro-desc">';
1003 $content[] = '<img class="ays-chart-new-chart-pro-guaranteeicon" src="' . esc_url(plugins_url('admin/images/chart-builder-guaranteeicon.webp', dirname(__FILE__))) . '" style="width: 30px;">'; // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage
1004 $content[] = esc_html__( "30 Days Money Back Guarantee", 'chart-builder' );
1005 $content[] = '</span>';
1006
1007 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
1008 $content[] = '<form method="POST">';
1009 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1010 if (current_user_can( 'manage_options' )) {
1011 $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>';
1012 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1013 }
1014 $content[] = '</div>';
1015 $content[] = '</form>';
1016 $content[] = '</div>';
1017
1018 $content[] = '</div>';
1019
1020 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1021
1022 $content[] = '<div id="ays-chart-countdown-main-container">';
1023 $content[] = '<div class="ays-chart-countdown-container">';
1024 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1025 $content[] = esc_html__( "Offer ends in:", 'chart-builder' );
1026
1027 $content[] = '<ul style="padding: 0">';
1028 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . esc_html__( 'Days', 'chart-builder' ) . '</li>';
1029 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . esc_html__( 'Hours', 'chart-builder' ) . '</li>';
1030 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . esc_html__( 'Minutes', 'chart-builder' ) . '</li>';
1031 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . esc_html__( 'Seconds', 'chart-builder' ) . '</li>';
1032 $content[] = '</ul>';
1033 $content[] = '</div>';
1034
1035 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1036 $content[] = '<span>🚀</span>';
1037 $content[] = '<span>⌛</span>';
1038 $content[] = '<span>🔥</span>';
1039 $content[] = '<span>💣</span>';
1040 $content[] = '</div>';
1041 $content[] = '</div>';
1042 $content[] = '</div>';
1043
1044 $content[] = '</div>';
1045
1046 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1047 $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>';
1048 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1049 $content[] = esc_html__( "One-time payment", 'chart-builder' );
1050 $content[] = '</span>';
1051 $content[] = '</div>';
1052
1053 $content[] = '</div>';
1054
1055 $content[] = '</div>';
1056
1057 $content = implode( '', $content );
1058 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1059 }
1060 }
1061
1062 // Helloween banner
1063 public static function ays_chart_helloween_message($ishmar){
1064 if($ishmar == 0 ){
1065 $content = array();
1066
1067 $content[] = '<div id="ays-chart-dicount-month-main-helloween" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1068 $content[] = '<div id="ays-chart-dicount-month-helloween" class="ays_chart_dicount_month_helloween">';
1069 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-limited">';
1070
1071 $content[] = '<p>';
1072 $content[] = __( "Limited Time
1073 <span class='ays-chart-dicount-wrap-color-helloween' style='color:#b2ff00;'>30%</span>
1074 <span>
1075 SALE on
1076 </span>
1077 <br>
1078 <span style='' class='ays-chart-helloween-bundle'>
1079 <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;'>
1080 Chart Builder
1081 </a>
1082 </span>", 'chart-builder' );
1083 $content[] = '</p>';
1084 $content[] = '<p>';
1085 $content[] = __( "Hurry up!
1086 <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;'>
1087 Check it out!
1088 </a>", 'chart-builder' );
1089 $content[] = '</p>';
1090
1091 $content[] = '</div>';
1092
1093
1094 $content[] = '<div class="ays-chart-helloween-bundle-buy-now-timer">';
1095 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-timer">';
1096 $content[] = '<div id="ays-chart-countdown-main-container" class="ays-chart-countdown-main-container-helloween">';
1097 $content[] = '<div class="ays-chart-countdown-container-helloween">';
1098 $content[] = '<div id="ays-chart-countdown">';
1099 $content[] = '<ul>';
1100 $content[] = '<li><p><span id="ays-chart-countdown-days"></span><span>days</span></p></li>';
1101 $content[] = '<li><p><span id="ays-chart-countdown-hours"></span><span>Hours</span></p></li>';
1102 $content[] = '<li><p><span id="ays-chart-countdown-minutes"></span><span>Mins</span></p></li>';
1103 $content[] = '<li><p><span id="ays-chart-countdown-seconds"></span><span>Secs</span></p></li>';
1104 $content[] = '</ul>';
1105 $content[] = '</div>';
1106
1107 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1108 $content[] = '<span>🚀</span>';
1109 $content[] = '<span>⌛</span>';
1110 $content[] = '<span>🔥</span>';
1111 $content[] = '<span>💣</span>';
1112 $content[] = '</div>';
1113
1114 $content[] = '</div>';
1115
1116 $content[] = '</div>';
1117
1118 $content[] = '</div>';
1119 $content[] = '<div class="ays-chart-dicount-wrap-box ays-buy-now-button-box-helloween">';
1120 $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>';
1121 $content[] = '</div>';
1122 $content[] = '</div>';
1123
1124 $content[] = '</div>';
1125
1126 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-helloween">';
1127 $content[] = '<form method="POST">';
1128 $content[] = '<div id="ays-chart-dismiss-buttons-content-helloween">';
1129 if( current_user_can( 'manage_options' ) ){
1130 $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>';
1131 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1132 }
1133 $content[] = '</div>';
1134 $content[] = '</form>';
1135
1136 $content[] = '</div>';
1137 // $content[] = '<button type="button" class="notice-dismiss">';
1138 // $content[] = '</button>';
1139 $content[] = '</div>';
1140
1141 $content = implode( '', $content );
1142
1143 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1144 }
1145 }
1146
1147 // Black Friday banner
1148 public static function ays_chart_black_friday_message($ishmar){
1149 if($ishmar == 0 ){
1150 $content = array();
1151
1152 $content[] = '<div id="ays-chart-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1153 $content[] = '<div id="ays-chart-dicount-black-friday-month" class="ays_chart_dicount_month">';
1154 $content[] = '<div class="ays-chart-dicount-black-friday-box">';
1155 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-box-80" style="width: 70%;">';
1156 $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>';
1157 $content[] = '<div class="ays-chart-dicount-black-friday-title-row">' . __( 'Chart Builder plugin', "chart-builder" ) . '</div>';
1158 $content[] = '</div>';
1159
1160 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-text-box">';
1161 $content[] = '<div class="ays-chart-dicount-black-friday-text-row">' . __( '20% off', "chart-builder" ) . '</div>';
1162 $content[] = '</div>';
1163
1164 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1165 $content[] = '<div id="ays-chart-countdown-main-container">';
1166 $content[] = '<div class="ays-chart-countdown-container">';
1167 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1168 $content[] = '<ul>';
1169 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . __( 'Days', "chart-builder" ) . '</li>';
1170 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . __( 'Hours', "chart-builder" ) . '</li>';
1171 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . __( 'Minutes', "chart-builder" ) . '</li>';
1172 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . __( 'Seconds', "chart-builder" ) . '</li>';
1173 $content[] = '</ul>';
1174 $content[] = '</div>';
1175 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1176 $content[] = '<span>🚀</span>';
1177 $content[] = '<span>⌛</span>';
1178 $content[] = '<span>🔥</span>';
1179 $content[] = '<span>💣</span>';
1180 $content[] = '</div>';
1181 $content[] = '</div>';
1182 $content[] = '</div>';
1183 $content[] = '</div>';
1184
1185 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1186 $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>';
1187 $content[] = '</div>';
1188 $content[] = '</div>';
1189 $content[] = '</div>';
1190
1191 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-black-friday">';
1192 $content[] = '<form method="POST">';
1193 $content[] = '<div id="ays-chart-dismiss-buttons-content-black-friday">';
1194 if( current_user_can( 'manage_options' ) ){
1195 $content[] = '<button class="btn btn-link ays-button-black-friday" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', "chart-builder" ) . '</button>';
1196 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1197 }
1198 $content[] = '</div>';
1199 $content[] = '</form>';
1200 $content[] = '</div>';
1201 $content[] = '</div>';
1202
1203 $content = implode( '', $content );
1204
1205 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1206 }
1207 }
1208
1209 // Christmas banner
1210 public static function ays_chart_christmas_message($ishmar){
1211 if($ishmar == 0 ){
1212 $content = array();
1213
1214 $content[] = '<div id="ays-chart-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1215 $content[] = '<div id="ays-chart-dicount-christmas-month" class="ays_chart_dicount_month">';
1216 $content[] = '<div class="ays-chart-dicount-christmas-box">';
1217 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box ays-chart-dicount-christmas-wrap-box-80">';
1218 $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>';
1219 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Chart Builder Plugin', 'chart-builder' ) . '</div>';
1220 $content[] = '</div>';
1221
1222 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1223 $content[] = '<div id="ays-chart-countdown-main-container">';
1224 $content[] = '<div class="ays-chart-countdown-container">';
1225 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1226 $content[] = '<ul>';
1227 $content[] = '<li><span id="ays-chart-countdown-days"></span>' . __( 'Days', 'chart-builder' ) . '</li>';
1228 $content[] = '<li><span id="ays-chart-countdown-hours"></span>' . __( 'Hours', 'chart-builder' ) . '</li>';
1229 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>' . __( 'Minutes', 'chart-builder' ) . '</li>';
1230 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>' . __( 'Seconds', 'chart-builder' ) . '</li>';
1231 $content[] = '</ul>';
1232 $content[] = '</div>';
1233 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1234 $content[] = '<span>🚀</span>';
1235 $content[] = '<span>⌛</span>';
1236 $content[] = '<span>🔥</span>';
1237 $content[] = '<span>💣</span>';
1238 $content[] = '</div>';
1239 $content[] = '</div>';
1240 $content[] = '</div>';
1241 $content[] = '</div>';
1242
1243 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1244 $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>';
1245 $content[] = '</div>';
1246 $content[] = '</div>';
1247 $content[] = '</div>';
1248
1249 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-christmas">';
1250 $content[] = '<form method="POST">';
1251 $content[] = '<div id="ays-chart-dismiss-buttons-content-christmas">';
1252 $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', 'chart-builder' ) . '</button>';
1253 $content[] = '</div>';
1254 $content[] = '</form>';
1255 $content[] = '</div>';
1256 $content[] = '</div>';
1257
1258 $content = implode( '', $content );
1259
1260 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1261 }
1262 }
1263
1264 // Silver Bundle
1265 public function ays_chart_silver_bundle_message($ishmar){
1266 if($ishmar == 0 ){
1267 $content = array();
1268
1269 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1270 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1271 $content[] = '<a href="https://ays-pro.com/silver-bundle" target="_blank" class="ays-chart-sale-banner-link"><img src="' . esc_url(plugins_url('/images/silver_bundle_logo_box.png', dirname(__FILE__))) . '"></a>';// phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage
1272
1273 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1274
1275 $content[] = '<strong style="font-weight: bold;">';
1276 $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' );
1277 $content[] = '</strong>';
1278
1279 $content[] = '<br>';
1280
1281 $content[] = '<strong>';
1282 $content[] = __( "Hurry up! <a href='https://ays-pro.com/silver-bundle' target='_blank'>Check it out!</a>", 'chart-builder' );
1283 $content[] = '</strong>';
1284
1285 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1286
1287 $content[] = '<form method="POST">';
1288 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1289 $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>';
1290 $content[] = '</div>';
1291 $content[] = '</form>';
1292
1293 $content[] = '</div>';
1294
1295 $content[] = '</div>';
1296
1297 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1298
1299 $content[] = '<div id="ays-chart-countdown-main-container">';
1300 $content[] = '<div class="ays-chart-countdown-container">';
1301
1302 $content[] = '<div id="ays-chart-countdown">';
1303 $content[] = '<ul>';
1304 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
1305 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
1306 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
1307 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
1308 $content[] = '</ul>';
1309 $content[] = '</div>';
1310
1311 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1312 $content[] = '<span>🚀</span>';
1313 $content[] = '<span>⌛</span>';
1314 $content[] = '<span>🔥</span>';
1315 $content[] = '<span>💣</span>';
1316 $content[] = '</div>';
1317
1318 $content[] = '</div>';
1319 $content[] = '</div>';
1320
1321 $content[] = '</div>';
1322
1323 $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>';
1324 $content[] = '</div>';
1325 $content[] = '</div>';
1326
1327 $content = implode( '', $content );
1328 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1329 }
1330 }
1331
1332 // Black Friday 2024
1333 public function ays_chart_black_friday_message_2024($ishmar){
1334 if($ishmar == 0 ){
1335 $content = array();
1336
1337 $content[] = '<div id="ays-chart-black-friday-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1338 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1339
1340 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1341
1342 $content[] = '<div id="ays-chart-countdown-main-container">';
1343 $content[] = '<div class="ays-chart-countdown-container">';
1344
1345 $content[] = '<div id="ays-chart-countdown">';
1346
1347 $content[] = '<div>';
1348 $content[] = __( "Offer ends in:", 'chart-builder' );
1349 $content[] = '</div>';
1350
1351 $content[] = '<ul>';
1352 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1353 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1354 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1355 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1356 $content[] = '</ul>';
1357 $content[] = '</div>';
1358
1359 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1360 $content[] = '<span>🚀</span>';
1361 $content[] = '<span>⌛</span>';
1362 $content[] = '<span>🔥</span>';
1363 $content[] = '<span>💣</span>';
1364 $content[] = '</div>';
1365
1366 $content[] = '</div>';
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[] = '<div>';
1373
1374 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1375 $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' );
1376 $content[] = '</span>';
1377
1378 $content[] = '</br>';
1379
1380 $content[] = '<span class="ays-chart-black-friday-bundle-desc">';
1381 $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">';
1382 $content[] = __( "50% OFF", 'chart-builder' );
1383 $content[] = '</a>';
1384 $content[] = '</span>';
1385 $content[] = '</div>';
1386
1387 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1388
1389 $content[] = '<form action="" method="POST">';
1390 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1391 if( current_user_can( 'manage_options' ) ){
1392 $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>';
1393 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1394 }
1395 $content[] = '</div>';
1396 $content[] = '</form>';
1397
1398 $content[] = '</div>';
1399
1400 $content[] = '</div>';
1401
1402 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1403 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1404 $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">';
1405 $content[] = __( 'Silver Bundle', 'chart-builder' );
1406 $content[] = '</a>';
1407 $content[] = '</span>';
1408 $content[] = '</div>';
1409
1410 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1411 $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>';
1412 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1413 $content[] = __( "One-time payment", 'chart-builder' );
1414 $content[] = '</span>';
1415 $content[] = '</div>';
1416 $content[] = '</div>';
1417 $content[] = '</div>';
1418
1419 $content = implode( '', $content );
1420 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1421 }
1422 }
1423
1424 //silver bundle
1425 public function ays_chart_new_silver_bundle_message_2025($ishmar){
1426 if($ishmar == 0 ){
1427 $content = array();
1428
1429 $content[] = '<div id="ays-chart-new-silver-bundle-2025-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1430 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
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-new-silver-bundle-2025-title">';
1436 $content[] = __( "<span><a href='https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=new_silver_bundle_message_2025' style='color:#ffffff; text-decoration: underline;'>Silver Bundle</a></span> (Quiz + Form + Chart)", 'quiz-maker' );
1437 $content[] = '<span>';
1438 $content[] = '<img class="ays-chart-new-silver-bundle-discount" src="' . CHART_BUILDER_ADMIN_URL . '/images/ays-chart-banner-50.svg" style="width: 60px;">';
1439 $content[] = '</span>';
1440
1441 $content[] = '</span>';
1442
1443 $content[] = '</br>';
1444
1445 $content[] = '<span class="ays-chart-new-silver-bundle-2025-desc">';
1446 $content[] = '<span>';
1447 $content[] = '<img class="ays-chart-new-silver-bundle-guaranteeicon" src="' . CHART_BUILDER_ADMIN_URL . '/images/ays-chart-guaranteeicon.svg" style="width: 30px;">';
1448 $content[] = '</span>';
1449 $content[] = __( "30 Day Money Back Guarantee", 'chart-builder' );
1450 $content[] = '</span>';
1451 $content[] = '</div>';
1452
1453 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1454
1455 $content[] = '<form action="" method="POST">';
1456 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1457 if( current_user_can( 'manage_options' ) ){
1458 $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>';
1459 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1460 }
1461 $content[] = '</div>';
1462 $content[] = '</form>';
1463
1464 $content[] = '</div>';
1465
1466 $content[] = '</div>';
1467
1468 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1469
1470 $content[] = '<div id="ays-chart-countdown-main-container">';
1471 $content[] = '<div class="ays-chart-countdown-container">';
1472
1473 $content[] = '<div id="ays-chart-countdown">';
1474
1475 $content[] = '<ul>';
1476 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1477 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1478 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1479 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1480 $content[] = '</ul>';
1481 $content[] = '</div>';
1482
1483 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1484 $content[] = '<span></span>';
1485 $content[] = '<span></span>';
1486 $content[] = '<span></span>';
1487 $content[] = '<span></span>';
1488 $content[] = '</div>';
1489
1490 $content[] = '</div>';
1491 $content[] = '</div>';
1492
1493 $content[] = '</div>';
1494
1495 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1496 $content[] = '<a href="https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=new-silver-bundle-message-2025" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now', 'chart-builder' ) . '</a>';
1497 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1498 $content[] = __( "One-time payment", 'chart-builder' );
1499 $content[] = '</span>';
1500 $content[] = '</div>';
1501 $content[] = '</div>';
1502 $content[] = '</div>';
1503
1504 $content = implode( '', $content );
1505 echo wp_kses_post($content);
1506 }
1507 }
1508
1509
1510 // Christmas Top Banner 2024
1511 public function ays_chart_christmas_message_2024($ishmar){
1512 if($ishmar == 0 ){
1513 $content = array();
1514
1515 $content[] = '<div id="ays-chart-christmas-top-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1516 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1517
1518 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1519
1520 $content[] = '<div id="ays-chart-countdown-main-container">';
1521 $content[] = '<div class="ays-chart-countdown-container">';
1522
1523 $content[] = '<div id="ays-chart-countdown">';
1524
1525 $content[] = '<div>';
1526 $content[] = __( "Offer ends in:", 'chart-builder' );
1527 $content[] = '</div>';
1528
1529 $content[] = '<ul style="padding-left: 0;">';
1530 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", 'chart-builder' ) .'</li>';
1531 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", 'chart-builder' ) .'</li>';
1532 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", 'chart-builder' ) .'</li>';
1533 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", 'chart-builder' ) .'</li>';
1534 $content[] = '</ul>';
1535 $content[] = '</div>';
1536
1537 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1538 $content[] = '<span>🚀</span>';
1539 $content[] = '<span>⌛</span>';
1540 $content[] = '<span>🔥</span>';
1541 $content[] = '<span>💣</span>';
1542 $content[] = '</div>';
1543
1544 $content[] = '</div>';
1545 $content[] = '</div>';
1546
1547 $content[] = '</div>';
1548
1549 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1550 $content[] = '<div>';
1551
1552 $content[] = '<span class="ays-chart-christmas-top-bundle-title">';
1553 $content[] = sprintf(
1554 /* translators: %s is the Chart Builder plugin URL with version parameter. */
1555 __(
1556 "<span><a href='%s' class='ays-chart-christmas-top-bundle-title-link' target='_blank'>Christmas Sale</a></span>",
1557 'chart-builder'
1558 ),
1559 "https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner" . CHART_BUILDER_VERSION
1560 );
1561 $content[] = '</span>';
1562
1563 $content[] = '</br>';
1564
1565 $content[] = '<span class="ays-chart-christmas-top-bundle-desc">';
1566 $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">';
1567 $content[] = __( "20% Extra OFF", 'chart-builder' );
1568 $content[] = '</a>';
1569 $content[] = '</span>';
1570 $content[] = '</div>';
1571
1572 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1573
1574 $content[] = '<form action="" method="POST">';
1575 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1576 if( current_user_can( 'manage_options' ) ){
1577 $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>';
1578 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1579 }
1580 $content[] = '</div>';
1581 $content[] = '</form>';
1582
1583 $content[] = '</div>';
1584
1585 $content[] = '</div>';
1586
1587 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-christmas-top-bundle-coupon-text-box">';
1588 $content[] = '<div class="ays-chart-christmas-top-bundle-coupon-row">';
1589 $content[] = 'xmas20off';
1590 $content[] = '</div>';
1591 $content[] = '<div class="ays-chart-christmas-top-bundle-text-row">';
1592 $content[] = __( '20% Extra Discount Coupon', 'chart-builder' );
1593 $content[] = '</div>';
1594 $content[] = '</div>';
1595
1596 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1597 $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>';
1598 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1599 $content[] = __( "One-time payment", 'chart-builder' );
1600 $content[] = '</span>';
1601 $content[] = '</div>';
1602 $content[] = '</div>';
1603 $content[] = '</div>';
1604
1605 $content = implode( '', $content );
1606 echo wp_kses_post( html_entity_decode( $content, ENT_QUOTES, 'UTF-8' ) );
1607 }
1608 }
1609
1610 public function ays_chart_update_banner_time(){
1611
1612 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
1613 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
1614 $next_3_days = gmdate('M d, Y H:i:s', $date);
1615
1616 $ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1617
1618 if ( !$ays_chart_banner_time || is_null( $ays_chart_banner_time ) ) {
1619 update_option('ays_chart_20_bundle_banner_time', $next_3_days );
1620 }
1621
1622 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1623
1624 $val = 60*60*24*0.5; // half day
1625 // $val = 60; // for testing | 1 min
1626
1627 $current_date = current_time( 'mysql' );
1628 $date_diff = strtotime($current_date) - intval(strtotime($get_ays_chart_banner_time));
1629
1630 $days_diff = $date_diff / $val;
1631 if(intval($days_diff) > 0 ){
1632 update_option('ays_chart_20_bundle_banner_time', $next_3_days);
1633 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1634 }
1635
1636 return $get_ays_chart_banner_time;
1637 }
1638
1639 public function author_user_search() {
1640 check_ajax_referer( 'cbuilder-author-user-search', 'security' );
1641 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
1642 $search = isset($params['search']) && $params['search'] != '' ? sanitize_text_field( $params['search'] ) : null;
1643 $checked = isset($params['val']) && $params['val'] !='' ? sanitize_text_field( $params['val'] ) : null;
1644 $args = 'search=';
1645 if ($search !== null) {
1646 $args .= '*';
1647 $args .= $search;
1648 $args .= '*';
1649 }
1650
1651 $users = get_users($args);
1652
1653 $content_text = array(
1654 'results' => array()
1655 );
1656
1657 foreach ($users as $key => $value) {
1658 if ($checked !== null) {
1659 if ( !is_array( $checked ) ) {
1660 $checked2 = $checked;
1661 $checked = array();
1662 $checked[] = absint($checked2);
1663 }
1664 if (in_array($value->ID, $checked)) {
1665 continue;
1666 } else {
1667 $content_text['results'][] = array(
1668 'id' => $value->ID,
1669 'text' => $value->data->display_name,
1670 );
1671 }
1672 } else {
1673 $content_text['results'][] = array(
1674 'id' => $value->ID,
1675 'text' => $value->data->display_name,
1676 );
1677 }
1678 }
1679
1680 ob_end_clean();
1681 echo json_encode($content_text);
1682 wp_die();
1683 }
1684
1685 /**
1686 * Determine if the plugin/addon installations are allowed.
1687 *
1688 * @since 6.4.0.4
1689 *
1690 * @param string $type Should be `plugin` or `addon`.
1691 *
1692 * @return bool
1693 */
1694 public static function ays_chart_can_install( $type ) {
1695
1696 return self::ays_chart_can_do( 'install', $type );
1697 }
1698
1699 /**
1700 * Determine if the plugin/addon activations are allowed.
1701 *
1702 * @since 6.4.0.4
1703 *
1704 * @param string $type Should be `plugin` or `addon`.
1705 *
1706 * @return bool
1707 */
1708 public static function ays_chart_can_activate( $type ) {
1709
1710 return self::ays_chart_can_do( 'activate', $type );
1711 }
1712
1713 /**
1714 * Determine if the plugin/addon installations/activations are allowed.
1715 *
1716 * @since 6.4.0.4
1717 *
1718 * @param string $what Should be 'activate' or 'install'.
1719 * @param string $type Should be `plugin` or `addon`.
1720 *
1721 * @return bool
1722 */
1723 public static function ays_chart_can_do( $what, $type ) {
1724
1725 if ( ! in_array( $what, array( 'install', 'activate' ), true ) ) {
1726 return false;
1727 }
1728
1729 if ( ! in_array( $type, array( 'plugin', 'addon' ), true ) ) {
1730 return false;
1731 }
1732
1733 $capability = $what . '_plugins';
1734
1735 if ( ! current_user_can( $capability ) ) {
1736 return false;
1737 }
1738
1739 // Determine whether file modifications are allowed and it is activation permissions checking.
1740 if ( $what === 'install' && ! wp_is_file_mod_allowed( 'ays_chart_can_install' ) ) {
1741 return false;
1742 }
1743
1744 // All plugin checks are done.
1745 if ( $type === 'plugin' ) {
1746 return true;
1747 }
1748 return false;
1749 }
1750
1751 /**
1752 * Activate plugin.
1753 *
1754 * @since 1.0.0
1755 * @since 6.4.0.4 Updated the permissions checking.
1756 */
1757 public function ays_chart_activate_plugin() {
1758
1759 // Run a security check.
1760 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
1761 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1762 }
1763
1764 // Check for permissions.
1765 if ( ! current_user_can( 'activate_plugins' ) ) {
1766 wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', 'chart-builder' ) );
1767 }
1768
1769 $type = 'addon';
1770
1771 if ( isset( $_POST['plugin'] ) ) {
1772
1773 if ( ! empty( $_POST['type'] ) ) {
1774 $type = sanitize_key( $_POST['type'] );
1775 }
1776
1777 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
1778 $activate = activate_plugins( $plugin );
1779
1780 if ( ! is_wp_error( $activate ) ) {
1781 if ( $type === 'plugin' ) {
1782 wp_send_json_success( esc_html__( 'Plugin activated.', 'chart-builder' ) );
1783 } else {
1784 ( esc_html__( 'Addon activated.', 'chart-builder' ) );
1785 }
1786 }
1787 }
1788
1789 if ( $type === 'plugin' ) {
1790 wp_send_json_error( esc_html__( 'Could not activate the plugin. Please activate it on the Plugins page.', 'chart-builder' ) );
1791 }
1792
1793 wp_send_json_error( esc_html__( 'Could not activate the addon. Please activate it on the Plugins page.', 'chart-builder' ) );
1794 }
1795
1796 /**
1797 * Install addon.
1798 *
1799 * @since 1.0.0
1800 * @since 6.4.0.4 Updated the permissions checking.
1801 */
1802 public function ays_chart_install_plugin() {
1803
1804 // Run a security check.
1805 if ( isset( $_REQUEST['_ajax_nonce'] ) ) {
1806 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1807 }
1808
1809 $generic_error = esc_html__( 'There was an error while performing your request.', 'chart-builder' );
1810 $type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
1811
1812 // Check if new installations are allowed.
1813 if ( ! self::ays_chart_can_install( $type ) ) {
1814 wp_send_json_error( $generic_error );
1815 }
1816
1817 $error = $type === 'plugin'
1818 ? esc_html__( 'Could not install the plugin. Please download and install it manually.', 'chart-builder' )
1819 : "";
1820
1821 $plugin_url = ! empty( $_POST['plugin'] ) ? esc_url_raw( wp_unslash( $_POST['plugin'] ) ) : '';
1822
1823 if ( empty( $plugin_url ) ) {
1824 wp_send_json_error( $error );
1825 }
1826
1827 // Prepare variables.
1828 $url = esc_url_raw(
1829 add_query_arg(
1830 [
1831 'page' => 'chart-builder-featured-plugins',
1832 ],
1833 admin_url( 'admin.php' )
1834 )
1835 );
1836
1837 ob_start();
1838 $creds = request_filesystem_credentials( $url, '', false, false, null );
1839
1840 // Hide the filesystem credentials form.
1841 ob_end_clean();
1842
1843 // Check for file system permissions.
1844 if ( $creds === false ) {
1845 wp_send_json_error( $error );
1846 }
1847
1848 if ( ! WP_Filesystem( $creds ) ) {
1849 wp_send_json_error( $error );
1850 }
1851
1852 /*
1853 * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
1854 */
1855 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-upgrader.php';
1856 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-install-skin.php';
1857 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-skin.php';
1858
1859
1860 // Do not allow WordPress to search/download translations, as this will break JS output.
1861 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1862
1863 // Create the plugin upgrader with our custom skin.
1864 $installer = new ChartBuilder\Helpers\ChartBuilderPluginSilentUpgrader( new Chart_Builder_Install_Skin() );
1865
1866 // Error check.
1867 if ( ! method_exists( $installer, 'install' ) ) {
1868 wp_send_json_error( $error );
1869 }
1870
1871 $installer->install( $plugin_url );
1872
1873 // Flush the cache and return the newly installed plugin basename.
1874 wp_cache_flush();
1875
1876 $plugin_basename = $installer->plugin_info();
1877
1878 if ( empty( $plugin_basename ) ) {
1879 wp_send_json_error( $error );
1880 }
1881
1882 $result = array(
1883 'msg' => $generic_error,
1884 'is_activated' => false,
1885 'basename' => $plugin_basename,
1886 );
1887
1888 // Check for permissions.
1889 if ( ! current_user_can( 'activate_plugins' ) ) {
1890 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed.', 'chart-builder' ) : "";
1891
1892 wp_send_json_success( $result );
1893 }
1894
1895 // Activate the plugin silently.
1896 $activated = activate_plugin( $plugin_basename );
1897 remove_action( 'activated_plugin', array( 'ays_sccp_activation_redirect_method', 'gallery_p_gallery_activation_redirect_method', 'poll_maker_activation_redirect_method' ), 100 );
1898
1899 if ( ! is_wp_error( $activated ) ) {
1900
1901 $result['is_activated'] = true;
1902 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed and activated.', 'chart-builder' ) : esc_html__( 'Addon installed and activated.', 'chart-builder' );
1903
1904 wp_send_json_success( $result );
1905 }
1906
1907 // Fallback error just in case.
1908 wp_send_json_error( $result );
1909 }
1910
1911 /**
1912 * List of AM plugins that we propose to install.
1913 *
1914 * @since 6.4.0.4
1915 *
1916 * @return array
1917 */
1918 protected function get_am_plugins() {
1919 if ( !isset( $_SESSION ) ) {
1920 session_start();
1921 }
1922
1923 $images_url = CHART_BUILDER_ADMIN_URL . '/images/icons/';
1924
1925 $plugin_slug = array(
1926 'fox-lms',
1927 'quiz-maker',
1928 'survey-maker',
1929 'poll-maker',
1930 'ays-popup-box',
1931 'secure-copy-content-protection',
1932 'gallery-photo-gallery',
1933 'ays-chatgpt-assistant',
1934 'easy-form',
1935 );
1936
1937 $plugin_url_arr = array();
1938 foreach ($plugin_slug as $key => $slug) {
1939 if ( isset( $_SESSION['ays_chart_our_product_links'] ) && !empty( $_SESSION['ays_chart_our_product_links'] )
1940 && isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && !empty( $_SESSION['ays_chart_our_product_links'][$slug] ) ) {
1941 $plugin_url = (isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && $_SESSION['ays_chart_our_product_links'][$slug] != "") ? esc_url_raw(sanitize_text_field($_SESSION['ays_chart_our_product_links'][$slug])) : "";
1942 } else {
1943 $latest_version = $this->ays_chart_get_latest_plugin_version($slug);
1944 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.zip';
1945 if ( $latest_version != '' ) {
1946 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.'. $latest_version .'.zip';
1947 $_SESSION['ays_chart_our_product_links'][$slug] = $plugin_url;
1948 }
1949 }
1950
1951 $plugin_url_arr[$slug] = $plugin_url;
1952 }
1953
1954 $plugins_array = array(
1955 'fox-lms/fox-lms.php' => array(
1956 'icon' => $images_url . 'icon-fox-lms-128x128.png',
1957 'name' => __( 'Fox LMS', 'chart-builder' ),
1958 'desc' => __( 'Build and manage online courses directly on your WordPress site.', 'chart-builder' ),
1959 'desc_hidden' => __( 'With the FoxLMS plugin, you can create, sell, and organize courses, lessons, and quizzes, transforming your website into a dynamic e-learning platform.', 'chart-builder' ),
1960 'wporg' => 'https://wordpress.org/plugins/fox-lms/',
1961 'buy_now' => 'https://foxlms.com/pricing/?utm_source=dashboard&utm_medium=chart-free&utm_campaign=fox-lms-our-products-page',
1962 'url' => $plugin_url_arr['fox-lms'],
1963 ),
1964 'quiz-maker/quiz-maker.php' => array(
1965 'icon' => $images_url . 'icon-quiz-128x128.png',
1966 'name' => __( 'Quiz Maker', 'chart-builder' ),
1967 'desc' => __( 'Create powerful and engaging quizzes, tests, and exams in minutes.', 'chart-builder' ),
1968 'desc_hidden' => __( 'Build an unlimited number of quizzes and questions.', 'chart-builder' ),
1969 'wporg' => 'https://wordpress.org/plugins/quiz-maker/',
1970 'buy_now' => 'https://ays-pro.com/wordpress/quiz-maker/',
1971 'url' => $plugin_url_arr['quiz-maker'],
1972 ),
1973 'survey-maker/survey-maker.php' => array(
1974 'icon' => $images_url . 'icon-survey-128x128.png',
1975 'name' => __( 'Survey Maker', 'chart-builder' ),
1976 'desc' => __( 'Make amazing online surveys and get real-time feedback quickly and easily.', 'chart-builder' ),
1977 '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' ),
1978 'wporg' => 'https://wordpress.org/plugins/survey-maker/',
1979 'buy_now' => 'https://ays-pro.com/wordpress/survey-maker',
1980 'url' => $plugin_url_arr['survey-maker'],
1981 ),
1982 'poll-maker/poll-maker-ays.php' => array(
1983 'icon' => $images_url . 'icon-poll-128x128.png',
1984 'name' => __( 'Poll Maker', 'chart-builder' ),
1985 'desc' => __( 'Create amazing online polls for your WordPress website super easily.', 'chart-builder' ),
1986 'desc_hidden' => __( 'Build up various types of polls in a minute and get instant feedback on any topic or product.', 'chart-builder' ),
1987 'wporg' => 'https://wordpress.org/plugins/poll-maker/',
1988 'buy_now' => 'https://ays-pro.com/wordpress/poll-maker/',
1989 'url' => $plugin_url_arr['poll-maker'],
1990 ),
1991 'ays-popup-box/ays-pb.php' => array(
1992 'icon' => $images_url . 'icon-popup-128x128.png',
1993 'name' => __( 'Popup Box', 'chart-builder' ),
1994 'desc' => __( 'Popup everything you want! Create informative and promotional popups all in one plugin.', 'chart-builder' ),
1995 'desc_hidden' => __( 'Attract your visitors and convert them into email subscribers and paying customers.', 'chart-builder' ),
1996 'wporg' => 'https://wordpress.org/plugins/ays-popup-box/',
1997 'buy_now' => 'https://ays-pro.com/wordpress/popup-box/',
1998 'url' => $plugin_url_arr['ays-popup-box'],
1999 ),
2000 'secure-copy-content-protection/secure-copy-content-protection.php' => array(
2001 'icon' => $images_url . 'icon-sccp-128x128.png',
2002 'name' => __( 'Secure Copy Content Protection', 'chart-builder' ),
2003 'desc' => __( 'Disable the right click, copy paste, content selection and copy shortcut keys on your website.', 'chart-builder' ),
2004 'desc_hidden' => __( 'Protect web content from being plagiarized. Prevent plagiarism from your website with this easy to use plugin.', 'chart-builder' ),
2005 'wporg' => 'https://wordpress.org/plugins/secure-copy-content-protection/',
2006 'buy_now' => 'https://ays-pro.com/wordpress/secure-copy-content-protection/',
2007 'url' => $plugin_url_arr['secure-copy-content-protection'],
2008 ),
2009 'gallery-photo-gallery/gallery-photo-gallery.php' => array(
2010 'icon' => $images_url . 'icon-gallery-128x128.png',
2011 'name' => __( 'Gallery Photo Gallery', 'chart-builder' ),
2012 'desc' => __( 'Create unlimited galleries and include unlimited images in those galleries.', 'chart-builder' ),
2013 'desc_hidden' => __( 'Represent images in an attractive way. Attract people with your own single and multiple free galleries from your photo library.', 'chart-builder' ),
2014 'wporg' => 'https://wordpress.org/plugins/gallery-photo-gallery/',
2015 'buy_now' => 'https://ays-pro.com/wordpress/photo-gallery/',
2016 'url' => $plugin_url_arr['gallery-photo-gallery'],
2017 ),
2018 'ays-chatgpt-assistant/ays-chatgpt-assistant.php' => array(
2019 'icon' => $images_url . 'icon-chatgpt-128x128.png',
2020 'name' => __( 'AI Assistant with ChatGPT', 'chart-builder' ),
2021 'desc' => __( 'ChatGPT AI Assistant plugin gives you the ability to automate various tasks related to content creation and programming.', 'chart-builder' ),
2022 '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' ),
2023 'wporg' => 'https://wordpress.org/plugins/ays-chatgpt-assistant/',
2024 'buy_now' => 'https://ays-pro.com/wordpress/chatgpt-assistant',
2025 'url' => $plugin_url_arr['ays-chatgpt-assistant'],
2026 ),
2027 'easy-form/easy-form.php' => array(
2028 'icon' => $images_url . 'icon-form-128x128.png',
2029 'name' => __( 'Easy Form', 'chart-builder' ),
2030 'desc' => __( 'Choose the best WordPress form builder plugin. ', 'chart-builder' ),
2031 'desc_hidden' => __( 'Create contact forms, payment forms, surveys, and many more custom forms. Build forms easily with us.', 'chart-builder' ),
2032 'wporg' => 'https://wordpress.org/plugins/easy-form/',
2033 'buy_now' => 'https://ays-pro.com/wordpress/easy-form',
2034 'url' => $plugin_url_arr['easy-form'],
2035 ),
2036 );
2037
2038 return $plugins_array;
2039 }
2040
2041 protected function ays_chart_get_latest_plugin_version( $slug ){
2042
2043 if ( is_null( $slug ) || empty($slug) ) {
2044 return "";
2045 }
2046
2047 $version_latest = "";
2048
2049 if ( ! function_exists( 'plugins_api' ) ) {
2050 require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
2051 }
2052
2053 // set the arguments to get latest info from repository via API ##
2054 $args = array(
2055 'slug' => $slug,
2056 'fields' => array(
2057 'version' => true,
2058 )
2059 );
2060
2061 /** Prepare our query */
2062 $call_api = plugins_api( 'plugin_information', $args );
2063
2064 /** Check for Errors & Display the results */
2065 if ( is_wp_error( $call_api ) ) {
2066 $api_error = $call_api->get_error_message();
2067 } else {
2068
2069 //echo $call_api;
2070 // everything ##
2071 if ( ! empty( $call_api->version ) ) {
2072 $version_latest = $call_api->version;
2073 }
2074 }
2075
2076 return $version_latest;
2077 }
2078
2079 /**
2080 * Get AM plugin data to display in the Addons section of About tab.
2081 *
2082 * @since 6.4.0.4
2083 *
2084 * @param string $plugin Plugin slug.
2085 * @param array $details Plugin details.
2086 * @param array $all_plugins List of all plugins.
2087 *
2088 * @return array
2089 */
2090 protected function get_plugin_data( $plugin, $details, $all_plugins ) {
2091
2092 $have_pro = ( ! empty( $details['pro'] ) && ! empty( $details['pro']['plug'] ) );
2093 $show_pro = false;
2094
2095 $plugin_data = array();
2096
2097 if ( $have_pro ) {
2098 if ( array_key_exists( $plugin, $all_plugins ) ) {
2099 if ( is_plugin_active( $plugin ) ) {
2100 $show_pro = true;
2101 }
2102 }
2103 if ( array_key_exists( $details['pro']['plug'], $all_plugins ) ) {
2104 $show_pro = true;
2105 }
2106 if ( $show_pro ) {
2107 $plugin = $details['pro']['plug'];
2108 $details = $details['pro'];
2109 }
2110 }
2111
2112 if ( array_key_exists( $plugin, $all_plugins ) ) {
2113 if ( is_plugin_active( $plugin ) ) {
2114 // Status text/status.
2115 $plugin_data['status_class'] = 'status-active';
2116 $plugin_data['status_text'] = esc_html__( 'Active', 'chart-builder' );
2117 // Button text/status.
2118 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info disabled';
2119 $plugin_data['action_text'] = esc_html__( 'Activated', 'chart-builder' );
2120 $plugin_data['plugin_src'] = esc_attr( $plugin );
2121 } else {
2122 // Status text/status.
2123 $plugin_data['status_class'] = 'status-installed';
2124 $plugin_data['status_text'] = esc_html__( 'Inactive', 'chart-builder' );
2125 // Button text/status.
2126 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
2127 $plugin_data['action_text'] = esc_html__( 'Activate', 'chart-builder' );
2128 $plugin_data['plugin_src'] = esc_attr( $plugin );
2129 }
2130 } else {
2131 // Doesn't exist, install.
2132 // Status text/status.
2133 $plugin_data['status_class'] = 'status-missing';
2134
2135 if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) {
2136 $plugin_data['status_class'] = 'status-go-to-url';
2137 }
2138 $plugin_data['status_text'] = esc_html__( 'Not Installed', 'chart-builder' );
2139 // Button text/status.
2140 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
2141 $plugin_data['action_text'] = esc_html__( 'Install Plugin', 'chart-builder' );
2142 $plugin_data['plugin_src'] = esc_url( $details['url'] );
2143 }
2144
2145 $plugin_data['details'] = $details;
2146
2147 return $plugin_data;
2148 }
2149
2150 /**
2151 * Display the Addons section of About tab.
2152 *
2153 * @since 6.4.0.4
2154 */
2155 public function output_about_addons() {
2156
2157 if ( ! function_exists( 'get_plugins' ) ) {
2158 require_once ABSPATH . 'wp-admin/includes/plugin.php';
2159 }
2160
2161 $all_plugins = get_plugins();
2162 $am_plugins = $this->get_am_plugins();
2163 $can_install_plugins = self::ays_chart_can_install( 'plugin' );
2164 $can_activate_plugins = self::ays_chart_can_activate( 'plugin' );
2165
2166 $content = '';
2167 $content.= '<div class="ays-chart-cards-block">';
2168 foreach ( $am_plugins as $plugin => $details ){
2169
2170 $plugin_data = $this->get_plugin_data( $plugin, $details, $all_plugins );
2171 $plugin_ready_to_activate = $can_activate_plugins
2172 && isset( $plugin_data['status_class'] )
2173 && $plugin_data['status_class'] === 'status-installed';
2174 $plugin_not_activated = ! isset( $plugin_data['status_class'] )
2175 || $plugin_data['status_class'] !== 'status-active';
2176
2177 $plugin_action_class = ( isset( $plugin_data['action_class'] ) && esc_attr( $plugin_data['action_class'] ) != "" ) ? esc_attr( $plugin_data['action_class'] ) : "";
2178
2179 $plugin_action_class_disbaled = "";
2180 if ( strpos($plugin_action_class, 'status-active') !== false ) {
2181 $plugin_action_class_disbaled = "disbaled='true'";
2182 }
2183
2184 $content .= '
2185 <div class="ays-chart-card">
2186 <div class="ays-chart-card__content flexible">
2187 <div class="ays-chart-card__content-img-box">
2188 <img class="ays-chart-card__img" src="'. esc_url( $plugin_data['details']['icon'] ) .'" alt="'. esc_attr( $plugin_data['details']['name'] ) .'">
2189 </div>
2190 <div class="ays-chart-card__text-block">
2191 <h5 class="ays-chart-card__title">'. esc_html( $plugin_data['details']['name'] ) .'</h5>
2192 <p class="ays-chart-card__text">'. wp_kses_post( $plugin_data['details']['desc'] ) .'
2193 <span class="ays-chart-card__text-hidden">
2194 '. wp_kses_post( $plugin_data['details']['desc_hidden'] ) .'
2195 </span>
2196 </p>
2197 </div>
2198 </div>
2199 <div class="ays-chart-card__footer">';
2200 if ( $can_install_plugins || $plugin_ready_to_activate || ! $details['wporg'] ) {
2201 $content .= '<button class="'. esc_attr( $plugin_data['action_class'] ) .'" data-plugin="'. esc_attr( $plugin_data['plugin_src'] ) .'" data-type="plugin" '. $plugin_action_class_disbaled .'>
2202 '. wp_kses_post( $plugin_data['action_text'] ) .'
2203 </button>';
2204 }
2205 elseif ( $plugin_not_activated ) {
2206 $content .= '<a href="'. esc_url( $details['wporg'] ) .'" target="_blank" rel="noopener noreferrer">
2207 '. esc_html_e( 'WordPress.org', 'chart-builder' ) .'
2208 <span aria-hidden="true" class="dashicons dashicons-external"></span>
2209 </a>';
2210 }
2211 $content .='
2212 <a target="_blank" href="'. esc_url( $plugin_data['details']['buy_now'] ) .'" class="ays-chart-card__btn-primary">'. __('Buy Now', 'chart-builder') .'</a>
2213 </div>
2214 </div>';
2215 }
2216 $install_plugin_nonce = wp_create_nonce( $this->plugin_name . '-install-plugin-nonce' );
2217 $content.= '<input type="hidden" id="ays_chart_ajax_install_plugin_nonce" name="ays_chart_ajax_install_plugin_nonce" value="'. $install_plugin_nonce .'">';
2218 $content.= '</div>';
2219
2220 echo html_entity_decode($content);
2221 }
2222
2223 /**
2224 * Returns the data from Quiz maker.
2225 *
2226 * @access public
2227 */
2228 public function fetch_quiz_maker_data(){
2229 check_ajax_referer( 'cbuilder-fetch-quiz-maker-data', 'security' );
2230
2231 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
2232 if ( !isset($params) || empty($params) ) {
2233 return array(
2234 'success' => false,
2235 'data' => array(
2236 'msg' => __( "Something went wrong.", "chart-builder" )
2237 )
2238 );
2239 }
2240
2241 $query = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2242 if ( $query == '' ) {
2243 return array(
2244 'success' => false,
2245 'data' => array(
2246 'msg' => __( "No data given.", "chart-builder" )
2247 )
2248 );
2249 }
2250 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : null;
2251 $user_id = get_current_user_id();
2252
2253 $return_results = CBFunctions()->get_quiz_query($query, $quiz_id, $user_id);
2254
2255 if (empty($return_results)) {
2256 return array(
2257 'success' => false,
2258 'data' => array(
2259 'msg' => __( "Something went wrong.", "chart-builder" )
2260 )
2261 );
2262 }
2263
2264 $result_values = $return_results['result'];
2265 $query = $return_results['query'];
2266
2267 if (empty($result_values)) {
2268 return array(
2269 'success' => false,
2270 'data' => array(
2271 'msg' => $return_results['message']
2272 )
2273 );
2274 }
2275
2276 if (count($return_results['result'][0]) != 1 ) {
2277 $results = array();
2278 $headers = array();
2279 if ( $result_values ) {
2280 $row_num = 0;
2281 foreach ( $result_values as $row ) {
2282 $result = array();
2283 foreach ( $row as $k => $v ) {
2284 $result[] = $v;
2285 if ( $row_num === 0 ) {
2286 $headers[] = $k;
2287 }
2288 }
2289 $results[] = $result;
2290 $row_num++;
2291 }
2292 }
2293 } else if (count($return_results['result'][0]) == 1) {
2294 $results = array();
2295 $headers = array();
2296 if ( $result_values ) {
2297 $row_num = 0;
2298 foreach ( $result_values as $index => $row ) {
2299 $result = array();
2300 foreach ( $row as $k => $v ) {
2301 $result[] = strval($index) + 1;
2302 $result[] = $v;
2303 if ( $row_num === 0 ) {
2304 $headers[] = 'Quiz';
2305 $headers[] = $k;
2306 }
2307 }
2308 $results[] = $result;
2309 $row_num++;
2310 }
2311 }
2312 }
2313
2314 if (empty($results)) {
2315 return array(
2316 'success' => false,
2317 'data' => array(
2318 'msg' => $return_results['message']
2319 )
2320 );
2321 }
2322
2323 foreach ($results as $key => $value) {
2324 if (!isset($value) || count($value) <= 1 && $key != 0) {
2325 unset($results[$key]);
2326 }
2327 }
2328
2329 array_unshift($results, $headers);
2330 $results = array_values( $results );
2331 $data = $results;
2332
2333 $headers = $results[0];
2334 unset( $results[0] );
2335
2336 $html = CBFunctions()->get_table_html( $headers, $results );
2337
2338 return array(
2339 'success' => true,
2340 'data' => array(
2341 'table' => $html,
2342 'data' => $data
2343 )
2344 );
2345 }
2346
2347 /**
2348 * Saves the Quiz maker data.
2349 *
2350 * @access public
2351 */
2352 public function save_quiz_maker_data() {
2353 check_ajax_referer( 'cbuilder-save-quiz-maker-data', 'security' );
2354
2355 $params = isset($_REQUEST['params']) ? sanitize_text_field(wp_unslash($_REQUEST['params'])) : array();
2356 if ( !isset($params) || empty($params) ) {
2357 return array(
2358 'success' => false,
2359 'data' => array(
2360 'msg' => __( "Something went wrong.", "chart-builder" )
2361 )
2362 );
2363 }
2364
2365 $query_id = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2366 if ( $query_id == '' ) {
2367 return array(
2368 'success' => false,
2369 'data' => array(
2370 'msg' => __( "No data given.", "chart-builder" )
2371 )
2372 );
2373 }
2374
2375 $chart_id = isset( $params['chart_id'] ) ? absint( $params['chart_id'] ) : 0;
2376 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : 0;
2377 $user_id = get_current_user_id();
2378
2379 if ( $chart_id >= 0 ) {
2380
2381 $return_results = CBFunctions()->get_quiz_query($query_id, $quiz_id, $user_id);
2382
2383 if (empty($return_results)) {
2384 return array(
2385 'success' => false,
2386 'data' => array(
2387 'msg' => __( "Something went wrong.", "chart-builder" )
2388 )
2389 );
2390 }
2391
2392 $result_values = $return_results['result'];
2393 $query = $return_results['query'];
2394
2395 if (empty($result_values)) {
2396 return array(
2397 'success' => false,
2398 'data' => array(
2399 'msg' => $return_results['message']
2400 )
2401 );
2402 }
2403
2404 if ( !empty($result_values) && count($return_results['result'][0]) != 1 ) {
2405 $results = array();
2406 $headers = array();
2407 if ( $result_values ) {
2408 $row_num = 0;
2409 foreach ( $result_values as $row ) {
2410 $result = array();
2411 foreach ( $row as $k => $v ) {
2412 $result[] = $v;
2413 if ( $row_num === 0 ) {
2414 $headers[] = $k;
2415 }
2416 }
2417 $results[] = $result;
2418 $row_num++;
2419 }
2420 }
2421 } else if (count($return_results['result'][0]) == 1) {
2422 $results = array();
2423 $headers = array();
2424 if ( $result_values ) {
2425 $row_num = 0;
2426 foreach ( $result_values as $index => $row ) {
2427 $result = array();
2428 foreach ( $row as $k => $v ) {
2429 $result[] = strval($index) + 1;
2430 $result[] = $v;
2431 if ( $row_num === 0 ) {
2432 $headers[] = 'Quiz';
2433 $headers[] = $k;
2434 }
2435 }
2436 $results[] = $result;
2437 $row_num++;
2438 }
2439 }
2440 }
2441
2442 $source_type = 'quiz_maker';
2443 $option_name_for_data = $chart_id == 0 ? 'ays_chart_quiz_maker_results_temp' : 'ays_chart_quiz_maker_results_' . $chart_id;
2444 $option_name_for_quiz = $chart_id == 0 ? 'ays_chart_quiz_maker_quiz_data_temp' : 'ays_chart_quiz_maker_quiz_data_' . $chart_id;
2445
2446 update_option( $option_name_for_data, array(
2447 'source_type' => $source_type,
2448 'source' => $query,
2449 'data' => $results,
2450 ) );
2451 update_option( $option_name_for_quiz, array(
2452 'quiz_query' => $query_id,
2453 'quiz_id' => $quiz_id
2454 ) );
2455
2456 } else {
2457 return array(
2458 'success' => false,
2459 'data' => array(
2460 'msg' => __( 'Given incorrect Chart ID.', "chart-builder")
2461 )
2462 );
2463 }
2464
2465 return array(
2466 'success' => true,
2467 'data' => array(
2468 'msg' => __( 'Data was successfully saved.', "chart-builder" )
2469 )
2470 );
2471 }
2472
2473 /**
2474 * Chart page action hooks
2475 */
2476
2477 /**
2478 * Chart page sources contents
2479 * @param $args
2480 */
2481 public function ays_chart_page_source_contents( $args ){
2482 $chart_source_type = $args['chart_source_type'];
2483
2484 if ($chart_source_type === 'chart-js') {
2485 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings_chartjs', array(), $args );
2486 } else {
2487 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings', array(), $args );
2488 }
2489
2490 $source_type = $args['source_type'];
2491
2492 $sources = array();
2493 foreach ( $sources_contents as $key => $sources_content ) {
2494 $collapsed = $key == $source_type ? 'false' : 'true';
2495
2496 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="'. $collapsed .'">';
2497 if( isset( $sources_content['title'] ) ){
2498 $content .= '<legend class="ays-accordion-options-header">';
2499 $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">
2500 <g>
2501 <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" />
2502 </g>
2503 </svg>';
2504
2505 $content .= '<span>'. $sources_content['title'] .'</span></legend>';
2506 }
2507
2508 $content .= '<div class="ays-accordion-options-content">';
2509 $content .= $sources_content['content'];
2510 $content .= '</div>';
2511
2512 $content .= '</fieldset>';
2513
2514 $sources[] = $content;
2515 }
2516 $content_for_escape = implode('' , $sources );
2517 echo html_entity_decode( esc_html($content_for_escape) );
2518 }
2519
2520 public function source_contents_import_from_csv_settings( $sources, $args ){
2521 $html_class_prefix = $args['html_class_prefix'];
2522 $html_name_prefix = $args['html_name_prefix'];
2523
2524 ob_start();
2525 ?>
2526 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2527 <div class="ays-pro-features-v2-big-buttons-box">
2528 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2529 <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>
2530 <div class="ays-pro-features-v2-video-text">
2531 <?php echo esc_html__("Watch Video" , "chart-builder"); ?>
2532 </div>
2533 </a>
2534 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2535 <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>
2536 <div class="ays-pro-features-v2-upgrade-text">
2537 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2538 </div>
2539 </a>
2540 </div>
2541 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main ays-accordion-data-main-wrap">
2542 <div class="<?php echo esc_attr($html_class_prefix) ?>file-import-form">
2543 <h6><?php echo esc_html__("Choose what kind of data would you like to upload.", "chart-builder"); ?></h6>
2544 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>import-files-file-type">
2545 <option value="csv">CSV File</option>
2546 </select>
2547 <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>
2548 <p class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example" style="font-size: 15px; font-style: italic;">Example:
2549 <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>
2550 </p>
2551 <div>
2552 <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" />
2553 </div>
2554 <div class='ays-chart-file-import-success'></div>
2555 <div class='ays-chart-file-import-error'></div>
2556 <div class="ays-chart-buttons-group">
2557 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-fetch">
2558 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2559 </button>
2560 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-show-on-chart">
2561 <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>
2562 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2563 </button>
2564 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-save">
2565 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2566 </button>
2567 </div>
2568 </div>
2569 </div>
2570 </div>
2571 <?php
2572 $content = ob_get_clean();
2573
2574 $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") . '">
2575 <i class="ays_fa ays_fa_info_circle"></i>
2576 </a>';
2577
2578 $sources['file_import'] = array(
2579 'content' => $content,
2580 'title' => $title
2581 );
2582
2583 return $sources;
2584 }
2585
2586 public function source_contents_import_from_db_settings( $sources, $args ){
2587 $html_class_prefix = $args['html_class_prefix'];
2588 $html_name_prefix = $args['html_name_prefix'];
2589
2590 ob_start();
2591 ?>
2592 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2593 <div class="ays-pro-features-v2-big-buttons-box">
2594 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2595 <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>
2596 <div class="ays-pro-features-v2-video-text">
2597 <?php echo esc_html__("Watch Video" , "chart-builder"); ?>
2598 </div>
2599 </a>
2600 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2601 <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>
2602 <div class="ays-pro-features-v2-upgrade-text">
2603 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2604 </div>
2605 </a>
2606 </div>
2607 <div class="<?php echo esc_attr( $html_class_prefix ) ?>source-data-main-wrap ays-accordion-data-main-wrap ">
2608 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2609 <div id="ays-chart-db-query">
2610 <div class="<?php echo esc_attr($html_class_prefix) ?>-db-query-form">
2611 <div id="db-query-form">
2612 <input type="hidden" name="chart_id" value="1">
2613 <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>
2614 <div class='db-wizard-success'></div>
2615 <div class='db-wizard-error'></div>
2616 </div>
2617 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2618 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-fetch">
2619 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2620 </button>
2621 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-show-on-chart">
2622 <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>
2623 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2624 </button>
2625 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-save">
2626 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2627 </button>
2628 </div>
2629 </div>
2630 <div class="db-wizard-hints">
2631 <ul>
2632 <!-- <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> -->
2633 <li>
2634 <?php
2635 echo sprintf(
2636 /* translators: %1$s and %2$s are HTML span tags for styling. */
2637 esc_html__( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'chart-builder' ),
2638 '<span class="ays-chart-emboss">',
2639 '</span>'
2640 );
2641 ?>
2642 </li>
2643 </ul>
2644 </div>
2645 </div>
2646 </div>
2647 </div>
2648 </div>
2649 <?php
2650 $content = ob_get_clean();
2651
2652 $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') . '">
2653 <i class="ays_fa ays_fa_info_circle"></i>
2654 </a>';
2655
2656 $sources['import_from_db'] = array(
2657 'content' => $content,
2658 'title' => $title
2659 );
2660
2661 return $sources;
2662 }
2663
2664 public function source_contents_import_from_external_db_settings( $sources, $args ){
2665 $html_class_prefix = $args['html_class_prefix'];
2666 $html_name_prefix = $args['html_name_prefix'];
2667
2668 ob_start();
2669 ?>
2670 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2671 <div class="ays-pro-features-v2-big-buttons-box">
2672 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2673 <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>
2674 <div class="ays-pro-features-v2-upgrade-text">
2675 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2676 </div>
2677 </a>
2678 </div>
2679 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap ays-accordion-data-main-wrap ">
2680 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2681 <div class="form-group row mb-2">
2682 <div class="col-sm-8 <?php echo esc_attr($html_class_prefix) ?>option-title">
2683 <label class="form-label">
2684 <?php echo esc_html(__('Use custom database settings for this chart', "chart-builder")); ?>
2685 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __(".","chart-builder") ); ?>">
2686 <i class="ays_fa ays_fa_info_circle"></i>
2687 </a>
2688 </label>
2689 </div>
2690 <div class="col-sm-3 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2691 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2692 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" type="checkbox" />
2693 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2694 </label>
2695 </div>
2696 </div>
2697 <div id="ays-chart-external-db-query">
2698 <div class="<?php echo esc_attr($html_class_prefix) ?>-db-query-form">
2699 <div id="external-db-query-form">
2700 <input type="hidden" name="chart_id" value="1">
2701 <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>
2702 <div class='db-wizard-success'></div>
2703 <div class='db-wizard-error'></div>
2704 </div>
2705 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2706 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-fetch">
2707 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2708 </button>
2709 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-show-on-chart">
2710 <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>
2711 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2712 </button>
2713 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-save">
2714 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2715 </button>
2716 </div>
2717 </div>
2718 <div class="db-wizard-hints">
2719 <ul>
2720 <!-- <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> -->
2721 <li>
2722 <?php
2723 echo sprintf(
2724 /* translators: %1$s and %2$s are HTML span tags for styling. */
2725 esc_html__( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'chart-builder' ),
2726 '<span class="ays-chart-emboss">',
2727 '</span>'
2728 );
2729 ?>
2730 </li>
2731 </ul>
2732 </div>
2733 </div>
2734 </div>
2735 </div>
2736 </div>
2737 <?php
2738 $content = ob_get_clean();
2739
2740 $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') . '">
2741 <i class="ays_fa ays_fa_info_circle"></i>
2742 </a>';
2743
2744 $sources['import_from_external_db'] = array(
2745 'content' => $content,
2746 'title' => $title
2747 );
2748
2749 return $sources;
2750 }
2751
2752 public function source_contents_quiz_maker_integration_settings( $sources, $args ){
2753 global $wpdb;
2754 $chart_id = $args['chart_id'];
2755 $html_class_prefix = $args['html_class_prefix'];
2756 $html_name_prefix = $args['html_name_prefix'];
2757 $source = $args['source'];
2758 $settings = $args['settings'];
2759 $quiz_queries = $args['quiz_queries'];
2760 $quiz_query_tooltips = $args['quiz_query_tooltips'];
2761 $quiz_id = $args['quiz_id'];
2762 $quiz_query = $args['quiz_query'];
2763
2764 if ( !is_plugin_active('quiz-maker/quiz-maker.php') ) {
2765 // $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") . '">
2766 // <i class="ays_fa ays_fa_info_circle"></i>
2767 // </a>', '<br>', '<b>', '</b>');
2768 // $content = $this->blockquote_content_quiz;
2769 // $sources['quiz_maker'] = array(
2770 // 'content' => $content,
2771 // 'title' => $title
2772 // );
2773
2774 return $sources;
2775 }
2776 $quizes = $wpdb->get_results( // phpcs:ignore
2777 $wpdb->prepare(
2778 "SELECT `title`, `id` FROM {$wpdb->prefix}aysquiz_quizes
2779 WHERE `published` = %d AND `question_ids` <> %s",
2780 1,
2781 ''
2782 ),
2783 ARRAY_A
2784 );
2785
2786
2787 ob_start();
2788 ?>
2789 <div class="ays-accordion-data-main-wrap">
2790 <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">
2791 <div id="<?php echo esc_attr($html_class_prefix) ?>quiz-maker-form">
2792 <input type="hidden" class="<?php echo esc_attr($html_class_prefix) ?>chart-id" value="<?php echo esc_attr($chart_id) ?>">
2793 <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">
2794 <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' ) ?>">
2795 <i class="ays_fa ays_fa_info_circle"></i>
2796 </a>
2797 <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">
2798 <option value=""><?php echo esc_html__( "Select query", "chart-builder" ) ?></option>
2799 <?php foreach ( $quiz_queries as $id => $q):
2800 $disabled = preg_replace('/[^0-9]/', '', $id) <= 6 ? "false" : "true" ; ?>
2801 <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>
2802 <?php endforeach; ?>
2803 </select>
2804 </div>
2805 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz-container">
2806 <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">
2807 <option value="0"><?php echo esc_html__( "Select quiz", "chart-builder" ) ?></option>
2808 <?php foreach ( $quizes as $quiz): ?>
2809 <option value="<?php echo esc_attr($quiz['id']) ?>" <?php echo $quiz_id == $quiz['id'] ? 'selected' : '' ?> ><?php echo esc_html($quiz['title'] )?></option>
2810 <?php endforeach; ?>
2811 </select>
2812 </div>
2813 <div id="ays-chart-quiz-maker-success"></div>
2814 <div id="ays-chart-quiz-maker-error"></div>
2815 <div class="ays-chart-buttons-group">
2816 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-fetch">
2817 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2818 </button>
2819 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-show-on-chart">
2820 <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>
2821 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2822 </button>
2823 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-save">
2824 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2825 </button>
2826 </div>
2827 </div>
2828 <div>
2829 <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>
2830 </div>
2831 </div>
2832 </div>
2833 <?php
2834 $content = ob_get_clean();
2835
2836 $title = sprintf(
2837 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2838 __( 'Get Quiz Maker data', 'chart-builder' ) .
2839 ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' .
2840 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2841 __( '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' ) . '">
2842 <i class="ays_fa ays_fa_info_circle"></i>
2843 </a>',
2844 '<br>', '<b>', '</b>'
2845 );
2846 $sources['quiz_maker'] = array(
2847 'content' => $content,
2848 'title' => $title
2849 );
2850
2851 return $sources;
2852 }
2853
2854 public function source_contents_woocommerce_integration_settings( $sources, $args ){
2855 if ( !is_plugin_active('woocommerce/woocommerce.php') ) {
2856 return $sources;
2857 }
2858
2859 $chart_id = $args['chart_id'];
2860 $html_class_prefix = $args['html_class_prefix'];
2861 $html_name_prefix = $args['html_name_prefix'];
2862 ob_start();
2863 ?>
2864 <div class="ays-accordion-data-main-wrap ays-accordion-data-main-wrap-woocommerce ays-pro-features-v2-main-box" style="padding:10px;">
2865 <div class="ays-pro-features-v2-big-buttons-box">
2866 <div class="ays-pro-features-v2-video-button"></div>
2867 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2868 <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>
2869 <div class="ays-pro-features-v2-upgrade-text">
2870 <?php echo esc_html__("Upgrade" , "chart-builder"); ?>
2871 </div>
2872 </a>
2873 </div>
2874 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main ays-accordion-data-main-wrap ">
2875 <div id="ays-chart-woocommerce-datas">
2876 <div class="<?php echo esc_attr($html_class_prefix) ?>woocommerce-datas-form">
2877 <div id="woocommerce-datas-form">
2878 <input type="hidden" name="chart_id" value="<?php echo esc_attr( $chart_id )?>">
2879 <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" >
2880 <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' ) ?>">
2881 <i class="ays_fa ays_fa_info_circle"></i>
2882 </a>
2883 <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]">
2884 <option value=""><?php echo esc_html__( 'Select query', 'chart-builder') ?></option>
2885 </select>
2886 </div>
2887 <div class='ays-chart-woocommerce-datas-success'></div>
2888 <div class='ays-chart-woocommerce-datas-error'></div>
2889 </div>
2890 <div class="ays-chart-buttons-group">
2891 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-fetch">
2892 <?php echo esc_html__( 'Show Results', "chart-builder" ); ?>
2893 </button>
2894 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-show-on-chart">
2895 <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>
2896 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
2897 </button>
2898 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-save">
2899 <?php echo esc_html__( 'Save data', "chart-builder" ); ?>
2900 </button>
2901 </div>
2902 </div>
2903 </div>
2904 </div>
2905 </div>
2906 <?php
2907 $content = ob_get_clean();
2908
2909 $title = sprintf(
2910 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2911 esc_html__( 'Get WooCommerce data', 'chart-builder' ) .
2912 ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' .
2913 /* translators: %1$s: Line break, %2$s: Opening bold tag, %3$s: Closing bold tag. */
2914 __( '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' ) . '">
2915 <i class="ays_fa ays_fa_info_circle"></i>
2916 </a>',
2917 '<br>', '<b>', '</b>'
2918 );
2919 $sources['woocommerce'] = array(
2920 'content' => $content,
2921 'title' => $title
2922 );
2923
2924 return $sources;
2925 }
2926
2927 public function source_contents_manual_settings( $sources, $args ){
2928 $html_class_prefix = $args['html_class_prefix'];
2929 $html_name_prefix = $args['html_name_prefix'];
2930 $source = $args['source'];
2931 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2932 $settings = $args['settings'];
2933 $source_chart_type = $args['source_chart_type'];
2934 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
2935 $action = isset($_GET['action']) ? sanitize_text_field(wp_unslash($_GET['action'])) : 'add';
2936
2937 if (isset($source) && !empty($source)) {
2938 if ( !isset( $source[0] ) ) {
2939 if (count($source[1]) > 2) {
2940 $titles = array();
2941 for ($i = 0; $i < count($source[1]); $i++) {
2942 array_push($titles, __("Title", 'chart-builder').$i);
2943 }
2944 $source[0] = $titles;
2945 } else {
2946 $source[0] = array(
2947 __("Country", 'chart-builder'),
2948 __("Population", 'chart-builder'),
2949 );
2950 }
2951
2952 ksort($source);
2953 }
2954 }
2955
2956 if ($action == 'add') {
2957 foreach ($source as $key => $row) {
2958 $source[$key] = array_slice($row, 0, 2);
2959 }
2960 } else if ($action == 'edit') {
2961 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
2962 foreach ($source as $key => $row) {
2963 $source[$key] = array_slice($row, 0, 2);
2964 }
2965 }
2966 }
2967 ob_start();
2968 ?>
2969 <div class="ays-accordion-data-main-wrap">
2970 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2971 <?php if($source_chart_type != 'org_chart'): ?>
2972 <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">
2973 <!-- <div class="<//?= $html_class_prefix ?>icons-box">
2974 <img class="<//?= $html_class_prefix ?>add-new-row" src="<//?php echo CHART_BUILDER_ADMIN_URL; ?>/images/icons/add-circle-outline.svg">
2975 </div> -->
2976 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2977 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2978 <?php if(!empty($source)):
2979 foreach($source as $source_id => $source_value):
2980 if(!empty($source_value) ):
2981 if ($source_id == 0): ?>
2982 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2983 <div class="ays-chart-empty-data-table-cell"></div>
2984 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2985 <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); ?>">
2986 <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">
2987 <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;" />
2988 </svg>
2989 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2990 <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'" : "" ?>>
2991 <?php if ($each_source_id !== 0): ?>
2992 <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">
2993 <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;" />
2994 </svg>
2995 <?php endif; ?>
2996 </div>
2997 </div>
2998 <?php endforeach; ?>
2999 </div>
3000 <?php else: ?>
3001 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
3002 <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">
3003 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3004 <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;" />
3005 </svg>
3006 </div>
3007 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
3008 <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">
3009 <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;" />
3010 </svg>
3011 </div>
3012 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
3013 <?php if ($each_source_id == 0): ?>
3014 <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); ?>">
3015 <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)); ?>">
3016 </div>
3017 <?php else: ?>
3018 <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); ?>">
3019 <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">
3020 </div>
3021 <?php endif; ?>
3022 <?php endforeach; ?>
3023 </div>
3024 <?php endif; ?>
3025 <?php endif; ?>
3026 <?php endforeach; ?>
3027 <?php else:?>
3028 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block">
3029 <div style="height: 63.11px; padding: 0 15px;"></div>
3030 <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">
3031 <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">
3032 <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;" />
3033 </svg>
3034 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
3035 <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'>
3036 <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">
3037 <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;" />
3038 </svg>
3039 </div>
3040 </div>
3041 </div>
3042 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
3043 <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">
3044 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3045 <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" />
3046 </svg>
3047 </div>
3048 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
3049 <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">
3050 <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;" />
3051 </svg>
3052 </div>
3053 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
3054 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
3055 </div>
3056 <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">
3057 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
3058 </div>
3059 </div>
3060 <?php endif; ?>
3061 </div>
3062 <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">
3063 <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">
3064 <?php echo esc_html__( 'Add column', "chart-builder" ); ?>
3065 </div>
3066 </div>
3067 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
3068 <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">
3069 <?php echo esc_html__( 'Add row', "chart-builder" ); ?>
3070 </div>
3071 <br>
3072 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
3073 <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>
3074 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
3075 </button>
3076 </div>
3077 <?php endif; ?>
3078 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main-org-type display_none cb-changable-manual cb-org_chart-manual">
3079 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-org-type">
3080 <ul id="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-tree-content">
3081 </ul>
3082 </div>
3083 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
3084 <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>
3085 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
3086 </button>
3087 </div>
3088 </div>
3089 </div>
3090 <?php
3091 $content = ob_get_clean();
3092
3093 $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") . '">
3094 <i class="ays_fa ays_fa_info_circle"></i>
3095 </a>';
3096
3097 $sources['manual'] = array(
3098 'content' => $content,
3099 'title' => $title
3100 );
3101
3102 return $sources;
3103 }
3104
3105 public function source_contents_manual_settings_chartjs( $sources, $args ){
3106 $html_class_prefix = $args['html_class_prefix'];
3107 $html_name_prefix = $args['html_name_prefix'];
3108 $source = $args['source'];
3109 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
3110 $settings = $args['settings'];
3111 $source_chart_type = $args['source_chart_type'];
3112 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
3113 $action = isset($_GET['action']) ? sanitize_text_field((wp_unslash($_GET['action']))) : 'add';
3114
3115 ob_start();
3116 ?>
3117 <div class="ays-accordion-data-main-wrap">
3118 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
3119 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?php echo esc_attr($html_class_prefix) ?>chart-source-data-manual">
3120 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
3121 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
3122 <?php if(!empty($source)):
3123 foreach($source as $source_id => $source_value):
3124 if(!empty($source_value) ):
3125 if ($source_id == 0): ?>
3126 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
3127 <div class="ays-chart-empty-data-table-cell"></div>
3128 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
3129 <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); ?>">
3130 <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">
3131 <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;" />
3132 </svg>
3133 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
3134 <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'" : "" ?>>
3135 <?php if ($each_source_id !== 0): ?>
3136 <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">
3137 <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;" />
3138 </svg>
3139 <?php endif; ?>
3140 </div>
3141 </div>
3142 <?php endforeach; ?>
3143 </div>
3144 <?php else: ?>
3145 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
3146 <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">
3147 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3148 <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;" />
3149 </svg>
3150 </div>
3151 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
3152 <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">
3153 <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;" />
3154 </svg>
3155 </div>
3156 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
3157 <?php if ($each_source_id == 0): ?>
3158 <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); ?>">
3159 <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)); ?>">
3160 </div>
3161 <?php else: ?>
3162 <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); ?>">
3163 <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">
3164 </div>
3165 <?php endif; ?>
3166 <?php endforeach; ?>
3167 </div>
3168 <?php endif; ?>
3169 <?php endif; ?>
3170 <?php endforeach; ?>
3171 <?php else:?>
3172 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block">
3173 <div style="height: 63.11px; padding: 0 15px;"></div>
3174 <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">
3175 <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">
3176 <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;" />
3177 </svg>
3178 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
3179 <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'>
3180 <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">
3181 <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;" />
3182 </svg>
3183 </div>
3184 </div>
3185 </div>
3186 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
3187 <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">
3188 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
3189 <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" />
3190 </svg>
3191 </div>
3192 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
3193 <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">
3194 <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;" />
3195 </svg>
3196 </div>
3197 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
3198 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
3199 </div>
3200 <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">
3201 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
3202 </div>
3203 </div>
3204 <?php endif; ?>
3205 </div>
3206 <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">
3207 <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">
3208 <?php echo esc_html__( 'Add column', "chart-builder" ); ?>
3209 </div>
3210 </div>
3211 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
3212 <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">
3213 <?php echo esc_html__( 'Add row', "chart-builder" ); ?>
3214 </div>
3215 <br>
3216 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
3217 <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>
3218 <?php echo esc_html__( 'Preview', "chart-builder" ); ?>
3219 </button>
3220 </div>
3221 </div>
3222 </div>
3223 <?php
3224 $content = ob_get_clean();
3225
3226 $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") . '">
3227 <i class="ays_fa ays_fa_info_circle"></i>
3228 </a>';
3229
3230 $sources['manual'] = array(
3231 'content' => $content,
3232 'title' => $title
3233 );
3234
3235 return $sources;
3236 }
3237
3238 /**
3239 * Chart page settings contents
3240 * @param $args
3241 */
3242 public function ays_chart_page_settings_contents( $args ){
3243 $chart_source_type = $args['chart_source_type'];
3244
3245 if ($chart_source_type === 'chart-js') {
3246 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings_chartjs', array(), $args );
3247 } else {
3248 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings', array(), $args );
3249 }
3250
3251 $sources = array();
3252 foreach ( $sources_contents as $key => $sources_content ) {
3253 $collapsed = $key == 'general_settings' ? 'false' : 'true';
3254
3255 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
3256 if(isset($sources_content['title'])){
3257 $content .= '<legend class="ays-accordion-options-header">';
3258 $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">
3259 <g>
3260 <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" />
3261 </g>
3262 </svg>';
3263
3264 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
3265 }
3266
3267 $content .= '<div class="ays-accordion-options-content">';
3268 $content .= $sources_content['content'];
3269 $content .= '</div>';
3270
3271 $content .= '</fieldset>';
3272
3273 $sources[] = $content;
3274 }
3275 $content_for_escape = implode('' , $sources );
3276 echo html_entity_decode( $content_for_escape );
3277 }
3278
3279 public function settings_contents_general_settings( $sources, $args ){
3280 $html_class_prefix = $args['html_class_prefix'];
3281 $html_name_prefix = $args['html_name_prefix'];
3282 $chart_description = $args['chart_description'];
3283 $create_author_data = $args['create_author_data'];
3284 $status = $args['status'];
3285 $settings = $args['settings'];
3286
3287 $show_title = $settings['show_title'];
3288 $show_description = $settings['show_description'];
3289 $enable_interactivity = $settings['enable_interactivity'];
3290 $maximized_view = $settings['maximized_view'];
3291
3292 ob_start();
3293 ?>
3294 <div class="ays-accordion-data-main-wrap">
3295 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3296 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3297 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3298 <label for="ays-status" class="form-label">
3299 <?php echo esc_html(__('Status', "chart-builder")); ?>
3300 <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") ); ?>">
3301 <i class="ays_fa ays_fa_info_circle"></i>
3302 </a>
3303 </label>
3304 </div>
3305 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3306 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3307 <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' : ''; ?> >
3308 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3309 </label>
3310 </div>
3311 </div> <!-- Status -->
3312 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3313 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3314 <label for="ays-chart-description" class="form-label">
3315 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3316 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3317 <i class="ays_fa ays_fa_info_circle"></i>
3318 </a>
3319 </label>
3320 </div>
3321 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3322 <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>
3323 </div>
3324 </div> <!-- Chart description -->
3325 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3326 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3327 <label for="ays-chart-create-author" class="form-label">
3328 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3329 <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")); ?>">
3330 <i class="ays_fa ays_fa_info_circle"></i>
3331 </a>
3332 </label>
3333 </div>
3334 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3335 <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">
3336 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3337 <?php if (isset($create_author_data['ID'])) : ?>
3338 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3339 <?php endif; ?>
3340 </select>
3341 </div>
3342 </div> <!-- Change chart author -->
3343 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3344 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3345 <label for="ays-chart-show-title" class="form-label">
3346 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3347 <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") ); ?>">
3348 <i class="ays_fa ays_fa_info_circle"></i>
3349 </a>
3350 </label>
3351 </div>
3352 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3353 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3354 <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); ?> >
3355 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3356 </label>
3357 </div>
3358 </div> <!-- Show title -->
3359 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3360 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3361 <label for="ays-chart-show-description" class="form-label">
3362 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3363 <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") ); ?>">
3364 <i class="ays_fa ays_fa_info_circle"></i>
3365 </a>
3366 </label>
3367 </div>
3368 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3369 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3370 <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); ?> >
3371 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3372 </label>
3373 </div>
3374 </div> <!-- Show description -->
3375 <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">
3376 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3377 <label for="ays-chart-option-enable-interactivity" class="form-label">
3378 <?php echo esc_html(__('Enable interactivity', "chart-builder")); ?>
3379 <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") ); ?>">
3380 <i class="ays_fa ays_fa_info_circle"></i>
3381 </a>
3382 </label>
3383 </div>
3384 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3385 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3386 <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); ?> >
3387 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3388 </label>
3389 </div>
3390 </div> <!-- Enable interactivity -->
3391 <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">
3392 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3393 <label for="ays-chart-option-maximized-view" class="form-label">
3394 <?php echo esc_html(__('Maximized view', "chart-builder")); ?>
3395 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, maximizes the area of the chart.","chart-builder") ); ?>">
3396 <i class="ays_fa ays_fa_info_circle"></i>
3397 </a>
3398 </label>
3399 </div>
3400 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3401 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3402 <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); ?> >
3403 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3404 </label>
3405 </div>
3406 </div> <!-- Maximized view -->
3407 </div>
3408 </div>
3409 <?php
3410 $content = ob_get_clean();
3411
3412 $title = __( 'General Settings', "chart-builder" );
3413
3414 $sources['general_settings'] = array(
3415 'content' => $content,
3416 'title' => $title
3417 );
3418
3419 return $sources;
3420 }
3421
3422 public function settings_contents_general_settings_chartjs( $sources, $args ){
3423 $html_class_prefix = $args['html_class_prefix'];
3424 $html_name_prefix = $args['html_name_prefix'];
3425 $chart_description = $args['chart_description'];
3426 $create_author_data = $args['create_author_data'];
3427 $status = $args['status'];
3428 $settings = $args['settings'];
3429
3430 $show_title = $settings['show_title'];
3431 $show_description = $settings['show_description'];
3432
3433 ob_start();
3434 ?>
3435 <div class="ays-accordion-data-main-wrap">
3436 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3437 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3438 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3439 <label for="ays-status" class="form-label">
3440 <?php echo esc_html(__('Status', "chart-builder")); ?>
3441 <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") ); ?>">
3442 <i class="ays_fa ays_fa_info_circle"></i>
3443 </a>
3444 </label>
3445 </div>
3446 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3447 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3448 <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' : ''; ?> >
3449 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3450 </label>
3451 </div>
3452 </div> <!-- Status -->
3453 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3454 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3455 <label for="ays-chart-description" class="form-label">
3456 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3457 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3458 <i class="ays_fa ays_fa_info_circle"></i>
3459 </a>
3460 </label>
3461 </div>
3462 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3463 <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>
3464 </div>
3465 </div> <!-- Chart description -->
3466 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3467 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3468 <label for="ays-chart-create-author" class="form-label">
3469 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3470 <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")); ?>">
3471 <i class="ays_fa ays_fa_info_circle"></i>
3472 </a>
3473 </label>
3474 </div>
3475 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3476 <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">
3477 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3478 <?php if (isset($create_author_data['ID'])) : ?>
3479 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3480 <?php endif; ?>
3481 </select>
3482 </div>
3483 </div> <!-- Change chart author -->
3484 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3485 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3486 <label for="ays-chart-show-title" class="form-label">
3487 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3488 <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") ); ?>">
3489 <i class="ays_fa ays_fa_info_circle"></i>
3490 </a>
3491 </label>
3492 </div>
3493 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3494 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3495 <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); ?> >
3496 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3497 </label>
3498 </div>
3499 </div> <!-- Show title -->
3500 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3501 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3502 <label for="ays-chart-show-description" class="form-label">
3503 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3504 <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") ); ?>">
3505 <i class="ays_fa ays_fa_info_circle"></i>
3506 </a>
3507 </label>
3508 </div>
3509 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3510 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3511 <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); ?> >
3512 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3513 </label>
3514 </div>
3515 </div> <!-- Show description -->
3516 </div>
3517 </div>
3518 <?php
3519 $content = ob_get_clean();
3520
3521 $title = __( 'General Settings', "chart-builder" );
3522
3523 $sources['general_settings'] = array(
3524 'content' => $content,
3525 'title' => $title
3526 );
3527
3528 return $sources;
3529 }
3530
3531 public function settings_contents_tooltip_settings( $sources, $args ){
3532 $html_class_prefix = $args['html_class_prefix'];
3533 $html_name_prefix = $args['html_name_prefix'];
3534 $settings = $args['settings'];
3535
3536 $tooltip_trigger_options = $settings['tooltip_trigger_options'];
3537 $tooltip_trigger = $settings['tooltip_trigger'];
3538 $show_color_code = $settings['show_color_code'];
3539 $tooltip_italic = $settings['tooltip_italic'];
3540 $tooltip_bold = $settings['tooltip_bold'];
3541 $tooltip_bold_options = $settings['tooltip_bold_options'];
3542 $tooltip_text_color = $settings['tooltip_text_color'];
3543 $tooltip_font_size = $settings['tooltip_font_size'];
3544
3545 ob_start();
3546 ?>
3547 <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">
3548 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3549 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3550 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3551 <label for="ays-chart-option-tooltip-trigger">
3552 <?php echo esc_html(__( "Trigger", "chart-builder" )); ?>
3553 <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") )); ?>">
3554 <i class="ays_fa ays_fa_info_circle"></i>
3555 </a>
3556 </label>
3557 </div>
3558 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3559 <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]">
3560 <?php
3561 foreach ( $tooltip_trigger_options as $option_slug => $option ):
3562 $selected = ( $tooltip_trigger == $option_slug ) ? 'selected' : '';
3563 ?>
3564 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3565 <?php
3566 endforeach;
3567 ?>
3568 </select>
3569 </div>
3570 </div> <!-- Trigger -->
3571 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3572 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3573 <label for="ays-chart-option-show-color-code">
3574 <?php echo esc_html(__( "Show Color Code", "chart-builder" )); ?>
3575 <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") ); ?>">
3576 <i class="ays_fa ays_fa_info_circle"></i>
3577 </a>
3578 </label>
3579 </div>
3580 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3581 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3582 <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); ?> >
3583 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3584 </label>
3585 </div>
3586 </div> <!-- Show Color Code -->
3587 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3588 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3589 <label for="ays-chart-option-tooltip-text-color">
3590 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
3591 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
3592 <i class="ays_fa ays_fa_info_circle"></i>
3593 </a>
3594 </label>
3595 </div>
3596 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3597 <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) ?>">
3598 </div>
3599 </div> <!-- Text color -->
3600 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3601 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3602 <label for="ays-chart-option-tooltip-font-size" class="form-label">
3603 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3604 <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") )); ?>">
3605 <i class="ays_fa ays_fa_info_circle"></i>
3606 </a>
3607 </label>
3608 </div>
3609 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3610 <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) ?>">
3611 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3612 </div>
3613 </div> <!-- Font size -->
3614 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3615 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3616 <label for="ays-chart-option-tooltip-italic">
3617 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3618 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart tooltip text italic.","chart-builder") ); ?>">
3619 <i class="ays_fa ays_fa_info_circle"></i>
3620 </a>
3621 </label>
3622 </div>
3623 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3624 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3625 <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); ?> >
3626 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3627 </label>
3628 </div>
3629 </div> <!-- Italic text -->
3630 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3631 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3632 <label for="ays-chart-option-tooltip-bold">
3633 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3634 <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") )); ?>">
3635 <i class="ays_fa ays_fa_info_circle"></i>
3636 </a>
3637 </label>
3638 </div>
3639 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3640 <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]">
3641 <?php
3642 foreach ( $tooltip_bold_options as $option_slug => $option ):
3643 $selected = ( $tooltip_bold == $option_slug ) ? 'selected' : '';
3644 ?>
3645 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3646 <?php
3647 endforeach;
3648 ?>
3649 </select>
3650 </div>
3651 </div> <!-- Bold text -->
3652 </div>
3653 </div>
3654 <?php
3655 $content = ob_get_clean();
3656
3657 $title = __( 'Tooltip', "chart-builder" );
3658
3659 $sources['tooltip'] = array(
3660 'content' => $content,
3661 'title' => $title
3662 );
3663
3664 return $sources;
3665 }
3666
3667 public function settings_contents_tooltip_settings_chartjs( $sources, $args ){
3668 $html_class_prefix = $args['html_class_prefix'];
3669 $html_name_prefix = $args['html_name_prefix'];
3670 $settings = $args['settings'];
3671
3672 $tooltip_text_color = $settings['tooltip_text_color'];
3673
3674 ob_start();
3675 ?>
3676 <div class="ays-accordion-data-main-wrap ">
3677 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3678 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3679 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3680 <label for="ays-chart-option-tooltip-text-color">
3681 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
3682 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
3683 <i class="ays_fa ays_fa_info_circle"></i>
3684 </a>
3685 </label>
3686 </div>
3687 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3688 <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) ?>">
3689 </div>
3690 </div> <!-- Text color -->
3691 </div>
3692 </div>
3693 <?php
3694 $content = ob_get_clean();
3695
3696 $title = __( 'Tooltip', "chart-builder" );
3697
3698 $sources['tooltip'] = array(
3699 'content' => $content,
3700 'title' => $title
3701 );
3702
3703 return $sources;
3704 }
3705
3706 public function settings_contents_legend_settings( $sources, $args ){
3707 $html_class_prefix = $args['html_class_prefix'];
3708 $html_name_prefix = $args['html_name_prefix'];
3709 $settings = $args['settings'];
3710 $legend_positions = $settings['legend_positions'];
3711 $legend_position = $settings['legend_position'];
3712 $legend_alignments = $settings['legend_alignments'];
3713 $legend_alignment = $settings['legend_alignment'];
3714 $legend_color = $settings['legend_color'];
3715 $legend_font_size = $settings['legend_font_size'];
3716 $legend_bold = $settings['legend_bold'];
3717 $legend_italic = $settings['legend_italic'];
3718
3719 ob_start();
3720 ?>
3721 <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">
3722 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3723 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3724 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3725 <label for="ays-chart-option-legend-position">
3726 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3727 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") )); ?>">
3728 <i class="ays_fa ays_fa_info_circle"></i>
3729 </a>
3730 </label>
3731 </div>
3732 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3733 <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]">
3734 <?php
3735 foreach ( $legend_positions as $option_slug => $option ):
3736 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
3737
3738 $type_class = '';
3739 if ($option_slug == 'left') {
3740 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3741 } else if ($option_slug == 'in') {
3742 $type_class = ' cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt ';
3743 } else if ($option_slug == 'labeled') {
3744 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3745 }
3746
3747 ?>
3748
3749 <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>
3750 <?php
3751 endforeach;
3752 ?>
3753 </select>
3754 </div>
3755 </div> <!-- Legend position -->
3756 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3757 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3758 <label for="ays-chart-option-legend-alignment">
3759 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
3760 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") )); ?>">
3761 <i class="ays_fa ays_fa_info_circle"></i>
3762 </a>
3763 </label>
3764 </div>
3765 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3766 <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]">
3767 <?php
3768 foreach ( $legend_alignments as $option_slug => $option ):
3769 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
3770 ?>
3771 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3772 <?php
3773 endforeach;
3774 ?>
3775 </select>
3776 </div>
3777 </div> <!-- Legend alignment -->
3778 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3779 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3780 <label for="ays-chart-option-legend-font-color">
3781 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
3782 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the font color for the chart legend.","chart-builder") )); ?>">
3783 <i class="ays_fa ays_fa_info_circle"></i>
3784 </a>
3785 </label>
3786 </div>
3787 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3788 <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) ?>">
3789 </div>
3790 </div> <!-- Legend font color -->
3791 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3792 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3793 <label for="ays-chart-option-legend-font-size" class="form-label">
3794 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3795 <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") )); ?>">
3796 <i class="ays_fa ays_fa_info_circle"></i>
3797 </a>
3798 </label>
3799 </div>
3800 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3801 <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) ?>">
3802 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3803 </div>
3804 </div> <!-- Font size -->
3805 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3806 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3807 <label for="ays-chart-option-legend-italic">
3808 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3809 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
3810 <i class="ays_fa ays_fa_info_circle"></i>
3811 </a>
3812 </label>
3813 </div>
3814 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3815 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3816 <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); ?> >
3817 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3818 </label>
3819 </div>
3820 </div> <!-- Italic text -->
3821 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3822 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3823 <label for="ays-chart-option-legend-bold">
3824 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3825 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
3826 <i class="ays_fa ays_fa_info_circle"></i>
3827 </a>
3828 </label>
3829 </div>
3830 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3831 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3832 <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); ?> >
3833 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3834 </label>
3835 </div>
3836 </div> <!-- Bold text -->
3837 </div>
3838 </div>
3839 <?php
3840 $content = ob_get_clean();
3841
3842 $title = __( 'Legend', "chart-builder" );
3843
3844 $sources['legend'] = array(
3845 'content' => $content,
3846 'title' => $title
3847 );
3848
3849 return $sources;
3850 }
3851
3852 public function settings_contents_legend_settings_chartjs( $sources, $args ){
3853 $html_class_prefix = $args['html_class_prefix'];
3854 $html_name_prefix = $args['html_name_prefix'];
3855 $settings = $args['settings'];
3856 $legend_positions = $settings['legend_positions'];
3857 $legend_position = $settings['legend_position'];
3858 $legend_alignments = $settings['legend_alignments'];
3859 $legend_alignment = $settings['legend_alignment'];
3860 $legend_color = $settings['legend_color'];
3861 $legend_font_size = $settings['legend_font_size'];
3862 $legend_reverse = $settings['legend_reverse'];
3863 $legend_bold = $settings['legend_bold'];
3864 $legend_italic = $settings['legend_italic'];
3865 ob_start();
3866 ?>
3867 <div class="ays-accordion-data-main-wrap">
3868 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3869 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3870 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3871 <label for="ays-chart-option-legend-position">
3872 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3873 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") )); ?>">
3874 <i class="ays_fa ays_fa_info_circle"></i>
3875 </a>
3876 </label>
3877 </div>
3878 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3879 <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]">
3880 <?php
3881 foreach ( $legend_positions as $option_slug => $option ):
3882 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
3883 ?>
3884 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?> ><?php echo esc_html($option); ?></option>
3885 <?php
3886 endforeach;
3887 ?>
3888 </select>
3889 </div>
3890 </div> <!-- Legend position -->
3891 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3892 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3893 <label for="ays-chart-option-legend-alignment">
3894 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
3895 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") )); ?>">
3896 <i class="ays_fa ays_fa_info_circle"></i>
3897 </a>
3898 </label>
3899 </div>
3900 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3901 <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]">
3902 <?php
3903 foreach ( $legend_alignments as $option_slug => $option ):
3904 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
3905 ?>
3906 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3907 <?php
3908 endforeach;
3909 ?>
3910 </select>
3911 </div>
3912 </div> <!-- Legend alignment -->
3913 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3914 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3915 <label for="ays-chart-option-legend-font-color">
3916 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
3917 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr(htmlspecialchars( __("Choose the font color for the chart legend.","chart-builder") )); ?>">
3918 <i class="ays_fa ays_fa_info_circle"></i>
3919 </a>
3920 </label>
3921 </div>
3922 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3923 <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) ?>">
3924 </div>
3925 </div> <!-- Legend font color -->
3926 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3927 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3928 <label for="ays-chart-option-legend-font-size" class="form-label">
3929 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3930 <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") )); ?>">
3931 <i class="ays_fa ays_fa_info_circle"></i>
3932 </a>
3933 </label>
3934 </div>
3935 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3936 <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) ?>">
3937 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3938 </div>
3939 </div> <!-- Font size -->
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-legend-italic">
3943 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3944 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
3945 <i class="ays_fa ays_fa_info_circle"></i>
3946 </a>
3947 </label>
3948 </div>
3949 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3950 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3951 <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); ?> >
3952 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3953 </label>
3954 </div>
3955 </div> <!-- Italic text -->
3956 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3957 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3958 <label for="ays-chart-option-legend-bold">
3959 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3960 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
3961 <i class="ays_fa ays_fa_info_circle"></i>
3962 </a>
3963 </label>
3964 </div>
3965 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3966 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3967 <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); ?> >
3968 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3969 </label>
3970 </div>
3971 </div> <!-- Bold text -->
3972 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt">
3973 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3974 <label for="ays-chart-option-legend-revers">
3975 <?php echo esc_html(__( "Show datasets in reverse order", "chart-builder" )); ?>
3976 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this toggle to show datasets in reverse ordering.","chart-builder") ); ?>">
3977 <i class="ays_fa ays_fa_info_circle"></i>
3978 </a>
3979 </label>
3980 </div>
3981 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3982 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3983 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-legend-reverse" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[legend_reverse]" value="on" <?php echo esc_attr($legend_reverse); ?> >
3984 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3985 </label>
3986 </div>
3987 </div> <!-- reverse datasets -->
3988 </div>
3989 </div>
3990 <?php
3991 $content = ob_get_clean();
3992
3993 $title = __( 'Legend', "chart-builder" );
3994
3995 $sources['legend'] = array(
3996 'content' => $content,
3997 'title' => $title
3998 );
3999
4000 return $sources;
4001 }
4002
4003 public function settings_contents_horizontal_axis_settings( $sources, $args ){
4004 $html_class_prefix = $args['html_class_prefix'];
4005 $html_name_prefix = $args['html_name_prefix'];
4006 $settings = $args['settings'];
4007
4008 $haxis_title = $settings['haxis_title'];
4009 $axes_text_positions = $settings['axes_text_positions'];
4010 $haxis_text_position = $settings['haxis_text_position'];
4011 $haxis_direction = $settings['haxis_direction'];
4012 $haxis_text_color = $settings['haxis_text_color'];
4013 $haxis_baseline_color = $settings['haxis_baseline_color'];
4014 $haxis_slanted_options = $settings['haxis_slanted_options'];
4015 $haxis_slanted = $settings['haxis_slanted'];
4016 $haxis_slanted_text_angle = $settings['haxis_slanted_text_angle'];
4017 $haxis_show_text_every = $settings['haxis_show_text_every'];
4018 $haxis_format_options = $settings['axes_format_options'];
4019 $haxis_format = $settings['haxis_format'];
4020 $haxis_enable_divide_percent = $settings['haxis_enable_divide_percent'];
4021 $haxis_label_font_size = $settings['haxis_label_font_size'];
4022 $haxis_max_value = $settings['haxis_max_value'];
4023 $haxis_min_value = $settings['haxis_min_value'];
4024 $haxis_text_font_size = $settings['haxis_text_font_size'];
4025 $haxis_label_color = $settings['haxis_label_color'];
4026 $haxis_bold = $settings['haxis_bold'];
4027 $haxis_italic = $settings['haxis_italic'];
4028 $haxis_title_bold = $settings['haxis_title_bold'];
4029 $haxis_title_italic = $settings['haxis_title_italic'];
4030 $haxis_gridlines_count = $settings['haxis_gridlines_count'];
4031 $haxis_gridlines_color = $settings['haxis_gridlines_color'];
4032 $haxis_minor_gridlines_color = $settings['haxis_minor_gridlines_color'];
4033
4034 ob_start();
4035 ?>
4036 <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">
4037 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4038 <h6>Label</h6>
4039 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4040 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4041 <label for="ays-chart-option-haxis-title" class="form-label">
4042 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
4043 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The title of the horizontal axis","chart-builder") ); ?>">
4044 <i class="ays_fa ays_fa_info_circle"></i>
4045 </a>
4046 </label>
4047 </div>
4048 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4049 <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) ?>">
4050 </div>
4051 </div> <!-- Horizontal axis label -->
4052 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4053 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4054 <label for="ays-chart-option-haxis-label-font-size" class="form-label">
4055 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4056 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis label.","chart-builder") ); ?>">
4057 <i class="ays_fa ays_fa_info_circle"></i>
4058 </a>
4059 </label>
4060 </div>
4061 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4062 <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) ?>">
4063 </div>
4064 </div> <!-- Horizontal axis label font size -->
4065 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4066 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4067 <label for="ays-chart-option-haxis-label-color">
4068 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4069 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
4070 <i class="ays_fa ays_fa_info_circle"></i>
4071 </a>
4072 </label>
4073 </div>
4074 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4075 <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) ?>">
4076 </div>
4077 </div> <!-- Horizontal axis label color -->
4078 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4079 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4080 <label for="ays-chart-option-haxis-title-italic">
4081 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
4082 <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") ); ?>">
4083 <i class="ays_fa ays_fa_info_circle"></i>
4084 </a>
4085 </label>
4086 </div>
4087 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4088 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4089 <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); ?> >
4090 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4091 </label>
4092 </div>
4093 </div> <!-- Italic label -->
4094 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4095 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4096 <label for="ays-chart-option-haxis-title-bold">
4097 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
4098 <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") ); ?>">
4099 <i class="ays_fa ays_fa_info_circle"></i>
4100 </a>
4101 </label>
4102 </div>
4103 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4104 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4105 <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); ?> >
4106 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4107 </label>
4108 </div>
4109 </div> <!-- Bold label -->
4110 <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">
4111 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4112 <label for="ays-chart-option-haxis-show-text-every" class="form-label">
4113 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
4114 <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") ); ?>">
4115 <i class="ays_fa ays_fa_info_circle"></i>
4116 </a>
4117 </label>
4118 </div>
4119 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4120 <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">
4121 </div>
4122 </div> <!-- Label interval -->
4123
4124 <br>
4125 <h6>Text</h6>
4126 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4127 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4128 <label for="ays-chart-option-haxis-text-position" class="form-label">
4129 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4130 <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") ); ?>">
4131 <i class="ays_fa ays_fa_info_circle"></i>
4132 </a>
4133 </label>
4134 </div>
4135 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4136 <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]">
4137 <?php
4138 foreach ( $axes_text_positions as $option_slug => $option ):
4139 $selected = ( $haxis_text_position == $option_slug ) ? 'selected' : '';
4140 ?>
4141 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4142 <?php
4143 endforeach;
4144 ?>
4145 </select>
4146 </div>
4147 </div> <!-- Horizontal axis text position -->
4148 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4149 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4150 <label for="ays-chart-option-haxis-text-color">
4151 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4152 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis text.","chart-builder") ); ?>">
4153 <i class="ays_fa ays_fa_info_circle"></i>
4154 </a>
4155 </label>
4156 </div>
4157 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4158 <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) ?>">
4159 </div>
4160 </div> <!-- Horizontal axis text color -->
4161 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4162 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4163 <label for="ays-chart-option-haxis-text-font-size" class="form-label">
4164 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4165 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
4166 <i class="ays_fa ays_fa_info_circle"></i>
4167 </a>
4168 </label>
4169 </div>
4170 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4171 <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) ?>">
4172 </div>
4173 </div> <!-- Horizontal axis text font size -->
4174 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4175 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4176 <label for="ays-chart-option-haxis-text-direction">
4177 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
4178 <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") ); ?>">
4179 <i class="ays_fa ays_fa_info_circle"></i>
4180 </a>
4181 </label>
4182 </div>
4183 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4184 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4185 <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); ?> >
4186 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4187 </label>
4188 </div>
4189 </div> <!-- Horizontal axis text direction -->
4190 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4191 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4192 <label for="ays-chart-option-haxis-italic">
4193 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
4194 <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") ); ?>">
4195 <i class="ays_fa ays_fa_info_circle"></i>
4196 </a>
4197 </label>
4198 </div>
4199 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4200 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4201 <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); ?> >
4202 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4203 </label>
4204 </div>
4205 </div> <!-- Italic text -->
4206 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4207 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4208 <label for="ays-chart-option-haxis-bold">
4209 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
4210 <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") ); ?>">
4211 <i class="ays_fa ays_fa_info_circle"></i>
4212 </a>
4213 </label>
4214 </div>
4215 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4216 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4217 <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); ?> >
4218 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4219 </label>
4220 </div>
4221 </div> <!-- Bold text -->
4222 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4223 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4224 <label for="ays-chart-option-haxis-slanted-text" class="form-label">
4225 <?php echo esc_html(__( "Slanted text", "chart-builder" )); ?>
4226 <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") ); ?>">
4227 <i class="ays_fa ays_fa_info_circle"></i>
4228 </a>
4229 </label>
4230 </div>
4231 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4232 <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]">
4233 <?php
4234 foreach ( $haxis_slanted_options as $option_slug => $option ):
4235 $selected = ( $haxis_slanted == $option_slug ) ? 'selected' : '';
4236 ?>
4237 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4238 <?php
4239 endforeach;
4240 ?>
4241 </select>
4242 </div>
4243 </div> <!-- Horizontal axis slanted text -->
4244 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section <?php echo ($haxis_slanted == 'false') ? 'display_none' : ''; ?>">
4245 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4246 <label for="ays-chart-option-haxis-slanted-text-angle" class="form-label">
4247 <?php echo esc_html(__( "Slanted text angle", "chart-builder" )); ?>
4248 <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") ); ?>">
4249 <i class="ays_fa ays_fa_info_circle"></i>
4250 </a>
4251 </label>
4252 </div>
4253 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4254 <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">
4255 </div>
4256 </div> <!-- Horizontal axis slanted text angle -->
4257
4258 <br>
4259 <h6>Gridlines</h6>
4260 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4261 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4262 <label for="ays-chart-option-haxis-gridlines-count" class="form-label">
4263 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
4264 <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") ); ?>">
4265 <i class="ays_fa ays_fa_info_circle"></i>
4266 </a>
4267 </label>
4268 </div>
4269 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4270 <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) ?>">
4271 </div>
4272 </div> <!-- Horizontal axis gridlines count -->
4273 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4274 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4275 <label for="ays-chart-option-haxis-gridlines-color">
4276 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4277 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis gridlines.","chart-builder") ); ?>">
4278 <i class="ays_fa ays_fa_info_circle"></i>
4279 </a>
4280 </label>
4281 </div>
4282 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4283 <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) ?>">
4284 </div>
4285 </div> <!-- Horizontal axis gridlines color -->
4286 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4287 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4288 <label for="ays-chart-option-haxis-minor-gridlines-color">
4289 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
4290 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis minor gridlines.","chart-builder") ); ?>">
4291 <i class="ays_fa ays_fa_info_circle"></i>
4292 </a>
4293 </label>
4294 </div>
4295 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4296 <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) ?>">
4297 </div>
4298 </div> <!-- Horizontal axis minor gridlines color -->
4299 <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">
4300 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4301 <label for="ays-chart-option-haxis-baseline-color">
4302 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4303 <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") ); ?>">
4304 <i class="ays_fa ays_fa_info_circle"></i>
4305 </a>
4306 </label>
4307 </div>
4308 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4309 <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) ?>">
4310 </div>
4311 </div> <!-- Horizontal axis baseline color -->
4312
4313 <br class="cb-changable-opt cb-bar_chart-opt " >
4314 <h6 class="cb-changable-opt cb-bar_chart-opt">Format</h6>
4315 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt " >
4316 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4317 <label for="ays-chart-option-haxis-format" class="form-label">
4318 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4319 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4320 echo esc_attr( sprintf(
4321 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4322 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4323 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4324 __('%1$sNone:%2$s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4325 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4326 __('%1$sDecimal:%2$s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4327 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4328 __('%1$sScientific:%2$s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4329 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4330 __('%1$sCurrency:%2$s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4331 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4332 __('%1$sPercent:%2$s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4333 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4334 __('%1$sShort:%2$s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4335 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4336 __('%1$sLong:%2$s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4337 '<em>', '</em>',
4338 '<em>', '</em>',
4339 '<em>', '</em>',
4340 '<em>', '</em>',
4341 '<em>', '</em>',
4342 '<em>', '</em>',
4343 '<em>', '</em>'
4344 ));
4345 ?>">
4346 <i class="ays_fa ays_fa_info_circle"></i>
4347 </a>
4348 </label>
4349 </div>
4350 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4351 <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]">
4352 <?php
4353 foreach ( $haxis_format_options as $option_slug => $option ):
4354 $selected = ( $haxis_format == $option_slug ) ? 'selected' : '';
4355 ?>
4356 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4357 <?php
4358 endforeach;
4359 ?>
4360 </select>
4361 </div>
4362 </div> <!-- Horizontal axis format -->
4363 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section option-haxis-enable-divide-percent cb-changable-opt cb-bar_chart-opt" style="<?php echo ($haxis_format == 'percent') ? '' : 'display: none;'; ?>">
4364 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4365 <label for="ays-chart-option-haxis-enable-divide-percent">
4366 <?php echo esc_html(__( "Remove Extra Zeros ", "chart-builder" )); ?>
4367 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to hide extra 00's from the axis text if the Format option is set to 'Percent'. Note: Make sure to save chart, to see changes.","chart-builder") ); ?>">
4368 <i class="ays_fa ays_fa_info_circle"></i>
4369 </a>
4370 </label>
4371 </div>
4372 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4373 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4374 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-haxis-enable-divide-percent" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_enable_divide_percent]" value="on" <?php echo esc_attr($haxis_enable_divide_percent); ?> >
4375 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4376 </label>
4377 </div>
4378 </div> <!--Remove Extra Zeros"-->
4379 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt" >
4380 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4381 <label for="ays-chart-option-haxis-max-value" class="form-label">
4382 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4383 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4384 <i class="ays_fa ays_fa_info_circle"></i>
4385 </a>
4386 </label>
4387 </div>
4388 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4389 <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) ?>">
4390 </div>
4391 </div> <!-- Horizontal axis max value -->
4392 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-bar_chart-opt" >
4393 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4394 <label for="ays-chart-option-haxis-min-value" class="form-label">
4395 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4396 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4397 <i class="ays_fa ays_fa_info_circle"></i>
4398 </a>
4399 </label>
4400 </div>
4401 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4402 <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) ?>">
4403 </div>
4404 </div> <!-- Horizontal axis min value -->
4405 </div>
4406 </div>
4407 <?php
4408 $content = ob_get_clean();
4409
4410 $title = __( 'Horizontal Axis Settings', "chart-builder" );
4411
4412 $sources['horizontal_axis'] = array(
4413 'content' => $content,
4414 'title' => $title
4415 );
4416
4417 return $sources;
4418 }
4419
4420 public function settings_contents_vertical_axis_settings( $sources, $args ){
4421 $html_class_prefix = $args['html_class_prefix'];
4422 $html_name_prefix = $args['html_name_prefix'];
4423 $settings = $args['settings'];
4424
4425 $vaxis_title = $settings['vaxis_title'];
4426 $axes_text_positions = $settings['axes_text_positions'];
4427 $vaxis_text_position = $settings['vaxis_text_position'];
4428 $vaxis_direction = $settings['vaxis_direction'];
4429 $vaxis_text_color = $settings['vaxis_text_color'];
4430 $vaxis_baseline_color = $settings['vaxis_baseline_color'];
4431 $vaxis_format_options = $settings['axes_format_options'];
4432 $vaxis_format = $settings['vaxis_format'];
4433 $vaxis_enable_divide_percent = $settings['vaxis_enable_divide_percent'];
4434 $vaxis_label_font_size = $settings['vaxis_label_font_size'];
4435 $vaxis_max_value = $settings['vaxis_max_value'];
4436 $vaxis_min_value = $settings['vaxis_min_value'];
4437 $vaxis_text_font_size = $settings['vaxis_text_font_size'];
4438 $vaxis_label_color = $settings['vaxis_label_color'];
4439 $vaxis_bold = $settings['vaxis_bold'];
4440 $vaxis_italic = $settings['vaxis_italic'];
4441 $vaxis_title_bold = $settings['vaxis_title_bold'];
4442 $vaxis_title_italic = $settings['vaxis_title_italic'];
4443 $vaxis_gridlines_count = $settings['vaxis_gridlines_count'];
4444 $vaxis_gridlines_color = $settings['vaxis_gridlines_color'];
4445 $vaxis_minor_gridlines_color = $settings['vaxis_minor_gridlines_color'];
4446
4447 ob_start();
4448 ?>
4449 <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">
4450 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4451 <h6>Label</h6>
4452 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4453 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4454 <label for="ays-chart-option-vaxis-title" class="form-label">
4455 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
4456 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The title of the vertical axis","chart-builder") ); ?>">
4457 <i class="ays_fa ays_fa_info_circle"></i>
4458 </a>
4459 </label>
4460 </div>
4461 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4462 <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) ?>">
4463 </div>
4464 </div> <!-- Vertical axis label -->
4465 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4466 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4467 <label for="ays-chart-option-vaxis-label-font-size" class="form-label">
4468 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4469 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the vertical axis label.","chart-builder") ); ?>">
4470 <i class="ays_fa ays_fa_info_circle"></i>
4471 </a>
4472 </label>
4473 </div>
4474 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4475 <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) ?>">
4476 </div>
4477 </div> <!-- Vertical axis label font size -->
4478 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4479 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4480 <label for="ays-chart-option-vaxis-label-color">
4481 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4482 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
4483 <i class="ays_fa ays_fa_info_circle"></i>
4484 </a>
4485 </label>
4486 </div>
4487 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4488 <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) ?>">
4489 </div>
4490 </div> <!-- Vertical axis label color -->
4491 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4492 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4493 <label for="ays-chart-option-vaxis-title-italic">
4494 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
4495 <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") ); ?>">
4496 <i class="ays_fa ays_fa_info_circle"></i>
4497 </a>
4498 </label>
4499 </div>
4500 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4501 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4502 <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); ?> >
4503 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4504 </label>
4505 </div>
4506 </div> <!-- Italic label -->
4507 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4508 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4509 <label for="ays-chart-option-vaxis-title-bold">
4510 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
4511 <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") ); ?>">
4512 <i class="ays_fa ays_fa_info_circle"></i>
4513 </a>
4514 </label>
4515 </div>
4516 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4517 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4518 <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); ?> >
4519 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4520 </label>
4521 </div>
4522 </div> <!-- Bold label -->
4523
4524 <br>
4525 <h6>Text</h6>
4526 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4527 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4528 <label for="ays-chart-option-vaxis-text-position" class="form-label">
4529 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4530 <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") ); ?>">
4531 <i class="ays_fa ays_fa_info_circle"></i>
4532 </a>
4533 </label>
4534 </div>
4535 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4536 <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]">
4537 <?php
4538 foreach ( $axes_text_positions as $option_slug => $option ):
4539 $selected = ( $vaxis_text_position == $option_slug ) ? 'selected' : '';
4540 ?>
4541 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4542 <?php
4543 endforeach;
4544 ?>
4545 </select>
4546 </div>
4547 </div> <!-- Vertical axis text position -->
4548 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4549 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4550 <label for="ays-chart-option-vaxis-text-color">
4551 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4552 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis text.","chart-builder") ); ?>">
4553 <i class="ays_fa ays_fa_info_circle"></i>
4554 </a>
4555 </label>
4556 </div>
4557 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4558 <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) ?>">
4559 </div>
4560 </div> <!-- Vertical axis text color -->
4561 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4562 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4563 <label for="ays-chart-option-vaxis-text-font-size" class="form-label">
4564 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4565 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
4566 <i class="ays_fa ays_fa_info_circle"></i>
4567 </a>
4568 </label>
4569 </div>
4570 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4571 <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) ?>">
4572 </div>
4573 </div> <!-- Vertical axis text font size -->
4574 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4575 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4576 <label for="ays-chart-option-vaxis-text-direction">
4577 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
4578 <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") ); ?>">
4579 <i class="ays_fa ays_fa_info_circle"></i>
4580 </a>
4581 </label>
4582 </div>
4583 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4584 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4585 <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); ?> >
4586 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4587 </label>
4588 </div>
4589 </div> <!-- Vertical axis text direction -->
4590 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4591 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4592 <label for="ays-chart-option-vaxis-italic">
4593 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
4594 <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") ); ?>">
4595 <i class="ays_fa ays_fa_info_circle"></i>
4596 </a>
4597 </label>
4598 </div>
4599 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4600 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4601 <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); ?> >
4602 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4603 </label>
4604 </div>
4605 </div> <!-- Italic text -->
4606 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4607 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4608 <label for="ays-chart-option-vaxis-bold">
4609 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
4610 <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") ); ?>">
4611 <i class="ays_fa ays_fa_info_circle"></i>
4612 </a>
4613 </label>
4614 </div>
4615 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4616 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4617 <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); ?> >
4618 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4619 </label>
4620 </div>
4621 </div> <!-- Bold text -->
4622
4623 <br>
4624 <h6>Gridlines</h6>
4625 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4626 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4627 <label for="ays-chart-option-vaxis-gridlines-count" class="form-label">
4628 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
4629 <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") ); ?>">
4630 <i class="ays_fa ays_fa_info_circle"></i>
4631 </a>
4632 </label>
4633 </div>
4634 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4635 <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) ?>">
4636 </div>
4637 </div> <!-- Vertical axis gridlines count -->
4638 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4639 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4640 <label for="ays-chart-option-vaxis-gridlines-color">
4641 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4642 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis gridlines.","chart-builder") ); ?>">
4643 <i class="ays_fa ays_fa_info_circle"></i>
4644 </a>
4645 </label>
4646 </div>
4647 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4648 <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) ?>">
4649 </div>
4650 </div> <!-- Vertical axis gridlines color -->
4651 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4652 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4653 <label for="ays-chart-option-vaxis-minor-gridlines-color">
4654 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
4655 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis minor gridlines.","chart-builder") ); ?>">
4656 <i class="ays_fa ays_fa_info_circle"></i>
4657 </a>
4658 </label>
4659 </div>
4660 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4661 <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) ?>">
4662 </div>
4663 </div> <!-- Vertical axis minor gridlines color -->
4664 <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">
4665 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4666 <label for="ays-chart-option-vaxis-baseline-color">
4667 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4668 <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") ); ?>">
4669 <i class="ays_fa ays_fa_info_circle"></i>
4670 </a>
4671 </label>
4672 </div>
4673 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4674 <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) ?>">
4675 </div>
4676 </div> <!-- Vertical axis baseline color -->
4677
4678 <br class="cb-changable-opt cb-column_chart-opt cb-line_chart-opt">
4679 <h6 class="cb-changable-opt cb-column_chart-opt cb-line_chart-opt">Format</h6>
4680 <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">
4681 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4682 <label for="ays-chart-option-vaxis-format" class="form-label">
4683 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4684 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4685 echo esc_attr( sprintf(
4686 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4687 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4688 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4689 __('%1$sNone:%2$s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4690 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4691 __('%1$sDecimal:%2$s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4692 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4693 __('%1$sScientific:%2$s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4694 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4695 __('%1$sCurrency:%2$s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4696 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4697 __('%1$sPercent:%2$s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4698 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4699 __('%1$sShort:%2$s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4700 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4701 __('%1$sLong:%2$s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4702 '<em>', '</em>',
4703 '<em>', '</em>',
4704 '<em>', '</em>',
4705 '<em>', '</em>',
4706 '<em>', '</em>',
4707 '<em>', '</em>',
4708 '<em>', '</em>'
4709 ));
4710 ?>">
4711 <i class="ays_fa ays_fa_info_circle"></i>
4712 </a>
4713 </label>
4714 </div>
4715 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4716 <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]">
4717 <?php
4718 foreach ( $vaxis_format_options as $option_slug => $option ):
4719 $selected = ( $vaxis_format == $option_slug ) ? 'selected' : '';
4720 ?>
4721 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4722 <?php
4723 endforeach;
4724 ?>
4725 </select>
4726 </div>
4727 </div> <!-- Vertical axis format -->
4728 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section option-vaxis-enable-divide-percent cb-changable-opt cb-column_chart-opt cb-line_chart-opt" style="<?php echo ($vaxis_format == 'percent') ? '' : 'display: none;'; ?>">
4729 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4730 <label for="ays-chart-option-vaxis-enable-divide-percent">
4731 <?php echo esc_html(__( "Remove Extra Zeros", "chart-builder" )); ?>
4732 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to hide extra 00's from the axis text if the Format option is set to 'Percent'. Note: Make sure to save chart, to see changes.","chart-builder") ); ?>">
4733 <i class="ays_fa ays_fa_info_circle"></i>
4734 </a>
4735 </label>
4736 </div>
4737 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4738 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4739 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-vaxis-enable-divide-percent" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[vaxis_enable_divide_percent]" value="on" <?php echo esc_attr($vaxis_enable_divide_percent); ?> >
4740 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4741 </label>
4742 </div>
4743 </div> <!--Remove Extra Zeros-->
4744 <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">
4745 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4746 <label for="ays-chart-option-vaxis-max-value" class="form-label">
4747 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4748 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4749 <i class="ays_fa ays_fa_info_circle"></i>
4750 </a>
4751 </label>
4752 </div>
4753 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4754 <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) ?>">
4755 </div>
4756 </div> <!-- Vertical axis max value -->
4757 <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">
4758 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4759 <label for="ays-chart-option-vaxis-min-value" class="form-label">
4760 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4761 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4762 <i class="ays_fa ays_fa_info_circle"></i>
4763 </a>
4764 </label>
4765 </div>
4766 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4767 <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) ?>">
4768 </div>
4769 </div> <!-- Vertical axis min value -->
4770 </div>
4771 </div>
4772 <?php
4773 $content = ob_get_clean();
4774
4775 $title = __( 'Vertical Axis Settings', "chart-builder" );
4776
4777 $sources['vertical_axis'] = array(
4778 'content' => $content,
4779 'title' => $title
4780 );
4781
4782 return $sources;
4783 }
4784
4785 public function settings_contents_animation_settings( $sources, $args ) {
4786 $html_class_prefix = $args['html_class_prefix'];
4787 $html_name_prefix = $args['html_name_prefix'];
4788 $settings = $args['settings'];
4789
4790 $enable_animation = $settings['enable_animation'];
4791 $animation_duration = $settings['animation_duration'];
4792 $animation_startup = $settings['animation_startup'];
4793 $animation_easing_options = $settings['animation_easing_options'];
4794 $animation_easing = $settings['animation_easing'];
4795
4796 ob_start();
4797 ?>
4798 <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">
4799 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4800 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4801 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4802 <label for="ays-chart-option-enable-animation">
4803 <?php echo esc_html(__( "Enable chart animation", "chart-builder" )); ?>
4804 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable chart animation.","chart-builder") ); ?>">
4805 <i class="ays_fa ays_fa_info_circle"></i>
4806 </a>
4807 </label>
4808 </div>
4809 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4810 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4811 <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); ?> >
4812 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4813 </label>
4814 </div>
4815 </div> <!-- Enable animation -->
4816 <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'; ?>">
4817 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4818 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4819 <label for="ays-chart-option-animation-duration" class="form-label">
4820 <?php echo esc_html(__( "Duration", "chart-builder" )); ?>
4821 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The duration of the chart animation, in milliseconds.","chart-builder") ); ?>">
4822 <i class="ays_fa ays_fa_info_circle"></i>
4823 </a>
4824 </label>
4825 </div>
4826 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4827 <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) ?>">
4828 </div>
4829 </div> <!-- Animation duration -->
4830 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4831 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4832 <label for="ays-chart-option-animation-startup">
4833 <?php echo esc_html(__( "Startup", "chart-builder" )); ?>
4834 <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") ); ?>">
4835 <i class="ays_fa ays_fa_info_circle"></i>
4836 </a>
4837 </label>
4838 </div>
4839 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4840 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4841 <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); ?> >
4842 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4843 </label>
4844 </div>
4845 </div> <!-- Animation startup -->
4846 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4847 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4848 <label for="ays-chart-option-animation-easing" class="form-label">
4849 <?php echo esc_html(__( "Easing", "chart-builder" )); ?>
4850 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4851 echo esc_attr( sprintf(
4852 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4853 "<p>" . __('The easing function applied to the chart animation. The following options are available:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4854 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4855 __('%1$sLinear:%2$s Constant speed.', "chart-builder") . "</li><li>" .
4856 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4857 __('%1$sEase in:%2$s Start slow and speed up.', "chart-builder") . "</li><li>" .
4858 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4859 __('%1$sEase out:%2$s Start fast and slow down.', "chart-builder") . "</li><li>" .
4860 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
4861 __('%1$sEase in and out:%2$s Start slow, speed up, then slow down.', "chart-builder") . "</li></ul>",
4862 '<em>', '</em>',
4863 '<em>', '</em>',
4864 '<em>', '</em>',
4865 '<em>', '</em>'
4866 ));
4867 ?>">
4868 <i class="ays_fa ays_fa_info_circle"></i>
4869 </a>
4870 </label>
4871 </div>
4872 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4873 <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]">
4874 <?php
4875 foreach ( $animation_easing_options as $option_slug => $option ):
4876 $selected = ( $animation_easing == $option_slug ) ? 'selected' : '';
4877 ?>
4878 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4879 <?php
4880 endforeach;
4881 ?>
4882 </select>
4883 </div>
4884 </div> <!-- Animation easing -->
4885 <div>
4886 </div>
4887 </div>
4888 <?php
4889 $content = ob_get_clean();
4890
4891 $title = __( 'Chart animation', "chart-builder" );
4892
4893 $sources['animation'] = array(
4894 'content' => $content,
4895 'title' => $title
4896 );
4897
4898 return $sources;
4899 }
4900
4901 public function settings_contents_live_chart_settings( $sources, $args ) {
4902 $html_class_prefix = $args['html_class_prefix'];
4903 $html_name_prefix = $args['html_name_prefix'];
4904
4905 ob_start();
4906 ?>
4907 <div class="ays-accordion-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>options-live-chart-settings-tab">
4908 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4909 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4910 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4911 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4912 <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>
4913 <div class="ays-pro-features-v2-video-text">
4914 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4915 </div>
4916 </a>
4917 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4918 <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>
4919 <div class="ays-pro-features-v2-upgrade-text">
4920 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4921 </div>
4922 </a>
4923 </div>
4924 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4925 <label for="ays-chart-option-enable-live-chart">
4926 <?php echo esc_html(__( "Enable live chart", "chart-builder" )); ?>
4927 <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") ); ?>">
4928 <i class="ays_fa ays_fa_info_circle"></i>
4929 </a>
4930 </label>
4931 </div>
4932 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4933 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4934 <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">
4935 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4936 </label>
4937 </div>
4938 </div> <!-- Enable live chart -->
4939 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4940 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4941 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4942 <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>
4943 <div class="ays-pro-features-v2-video-text">
4944 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
4945 </div>
4946 </a>
4947 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4948 <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>
4949 <div class="ays-pro-features-v2-upgrade-text">
4950 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
4951 </div>
4952 </a>
4953 </div>
4954 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4955 <label for="ays-chart-option-live-chart-interval" class="form-label">
4956 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
4957 <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") ); ?>">
4958 <i class="ays_fa ays_fa_info_circle"></i>
4959 </a>
4960 </label>
4961 </div>
4962 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4963 <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">
4964 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">ms</div>
4965 </div>
4966 </div> <!-- Live chart interval -->
4967 </div>
4968 </div>
4969 <?php
4970 $content = ob_get_clean();
4971
4972 $title = __( 'Live Chart', "chart-builder" );
4973
4974 $sources['live_chart'] = array(
4975 'content' => $content,
4976 'title' => $title
4977 );
4978
4979 return $sources;
4980
4981 }
4982
4983 public function settings_contents_export_options( $sources, $args ){
4984 $html_class_prefix = $args['html_class_prefix'];
4985 $html_name_prefix = $args['html_name_prefix'];
4986 $settings = $args['settings'];
4987
4988 $enable_img = $settings['enable_img'];
4989
4990 ob_start();
4991 ?>
4992 <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">
4993 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4994 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4995 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4996 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4997 <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>
4998 <div class="ays-pro-features-v2-video-text">
4999 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
5000 </div>
5001 </a>
5002 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
5003 <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>
5004 <div class="ays-pro-features-v2-upgrade-text">
5005 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
5006 </div>
5007 </a>
5008 </div>
5009 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5010 <label for="ays-chart-option-export-print">
5011 <?php echo esc_html(__( "Print chart", "chart-builder" )); ?>
5012 <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") ); ?>">
5013 <i class="ays_fa ays_fa_info_circle"></i>
5014 </a>
5015 </label>
5016 </div>
5017 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5018 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5019 <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">
5020 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5021 </label>
5022 </div>
5023 </div> <!-- Print option end -->
5024 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
5025 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
5026 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
5027 <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>
5028 <div class="ays-pro-features-v2-video-text">
5029 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
5030 </div>
5031 </a>
5032 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
5033 <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>
5034 <div class="ays-pro-features-v2-upgrade-text">
5035 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
5036 </div>
5037 </a>
5038 </div>
5039 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5040 <label for="ays-chart-option-export-Excel">
5041 <?php echo esc_html(__( "Excel download", "chart-builder" )); ?>
5042 <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") ); ?>">
5043 <i class="ays_fa ays_fa_info_circle"></i>
5044 </a>
5045 </label>
5046 </div>
5047 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5048 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5049 <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">
5050 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5051 </label>
5052 </div>
5053 </div> <!-- Excel option end -->
5054 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
5055 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
5056 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
5057 <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>
5058 <div class="ays-pro-features-v2-video-text">
5059 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
5060 </div>
5061 </a>
5062 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
5063 <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>
5064 <div class="ays-pro-features-v2-upgrade-text">
5065 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
5066 </div>
5067 </a>
5068 </div>
5069 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5070 <label for="ays-chart-option-export-CSV">
5071 <?php echo esc_html(__( "CSV download", "chart-builder" )); ?>
5072 <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") ); ?>">
5073 <i class="ays_fa ays_fa_info_circle"></i>
5074 </a>
5075 </label>
5076 </div>
5077 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5078 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5079 <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">
5080 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5081 </label>
5082 </div>
5083 </div> <!-- CSV option end -->
5084 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
5085 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
5086 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
5087 <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>
5088 <div class="ays-pro-features-v2-video-text">
5089 <?php echo esc_html(__("Watch Video" , "chart-builder")); ?>
5090 </div>
5091 </a>
5092 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
5093 <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>
5094 <div class="ays-pro-features-v2-upgrade-text">
5095 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
5096 </div>
5097 </a>
5098 </div>
5099 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5100 <label for="ays-chart-option-export-Copy">
5101 <?php echo esc_html(__( "Copy chart data", "chart-builder" )); ?>
5102 <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") ); ?>">
5103 <i class="ays_fa ays_fa_info_circle"></i>
5104 </a>
5105 </label>
5106 </div>
5107 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5108 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5109 <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">
5110 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5111 </label>
5112 </div>
5113 </div> <!-- Copy option end -->
5114 <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">
5115 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5116 <label for="ays-chart-option-export-img">
5117 <?php echo esc_html(__( "Download chart image", "chart-builder" )); ?>
5118 <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") ); ?>">
5119 <i class="ays_fa ays_fa_info_circle"></i>
5120 </a>
5121 </label>
5122 </div>
5123 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5124 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5125 <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)?> >
5126 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5127 </label>
5128 </div>
5129 </div> <!-- IMG option end -->
5130 </div>
5131 </div>
5132 <?php
5133
5134 $content = ob_get_clean();
5135
5136 $title = __( 'Frontend Actions', "chart-builder" );
5137
5138 $sources['export_options'] = array(
5139 'content' => $content,
5140 'title' => $title
5141 );
5142
5143 return $sources;
5144 }
5145
5146 /**
5147 * Chart page styles contents
5148 * @param $args
5149 */
5150 public function ays_chart_page_styles_contents( $args ){
5151 $chart_source_type = $args['chart_source_type'];
5152
5153 if ($chart_source_type === 'chart-js') {
5154 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings_chartjs', array(), $args );
5155 } else {
5156 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings', array(), $args );
5157 }
5158
5159 $sources = array();
5160 foreach ( $sources_contents as $key => $sources_content ) {
5161 $collapsed = $key == 'chart' ? 'false' : 'true';
5162
5163 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
5164 if(isset($sources_content['title'])){
5165 $content .= '<legend class="ays-accordion-options-header">';
5166 $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">
5167 <g>
5168 <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" />
5169 </g>
5170 </svg>';
5171
5172 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
5173 }
5174
5175 $content .= '<div class="ays-accordion-options-content">';
5176 $content .= $sources_content['content'];
5177 $content .= '</div>';
5178
5179 $content .= '</fieldset>';
5180
5181 $sources[] = $content;
5182 }
5183 $content_for_escape = implode('' , $sources );
5184 echo html_entity_decode( esc_html($content_for_escape) );
5185 }
5186
5187 public function settings_contents_chart_styles_settings( $sources, $args ){
5188 $html_class_prefix = $args['html_class_prefix'];
5189 $html_name_prefix = $args['html_name_prefix'];
5190 $settings = $args['settings'];
5191
5192 $width = $settings['width'];
5193 $width_format = $settings['width_format'];
5194 $title_positions = $settings['title_positions'];
5195 $position = $settings['position'];
5196 $width_format_options = $settings['width_format_options'];
5197 $responsive_width = $settings['responsive_width'];
5198 $height = $settings['height'];
5199 $height_format = $settings['height_format'];
5200 $font_size = $settings['font_size'];
5201 $org_chart_font_size_options = $settings['org_chart_font_size_options'];
5202 $org_chart_font_size = $settings['org_chart_font_size'];
5203 $background_color = $settings['background_color'];
5204 $transparent_background = $settings['transparent_background'];
5205 $border_width = $settings['border_width'];
5206 $border_width_with_title = $settings['border_width_with_title'];
5207 $border_radius_with_title = $settings['border_radius_with_title'];
5208 $border_color_with_title = $settings['border_color_with_title'];
5209 $border_style_with_title = $settings['border_style_with_title'];
5210 $border_style = $settings['border_style'];
5211 $border_styles = $settings['border_styles'];
5212 $border_radius = $settings['border_radius'];
5213 $border_color = $settings['border_color'];
5214 $box_shadow = $settings['box_shadow'];
5215 $box_shadow_color = $settings['box_shadow_color'];
5216 $padding_outer = $settings['padding_outer'];
5217 ob_start();
5218 ?>
5219 <div class="ays-accordion-data-main-wrap">
5220 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5221 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5222 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5223 <label for="ays-chart-option-width" class="form-label">
5224 <?php echo esc_html(__( "Width", "chart-builder" )); ?>
5225 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container, in percents.","chart-builder") ); ?>">
5226 <i class="ays_fa ays_fa_info_circle"></i>
5227 </a>
5228 </label>
5229 </div>
5230 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5231 <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) ?>">
5232 <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]">
5233 <?php
5234 foreach ( $width_format_options as $option_slug => $option ):
5235 $selected = ( $width_format == $option_slug ) ? 'selected' : '';
5236 ?>
5237 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5238 <?php
5239 endforeach;
5240 ?>
5241 </select>
5242 </div>
5243 </div> <!-- Width -->
5244 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5245 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5246 <label for="ays-chart-option-responsive-width" class="form-label">
5247 <?php echo esc_html(__( "Responsive Width", "chart-builder" )); ?>
5248 <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") ); ?>">
5249 <i class="ays_fa ays_fa_info_circle"></i>
5250 </a>
5251 </label>
5252 </div>
5253 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5254 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5255 <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); ?> >
5256 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5257 </label>
5258 </div>
5259 </div> <!-- Responsive Width -->
5260 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5261 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5262 <label for="ays-chart-option-position">
5263 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5264 <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") ); ?>">
5265 <i class="ays_fa ays_fa_info_circle"></i>
5266 </a>
5267 </label>
5268 </div>
5269 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5270 <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]">
5271 <?php
5272 foreach ( $title_positions as $option_slug => $option ):
5273 $selected = ( $position == $option_slug ) ? 'selected' : '';
5274 ?>
5275 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5276 <?php
5277 endforeach;
5278 ?>
5279 </select>
5280 </div>
5281 </div> <!-- Position -->
5282 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5283 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5284 <label for="ays-chart-option-height" class="form-label">
5285 <?php echo esc_html(__( "Height", "chart-builder" )); ?>
5286 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The height of the chart container, in pixels.","chart-builder") ); ?>">
5287 <i class="ays_fa ays_fa_info_circle"></i>
5288 </a>
5289 </label>
5290 </div>
5291 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5292 <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) ?>">
5293 <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]">
5294 <?php
5295 foreach ( $width_format_options as $option_slug => $option ):
5296 $selected = ( $height_format == $option_slug ) ? 'selected' : '';
5297 ?>
5298 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5299 <?php
5300 endforeach;
5301 ?>
5302 </select>
5303 </div>
5304 </div> <!-- Height -->
5305 <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">
5306 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5307 <label for="ays-chart-option-font-size" class="form-label">
5308 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5309 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart text.","chart-builder") ); ?>">
5310 <i class="ays_fa ays_fa_info_circle"></i>
5311 </a>
5312 </label>
5313 </div>
5314 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5315 <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) ?>">
5316 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5317 </div>
5318 </div> <!-- Font size -->
5319 <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">
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-org-chart-font-size" class="form-label">
5322 <?php echo esc_html(__( "Element size", 'chart-builder' )); ?>
5323 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The size of the chart element.","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) ?>option-input">
5329 <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]">
5330 <?php
5331 foreach ( $org_chart_font_size_options as $option_slug => $option ):
5332 $selected = ( $org_chart_font_size == $option_slug ) ? 'selected' : '';
5333 ?>
5334 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_attr($option); ?></option>
5335 <?php
5336 endforeach;
5337 ?>
5338 </select>
5339 </div>
5340 </div> <!-- Font size for org type -->
5341 <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">
5342 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5343 <label for="ays-chart-option-background-color">
5344 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
5345 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The background color of the chart container.","chart-builder") ); ?>">
5346 <i class="ays_fa ays_fa_info_circle"></i>
5347 </a>
5348 </label>
5349 </div>
5350 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5351 <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) ?>">
5352 </div>
5353 </div> <!-- Background color -->
5354 <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">
5355 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5356 <label for="ays-chart-option-transparent-background" class="form-label">
5357 <?php echo esc_html(__( "Transparent background", "chart-builder" )); ?>
5358 <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") ); ?>">
5359 <i class="ays_fa ays_fa_info_circle"></i>
5360 </a>
5361 </label>
5362 </div>
5363 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5364 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5365 <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); ?> >
5366 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5367 </label>
5368 </div>
5369 </div> <!-- Transparent background -->
5370 <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">
5371 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5372 <label for="ays-chart-option-border-width">
5373 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5374 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border.","chart-builder") ); ?>">
5375 <i class="ays_fa ays_fa_info_circle"></i>
5376 </a>
5377 </label>
5378 </div>
5379 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5380 <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) ?>">
5381 </div>
5382 </div> <!-- Border Width -->
5383 <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">
5384 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5385 <label for="ays-chart-option-border-color">
5386 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5387 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart container.","chart-builder") ); ?>">
5388 <i class="ays_fa ays_fa_info_circle"></i>
5389 </a>
5390 </label>
5391 </div>
5392 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5393 <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) ?>">
5394 </div>
5395 </div> <!-- Border color -->
5396 <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">
5397 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5398 <label for="ays-chart-option-border-radius">
5399 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
5400 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border radius of the chart container.","chart-builder") ); ?>">
5401 <i class="ays_fa ays_fa_info_circle"></i>
5402 </a>
5403 </label>
5404 </div>
5405 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5406 <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) ?>">
5407 </div>
5408 </div> <!-- Border radius -->
5409 <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">
5410 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5411 <label for="ays-chart-option-border-style">
5412 <?php echo esc_html(__( "Border Style", "chart-builder" )); ?>
5413 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border.","chart-builder") ); ?>">
5414 <i class="ays_fa ays_fa_info_circle"></i>
5415 </a>
5416 </label>
5417 </div>
5418 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5419 <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]">
5420 <?php
5421 foreach ( $border_styles as $option_slug => $option ):
5422 $selected = ( $border_style == $option_slug ) ? 'selected' : '';
5423 ?>
5424 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5425 <?php
5426 endforeach;
5427 ?>
5428 </select>
5429 </div>
5430 </div> <!-- Border style -->
5431 <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">
5432 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5433 <label for="ays-chart-option-box-shadow" class="form-label">
5434 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
5435 <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") ); ?>">
5436 <i class="ays_fa ays_fa_info_circle"></i>
5437 </a>
5438 </label>
5439 </div>
5440 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5441 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5442 <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); ?> >
5443 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5444 </label>
5445 </div>
5446 </div> <!-- box shadow -->
5447 <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">
5448 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5449 <label for="ays-chart-option-box-shadow-color" class="form-label">
5450 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
5451 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
5452 <i class="ays_fa ays_fa_info_circle"></i>
5453 </a>
5454 </label>
5455 </div>
5456 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5457 <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) ?>">
5458 </div>
5459 </div> <!-- box shadow color -->
5460 <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">
5461 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5462 <label for="ays-chart-option-border-width-with-title">
5463 <?php echo esc_html(__( "Border Width (including title)", "chart-builder" )); ?>
5464 <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") ); ?>">
5465 <i class="ays_fa ays_fa_info_circle"></i>
5466 </a>
5467 </label>
5468 </div>
5469 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5470 <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) ?>">
5471 </div>
5472 </div> <!-- Border Width with title -->
5473 <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">
5474 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5475 <label for="ays-chart-option-border-radius-with-title">
5476 <?php echo esc_html(__( "Border radius (including title)", "chart-builder" )); ?>
5477 <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") ); ?>">
5478 <i class="ays_fa ays_fa_info_circle"></i>
5479 </a>
5480 </label>
5481 </div>
5482 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5483 <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) ?>">
5484 </div>
5485 </div> <!-- Border radius with title -->
5486 <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">
5487 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5488 <label for="ays-chart-option-border-color-with-title">
5489 <?php echo esc_html(__( "Border Color (including title)", "chart-builder" )); ?>
5490 <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") ); ?>">
5491 <i class="ays_fa ays_fa_info_circle"></i>
5492 </a>
5493 </label>
5494 </div>
5495 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5496 <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) ?>">
5497 </div>
5498 </div> <!-- Border color with title -->
5499 <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">
5500 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5501 <label for="ays-chart-option-border-style-with-title">
5502 <?php echo esc_html(__( "Border Style (including title)", "chart-builder" )); ?>
5503 <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") ); ?>">
5504 <i class="ays_fa ays_fa_info_circle"></i>
5505 </a>
5506 </label>
5507 </div>
5508 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5509 <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]">
5510 <?php
5511 foreach ( $border_styles as $option_slug => $option ):
5512 $selected = ( $border_style_with_title == $option_slug ) ? 'selected' : '';
5513 ?>
5514 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5515 <?php
5516 endforeach;
5517 ?>
5518 </select>
5519 </div>
5520 </div> <!-- Border style with title -->
5521 <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">
5522 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5523 <label for="ays-chart-option-padding-outer">
5524 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
5525 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The padding of the chart container.","chart-builder") ); ?>">
5526 <i class="ays_fa ays_fa_info_circle"></i>
5527 </a>
5528 </label>
5529 </div>
5530 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5531 <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) ?>">
5532 </div>
5533 </div> <!-- Padding outer -->
5534 </div>
5535 </div>
5536 <?php
5537 $content = ob_get_clean();
5538
5539 $title = __( 'Chart', "chart-builder" );
5540
5541 $sources['chart'] = array(
5542 'content' => $content,
5543 'title' => $title
5544 );
5545
5546 return $sources;
5547 }
5548
5549 public function settings_contents_chart_styles_settings_chartjs( $sources, $args ){
5550 $html_class_prefix = $args['html_class_prefix'];
5551 $html_name_prefix = $args['html_name_prefix'];
5552 $settings = $args['settings'];
5553 $border_width_with_title = $settings['border_width_with_title'];
5554 $border_radius_with_title = $settings['border_radius_with_title'];
5555 $border_color_with_title = $settings['border_color_with_title'];
5556 $border_style_with_title = $settings['border_style_with_title'];
5557 $border_width = $settings['border_width'];
5558 $border_radius = $settings['border_radius'];
5559 $border_color = $settings['border_color'];
5560 $background_color_chart = $settings['background_color_chart'];
5561 $border_style = $settings['border_style'];
5562 $border_styles = $settings['border_styles'];
5563 $box_shadow = $settings['box_shadow'];
5564 $box_shadow_color = $settings['box_shadow_color'];
5565 $padding_outer = $settings['padding_outer'];
5566 ob_start();
5567 ?>
5568 <div class="ays-accordion-data-main-wrap">
5569 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5570 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5571 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5572 <label for="ays-chart-option-border-width">
5573 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5574 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the chart container border.","chart-builder") ); ?>">
5575 <i class="ays_fa ays_fa_info_circle"></i>
5576 </a>
5577 </label>
5578 </div>
5579 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5580 <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) ?>">
5581 </div>
5582 </div> <!-- Border Width -->
5583 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5584 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5585 <label for="ays-chart-option-border-radius">
5586 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
5587 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The radius of the chart container border.","chart-builder") ); ?>">
5588 <i class="ays_fa ays_fa_info_circle"></i>
5589 </a>
5590 </label>
5591 </div>
5592 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5593 <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) ?>">
5594 </div>
5595 </div> <!-- Border Radius -->
5596 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5597 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5598 <label for="ays-chart-option-border-color">
5599 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5600 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart container.","chart-builder") ); ?>">
5601 <i class="ays_fa ays_fa_info_circle"></i>
5602 </a>
5603 </label>
5604 </div>
5605 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5606 <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) ?>">
5607 </div>
5608 </div> <!-- Border color -->
5609 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5610 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5611 <label for="ays-chart-option-border-style">
5612 <?php echo esc_html(__( "Border Style", "chart-builder" )); ?>
5613 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The style of the chart container border.","chart-builder") ); ?>">
5614 <i class="ays_fa ays_fa_info_circle"></i>
5615 </a>
5616 </label>
5617 </div>
5618 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5619 <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]">
5620 <?php
5621 foreach ( $border_styles as $option_slug => $option ):
5622 $selected = ( $border_style == $option_slug ) ? 'selected' : '';
5623 ?>
5624 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5625 <?php
5626 endforeach;
5627 ?>
5628 </select>
5629 </div>
5630 </div> <!-- Border style -->
5631 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5632 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5633 <label for="ays-chart-option-backgorund-color">
5634 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
5635 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("With the help of this feature, you will be able to add background color for the Chart JS.","chart-builder") ); ?>">
5636 <i class="ays_fa ays_fa_info_circle"></i>
5637 </a>
5638 </label>
5639 </div>
5640 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5641 <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_chart]" value="<?php echo esc_attr($background_color_chart) ?>">
5642 </div>
5643 </div><!-- Background color -->
5644
5645 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5646 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5647 <label for="ays-chart-option-box-shadow" class="form-label">
5648 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
5649 <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") ); ?>">
5650 <i class="ays_fa ays_fa_info_circle"></i>
5651 </a>
5652 </label>
5653 </div>
5654 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5655 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5656 <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); ?> >
5657 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5658 </label>
5659 </div>
5660 </div> <!-- box shadow -->
5661 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5662 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5663 <label for="ays-chart-option-box-shadow-color" class="form-label">
5664 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
5665 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
5666 <i class="ays_fa ays_fa_info_circle"></i>
5667 </a>
5668 </label>
5669 </div>
5670 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5671 <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) ?>">
5672 </div>
5673 </div> <!-- box shadow color -->
5674 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5675 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5676 <label for="ays-chart-option-border-width-with-title">
5677 <?php echo esc_html(__( "Border Width (including title)", "chart-builder" )); ?>
5678 <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") ); ?>">
5679 <i class="ays_fa ays_fa_info_circle"></i>
5680 </a>
5681 </label>
5682 </div>
5683 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5684 <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) ?>">
5685 </div>
5686 </div> <!-- Border Width with title -->
5687 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5688 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5689 <label for="ays-chart-option-border-radius-with-title">
5690 <?php echo esc_html(__( "Border Radius (including title)", "chart-builder" )); ?>
5691 <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") ); ?>">
5692 <i class="ays_fa ays_fa_info_circle"></i>
5693 </a>
5694 </label>
5695 </div>
5696 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5697 <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) ?>">
5698 </div>
5699 </div> <!-- Border radius with title -->
5700 <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">
5701 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5702 <label for="ays-chart-option-border-color-with-title">
5703 <?php echo esc_html(__( "Border Color (including title)", "chart-builder" )); ?>
5704 <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") ); ?>">
5705 <i class="ays_fa ays_fa_info_circle"></i>
5706 </a>
5707 </label>
5708 </div>
5709 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5710 <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) ?>">
5711 </div>
5712 </div> <!-- Border colro with title -->
5713 <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">
5714 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5715 <label for="ays-chart-option-border-style-with-title">
5716 <?php echo esc_html(__( "Border Style (including title)", "chart-builder" )); ?>
5717 <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") ); ?>">
5718 <i class="ays_fa ays_fa_info_circle"></i>
5719 </a>
5720 </label>
5721 </div>
5722 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5723 <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]">
5724 <?php
5725 foreach ( $border_styles as $option_slug => $option ):
5726 $selected = ( $border_style_with_title == $option_slug ) ? 'selected' : '';
5727 ?>
5728 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5729 <?php
5730 endforeach;
5731 ?>
5732 </select>
5733 </div>
5734 </div> <!-- Border style with title -->
5735 <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">
5736 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5737 <label for="ays-chart-option-padding-outer">
5738 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
5739 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The padding of the chart container.","chart-builder") ); ?>">
5740 <i class="ays_fa ays_fa_info_circle"></i>
5741 </a>
5742 </label>
5743 </div>
5744 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5745 <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) ?>">
5746 </div>
5747 </div> <!-- Padding outer -->
5748 </div>
5749 </div>
5750 <?php
5751 $content = ob_get_clean();
5752
5753 $title = __( 'Chart', "chart-builder" );
5754
5755 $sources['chart'] = array(
5756 'content' => $content,
5757 'title' => $title
5758 );
5759
5760 return $sources;
5761 }
5762
5763 public function settings_contents_chart_area_styles_settings( $sources, $args ){
5764 $html_class_prefix = $args['html_class_prefix'];
5765 $html_name_prefix = $args['html_name_prefix'];
5766 $settings = $args['settings'];
5767
5768 $chart_background_color = $settings['chart_background_color'];
5769 $chart_border_color = $settings['chart_border_color'];
5770 $chart_left_margin = $settings['chart_left_margin'];
5771 $chart_right_margin = $settings['chart_right_margin'];
5772 $chart_top_margin = $settings['chart_top_margin'];
5773 $chart_bottom_margin = $settings['chart_bottom_margin'];
5774 $chart_border_width = $settings['chart_border_width'];
5775 ob_start();
5776 ?>
5777 <div class="ays-accordion-data-main-wrap">
5778 <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">
5779 <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">
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-chart-background-color">
5782 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
5783 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The background color of the chart area.","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) ?>input-align-right">
5789 <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) ?>">
5790 </div>
5791 </div> <!-- Chart Area background color -->
5792 <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">
5793 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5794 <label for="ays-chart-option-chart-border-width">
5795 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
5796 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border width of the chart area.","chart-builder") ); ?>">
5797 <i class="ays_fa ays_fa_info_circle"></i>
5798 </a>
5799 </label>
5800 </div>
5801 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5802 <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) ?>">
5803 </div>
5804 </div> <!-- Chart Area Border Width -->
5805 <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">
5806 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5807 <label for="ays-chart-option-chart-border-color">
5808 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5809 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The border color of the chart area.","chart-builder") ); ?>">
5810 <i class="ays_fa ays_fa_info_circle"></i>
5811 </a>
5812 </label>
5813 </div>
5814 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5815 <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) ?>">
5816 </div>
5817 </div> <!-- Chart Area border color -->
5818 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5819 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5820 <label for="ays-chart-option-chart-left-margin">
5821 <?php echo esc_html(__( "Left Margin", "chart-builder" )); ?>
5822 <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") ); ?>">
5823 <i class="ays_fa ays_fa_info_circle"></i>
5824 </a>
5825 </label>
5826 </div>
5827 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5828 <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) ?>">
5829 </div>
5830 </div> <!-- Chart Area Left Margin -->
5831 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5832 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5833 <label for="ays-chart-option-chart-right-margin">
5834 <?php echo esc_html(__( "Right Margin", "chart-builder" )); ?>
5835 <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") ); ?>">
5836 <i class="ays_fa ays_fa_info_circle"></i>
5837 </a>
5838 </label>
5839 </div>
5840 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5841 <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) ?>">
5842 </div>
5843 </div> <!-- Chart Area Right Margin -->
5844 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5845 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5846 <label for="ays-chart-option-chart-top-margin">
5847 <?php echo esc_html(__( "Top Margin", "chart-builder" )); ?>
5848 <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") ); ?>">
5849 <i class="ays_fa ays_fa_info_circle"></i>
5850 </a>
5851 </label>
5852 </div>
5853 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5854 <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) ?>">
5855 </div>
5856 </div> <!-- Chart Area Top Margin -->
5857 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5858 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5859 <label for="ays-chart-option-chart-bottom-margin">
5860 <?php echo esc_html(__( "Bottom Margin", "chart-builder" )); ?>
5861 <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") ); ?>">
5862 <i class="ays_fa ays_fa_info_circle"></i>
5863 </a>
5864 </label>
5865 </div>
5866 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5867 <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) ?>">
5868 </div>
5869 </div> <!-- Chart Area Bottom Margin -->
5870 </div>
5871 </div>
5872 <?php
5873 $content = ob_get_clean();
5874
5875 $title = __( 'Chart Area', "chart-builder" );
5876
5877 $sources['chart_area'] = array(
5878 'content' => $content,
5879 'title' => $title
5880 );
5881
5882 return $sources;
5883 }
5884
5885 public function settings_contents_title_styles_settings( $sources, $args ){
5886 $html_class_prefix = $args['html_class_prefix'];
5887 $html_name_prefix = $args['html_name_prefix'];
5888 $settings = $args['settings'];
5889
5890 $title_color = $settings['title_color'];
5891 $title_shadow_color = $settings['title_shadow_color'];
5892 $title_font_size = $settings['title_font_size'];
5893 $title_gap = $settings['title_gap'];
5894 $title_gap_description = $settings['title_gap_description'];
5895 $title_positions = $settings['title_positions'];
5896 $title_position = $settings['title_position'];
5897 $title_bold = $settings['title_bold'];
5898 $title_text_shadow = $settings['title_text_shadow'];
5899 $title_italic = $settings['title_italic'];
5900 $text_transforms = $settings['text_transforms'];
5901 $text_decorations = $settings['text_decorations'];
5902 $title_text_transform = $settings['title_text_transform'];
5903 $title_text_decoration = $settings['title_text_decoration'];
5904 $title_letter_spacing = $settings['title_letter_spacing'];
5905 ob_start();
5906 ?>
5907 <div class="ays-accordion-data-main-wrap">
5908 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5909 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5910 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5911 <label for="ays-chart-option-title-color">
5912 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5913 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart title.","chart-builder") ); ?>">
5914 <i class="ays_fa ays_fa_info_circle"></i>
5915 </a>
5916 </label>
5917 </div>
5918 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5919 <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) ?>">
5920 </div>
5921 </div> <!-- Chart title color -->
5922 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5923 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5924 <label for="ays-chart-option-title-font-size" class="form-label">
5925 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5926 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart title.","chart-builder") ); ?>">
5927 <i class="ays_fa ays_fa_info_circle"></i>
5928 </a>
5929 </label>
5930 </div>
5931 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5932 <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) ?>">
5933 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5934 </div>
5935 </div> <!-- Chart title font size -->
5936 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5937 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5938 <label for="ays-chart-option-title-bold" class="form-label">
5939 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5940 <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") ); ?>">
5941 <i class="ays_fa ays_fa_info_circle"></i>
5942 </a>
5943 </label>
5944 </div>
5945 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5946 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5947 <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); ?> >
5948 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5949 </label>
5950 </div>
5951 </div> <!-- Title bold -->
5952 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5953 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5954 <label for="ays-chart-option-title-italic" class="form-label">
5955 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5956 <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") ); ?>">
5957 <i class="ays_fa ays_fa_info_circle"></i>
5958 </a>
5959 </label>
5960 </div>
5961 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5962 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5963 <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); ?> >
5964 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5965 </label>
5966 </div>
5967 </div> <!-- Title italic -->
5968 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5969 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5970 <label for="ays-chart-option-title-position">
5971 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5972 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart title.","chart-builder") ); ?>">
5973 <i class="ays_fa ays_fa_info_circle"></i>
5974 </a>
5975 </label>
5976 </div>
5977 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5978 <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]">
5979 <?php
5980 foreach ( $title_positions as $option_slug => $option ):
5981 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5982 ?>
5983 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5984 <?php
5985 endforeach;
5986 ?>
5987 </select>
5988 </div>
5989 </div> <!-- Title position -->
5990 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5991 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5992 <label for="ays-chart-option-title-gap" class="form-label">
5993 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5994 <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") ); ?>">
5995 <i class="ays_fa ays_fa_info_circle"></i>
5996 </a>
5997 </label>
5998 </div>
5999 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6000 <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) ?>">
6001 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6002 </div>
6003 </div> <!-- Chart title gap -->
6004 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6005 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6006 <label for="ays-chart-option-title-gap-description" class="form-label">
6007 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
6008 <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") ); ?>">
6009 <i class="ays_fa ays_fa_info_circle"></i>
6010 </a>
6011 </label>
6012 </div>
6013 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6014 <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) ?>">
6015 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6016 </div>
6017 </div> <!-- Chart title gap -->
6018 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6019 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6020 <label for="ays-chart-option-title-text-transform">
6021 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
6022 <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") ); ?>">
6023 <i class="ays_fa ays_fa_info_circle"></i>
6024 </a>
6025 </label>
6026 </div>
6027 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6028 <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]">
6029 <?php
6030 foreach ( $text_transforms as $option_slug => $option ):
6031 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
6032 ?>
6033 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6034 <?php
6035 endforeach;
6036 ?>
6037 </select>
6038 </div>
6039 </div> <!-- Title text transform -->
6040 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6041 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6042 <label for="ays-chart-option-title-letter-spacing" class="form-label">
6043 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6044 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
6045 <i class="ays_fa ays_fa_info_circle"></i>
6046 </a>
6047 </label>
6048 </div>
6049 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6050 <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) ?>">
6051 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6052 </div>
6053 </div> <!-- Chart title letter spacing -->
6054 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6055 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6056 <label for="ays-chart-option-title-text-decoration">
6057 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6058 <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") ); ?>">
6059 <i class="ays_fa ays_fa_info_circle"></i>
6060 </a>
6061 </label>
6062 </div>
6063 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6064 <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]">
6065 <?php
6066 foreach ( $text_decorations as $option_slug => $option ):
6067 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
6068 ?>
6069 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6070 <?php
6071 endforeach;
6072 ?>
6073 </select>
6074 </div>
6075 </div> <!-- Title text decoration -->
6076 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6077 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6078 <label for="ays-chart-option-title-text-shadow" class="form-label">
6079 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6080 <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") ); ?>">
6081 <i class="ays_fa ays_fa_info_circle"></i>
6082 </a>
6083 </label>
6084 </div>
6085 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6086 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6087 <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); ?> >
6088 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6089 </label>
6090 </div>
6091 </div> <!-- Title bold -->
6092 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6093 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6094 <label for="ays-chart-option-title-shadow-color">
6095 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6096 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart title.","chart-builder") ); ?>">
6097 <i class="ays_fa ays_fa_info_circle"></i>
6098 </a>
6099 </label>
6100 </div>
6101 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6102 <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) ?>">
6103 </div>
6104 </div> <!-- Chart title color -->
6105 </div>
6106 </div>
6107 <?php
6108 $content = ob_get_clean();
6109
6110 $title = __( 'Title', "chart-builder" );
6111
6112 $sources['title'] = array(
6113 'content' => $content,
6114 'title' => $title
6115 );
6116
6117 return $sources;
6118 }
6119
6120 public function settings_contents_title_styles_settings_chartjs( $sources, $args ){
6121 $html_class_prefix = $args['html_class_prefix'];
6122 $html_name_prefix = $args['html_name_prefix'];
6123 $settings = $args['settings'];
6124
6125 $title_color = $settings['title_color'];
6126 $title_shadow_color = $settings['title_shadow_color'];
6127 $title_font_size = $settings['title_font_size'];
6128 $title_gap = $settings['title_gap'];
6129 $title_gap_description = $settings['title_gap_description'];
6130 $title_positions = $settings['title_positions'];
6131 $title_position = $settings['title_position'];
6132 $title_bold = $settings['title_bold'];
6133 $title_text_shadow = $settings['title_text_shadow'];
6134 $title_italic = $settings['title_italic'];
6135 $text_transforms = $settings['text_transforms'];
6136 $text_decorations = $settings['text_decorations'];
6137 $title_text_transform = $settings['title_text_transform'];
6138 $title_text_decoration = $settings['title_text_decoration'];
6139 $title_letter_spacing = $settings['title_letter_spacing'];
6140 ob_start();
6141 ?>
6142 <div class="ays-accordion-data-main-wrap">
6143 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6144 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6145 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6146 <label for="ays-chart-option-title-color">
6147 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6148 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart title.","chart-builder") ); ?>">
6149 <i class="ays_fa ays_fa_info_circle"></i>
6150 </a>
6151 </label>
6152 </div>
6153 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6154 <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) ?>">
6155 </div>
6156 </div> <!-- Chart title color -->
6157 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6158 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6159 <label for="ays-chart-option-title-font-size" class="form-label">
6160 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6161 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart title.","chart-builder") ); ?>">
6162 <i class="ays_fa ays_fa_info_circle"></i>
6163 </a>
6164 </label>
6165 </div>
6166 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6167 <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) ?>">
6168 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6169 </div>
6170 </div> <!-- Chart title font size -->
6171 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6172 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6173 <label for="ays-chart-option-title-bold" class="form-label">
6174 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
6175 <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") ); ?>">
6176 <i class="ays_fa ays_fa_info_circle"></i>
6177 </a>
6178 </label>
6179 </div>
6180 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6181 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6182 <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); ?> >
6183 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6184 </label>
6185 </div>
6186 </div> <!-- Title bold -->
6187 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6188 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6189 <label for="ays-chart-option-title-italic" class="form-label">
6190 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
6191 <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") ); ?>">
6192 <i class="ays_fa ays_fa_info_circle"></i>
6193 </a>
6194 </label>
6195 </div>
6196 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6197 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6198 <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); ?> >
6199 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6200 </label>
6201 </div>
6202 </div> <!-- Title italic -->
6203 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6204 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6205 <label for="ays-chart-option-title-position">
6206 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
6207 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart title.","chart-builder") ); ?>">
6208 <i class="ays_fa ays_fa_info_circle"></i>
6209 </a>
6210 </label>
6211 </div>
6212 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6213 <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]">
6214 <?php
6215 foreach ( $title_positions as $option_slug => $option ):
6216 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
6217 ?>
6218 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6219 <?php
6220 endforeach;
6221 ?>
6222 </select>
6223 </div>
6224 </div> <!-- Title position -->
6225 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6226 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6227 <label for="ays-chart-option-title-gap" class="form-label">
6228 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
6229 <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") ); ?>">
6230 <i class="ays_fa ays_fa_info_circle"></i>
6231 </a>
6232 </label>
6233 </div>
6234 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6235 <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) ?>">
6236 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6237 </div>
6238 </div> <!-- Chart title gap -->
6239 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6240 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6241 <label for="ays-chart-option-title-gap-description" class="form-label">
6242 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
6243 <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") ); ?>">
6244 <i class="ays_fa ays_fa_info_circle"></i>
6245 </a>
6246 </label>
6247 </div>
6248 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6249 <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) ?>">
6250 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6251 </div>
6252 </div> <!-- Chart title gap -->
6253 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6254 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6255 <label for="ays-chart-option-title-text-transform">
6256 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
6257 <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") ); ?>">
6258 <i class="ays_fa ays_fa_info_circle"></i>
6259 </a>
6260 </label>
6261 </div>
6262 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6263 <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]">
6264 <?php
6265 foreach ( $text_transforms as $option_slug => $option ):
6266 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
6267 ?>
6268 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6269 <?php
6270 endforeach;
6271 ?>
6272 </select>
6273 </div>
6274 </div> <!-- Title text transform -->
6275 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6276 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6277 <label for="ays-chart-option-title-letter-spacing" class="form-label">
6278 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6279 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
6280 <i class="ays_fa ays_fa_info_circle"></i>
6281 </a>
6282 </label>
6283 </div>
6284 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6285 <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) ?>">
6286 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6287 </div>
6288 </div> <!-- Chart title letter spacing -->
6289 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6290 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6291 <label for="ays-chart-option-title-text-decoration">
6292 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6293 <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") ); ?>">
6294 <i class="ays_fa ays_fa_info_circle"></i>
6295 </a>
6296 </label>
6297 </div>
6298 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6299 <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]">
6300 <?php
6301 foreach ( $text_decorations as $option_slug => $option ):
6302 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
6303 ?>
6304 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6305 <?php
6306 endforeach;
6307 ?>
6308 </select>
6309 </div>
6310 </div> <!-- Title text decoration -->
6311 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6312 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6313 <label for="ays-chart-option-title-text-shadow" class="form-label">
6314 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6315 <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") ); ?>">
6316 <i class="ays_fa ays_fa_info_circle"></i>
6317 </a>
6318 </label>
6319 </div>
6320 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6321 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6322 <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); ?> >
6323 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6324 </label>
6325 </div>
6326 </div> <!-- Title bold -->
6327 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6328 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6329 <label for="ays-chart-option-title-shadow-color">
6330 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6331 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart title.","chart-builder") ); ?>">
6332 <i class="ays_fa ays_fa_info_circle"></i>
6333 </a>
6334 </label>
6335 </div>
6336 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6337 <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) ?>">
6338 </div>
6339 </div> <!-- Chart title color -->
6340 </div>
6341 </div>
6342 <?php
6343 $content = ob_get_clean();
6344
6345 $title = __( 'Title', "chart-builder" );
6346
6347 $sources['title'] = array(
6348 'content' => $content,
6349 'title' => $title
6350 );
6351
6352 return $sources;
6353 }
6354
6355 public function settings_contents_description_styles_settings( $sources, $args ){
6356 $html_class_prefix = $args['html_class_prefix'];
6357 $html_name_prefix = $args['html_name_prefix'];
6358 $settings = $args['settings'];
6359
6360 $description_color = $settings['description_color'];
6361 $description_font_size = $settings['description_font_size'];
6362 $title_positions = $settings['title_positions'];
6363 $description_position = $settings['description_position'];
6364 $description_bold = $settings['description_bold'];
6365 $description_text_shadow = $settings['description_text_shadow'];
6366 $description_shadow_color = $settings['description_shadow_color'];
6367 $description_italic = $settings['description_italic'];
6368 $text_transforms = $settings['text_transforms'];
6369 $text_decorations = $settings['text_decorations'];
6370 $description_text_transform = $settings['description_text_transform'];
6371 $description_text_decoration = $settings['description_text_decoration'];
6372 $description_letter_spacing = $settings['description_letter_spacing'];
6373
6374 ob_start();
6375 ?>
6376 <div class="ays-accordion-data-main-wrap">
6377 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6378 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6379 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6380 <label for="ays-chart-option-description-color">
6381 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6382 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart description.","chart-builder") ); ?>">
6383 <i class="ays_fa ays_fa_info_circle"></i>
6384 </a>
6385 </label>
6386 </div>
6387 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6388 <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) ?>">
6389 </div>
6390 </div> <!-- Chart description color -->
6391 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6392 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6393 <label for="ays-chart-option-description-font-size" class="form-label">
6394 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6395 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart description.","chart-builder") ); ?>">
6396 <i class="ays_fa ays_fa_info_circle"></i>
6397 </a>
6398 </label>
6399 </div>
6400 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6401 <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) ?>">
6402 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6403 </div>
6404 </div> <!-- Chart description font size -->
6405 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6406 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6407 <label for="ays-chart-option-description-bold" class="form-label">
6408 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
6409 <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") ); ?>">
6410 <i class="ays_fa ays_fa_info_circle"></i>
6411 </a>
6412 </label>
6413 </div>
6414 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6415 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6416 <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); ?> >
6417 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6418 </label>
6419 </div>
6420 </div> <!-- Description bold -->
6421 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6422 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6423 <label for="ays-chart-option-description-italic" class="form-label">
6424 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
6425 <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") ); ?>">
6426 <i class="ays_fa ays_fa_info_circle"></i>
6427 </a>
6428 </label>
6429 </div>
6430 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6431 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6432 <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); ?> >
6433 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6434 </label>
6435 </div>
6436 </div> <!-- Description italic -->
6437 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6438 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6439 <label for="ays-chart-option-description-position">
6440 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
6441 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart description.","chart-builder") ); ?>">
6442 <i class="ays_fa ays_fa_info_circle"></i>
6443 </a>
6444 </label>
6445 </div>
6446 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6447 <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]">
6448 <?php
6449 foreach ( $title_positions as $option_slug => $option ):
6450 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
6451 ?>
6452 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6453 <?php
6454 endforeach;
6455 ?>
6456 </select>
6457 </div>
6458 </div> <!-- Description position -->
6459 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6460 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6461 <label for="ays-chart-option-description-text-transform">
6462 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
6463 <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") ); ?>">
6464 <i class="ays_fa ays_fa_info_circle"></i>
6465 </a>
6466 </label>
6467 </div>
6468 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6469 <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]">
6470 <?php
6471 foreach ( $text_transforms as $option_slug => $option ):
6472 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
6473 ?>
6474 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6475 <?php
6476 endforeach;
6477 ?>
6478 </select>
6479 </div>
6480 </div> <!-- description text transform -->
6481 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6482 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6483 <label for="ays-chart-option-description-letter-spacing" class="form-label">
6484 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6485 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
6486 <i class="ays_fa ays_fa_info_circle"></i>
6487 </a>
6488 </label>
6489 </div>
6490 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6491 <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) ?>">
6492 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6493 </div>
6494 </div> <!-- Chart description letter spacing -->
6495 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6496 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6497 <label for="ays-chart-option-description-text-decoration">
6498 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6499 <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") ); ?>">
6500 <i class="ays_fa ays_fa_info_circle"></i>
6501 </a>
6502 </label>
6503 </div>
6504 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6505 <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]">
6506 <?php
6507 foreach ( $text_decorations as $option_slug => $option ):
6508 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
6509 ?>
6510 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6511 <?php
6512 endforeach;
6513 ?>
6514 </select>
6515 </div>
6516 </div> <!-- description text decoration -->
6517 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6518 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6519 <label for="ays-chart-option-description-text-shadow" class="form-label">
6520 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6521 <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") ); ?>">
6522 <i class="ays_fa ays_fa_info_circle"></i>
6523 </a>
6524 </label>
6525 </div>
6526 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6527 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6528 <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); ?> >
6529 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6530 </label>
6531 </div>
6532 </div> <!-- description bold -->
6533 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6534 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6535 <label for="ays-chart-option-description-shadow-color">
6536 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6537 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart description.","chart-builder") ); ?>">
6538 <i class="ays_fa ays_fa_info_circle"></i>
6539 </a>
6540 </label>
6541 </div>
6542 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6543 <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) ?>">
6544 </div>
6545 </div> <!-- Chart title color -->
6546 </div>
6547 </div>
6548 <?php
6549 $content = ob_get_clean();
6550
6551 $title = __( 'Description', "chart-builder" );
6552
6553 $sources['description'] = array(
6554 'content' => $content,
6555 'title' => $title
6556 );
6557
6558 return $sources;
6559 }
6560
6561 public function settings_contents_description_styles_settings_chartjs( $sources, $args ){
6562 $html_class_prefix = $args['html_class_prefix'];
6563 $html_name_prefix = $args['html_name_prefix'];
6564 $settings = $args['settings'];
6565
6566 $description_color = $settings['description_color'];
6567 $description_font_size = $settings['description_font_size'];
6568 $title_positions = $settings['title_positions'];
6569 $description_position = $settings['description_position'];
6570 $description_bold = $settings['description_bold'];
6571 $description_text_shadow = $settings['description_text_shadow'];
6572 $description_shadow_color = $settings['description_shadow_color'];
6573 $description_italic = $settings['description_italic'];
6574 $text_transforms = $settings['text_transforms'];
6575 $text_decorations = $settings['text_decorations'];
6576 $description_text_transform = $settings['description_text_transform'];
6577 $description_text_decoration = $settings['description_text_decoration'];
6578 $description_letter_spacing = $settings['description_letter_spacing'];
6579
6580 ob_start();
6581 ?>
6582 <div class="ays-accordion-data-main-wrap">
6583 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6584 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6585 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6586 <label for="ays-chart-option-description-color">
6587 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6588 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the chart description.","chart-builder") ); ?>">
6589 <i class="ays_fa ays_fa_info_circle"></i>
6590 </a>
6591 </label>
6592 </div>
6593 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6594 <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) ?>">
6595 </div>
6596 </div> <!-- Chart description color -->
6597 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6598 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6599 <label for="ays-chart-option-description-font-size" class="form-label">
6600 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
6601 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the chart description.","chart-builder") ); ?>">
6602 <i class="ays_fa ays_fa_info_circle"></i>
6603 </a>
6604 </label>
6605 </div>
6606 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6607 <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) ?>">
6608 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6609 </div>
6610 </div> <!-- Chart description font size -->
6611 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6612 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6613 <label for="ays-chart-option-description-bold" class="form-label">
6614 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
6615 <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") ); ?>">
6616 <i class="ays_fa ays_fa_info_circle"></i>
6617 </a>
6618 </label>
6619 </div>
6620 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6621 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6622 <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); ?> >
6623 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6624 </label>
6625 </div>
6626 </div> <!-- Description bold -->
6627 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6628 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6629 <label for="ays-chart-option-description-italic" class="form-label">
6630 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
6631 <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") ); ?>">
6632 <i class="ays_fa ays_fa_info_circle"></i>
6633 </a>
6634 </label>
6635 </div>
6636 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6637 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6638 <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); ?> >
6639 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6640 </label>
6641 </div>
6642 </div> <!-- Description italic -->
6643 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6644 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6645 <label for="ays-chart-option-description-position">
6646 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
6647 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The position of the chart description.","chart-builder") ); ?>">
6648 <i class="ays_fa ays_fa_info_circle"></i>
6649 </a>
6650 </label>
6651 </div>
6652 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6653 <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]">
6654 <?php
6655 foreach ( $title_positions as $option_slug => $option ):
6656 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
6657 ?>
6658 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6659 <?php
6660 endforeach;
6661 ?>
6662 </select>
6663 </div>
6664 </div> <!-- Description position -->
6665 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6666 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6667 <label for="ays-chart-option-description-text-transform">
6668 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
6669 <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") ); ?>">
6670 <i class="ays_fa ays_fa_info_circle"></i>
6671 </a>
6672 </label>
6673 </div>
6674 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6675 <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]">
6676 <?php
6677 foreach ( $text_transforms as $option_slug => $option ):
6678 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
6679 ?>
6680 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6681 <?php
6682 endforeach;
6683 ?>
6684 </select>
6685 </div>
6686 </div> <!-- description text transform -->
6687 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6688 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6689 <label for="ays-chart-option-description-letter-spacing" class="form-label">
6690 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
6691 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
6692 <i class="ays_fa ays_fa_info_circle"></i>
6693 </a>
6694 </label>
6695 </div>
6696 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6697 <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) ?>">
6698 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6699 </div>
6700 </div> <!-- Chart description letter spacing -->
6701 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6702 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6703 <label for="ays-chart-option-description-text-decoration">
6704 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
6705 <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") ); ?>">
6706 <i class="ays_fa ays_fa_info_circle"></i>
6707 </a>
6708 </label>
6709 </div>
6710 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6711 <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]">
6712 <?php
6713 foreach ( $text_decorations as $option_slug => $option ):
6714 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
6715 ?>
6716 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6717 <?php
6718 endforeach;
6719 ?>
6720 </select>
6721 </div>
6722 </div> <!-- description text decoration -->
6723 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6724 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6725 <label for="ays-chart-option-description-text-shadow" class="form-label">
6726 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
6727 <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") ); ?>">
6728 <i class="ays_fa ays_fa_info_circle"></i>
6729 </a>
6730 </label>
6731 </div>
6732 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6733 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6734 <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); ?> >
6735 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6736 </label>
6737 </div>
6738 </div> <!-- description bold -->
6739 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6740 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6741 <label for="ays-chart-option-description-shadow-color">
6742 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
6743 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The text shadow color of the chart description.","chart-builder") ); ?>">
6744 <i class="ays_fa ays_fa_info_circle"></i>
6745 </a>
6746 </label>
6747 </div>
6748 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6749 <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) ?>">
6750 </div>
6751 </div> <!-- Chart title color -->
6752 </div>
6753 </div>
6754 <?php
6755 $content = ob_get_clean();
6756
6757 $title = __( 'Description', "chart-builder" );
6758
6759 $sources['description'] = array(
6760 'content' => $content,
6761 'title' => $title
6762 );
6763
6764 return $sources;
6765 }
6766
6767 /**
6768 * Chart page settings contents
6769 * @param $args
6770 */
6771 public function ays_chart_page_advanced_settings_contents( $args ){
6772 $chart_source_type = $args['chart_source_type'];
6773
6774 if ($chart_source_type === 'chart-js') {
6775 if ($args['source_chart_type'] !== 'pie_chart') {return;}
6776 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings_chartjs', array(), $args );
6777 } else {
6778 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings', array(), $args );
6779 }
6780
6781 $sources = array();
6782 foreach ( $sources_contents as $key => $sources_content ) {
6783 $collapsed = $key == 'advanced_settings' ? 'false' : 'true';
6784
6785 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
6786 if(isset($sources_content['title'])){
6787 $content .= '<legend class="ays-accordion-options-header">';
6788 $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">
6789 <g>
6790 <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" />
6791 </g>
6792 </svg>';
6793
6794 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
6795 }
6796
6797 $content .= '<div class="ays-accordion-options-content">';
6798 $content .= $sources_content['content'];
6799 $content .= '</div>';
6800
6801 $content .= '</fieldset>';
6802
6803 $sources[] = $content;
6804 }
6805 $content_for_escape = implode('' , $sources );
6806 echo html_entity_decode( esc_html($content_for_escape) );
6807 }
6808
6809 public function settings_contents_advanced_settings( $sources, $args ){
6810 $html_class_prefix = $args['html_class_prefix'];
6811 $html_name_prefix = $args['html_name_prefix'];
6812 $settings = $args['settings'];
6813 $tab_title = $args['tab_name'];
6814
6815 $rotation_degree = $settings['rotation_degree'];
6816 $reverse_categories = $settings['reverse_categories'];
6817 $slice_border_color = $settings['slice_border_color'];
6818 $slice_texts = $settings['slice_texts'];
6819 $slice_text = $settings['slice_text'];
6820 $tooltip_text_options = $settings['tooltip_text_options'];
6821 $tooltip_text = $settings['tooltip_text'];
6822 $is_stacked = $settings['is_stacked'];
6823 $focus_target_options = $settings['focus_target_options'];
6824 $focus_target = $settings['focus_target'];
6825 $multiple_data_format_options = $settings['multiple_data_format_options'];
6826 $multiple_data_format = $settings['multiple_data_format'];
6827 $opacity = $settings['opacity'];
6828 $group_width = $settings['group_width'];
6829 $group_width_format = $settings['group_width_format'];
6830 $group_width_format_options = $settings['group_width_format_options'];
6831 $line_width = $settings['line_width'];
6832 $data_grouping_limit = $settings['data_grouping_limit'];
6833 $data_grouping_label = $settings['data_grouping_label'];
6834 $data_grouping_color = $settings['data_grouping_color'];
6835 $multiple_selection = $settings['multiple_selection'];
6836 $point_shape_options = $settings['point_shape_options'];
6837 $point_shape = $settings['point_shape'];
6838 $crosshair_trigger_options = $settings['crosshair_trigger_options'];
6839 $crosshair_trigger = $settings['crosshair_trigger'];
6840 $crosshair_orientation_options = $settings['crosshair_orientation_options'];
6841 $crosshair_orientation = $settings['crosshair_orientation'];
6842 $crosshair_opacity = $settings['crosshair_opacity'];
6843 $dash_style = $settings['dash_style'];
6844 $point_size = $settings['point_size'];
6845 $donut_hole_size = $settings['donut_hole_size'];
6846 $orientation = $settings['orientation'];
6847 $fill_nulls = $settings['fill_nulls'];
6848 $allow_collapse = $settings['allow_collapse'];
6849 $org_classname = $settings['org_classname'];
6850 $org_node_background_color = $settings['org_node_background_color'];
6851 $org_node_padding = $settings['org_node_padding'];
6852 $org_node_border_radius = $settings['org_node_border_radius'];
6853 $org_node_border_width = $settings['org_node_border_width'];
6854 $org_node_border_color = $settings['org_node_border_color'];
6855 $org_node_text_color = $settings['org_node_text_color'];
6856 $org_node_text_font_size = $settings['org_node_text_font_size'];
6857 $org_node_description_font_color = $settings['org_node_description_font_color'];
6858 $org_node_description_font_size = $settings['org_node_description_font_size'];
6859 $org_selected_classname = $settings['org_selected_classname'];
6860 $org_selected_node_background_color = $settings['org_selected_node_background_color'];
6861 $org_selected_node_text_color = $settings['org_selected_node_text_color'];
6862
6863 ob_start();
6864 ?>
6865 <div class="ays-accordion-data-main-wrap">
6866 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
6867 <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">
6868 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6869 <label for="ays-chart-option-rotation-degree" class="form-label">
6870 <?php echo esc_html(__( "Degree of chart rotation", "chart-builder" )); ?>
6871 <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") ); ?>">
6872 <i class="ays_fa ays_fa_info_circle"></i>
6873 </a>
6874 </label>
6875 </div>
6876 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6877 <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) ?>">
6878 </div>
6879 </div> <!-- Rotation degree -->
6880 <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">
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-reverse-categories">
6883 <?php echo esc_html(__( "Reverse Categories", "chart-builder" )); ?>
6884 <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") ); ?>">
6885 <i class="ays_fa ays_fa_info_circle"></i>
6886 </a>
6887 </label>
6888 </div>
6889 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6890 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6891 <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); ?> >
6892 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6893 </label>
6894 </div>
6895 </div> <!-- Reverse Categories -->
6896 <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">
6897 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6898 <label for="ays-chart-option-slice-border-color">
6899 <?php echo esc_html(__( "Slice Border Color", "chart-builder" )); ?>
6900 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
6901 <i class="ays_fa ays_fa_info_circle"></i>
6902 </a>
6903 </label>
6904 </div>
6905 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6906 <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) ?>">
6907 </div>
6908 </div> <!-- Slice border color -->
6909 <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">
6910 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6911 <label for="ays-chart-option-slice-text">
6912 <?php echo esc_html(__( "Slice text", "chart-builder" )); ?>
6913 <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") ); ?>">
6914 <i class="ays_fa ays_fa_info_circle"></i>
6915 </a>
6916 </label>
6917 </div>
6918 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6919 <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]">
6920 <?php
6921 foreach ( $slice_texts as $option_slug => $option ):
6922 $selected = ( $slice_text == $option_slug ) ? 'selected' : '';
6923 ?>
6924 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6925 <?php
6926 endforeach;
6927 ?>
6928 </select>
6929 </div>
6930 </div> <!-- Slice text -->
6931 <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">
6932 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6933 <label for="ays-chart-option-tooltip-text">
6934 <?php echo esc_html(__( "Slice tooltip text", "chart-builder" )); ?>
6935 <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") ); ?>">
6936 <i class="ays_fa ays_fa_info_circle"></i>
6937 </a>
6938 </label>
6939 </div>
6940 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6941 <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]">
6942 <?php
6943 foreach ( $tooltip_text_options as $option_slug => $option ):
6944 $selected = ( $tooltip_text == $option_slug ) ? 'selected' : '';
6945 ?>
6946 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6947 <?php
6948 endforeach;
6949 ?>
6950 </select>
6951 </div>
6952 </div> <!-- Slice tooltip Text -->
6953 <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">
6954 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6955 <label for="ays-chart-option-data-grouping-limit" class="form-label">
6956 <?php echo esc_html(__( "Chart Data Grouping Limit", "chart-builder" )); ?>
6957 <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") ); ?>">
6958 <i class="ays_fa ays_fa_info_circle"></i>
6959 </a>
6960 </label>
6961 </div>
6962 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6963 <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">
6964 </div>
6965 </div> <!-- Data Grouping Limit -->
6966 <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">
6967 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6968 <label for="ays-chart-option-data-grouping-label" class="form-label">
6969 <?php echo esc_html(__( "Chart Data Grouping Label", "chart-builder" )); ?>
6970 <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") ); ?>">
6971 <i class="ays_fa ays_fa_info_circle"></i>
6972 </a>
6973 </label>
6974 </div>
6975 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6976 <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) ?>">
6977 </div>
6978 </div> <!-- Data Grouping Label -->
6979 <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">
6980 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6981 <label for="ays-chart-option-data-grouping-color">
6982 <?php echo esc_html(__( "Chart Data Grouping Color", "chart-builder" )); ?>
6983 <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") ); ?>">
6984 <i class="ays_fa ays_fa_info_circle"></i>
6985 </a>
6986 </label>
6987 </div>
6988 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6989 <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) ?>">
6990 </div>
6991 </div> <!-- Data Grouping Color -->
6992 <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">
6993 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6994 <label for="ays-chart-option-is-stacked">
6995 <?php echo esc_html(__( "Is stacked", "chart-builder" )); ?>
6996 <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") ); ?>">
6997 <i class="ays_fa ays_fa_info_circle"></i>
6998 </a>
6999 </label>
7000 </div>
7001 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7002 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7003 <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); ?> >
7004 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7005 </label>
7006 </div>
7007 </div> <!-- Is stacked -->
7008 <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">
7009 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7010 <label for="ays-chart-option-focus-target">
7011 <?php echo esc_html(__( "Focus target", "chart-builder" )); ?>
7012 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
7013 echo esc_html( sprintf(
7014 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7015 "<p>" . __('There are two ways to focus the data table elements.', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
7016 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7017 __('%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>" .
7018 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7019 __('%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>",
7020 '<em>', '</em>',
7021 '<em>', '</em>'
7022 ));
7023 ?>">
7024 <i class="ays_fa ays_fa_info_circle"></i>
7025 </a>
7026 </label>
7027 </div>
7028 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7029 <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]">
7030 <?php
7031 foreach ( $focus_target_options as $option_slug => $option ):
7032 $selected = ( $focus_target == $option_slug ) ? 'selected' : '';
7033 ?>
7034 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7035 <?php
7036 endforeach;
7037 ?>
7038 </select>
7039 </div>
7040 </div> <!-- Focus target -->
7041 <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">
7042 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7043 <label for="ays-chart-option-opacity" class="form-label">
7044 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
7045 <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") ); ?>">
7046 <i class="ays_fa ays_fa_info_circle"></i>
7047 </a>
7048 </label>
7049 </div>
7050 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7051 <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">
7052 </div>
7053 </div> <!-- Data opacity -->
7054 <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">
7055 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7056 <label for="ays-chart-option-group-width">
7057 <?php echo esc_html(__( "Bar width", "chart-builder" )); ?>
7058 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
7059 echo esc_html( sprintf(
7060 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7061 "<p>" . __('The width of the bars, specified in either of these formats:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
7062 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7063 __('%1$sPixels:%2$s Set the width of the bars in pixels.', "chart-builder") . "</li><li>" .
7064 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7065 __('%1$sPercentage:%2$s Set the width of the bars in percentage.', "chart-builder") . "</li></ul>",
7066 '<em>', '</em>',
7067 '<em>', '</em>'
7068 ));
7069 ?>">
7070 <i class="ays_fa ays_fa_info_circle"></i>
7071 </a>
7072 </label>
7073 </div>
7074 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7075 <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) ?>">
7076 <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]">
7077 <?php
7078 foreach ( $group_width_format_options as $option_slug => $option ):
7079 $selected = ( $group_width_format == $option_slug ) ? 'selected' : '';
7080 ?>
7081 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7082 <?php
7083 endforeach;
7084 ?>
7085 </select>
7086 </div>
7087 </div> <!-- Bars width -->
7088 <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">
7089 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7090 <label for="ays-chart-option-line-width" class="form-label">
7091 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
7092 <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") ); ?>">
7093 <i class="ays_fa ays_fa_info_circle"></i>
7094 </a>
7095 </label>
7096 </div>
7097 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7098 <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) ?>">
7099 </div>
7100 </div> <!-- Line width -->
7101 <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">
7102 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7103 <label for="ays-chart-option-multiple-selection">
7104 <?php echo esc_html(__( "Multiple data selection", "chart-builder" )); ?>
7105 <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") ); ?>">
7106 <i class="ays_fa ays_fa_info_circle"></i>
7107 </a>
7108 </label>
7109 </div>
7110 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7111 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7112 <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); ?> >
7113 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7114 </label>
7115 </div>
7116 </div> <!-- Multiple data selection -->
7117 <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">
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-multiple-data-format">
7120 <?php echo esc_html(__( "Multiple data format", "chart-builder" )); ?>
7121 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
7122 echo esc_html( sprintf(
7123 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7124 "<p>" . __('How multiple data selections are rolled up into tooltips:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
7125 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7126 __('%1$sCategory:%2$s Group selected data by row titles.', "chart-builder") . "</li><li>" .
7127 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7128 __('%1$sSeries:%2$s Group selected data by column titles.', "chart-builder") . "</li><li>" .
7129 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7130 __('%1$sAuto:%2$s Group selected data by row titles, if they have the same titles or by column titles', "chart-builder") . "</li><li>" .
7131 /* translators: %1$s: Opening <em> tag, %2$s: Closing <em> tag */
7132 __('%1$sNone:%2$s Show only one tooltip per selection.', "chart-builder") . "</li></ul>",
7133 '<em>', '</em>',
7134 '<em>', '</em>',
7135 '<em>', '</em>',
7136 '<em>', '</em>'
7137 ));
7138 ?>">
7139 <i class="ays_fa ays_fa_info_circle"></i>
7140 </a>
7141 </label>
7142 </div>
7143 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7144 <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]">
7145 <?php
7146 foreach ( $multiple_data_format_options as $option_slug => $option ):
7147 $selected = ( $multiple_data_format == $option_slug ) ? 'selected' : '';
7148 ?>
7149 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7150 <?php
7151 endforeach;
7152 ?>
7153 </select>
7154 </div>
7155 </div> <!-- Multiple data format -->
7156 <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">
7157 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7158 <label for="ays-chart-option-point-shape">
7159 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
7160 <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") ); ?>">
7161 <i class="ays_fa ays_fa_info_circle"></i>
7162 </a>
7163 </label>
7164 </div>
7165 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7166 <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]">
7167 <?php
7168 foreach ( $point_shape_options as $option_slug => $option ):
7169 $selected = ( $point_shape == $option_slug ) ? 'selected' : '';
7170 ?>
7171 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7172 <?php
7173 endforeach;
7174 ?>
7175 </select>
7176 </div>
7177 </div> <!-- Point shape -->
7178 <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">
7179 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7180 <label for="ays-chart-option-point-size" class="form-label">
7181 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
7182 <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") ); ?>">
7183 <i class="ays_fa ays_fa_info_circle"></i>
7184 </a>
7185 </label>
7186 </div>
7187 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7188 <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) ?>">
7189 </div>
7190 </div> <!-- Point size -->
7191 <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">
7192 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7193 <label for="ays-chart-option-orientation">
7194 <?php echo esc_html(__( "Rotate Vertical", "chart-builder" )); ?>
7195 <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") ); ?>">
7196 <i class="ays_fa ays_fa_info_circle"></i>
7197 </a>
7198 </label>
7199 </div>
7200 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7201 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7202 <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); ?> >
7203 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7204 </label>
7205 </div>
7206 </div> <!-- Orientation -->
7207 <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">
7208 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7209 <label for="ays-chart-option-fill-nulls">
7210 <?php echo esc_html(__( "Autofill nulls", "chart-builder" )); ?>
7211 <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") ); ?>">
7212 <i class="ays_fa ays_fa_info_circle"></i>
7213 </a>
7214 </label>
7215 </div>
7216 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7217 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7218 <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); ?> >
7219 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7220 </label>
7221 </div>
7222 </div> <!-- Autofill nulls -->
7223 <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">
7224 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7225 <label for="ays-chart-option-crosshair-trigger">
7226 <?php echo esc_html(__( "Crosshair trigger", "chart-builder" )); ?>
7227 <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") ); ?>">
7228 <i class="ays_fa ays_fa_info_circle"></i>
7229 </a>
7230 </label>
7231 </div>
7232 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7233 <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]">
7234 <?php
7235 foreach ( $crosshair_trigger_options as $option_slug => $option ):
7236 $selected = ( $crosshair_trigger == $option_slug ) ? 'selected' : '';
7237 ?>
7238 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7239 <?php
7240 endforeach;
7241 ?>
7242 </select>
7243 </div>
7244 </div> <!-- Crosshair trigger -->
7245 <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">
7246 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7247 <label for="ays-chart-option-crosshair-orientation">
7248 <?php echo esc_html(__( "Crosshair orientation", "chart-builder" )); ?>
7249 <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") ); ?>">
7250 <i class="ays_fa ays_fa_info_circle"></i>
7251 </a>
7252 </label>
7253 </div>
7254 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7255 <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]">
7256 <?php
7257 foreach ( $crosshair_orientation_options as $option_slug => $option ):
7258 $selected = ( $crosshair_orientation == $option_slug ) ? 'selected' : '';
7259 ?>
7260 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7261 <?php
7262 endforeach;
7263 ?>
7264 </select>
7265 </div>
7266 </div> <!-- Crosshair orientation -->
7267 <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">
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-crosshair-opacity" class="form-label">
7270 <?php echo esc_html(__( "Crosshair opacity", "chart-builder" )); ?>
7271 <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") ); ?>">
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 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">
7278 </div>
7279 </div> <!-- Crosshair opacity -->
7280 <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">
7281 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7282 <label for="ays-chart-option-dash-style" class="form-label">
7283 <?php echo esc_html(__( "Dash Pattern", "chart-builder" )); ?>
7284 <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") ); ?>">
7285 <i class="ays_fa ays_fa_info_circle"></i>
7286 </a>
7287 </label>
7288 </div>
7289 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7290 <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) ?>">
7291 </div>
7292 </div> <!-- Line dash pattern -->
7293 <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">
7294 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7295 <label for="ays-chart-option-donut-hole-size">
7296 <?php echo esc_html(__( "Hole size", 'chart-builder' )); ?>
7297 </label>
7298 </div>
7299 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right <?php echo esc_attr($html_class_prefix) ?>option-input">
7300 <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) ?>">
7301 </div>
7302 </div> <!-- Donut hole size -->
7303 <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">
7304 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
7305 <div class="ays-pro-features-v2-video-button"></div>
7306 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
7307 <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>
7308 <div class="ays-pro-features-v2-upgrade-text">
7309 <?php echo esc_html(__("Upgrade" , "chart-builder")); ?>
7310 </div>
7311 </a>
7312 </div>
7313 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix )?>option-title">
7314 <label for="ays-chart-option-curve-type">
7315 <?php echo esc_html(__( "Line curve type", "chart-builder" )); ?>
7316 </label>
7317 </div>
7318 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7319 <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]">
7320 <option><?php echo esc_html(__( "Straight", "chart-builder" )); ?></option>
7321 </select>
7322 </div>
7323 </div> <!-- Line curve type -->
7324 <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">
7325 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7326 <label for="ays-chart-option-allow-collapse">
7327 <?php echo esc_html(__( "Allow collapse", "chart-builder" )); ?>
7328 <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") ); ?>">
7329 <i class="ays_fa ays_fa_info_circle"></i>
7330 </a>
7331 </label>
7332 </div>
7333 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7334 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7335 <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); ?> >
7336 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7337 </label>
7338 </div>
7339 </div> <!-- Allow collapse -->
7340 <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">
7341 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7342 <label for="ays-chart-option-org-node-description-font-color">
7343 <?php echo esc_html(__( "Description color", "chart-builder" )); ?>
7344 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description text color of the node.","chart-builder") ); ?>">
7345 <i class="ays_fa ays_fa_info_circle"></i>
7346 </a>
7347 </label>
7348 </div>
7349 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7350 <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) ?>">
7351 </div>
7352 </div> <!-- Org Node Description color -->
7353 <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">
7354 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7355 <label for="ays-chart-option-org-node-description-font-size" class="form-label">
7356 <?php echo esc_html(__( "Description font size", "chart-builder" )); ?>
7357 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description font size of the node.","chart-builder") ); ?>">
7358 <i class="ays_fa ays_fa_info_circle"></i>
7359 </a>
7360 </label>
7361 </div>
7362 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7363 <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) ?>">
7364 </div>
7365 </div> <!-- Org Node Description font size -->
7366 <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">
7367 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7368 <label for="ays-chart-option-org-classname" class="form-label">
7369 <?php echo esc_html(__( "Custom CSS class", "chart-builder" )); ?>
7370 <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") ); ?>">
7371 <i class="ays_fa ays_fa_info_circle"></i>
7372 </a>
7373 </label>
7374 </div>
7375 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7376 <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) ?>">
7377 </div>
7378 </div> <!-- Org custom class -->
7379 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
7380 <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">
7381 <br>
7382 <blockquote>
7383 <?php echo sprintf(
7384 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7385 esc_html(__( '%1$sNote:%2$s Custom CSS class must be set for the options below to take effect.', 'chart-builder' )), '<strong>', '</strong>'); ?>
7386 </blockquote>
7387 <br>
7388 </div>
7389 <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">
7390 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7391 <label for="ays-chart-option-org-node-background-color">
7392 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
7393 <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") ); ?>">
7394 <i class="ays_fa ays_fa_info_circle"></i>
7395 </a>
7396 </label>
7397 </div>
7398 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7399 <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) ?>">
7400 </div>
7401 </div> <!-- Org Node Background color -->
7402 <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">
7403 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7404 <label for="ays-chart-option-org-node-padding" class="form-label">
7405 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
7406 <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") ); ?>">
7407 <i class="ays_fa ays_fa_info_circle"></i>
7408 </a>
7409 </label>
7410 </div>
7411 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7412 <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) ?>">
7413 </div>
7414 </div> <!-- Org Node Padding -->
7415 <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">
7416 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7417 <label for="ays-chart-option-org-node-border-radius" class="form-label">
7418 <?php echo esc_html(__( "Border radius", "chart-builder" )); ?>
7419 <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") ); ?>">
7420 <i class="ays_fa ays_fa_info_circle"></i>
7421 </a>
7422 </label>
7423 </div>
7424 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7425 <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) ?>">
7426 </div>
7427 </div> <!-- Org Node Border radius -->
7428 <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">
7429 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7430 <label for="ays-chart-option-org-node-border-width" class="form-label">
7431 <?php echo esc_html(__( "Border width", "chart-builder" )); ?>
7432 <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") ); ?>">
7433 <i class="ays_fa ays_fa_info_circle"></i>
7434 </a>
7435 </label>
7436 </div>
7437 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7438 <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) ?>">
7439 </div>
7440 </div> <!-- Org Node Border width -->
7441 <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">
7442 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7443 <label for="ays-chart-option-org-node-border-color">
7444 <?php echo esc_html(__( "Border color", "chart-builder" )); ?>
7445 <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") ); ?>">
7446 <i class="ays_fa ays_fa_info_circle"></i>
7447 </a>
7448 </label>
7449 </div>
7450 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7451 <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) ?>">
7452 </div>
7453 </div> <!-- Org Node Background color -->
7454 <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">
7455 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7456 <label for="ays-chart-option-org-node-text-color">
7457 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7458 <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") ); ?>">
7459 <i class="ays_fa ays_fa_info_circle"></i>
7460 </a>
7461 </label>
7462 </div>
7463 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7464 <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) ?>">
7465 </div>
7466 </div> <!-- Org Node Text color -->
7467 <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">
7468 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7469 <label for="ays-chart-option-org-node-text-font-size" class="form-label">
7470 <?php echo esc_html(__( "Text font size", "chart-builder" )); ?>
7471 <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") ); ?>">
7472 <i class="ays_fa ays_fa_info_circle"></i>
7473 </a>
7474 </label>
7475 </div>
7476 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7477 <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) ?>">
7478 </div>
7479 </div> <!-- Org Node Text font size -->
7480 </div> <!-- Org custom class options -->
7481 <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">
7482 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7483 <label for="ays-chart-option-org-selected-classname" class="form-label">
7484 <?php echo esc_html(__( "Selected node custom CSS class", "chart-builder" )); ?>
7485 <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") ); ?>">
7486 <i class="ays_fa ays_fa_info_circle"></i>
7487 </a>
7488 </label>
7489 </div>
7490 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7491 <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) ?>">
7492 </div>
7493 </div> <!-- Org custom selected class -->
7494 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
7495 <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">
7496 <br>
7497 <blockquote>
7498 <?php echo sprintf(
7499 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
7500 esc_html(__( '%1$sNote:%2$s Selected node custom CSS class must be set for the options below to take effect. Add the Custom CSS Class so that the Selected node custom CSS class can operate correctly for you.', 'chart-builder' )),
7501 '<strong>',
7502 '</strong>'
7503 ); ?>
7504 </blockquote>
7505 <br>
7506 </div>
7507 <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">
7508 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7509 <label for="ays-chart-option-org-selected-node-background-color">
7510 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
7511 <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") ); ?>">
7512 <i class="ays_fa ays_fa_info_circle"></i>
7513 </a>
7514 </label>
7515 </div>
7516 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7517 <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) ?>">
7518 </div>
7519 </div> <!-- Org selected Node Background color -->
7520 <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">
7521 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7522 <label for="ays-chart-option-org-selected-node-text-color">
7523 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7524 <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") ); ?>">
7525 <i class="ays_fa ays_fa_info_circle"></i>
7526 </a>
7527 </label>
7528 </div>
7529 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7530 <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) ?>">
7531 </div>
7532 </div> <!-- Org selected Node text color -->
7533 </div> <!-- Org custom selected class options -->
7534 </div>
7535 </div>
7536 <?php
7537 $content = ob_get_clean();
7538
7539 $sources['advanced_settings'] = array(
7540 'content' => $content,
7541 'title' => $tab_title
7542 );
7543
7544 return $sources;
7545 }
7546
7547 public function settings_contents_advanced_settings_chartjs( $sources, $args ){
7548 $html_class_prefix = $args['html_class_prefix'];
7549 $html_name_prefix = $args['html_name_prefix'];
7550 $settings = $args['settings'];
7551 $tab_title = $args['tab_name'];
7552
7553 $outer_radius = $settings['outer_radius'];
7554 $slice_spacing = $settings['slice_spacing'];
7555 $circumference = $settings['circumference'];
7556 $start_angle = $settings['start_angle'];
7557 $slice_border_color = $settings['slice_border_color'];
7558 $slice_border_width = $settings['slice_border_width'];
7559 // $index_axis = $settings['index_axis'];
7560
7561 ob_start();
7562 ?>
7563 <div class="ays-accordion-data-main-wrap">
7564 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
7565 <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">
7566 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7567 <label for="ays-chart-option-outer-radius" class="form-label">
7568 <?php echo esc_html(__( "Outer Radius", "chart-builder" )); ?>
7569 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The outer radius of the chart.","chart-builder") ); ?>">
7570 <i class="ays_fa ays_fa_info_circle"></i>
7571 </a>
7572 </label>
7573 </div>
7574 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7575 <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) ?>">
7576 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
7577 </div>
7578 </div> <!-- Outer Radius -->
7579 <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">
7580 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7581 <label for="ays-chart-option-slice-spacing" class="form-label">
7582 <?php echo esc_html(__( "Slices Spacing", "chart-builder" )); ?>
7583 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Fixed arc offset (in pixels).","chart-builder") ); ?>">
7584 <i class="ays_fa ays_fa_info_circle"></i>
7585 </a>
7586 </label>
7587 </div>
7588 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7589 <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) ?>">
7590 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
7591 </div>
7592 </div> <!-- Slice Spacing -->
7593 <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">
7594 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7595 <label for="ays-chart-option-circumference" class="form-label">
7596 <?php echo esc_html(__( "Arc Coverage", "chart-builder" )); ?>
7597 <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") ); ?>">
7598 <i class="ays_fa ays_fa_info_circle"></i>
7599 </a>
7600 </label>
7601 </div>
7602 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7603 <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) ?>">
7604 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
7605 </div>
7606 </div> <!-- Arc Coverage -->
7607 <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">
7608 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7609 <label for="ays-chart-option-start-angle" class="form-label">
7610 <?php echo esc_html(__( "Start Angle", "chart-builder" )); ?>
7611 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Starting angle to draw arcs from.","chart-builder") ); ?>">
7612 <i class="ays_fa ays_fa_info_circle"></i>
7613 </a>
7614 </label>
7615 </div>
7616 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7617 <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) ?>">
7618 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
7619 </div>
7620 </div> <!-- Start Angle -->
7621 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt ">
7622 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7623 <label for="ays-chart-option-slice-border-width">
7624 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
7625 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The width of the slice borders.","chart-builder") ); ?>">
7626 <i class="ays_fa ays_fa_info_circle"></i>
7627 </a>
7628 </label>
7629 </div>
7630 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
7631 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-slice-border-width" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_border_width]" value="<?php echo esc_attr($slice_border_width) ?>">
7632 </div>
7633 </div> <!-- Border Width -->
7634 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section cb-changable-opt cb-pie_chart-opt ">
7635 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7636 <label for="ays-chart-option-slice-border-color">
7637 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
7638 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
7639 <i class="ays_fa ays_fa_info_circle"></i>
7640 </a>
7641 </label>
7642 </div>
7643 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7644 <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) ?>">
7645 </div>
7646 </div> <!-- Slice border color -->
7647 <!-- <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">
7648 <div class="col-sm-5 d-flex align-items-center <?php // echo esc_attr($html_class_prefix) ?>option-title">
7649 <label for="ays-chart-option-index-axis">
7650 <?php // echo esc_html(__( "Horizontal ", "chart-builder" )); ?>
7651 <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") ); ?>">
7652 <i class="ays_fa ays_fa_info_circle"></i>
7653 </a>
7654 </label>
7655 </div>
7656 <div class="col-sm-7 py-1 <?php // echo esc_attr($html_class_prefix) ?>input-align-right">
7657 <label class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7658 <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); ?> >
7659 <span class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php // echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7660 </label>
7661 </div>
7662 </div> Reverse Categories -->
7663 </div>
7664 </div>
7665 <?php
7666 $content = ob_get_clean();
7667
7668 $sources['advanced_settings'] = array(
7669 'content' => $content,
7670 'title' => $tab_title
7671 );
7672
7673 return $sources;
7674 }
7675
7676 public function settings_contents_slices_settings( $sources, $args ){
7677 $html_class_prefix = $args['html_class_prefix'];
7678 $html_name_prefix = $args['html_name_prefix'];
7679 $settings = $args['settings'];
7680 $source = $args['source'];
7681 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7682 $source_chart_type = $args['source_chart_type'];
7683 $settings = $args['settings'];
7684 $title_row = array_shift($source);
7685
7686 if (isset($source) && !empty($source)) {
7687 if ( !isset( $source[0] ) ) {
7688 if (count($source[1]) > 2) {
7689 $titles = array();
7690 for ($i = 0; $i < count($source[1]); $i++) {
7691 array_push($titles, __("Title", 'chart-builder').$i);
7692 }
7693 $source[0] = $titles;
7694 } else {
7695 $source[0] = array(
7696 __("Country", 'chart-builder'),
7697 __("Population", 'chart-builder'),
7698 );
7699 }
7700
7701 ksort($source);
7702 }
7703 }
7704
7705 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7706 foreach ($source as $key => $row) {
7707 $source[$key] = array_slice($row, 0, 2);
7708 }
7709 }
7710
7711 ob_start();
7712 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7713 $slice_color = $settings['slice_color'];
7714 $slice_colors_default = $settings['slice_colors_default'];
7715 $slice_offset = $settings['slice_offset'];
7716 $slice_text_color = $settings['slice_text_color'];
7717
7718 ?>
7719 <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">
7720 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7721 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
7722 <?php
7723 foreach ( $source as $key => $val ):
7724 ?>
7725 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
7726 <legend class="ays-slices-accordion-options-header">
7727 <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">
7728 <g>
7729 <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" />
7730 </g>
7731 </svg>
7732 <span><?php echo esc_html($val[0]); ?></span>
7733 </legend>
7734 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
7735 <div class="ays-slices-accordion-data-main-wrap">
7736 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7737 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7738 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7739 <label for="ays-chart-option-slice-color">
7740 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7741 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color to use for this slice.","chart-builder") ); ?>">
7742 <i class="ays_fa ays_fa_info_circle"></i>
7743 </a>
7744 </label>
7745 </div>
7746 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7747 <input type="color"
7748 id="ays-chart-option-slice-color-<?php echo esc_attr($key); ?>"
7749 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7750 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo esc_attr($key); ?>]"
7751 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : esc_attr($slice_colors_default[$key]); ?>"
7752 data-slice-id="<?php echo esc_attr($key); ?>">
7753 </div>
7754 </div> <!-- Slice color -->
7755 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7756 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7757 <label for="ays-chart-option-slice-offset" class="form-label">
7758 <?php echo esc_html(__( "Offset", "chart-builder" )); ?>
7759 <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") ); ?>">
7760 <i class="ays_fa ays_fa_info_circle"></i>
7761 </a>
7762 </label>
7763 </div>
7764 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7765 <input type="number"
7766 id="ays-chart-option-slice-offset-<?php echo esc_attr($key); ?>"
7767 class="ays-chart-option-slice-offset ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7768 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_offset][<?php echo esc_attr($key); ?>]"
7769 value="<?php echo isset($slice_offset[$key]) ? esc_attr($slice_offset[$key]) : 0 ; ?>"
7770 data-slice-id="<?php echo esc_attr($key); ?>"
7771 step=".01" min="0.0" max="1.0">
7772 </div>
7773 </div> <!-- Slice offset -->
7774 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7775 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7776 <label for="ays-chart-option-slice-text-color">
7777 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
7778 <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") ); ?>">
7779 <i class="ays_fa ays_fa_info_circle"></i>
7780 </a>
7781 </label>
7782 </div>
7783 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7784 <input type="color"
7785 id="ays-chart-option-slice-text-color-<?php echo esc_attr($key); ?>"
7786 class="ays-chart-option-slice-text-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7787 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text_color][<?php echo esc_attr($key); ?>]"
7788 value="<?php echo isset($slice_text_color[$key]) ? esc_attr($slice_text_color[$key]) : '#ffffff'; ?>"
7789 data-slice-id="<?php echo esc_attr($key); ?>">
7790 </div>
7791 </div> <!-- Slice color -->
7792 </div>
7793 </div>
7794 </div>
7795 </fieldset>
7796 <?php
7797 endforeach;
7798 ?>
7799 </div>
7800 </div>
7801 <br>
7802 <blockquote>
7803 <?php echo esc_html(__( "Save the chart to update the data.", "chart-builder" )); ?>
7804 </blockquote>
7805 </div>
7806 <?php
7807
7808 } else {
7809 ?>
7810 <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>
7811 <?php
7812 }
7813
7814 $content = ob_get_clean();
7815
7816 $title = esc_html(__( 'Slices settings', 'chart-builder' ));
7817
7818 $sources['slices_settings'] = array(
7819 'content' => $content,
7820 'title' => $title
7821 );
7822
7823 return $sources;
7824 }
7825
7826 public function settings_contents_slices_settings_chartjs( $sources, $args ){
7827 $html_class_prefix = $args['html_class_prefix'];
7828 $html_name_prefix = $args['html_name_prefix'];
7829 $settings = $args['settings'];
7830 $source = $args['source'];
7831 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7832 $source_chart_type = $args['source_chart_type'];
7833 $settings = $args['settings'];
7834 $title_row = array_shift($source);
7835
7836 if (isset($source) && !empty($source)) {
7837 if ( !isset( $source[0] ) ) {
7838 if (count($source[1]) > 2) {
7839 $titles = array();
7840 for ($i = 0; $i < count($source[1]); $i++) {
7841 array_push($titles, __("Title", 'chart-builder').$i);
7842 }
7843 $source[0] = $titles;
7844 } else {
7845 $source[0] = array(
7846 __("Country", 'chart-builder'),
7847 __("Population", 'chart-builder'),
7848 );
7849 }
7850
7851 ksort($source);
7852 }
7853 }
7854
7855 if ($source_chart_type == 'pie_chart') {
7856 foreach ($source as $key => $row) {
7857 $source[$key] = array_slice($row, 0, 2);
7858 }
7859 }
7860
7861 ob_start();
7862 if ($source_chart_type == 'pie_chart') {
7863 $slice_color = $settings['slice_color'];
7864 $slice_colors_default = $settings['slice_colors_default'];
7865
7866 ?>
7867 <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">
7868 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7869 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
7870 <?php
7871 foreach ( $source as $key => $val ):
7872 ?>
7873 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
7874 <legend class="ays-slices-accordion-options-header">
7875 <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">
7876 <g>
7877 <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" />
7878 </g>
7879 </svg>
7880 <span><?php echo esc_html($val[0]); ?></span>
7881 </legend>
7882 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
7883 <div class="ays-slices-accordion-data-main-wrap">
7884 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7885 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7886 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7887 <label for="ays-chart-option-slice-color">
7888 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7889 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color to use for this slice.","chart-builder") ); ?>">
7890 <i class="ays_fa ays_fa_info_circle"></i>
7891 </a>
7892 </label>
7893 </div>
7894 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7895 <input type="color"
7896 id="ays-chart-option-slice-color-<?php echo esc_attr($key); ?>"
7897 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7898 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo esc_attr($key); ?>]"
7899 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : esc_attr($slice_colors_default[$key]); ?>"
7900 data-slice-id="<?php echo esc_attr($key); ?>">
7901 </div>
7902 </div> <!-- Slice color -->
7903 </div>
7904 </div>
7905 </div>
7906 </fieldset>
7907 <?php
7908 endforeach;
7909 ?>
7910 </div>
7911 </div>
7912 <br>
7913 <blockquote>
7914 <?php echo esc_html(__( "Save the chart to update the data.", "chart-builder" )); ?>
7915 </blockquote>
7916 </div>
7917 <?php
7918
7919 } else {
7920 ?>
7921 <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>
7922 <?php
7923 }
7924
7925 $content = ob_get_clean();
7926
7927 $title = esc_html(__( 'Slices settings', 'chart-builder' ));
7928
7929 $sources['slices_settings'] = array(
7930 'content' => $content,
7931 'title' => $title
7932 );
7933
7934 return $sources;
7935 }
7936
7937 public function settings_contents_series_settings( $sources, $args ){
7938 $html_class_prefix = $args['html_class_prefix'];
7939 $html_name_prefix = $args['html_name_prefix'];
7940 $settings = $args['settings'];
7941 $source = $args['source'];
7942 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7943 $source_chart_type = $args['source_chart_type'];
7944
7945 $line_width = $settings['line_width'];
7946 $point_size = $settings['point_size'];
7947 $point_shape_options = $settings['point_shape_options'];
7948 $point_shape = $settings['point_shape'];
7949
7950 if (isset($source) && !empty($source)) {
7951 if ( !isset( $source[0] ) ) {
7952 if (count($source[1]) > 2) {
7953 $titles = array();
7954 for ($i = 0; $i < count($source[1]); $i++) {
7955 array_push($titles, __("Title", "chart-builder").$i);
7956 }
7957 $source[0] = $titles;
7958 } else {
7959 $source[0] = array(
7960 __("Country", "chart-builder"),
7961 __("Population", "chart-builder"),
7962 );
7963 }
7964
7965 ksort($source);
7966 }
7967 }
7968
7969 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7970 foreach ($source as $key => $row) {
7971 $source[$key] = array_slice($row, 0, 2);
7972 }
7973 }
7974
7975 ob_start();
7976 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'line_chart' || $source_chart_type == 'bar_chart' || $source_chart_type == 'column_chart') {
7977 $series_row = array_shift($source);
7978 $title = array_shift($series_row);
7979 $series_color = $settings['series_color'];
7980 $series_colors_default = $settings['series_colors_default'];
7981 $series_format = $settings['series_format'];
7982 $series_visible_in_legend = $settings['series_visible_in_legend'];
7983 $series_line_width = $settings['series_line_width'];
7984 $series_point_size = $settings['series_point_size'];
7985 $series_point_shape = $settings['series_point_shape'];
7986
7987 ?>
7988 <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">
7989 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7990 <div class="<?php echo esc_attr($html_class_prefix) ?>series-settings">
7991 <?php
7992 foreach ( $series_row as $key => $val ):
7993 ?>
7994 <fieldset class="ays-series-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-series-<?php echo esc_attr($key); ?>" data-collapsed="true">
7995 <legend class="ays-series-accordion-options-header">
7996 <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">
7997 <g>
7998 <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" />
7999 </g>
8000 </svg>
8001 <span><?php echo esc_attr($val); ?></span>
8002 </legend>
8003 <div class="ays-series-accordion-options-content ays-series-accordion-options-content">
8004 <div class="ays-series-accordion-data-main-wrap">
8005 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
8006 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8007 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8008 <label for="ays-chart-option-series-color">
8009 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
8010 </label>
8011 </div>
8012 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8013 <input type="color"
8014 id="ays-chart-option-series-color-<?php echo esc_attr($key); ?>"
8015 class="ays-chart-option-series-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
8016 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_color][<?php echo esc_attr($key); ?>]"
8017 value="<?php echo isset($series_color[$key]) ? esc_attr($series_color[$key]) : esc_attr($series_colors_default[$key]); ?>"
8018 data-series-id="<?php echo esc_attr($key); ?>">
8019 </div>
8020 </div> <!-- series color -->
8021 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8022 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8023 <label for="ays-chart-option-series-visible-in-legend">
8024 <?php echo esc_html(__( "Visible in legend", "chart-builder" )); ?>
8025 <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") ); ?>">
8026 <i class="ays_fa ays_fa_info_circle"></i>
8027 </a>
8028 </label>
8029 </div>
8030 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8031 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8032 <input type="checkbox"
8033 id="ays-chart-option-series-visible-in-legend-<?php echo esc_attr($key); ?>"
8034 class="ays-chart-option-series-visible-in-legend <?php echo esc_attr($html_class_prefix) ?>toggle-switch"
8035 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_visible_in_legend][<?php echo esc_attr($key); ?>]"
8036 value="on"
8037 data-series-id="<?php echo esc_attr($key); ?>"
8038 <?php echo isset($series_visible_in_legend[$key]) && $series_visible_in_legend[$key] == 'on' ? 'checked' : (!isset($series_color[$key]) ? 'checked' : ''); ?> >
8039 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8040 </label>
8041 </div>
8042 </div> <!-- Series visible in legend -->
8043 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8044 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8045 <label for="ays-chart-option-series-color">
8046 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
8047 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The format of series data. The format string is a subset of the ICU pattern set . For instance, '#,###%' will result in output values '1,000%', '750%', and '50%' for values 10, 7.5, and 0.5. Note: This option won't work if the axes 'Remove Extra Zeros' option is enabled.","chart-builder") ); ?>">
8048 <i class="ays_fa ays_fa_info_circle"></i>
8049 </a>
8050 </label>
8051 </div>
8052 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8053 <input type="text"
8054 id="ays-chart-option-series-format-<?php echo $key; ?>"
8055 class="ays-chart-option-series-format ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
8056 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_format][<?php echo $key; ?>]"
8057 value="<?php echo isset($series_format[$key]) && '' !== $series_format[$key] ? esc_attr($series_format[$key]) : ''; ?>"
8058 data-series-id="<?php echo $key; ?>">
8059 </div>
8060 </div> <!-- Format -->
8061 <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">
8062 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8063 <label for="ays-chart-option-series-line-width">
8064 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
8065 <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") ); ?>">
8066 <i class="ays_fa ays_fa_info_circle"></i>
8067 </a>
8068 </label>
8069 </div>
8070 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8071 <input type="number"
8072 id="ays-chart-option-series-line-width-<?php echo esc_attr($key); ?>"
8073 class="ays-chart-option-series-line-width ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
8074 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_line_width][<?php echo esc_attr($key); ?>]"
8075 value="<?php echo isset($series_line_width[$key]) ? esc_attr($series_line_width[$key]) : esc_attr($line_width); ?>"
8076 data-series-id="<?php echo esc_attr($key); ?>">
8077 </div>
8078 </div> <!-- Line width -->
8079 <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">
8080 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8081 <label for="ays-chart-option-series-point-size">
8082 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
8083 <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") ); ?>">
8084 <i class="ays_fa ays_fa_info_circle"></i>
8085 </a>
8086 </label>
8087 </div>
8088 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8089 <input type="number"
8090 id="ays-chart-option-series-point-size-<?php echo esc_attr($key); ?>"
8091 class="ays-chart-option-series-point-size ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
8092 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_size][<?php echo esc_attr($key); ?>]"
8093 value="<?php echo isset($series_point_size[$key]) ? esc_attr($series_point_size[$key]) : esc_attr($point_size); ?>"
8094 data-series-id="<?php echo esc_attr($key); ?>">
8095 </div>
8096 </div> <!-- Point size -->
8097 <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">
8098 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8099 <label for="ays-chart-option-series-point-shape">
8100 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
8101 <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") ); ?>">
8102 <i class="ays_fa ays_fa_info_circle"></i>
8103 </a>
8104 </label>
8105 </div>
8106 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8107 <select
8108 id="ays-chart-option-series-point-shape-<?php echo esc_attr($key); ?>"
8109 class="ays-chart-option-series-point-shape <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select"
8110 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_shape][<?php echo esc_attr($key); ?>]"
8111 data-series-id="<?php echo esc_attr($key); ?>">
8112 >
8113 <?php
8114 $value = isset($series_point_shape[$key]) ? esc_attr($series_point_shape[$key]) : $point_shape;
8115 foreach ( $point_shape_options as $option_slug => $option ):
8116 $selected = ( $value === $option_slug ) ? 'selected' : '';
8117 ?>
8118 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
8119 <?php
8120 endforeach;
8121 ?>
8122 </select>
8123 </div>
8124 </div> <!-- Point shape -->
8125 </div>
8126 </div>
8127 </div>
8128 </fieldset>
8129 <?php
8130 endforeach;
8131 ?>
8132 </div>
8133 </div>
8134 <br>
8135 <blockquote>
8136 <?php echo esc_html(__( "Save the chart to update the data.", 'chart-builder' )); ?>
8137 <br>
8138 <?php echo sprintf(
8139 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
8140 esc_html(__( '%1$sNote:%2$s If you are not able to set the options, disable the row settings feature.', 'chart-builder' )),
8141 '<strong>',
8142 '</strong>'
8143 ); ?>
8144 </blockquote>
8145 </div>
8146 <?php
8147
8148 } else {
8149 ?>
8150 <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>
8151 <?php
8152 }
8153
8154 $content = ob_get_clean();
8155
8156 $title = __( 'Series settings', "chart-builder" );
8157
8158 $sources['series_settings'] = array(
8159 'content' => $content,
8160 'title' => $title
8161 );
8162
8163 return $sources;
8164 }
8165
8166 public function settings_contents_row_settings( $sources, $args ){
8167 $html_class_prefix = $args['html_class_prefix'];
8168 $html_name_prefix = $args['html_name_prefix'];
8169 $settings = $args['settings'];
8170 $source = $args['source'];
8171 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
8172 $source_chart_type = $args['source_chart_type'];
8173
8174 if (isset($source) && !empty($source)) {
8175 if ( !isset( $source[0] ) ) {
8176 if (count($source[1]) > 2) {
8177 $titles = array();
8178 for ($i = 0; $i < count($source[1]); $i++) {
8179 array_push($titles, __("Title", 'chart-builder').$i);
8180 }
8181 $source[0] = $titles;
8182 } else {
8183 $source[0] = array(
8184 __("Country", 'chart-builder'),
8185 __("Population", 'chart-builder'),
8186 );
8187 }
8188
8189 ksort($source);
8190 }
8191 }
8192
8193 array_shift($source);
8194 $rows = array_column($source, 0);
8195
8196 $enable_row_settings = $settings['enable_row_settings'];
8197 $series_color = $settings['series_color'][0] ?? '#3366cc';
8198 $rows_color = $settings['rows_color'];
8199 $rows_opacity = $settings['rows_opacity'];
8200
8201 ob_start();
8202 ?>
8203 <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">
8204 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
8205 <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">
8206 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8207 <label for="ays-chart-option-enable-row-settings">
8208 <?php echo esc_html(__( "Enable row settings", "chart-builder" )); ?>
8209 <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") ); ?>">
8210 <i class="ays_fa ays_fa_info_circle"></i>
8211 </a>
8212 </label>
8213 </div>
8214 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8215 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
8216 <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); ?> >
8217 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
8218 </label>
8219 </div>
8220 </div> <!-- Enable row settings -->
8221 <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'; ?>">
8222 <br>
8223 <?php
8224 foreach ( $rows as $key => $val ):
8225 ?>
8226 <fieldset class="ays-rows-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-rows-<?php echo esc_attr($key); ?>" data-collapsed="true">
8227 <legend class="ays-rows-accordion-options-header">
8228 <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">
8229 <g>
8230 <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" />
8231 </g>
8232 </svg>
8233 <span><?php echo esc_html($val); ?></span>
8234 </legend>
8235 <div class="ays-rows-accordion-options-content ays-rows-accordion-options-content">
8236 <div class="ays-rows-accordion-data-main-wrap">
8237 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
8238 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8239 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8240 <label for="ays-chart-option-rows-color">
8241 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
8242 </label>
8243 </div>
8244 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8245 <input type="color"
8246 id="ays-chart-option-rows-color-<?php echo esc_attr($key); ?>"
8247 class="ays-chart-option-rows-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
8248 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_color][<?php echo esc_attr($key); ?>]"
8249 value="<?php echo isset($rows_color[$key]) && '' !== $rows_color[$key] ? esc_attr($rows_color[$key]) : esc_attr($series_color); ?>"
8250 data-rows-id="<?php echo esc_attr($key); ?>">
8251 </div>
8252 </div> <!-- color -->
8253 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
8254 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
8255 <label for="ays-chart-option-rows-color">
8256 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
8257 </label>
8258 </div>
8259 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
8260 <input type="number"
8261 id="ays-chart-option-rows-opacity-<?php echo esc_attr($key); ?>"
8262 class="ays-chart-option-rows-opacity ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
8263 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_opacity][<?php echo esc_attr($key); ?>]"
8264 value="<?php echo isset($rows_opacity[$key]) && '' !== $rows_opacity[$key] ? esc_attr($rows_opacity[$key]) : 1.0; ?>"
8265 data-rows-id="<?php echo esc_attr($key); ?>"
8266 step=".1" min="0" max="1">
8267 </div>
8268 </div> <!-- opacity -->
8269 </div>
8270 </div>
8271 </div>
8272 </fieldset>
8273 <?php
8274 endforeach;
8275 ?>
8276 <br>
8277 <blockquote>
8278 <?php echo esc_html(__( "Save the chart to update the data.", 'chart-builder' )); ?>
8279 <br>
8280 <?php echo sprintf(
8281 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
8282 esc_html(__( '%1$sNote:%2$s The applied styles will work only if the chart has one column.', 'chart-builder' )),
8283 '<strong>',
8284 '</strong>'
8285 ); ?>
8286 </blockquote>
8287 </div>
8288 <div class="<?php echo esc_attr($html_class_prefix) ?>not-hidden-options-section <?php echo $enable_row_settings === 'checked' ? 'display_none' : ''; ?>">
8289 <br>
8290 <blockquote>
8291 <?php echo sprintf(
8292 /* translators: %1$s: Opening <strong> tag, %2$s: Closing </strong> tag */
8293 esc_html(__( '%1$sNote:%2$s If this option is disabled, the general options will be set from the series settings.', 'chart-builder' )),
8294 '<strong>',
8295 '</strong>'
8296 ); ?>
8297 </blockquote>
8298 </div>
8299 </div>
8300 </div>
8301 <?php
8302 $content = ob_get_clean();
8303
8304 $title = __( 'Row settings', "chart-builder" );
8305
8306 $sources['row_settings'] = array(
8307 'content' => $content,
8308 'title' => $title
8309 );
8310
8311 return $sources;
8312 }
8313 }
8314