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

7,229 lines 517.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The admin-specific functionality of the plugin.
5 *
6 * @link https://ays-pro.com/
7 * @since 1.0.0
8 *
9 * @package Chart_Builder
10 * @subpackage Chart_Builder/admin
11 */
12
13 /**
14 * The admin-specific functionality of the plugin.
15 *
16 * Defines the plugin name, version, and two examples hooks for how to
17 * enqueue the admin-specific stylesheet and JavaScript.
18 *
19 * @package Chart_Builder
20 * @subpackage Chart_Builder/admin
21 * @author Chart Builder Team <info@ays-pro.com>
22 */
23 class Chart_Builder_Admin {
24
25 /**
26 * The ID of this plugin.
27 *
28 * @since 1.0.0
29 * @access private
30 * @var string $plugin_name The ID of this plugin.
31 */
32 private $plugin_name;
33
34 /**
35 * The version of this plugin.
36 *
37 * @since 1.0.0
38 * @access private
39 * @var string $version The current version of this plugin.
40 */
41 private $version;
42
43 /**
44 * The capability of this plugin.
45 *
46 * @since 1.0.0
47 * @access private
48 * @var string $capability The capability for users access to this plugin.
49 */
50 private $capability;
51
52 /**
53 * @var Chart_Builder_DB_Actions
54 */
55 private $db_obj;
56
57 /**
58 * @var Chart_Builder_Settings_DB_Actions
59 */
60 private $settings_obj;
61
62 /**
63 * Initialize the class and set its properties.
64 *
65 * @since 1.0.0
66 * @param string $plugin_name The name of this plugin.
67 * @param string $version The version of this plugin.
68 */
69 public function __construct( $plugin_name, $version ) {
70
71 $this->plugin_name = $plugin_name;
72 $this->version = $version;
73
74 add_filter('set-screen-option', array(__CLASS__, 'set_screen'), 10, 3);
75 add_filter('set_screen_option_cb_charts_per_page', array(__CLASS__, 'set_screen'), 10, 3);
76
77 }
78
79 /**
80 * Register the stylesheets for the admin area.
81 *
82 * @since 1.0.0
83 */
84 public function enqueue_styles($hook_suffix) {
85 wp_enqueue_style( $this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
86 // Not enqueue styles if they are not on the current plugin page
87 if (false === strpos($hook_suffix, $this->plugin_name)) return;
88 //
89 wp_enqueue_style( $this->plugin_name . '-normalize', plugin_dir_url( __FILE__ ) . 'css/normalize.css', array(), $this->version . time(), 'all' );
90 wp_enqueue_style( $this->plugin_name . '-admin-general', plugin_dir_url( __FILE__ ) . 'css/admin-general.css', array(), $this->version, 'all' );
91 wp_enqueue_style( $this->plugin_name . '-banner', plugin_dir_url( __FILE__ ) . 'css/banner.css', array(), $this->version, 'all' );
92 wp_enqueue_style( $this->plugin_name . '-chart-builder-banner.css', plugin_dir_url(__FILE__) . 'css/chart-builder-banner.css', array(), $this->version, 'all');
93 wp_enqueue_style( $this->plugin_name . '-animate', plugin_dir_url(__FILE__) . 'css/animate.css', array(), $this->version, 'all');
94 wp_enqueue_style( $this->plugin_name . '-font-awesome', plugin_dir_url(__FILE__) . 'css/ays-font-awesome.min.css', array(), $this->version, 'all');
95 wp_enqueue_style( $this->plugin_name . '-font-awesome-icons', plugin_dir_url(__FILE__) . 'css/ays-font-awesome-icons.css', array(), $this->version, 'all');
96 wp_enqueue_style( $this->plugin_name . '-select2', plugin_dir_url(__FILE__) . 'css/ays-select2.min.css', array(), $this->version, 'all');
97 wp_enqueue_style( $this->plugin_name . '-chosen', plugin_dir_url(__FILE__) . 'css/chosen.min.css', array(), $this->version, 'all');
98 wp_enqueue_style( $this->plugin_name . '-bootstrap', plugin_dir_url(__FILE__) . 'css/bootstrap.min.css', array(), $this->version, 'all');
99 wp_enqueue_style( $this->plugin_name . '-data-bootstrap', plugin_dir_url(__FILE__) . 'css/dataTables.bootstrap4.min.css', array(), $this->version, 'all');
100 wp_enqueue_style( $this->plugin_name . '-jquery-ui.min', plugin_dir_url(__FILE__) . 'css/jquery-ui.min.css', array(), $this->version, 'all');
101
102 wp_enqueue_style( $this->plugin_name . '-layer', plugin_dir_url( __FILE__ ) . 'css/chart-builder-admin-layer.css', array(), $this->version, 'all' );
103 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/chart-builder-admin.css', array(), $this->version . time(), 'all' );
104 wp_enqueue_style( $this->plugin_name . "-pro-features", plugin_dir_url( __FILE__ ) . 'css/chart-builder-pro-features.css', array(), $this->version . time(), 'all' );
105
106 }
107
108 /**
109 * Register the JavaScript for the admin area.
110 *
111 * @since 1.0.0
112 */
113 public function enqueue_scripts($hook_suffix) {
114 if (false !== strpos($hook_suffix, "plugins.php")){
115 wp_enqueue_script( $this->plugin_name . '-sweetalert-js', plugin_dir_url( __FILE__ ) . 'js/chart-builder-sweetalert2.all.min.js', array('jquery'), $this->version, true );
116 wp_enqueue_script($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'js/admin.js', array('jquery'), $this->version, true);
117 wp_localize_script($this->plugin_name . '-admin', 'chart_builder_admin_ajax', array('ajax_url' => admin_url('admin-ajax.php')));
118 }
119
120 // Not enqueue scripts if they are not on the current plugin page
121 if (false === strpos($hook_suffix, $this->plugin_name)) return;
122 //
123 global $wp_version;
124 $version1 = $wp_version;
125 $operator = '>=';
126 $version2 = '5.5';
127 $versionCompare = CBFunctions()->versionCompare( $version1, $operator, $version2 );
128
129 if ( $versionCompare ) {
130 wp_enqueue_script( $this->plugin_name.'-wp-load-scripts', plugin_dir_url(__FILE__) . 'js/load-scripts.js', array(), $this->version, true);
131 }
132
133 wp_enqueue_script( 'jquery' );
134
135 /*
136 ==========================================
137 * Bootstrap
138 * select2
139 * jQuery DataTables
140 ==========================================
141 */
142 wp_enqueue_script( $this->plugin_name . "-popper", plugin_dir_url(__FILE__) . 'js/popper.min.js', array( 'jquery' ), $this->version, true );
143 wp_enqueue_script( $this->plugin_name . "-bootstrap", plugin_dir_url(__FILE__) . 'js/bootstrap.min.js', array( 'jquery' ), $this->version, true );
144 wp_enqueue_script( $this->plugin_name . '-select2js', plugin_dir_url( __FILE__ ) . 'js/ays-select2.min.js', array('jquery'), $this->version, true);
145 wp_enqueue_script( $this->plugin_name . '-chosen', plugin_dir_url( __FILE__ ) . 'js/chosen.jquery.min.js', array('jquery'), $this->version, true);
146 wp_enqueue_script( $this->plugin_name . '-datatable-min', plugin_dir_url( __FILE__ ) . 'js/chart-builder-datatable.min.js', array('jquery'), $this->version, true);
147 wp_enqueue_script( $this->plugin_name . "-db4.min.js", plugin_dir_url( __FILE__ ) . 'js/dataTables.bootstrap4.min.js', array( 'jquery' ), $this->version, true );
148 wp_enqueue_script( $this->plugin_name . "-jquery-ui.min.js", plugin_dir_url( __FILE__ ) . 'js/jquery-ui.min.js', array( 'jquery' ), $this->version, true );
149 wp_enqueue_script( $this->plugin_name . '-sweetalert-js', plugin_dir_url( __FILE__ ) . 'js/chart-builder-sweetalert2.all.min.js', array('jquery'), $this->version, true );
150
151 wp_enqueue_script( $this->plugin_name . "-treeSortable", plugin_dir_url( __FILE__ ) . 'js/treeSortable.js', array( 'jquery' ), $this->version, true );
152 wp_enqueue_script( $this->plugin_name . "-tippy-bundle", plugin_dir_url( __FILE__ ) . 'js/tippy-bundle.umd.js', array( 'jquery' ), $this->version, true );
153
154 $table_col_mapping = CBFunctions()->get_all_db_tables_column_mapping( 1 );
155 $chart_banner_date = $this->ays_chart_update_banner_time();
156
157 wp_enqueue_code_editor(
158 array(
159 'type' => 'sql',
160 'codemirror' => array(
161 'autofocus' => true,
162 'lineWrapping' => true,
163 'dragDrop' => false,
164 'matchBrackets' => true,
165 'autoCloseBrackets' => true,
166 'extraKeys' => array( 'Ctrl-Space' => 'autocomplete' ),
167 'hintOptions' => array( 'tables' => $table_col_mapping ),
168 ),
169 )
170 );
171
172 wp_enqueue_script( $this->plugin_name . '-charts-google', plugin_dir_url(__FILE__) . 'js/google-chart.js', array('jquery'), $this->version, true);
173 wp_enqueue_script( $this->plugin_name . '-chart-js', plugin_dir_url(__FILE__) . 'js/chart-js.js', array('jquery'), $this->version, true);
174
175 wp_enqueue_script( $this->plugin_name . '-functions', plugin_dir_url( __FILE__ ) . 'js/functions.js', array( 'jquery' ), $this->version, true );
176
177 wp_register_script( $this->plugin_name . '-localized', '' );
178
179 wp_localize_script( $this->plugin_name . '-localized', 'aysChartBuilderAdmin', array(
180 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
181 'selectUser' => __( 'Select author', "chart-builder" ),
182 'pleaseEnterMore' => __( "Please enter 1 or more characters", "chart-builder" ),
183 'searching' => __( "Searching...", "chart-builder" ),
184 'chartBannerDate' => $chart_banner_date,
185 'selectUserRoles' => __( 'Select user roles', "chart-builder" ),
186 'delete' => __( 'Delete', "chart-builder" ),
187 'selectQuestionDefaultType' => __( 'Select question default type', "chart-builder" ),
188 'yes' => __( 'Yes', "chart-builder" ),
189 'cancel' => __( 'Cancel', "chart-builder" ),
190 'somethingWentWrong' => __( "Maybe something went wrong.", "chart-builder" ),
191 'failed' => __( 'Failed', "chart-builder" ),
192 'selectPage' => __( 'Select page', "chart-builder" ),
193 'selectPostType' => __( 'Select post type', "chart-builder" ),
194 'copied' => __( 'Copied!', "chart-builder"),
195 'clickForCopy' => __( 'Click to copy', "chart-builder"),
196 'selectForm' => __( 'Select form', "chart-builder"),
197 'addImage' => __( 'Add Image', "chart-builder"),
198 'editImage' => __( 'Edit Image', "chart-builder"),
199 'confirmDelete' => __( 'Are you sure you want to delete the chart(s)?', "chart-builder"),
200 'confirmRowDelete' => __( 'Are you sure you want to delete the row?', "chart-builder"),
201 'confirmColDelete' => __( 'Are you sure you want to delete the column?', "chart-builder"),
202 'minRowNotice' => __( 'Sorry, minimum count of rows should be 1', "chart-builder"),
203 'minColNotice' => __( 'Sorry, minimum count of columns should be 1', "chart-builder"),
204 'activated' => __( "Activated", "chart-builder" ),
205 'errorMsg' => __( "Error", "chart-builder" ),
206 'loadResource' => __( "Can't load resource.", "chart-builder" ),
207 'somethingWentWrong' => __( "Maybe something went wrong.", "chart-builder" ),
208 ) );
209
210 wp_localize_script( $this->plugin_name . '-localized', 'aysChartBuilderChartSettings', array(
211 'types' => CBFunctions()->getAllowedTypes(),
212 'max_selected_options' => 2,
213 'l10n' => array(
214 'invalid_source' => esc_html__( 'You have entered invalid URL. Please, insert proper URL.', "chart-builder" ),
215 'loading' => esc_html__( 'Loading...', "chart-builder" ),
216 'filter_config_error' => esc_html__( 'Please check the filters you have configured.', "chart-builder" ),
217 'select_columns' => esc_html__( 'Please select a few columns to include in the chart.', "chart-builder" ),
218 'save_settings' => __( 'You have modified the chart\'s settings. To modify the source/data again, you must save this chart and reopen it for editing. If you continue without saving the chart, you may lose your changes.', "chart-builder" ),
219 ),
220 'ajax' => array(
221 'url' => admin_url( 'admin-ajax.php' ),
222 'nonces' => array(
223 'filter_get_props' => wp_create_nonce( 'cbuilder-fetch-post-type-props' ),
224 'filter_get_data' => wp_create_nonce( 'cbuilder-fetch-post-type-data' ),
225 'quiz_maker_get_data' => wp_create_nonce( 'cbuilder-fetch-quiz-maker-data' ),
226 'quiz_maker_save_data' => wp_create_nonce( 'cbuilder-save-quiz-maker-data' ),
227 'author_user_search' => wp_create_nonce( 'cbuilder-author-user-search' ),
228 ),
229 'actions' => array(
230 'filter_get_props' => 'fetch_post_type_props',
231 'filter_get_data' => 'fetch_post_type_data',
232 'quiz_maker_get_data' => 'fetch_quiz_maker_data',
233 'quiz_maker_save_data' => 'save_quiz_maker_data',
234 'author_user_search' => 'author_user_search'
235 ),
236 ),
237 'db_query' => array(
238 'tables' => $table_col_mapping,
239 ),
240 ) );
241
242 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version . time(), true );
243 wp_enqueue_script( $this->plugin_name . '-google', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-google.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version . time(), true );
244 wp_enqueue_script( $this->plugin_name . '-chartjs', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-chartjs.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version . time(), true );
245 wp_enqueue_script( $this->plugin_name . '-general-js', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-general.js', array( 'jquery', $this->plugin_name . '-localized' ), $this->version, true );
246
247 if ( false !== strpos( $hook_suffix, 'settings' ) ) {
248 wp_enqueue_script( $this->plugin_name . '-settings', plugin_dir_url( __FILE__ ) . 'js/chart-builder-admin-settings.js', array( 'jquery' ), $this->version, true );
249
250 wp_localize_script( $this->plugin_name . '-settings', 'aysChartBuilderAdminSettings', array(
251 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
252 'selectUserRoles' => __( 'Select user roles', $this->plugin_name ),
253 'delete' => __( 'Delete', $this->plugin_name ),
254 'selectQuestionDefaultType' => __( 'Select question default type', $this->plugin_name ),
255 'yes' => __( 'Yes', $this->plugin_name ),
256 'cancel' => __( 'Cancel', $this->plugin_name ),
257 'somethingWentWrong' => __( "Maybe something went wrong.", $this->plugin_name ),
258 'failed' => __( 'Failed', $this->plugin_name ),
259 'selectPage' => __( 'Select page', $this->plugin_name ),
260 'selectPostType' => __( 'Select post type', $this->plugin_name ),
261 'copied' => __( 'Copied!', $this->plugin_name),
262 'clickForCopy' => __( 'Click to copy', $this->plugin_name),
263 'selectForm' => __( 'Select form', $this->plugin_name),
264 ) );
265 }
266 }
267
268 /**
269 * De-register JavaScript files for the admin area.
270 *
271 * @since 1.0.0
272 */
273 public function disable_scripts($hook_suffix) {
274 if (false !== strpos($hook_suffix, $this->plugin_name)) {
275 if (is_plugin_active('ai-engine/ai-engine.php')) {
276 wp_deregister_script('mwai');
277 wp_deregister_script('mwai-vendor');
278 wp_dequeue_script('mwai');
279 wp_dequeue_script('mwai-vendor');
280 }
281 }
282 }
283
284 /**
285 * Register the administration menu for this plugin into the WordPress Dashboard menu.
286 *
287 * @since 1.0.0
288 */
289 public function add_plugin_admin_menu(){
290
291 /*
292 * Add a settings page for this plugin to the Settings menu.
293 *
294 * NOTE: Alternative menu locations are available via WordPress administration menu functions.
295 *
296 * Administration Menus: http://codex.wordpress.org/Administration_Menus
297 *
298 */
299 global $wpdb;
300 $menu_item = __( 'Chart Builder', "chart-builder" );
301 $this->capability = 'manage_options';
302
303 add_menu_page(
304 __( 'Chart Builder', "chart-builder" ),
305 $menu_item,
306 $this->capability,
307 $this->plugin_name,
308 array($this, 'display_plugin_charts_page'),
309 CHART_BUILDER_ADMIN_URL . '/images/icons/ays_chart_logo_icon_bw.svg',
310 '6.22'
311 );
312
313 }
314
315 public function add_plugin_charts_submenu(){
316 $hook_page_view = add_submenu_page(
317 $this->plugin_name,
318 __('All Charts', $this->plugin_name),
319 __('All Charts', $this->plugin_name),
320 'manage_options',
321 $this->plugin_name,
322 array($this, 'display_plugin_charts_page')
323 );
324
325 add_action( "load-$hook_page_view", array( $this, 'screen_option_charts' ) );
326 }
327
328 public function add_plugin_add_new_submenu(){
329 $hook_charts = add_submenu_page(
330 $this->plugin_name,
331 __('Add New', $this->plugin_name),
332 __('Add New', $this->plugin_name),
333 'manage_options',
334 $this->plugin_name."&action=add",
335 array($this, 'display_plugin_addnew_page')
336 );
337 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
338 }
339
340 public function add_plugin_dashboard_submenu(){
341 $hook_charts = add_submenu_page(
342 $this->plugin_name,
343 __('How to use', $this->plugin_name),
344 __('How to use', $this->plugin_name),
345 'manage_options',
346 $this->plugin_name . '-dashboard',
347 array($this, 'display_plugin_setup_page')
348 );
349 add_action("load-$hook_charts", array( $this, 'add_tabs' ));
350 }
351
352 public function add_plugin_general_settings_submenu(){
353 $hook_settings = add_submenu_page( $this->plugin_name,
354 __('General Settings', $this->plugin_name),
355 __('General Settings', $this->plugin_name),
356 'manage_options',
357 $this->plugin_name . '-settings',
358 array($this, 'display_plugin_settings_page')
359 );
360 add_action("load-$hook_settings", array($this, 'screen_option_settings'));
361 }
362
363 public function add_plugin_featured_plugins_submenu(){
364 $hook_our_products = add_submenu_page( $this->plugin_name,
365 __('Our products', $this->plugin_name),
366 __('Our products', $this->plugin_name),
367 'manage_options',
368 $this->plugin_name . '-featured-plugins',
369 array($this, 'display_plugin_featured_plugins_page')
370 );
371
372 add_action("load-$hook_our_products", array( $this, 'add_tabs' ));
373 }
374
375 public function add_plugin_chart_features_submenu(){
376 $hook_pro_features = add_submenu_page(
377 $this->plugin_name,
378 __('PRO Features', $this->plugin_name),
379 __('PRO Features', $this->plugin_name),
380 'manage_options',
381 $this->plugin_name . '-chart-features',
382 array($this, 'display_plugin_chart_features_page')
383 );
384
385 add_action("load-$hook_pro_features", array( $this, 'add_tabs' ));
386 }
387
388 public function screen_option_charts(){
389 $option = 'per_page';
390 $args = array(
391 'label' => __('Charts', "chart-builder"),
392 'default' => 5,
393 'option' => 'cb_charts_per_page'
394 );
395
396 if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
397 add_screen_option( $option, $args );
398 }
399
400 $this->db_obj = new Chart_Builder_DB_Actions( $this->plugin_name );
401 }
402
403 public function screen_option_settings(){
404 $this->settings_obj = new Chart_Builder_Settings_DB_Actions( $this->plugin_name );
405 }
406
407 public function add_tabs() {
408 $screen = get_current_screen();
409
410 if ( ! $screen) {
411 return;
412 }
413 }
414
415 public function display_plugin_charts_page(){
416 global $ays_chart_db_actions;
417
418 $action = (isset($_GET['action'])) ? sanitize_text_field( $_GET['action'] ) : '';
419 $id = (isset($_GET['id'])) ? absint( esc_attr($_GET['id']) ) : 0;
420
421 if (isset($_POST['bulk_delete_confirm'])) {
422 if (isset($_POST['bulk-delete']) && !empty($_POST['bulk-delete'])) {
423 $ids = $_POST['bulk-delete'];
424 foreach ($ids as $id) {
425 if ($id > 0) {
426 $this->db_obj->delete_item( $id );
427 }
428 }
429 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
430 $url = esc_url_raw( add_query_arg( array(
431 "status" => 'all-deleted'
432 ), $url ) );
433 wp_redirect( $url );
434 exit;
435 }
436 }
437
438 switch ($action) {
439 case 'trash':
440 if( $id > 0 ){
441 $this->db_obj->trash_item( $id );
442 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
443 $url = esc_url_raw( add_query_arg( array(
444 "status" => 'trashed'
445 ), $url ) );
446 wp_redirect( $url );
447 exit;
448 }
449 break;
450 case 'restore':
451 if( $id > 0 ){
452 $this->db_obj->restore_item( $id );
453 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
454 $url = esc_url_raw( add_query_arg( array(
455 "status" => 'restored'
456 ), $url ) );
457 wp_redirect( $url );
458 exit;
459 }
460 break;
461 case 'delete':
462 if( $id > 0 ){
463 $this->db_obj->delete_item( $id );
464 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
465 $url = esc_url_raw( add_query_arg( array(
466 "status" => 'deleted'
467 ), $url ) );
468 wp_redirect( $url );
469 exit;
470 }
471 break;
472 case 'publish':
473 if( $id > 0 ){
474 $this->db_obj->publish_item( $id );
475 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
476 $url = esc_url_raw( add_query_arg( array(
477 "status" => 'published'
478 ), $url ) );
479 wp_redirect( $url );
480 exit;
481 }
482 break;
483 case 'unpublish':
484 if( $id > 0 ){
485 $this->db_obj->restore_item( $id );
486 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
487 $url = esc_url_raw( add_query_arg( array(
488 "status" => 'unpublished'
489 ), $url ) );
490 wp_redirect( $url );
491 exit;
492 }
493 break;
494 case 'duplicate':
495 if( $id > 0 ){
496 $this->db_obj->duplicate_item( $id );
497 $url = remove_query_arg( array('action', 'id', '_wpnonce') );
498 $url = esc_url_raw( add_query_arg( array(
499 "status" => 'duplicated'
500 ), $url ) );
501 wp_redirect( $url );
502 exit;
503 }
504 break;
505 case 'add':
506 include_once('partials/charts/actions/chart-builder-charts-actions.php');
507 break;
508 case 'edit':
509 include_once('partials/charts/actions/chart-builder-charts-actions.php');
510 break;
511 default:
512 include_once('partials/charts/chart-builder-charts-display.php');
513 }
514 }
515
516 public function display_plugin_setup_page(){
517 include_once('partials/chart-builder-admin-display.php');
518 }
519
520 public function display_plugin_addnew_page(){
521
522 // $url = remove_query_arg( array('action', 'id', '_wpnonce') );
523 // $url = esc_url_raw( add_query_arg( array(
524 // "action" => 'add'
525 // ), $url ) );
526 // wp_redirect( $url );
527 }
528
529 public function display_plugin_settings_page(){
530 include_once('partials/settings/chart-builder-settings.php');
531 }
532
533 public function display_plugin_featured_plugins_page(){
534 include_once('partials/features/chart-builder-plugin-featured-display.php');
535 }
536
537 public function display_plugin_chart_features_page(){
538 include_once('partials/features/chart-builder-features-display.php');
539 }
540
541 /**
542 * Add settings action link to the plugins page.
543 *
544 * @since 1.0.0
545 */
546 public function add_action_links( $links ){
547
548 $chart_ajax_deactivate_plugin_nonce = wp_create_nonce( 'chart-ajax-deactivate-plugin-nonce' );
549
550 /*
551 * Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name)
552 */
553 $settings_link = array(
554 '<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' . __('Settings', "chart-builder") . '</a>',
555 '<a href="https://ays-demo.com/chart-builder-demo/" target="_blank">' . __('Demo', "chart-builder") . '</a>',
556 // '<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>',
557 '<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>
558 <input type="hidden" id="chart_ajax_deactivate_plugin_nonce" name="chart_ajax_deactivate_plugin_nonce" value="' . $chart_ajax_deactivate_plugin_nonce .'">',
559 );
560 return array_merge( $settings_link, $links );
561
562 }
563
564
565 public static function set_screen($status, $option, $value){
566 return $value;
567 }
568
569 public function ays_admin_ajax(){
570 global $wpdb;
571
572 $response = array(
573 "status" => false
574 );
575
576 $function = isset($_REQUEST['function']) ? sanitize_text_field( $_REQUEST['function'] ) : null;
577
578 if($function !== null){
579 $response = array();
580 if( is_callable( array( $this, $function ) ) ){
581 $response = $this->$function();
582
583 ob_end_clean();
584 $ob_get_clean = ob_get_clean();
585 echo json_encode( $response );
586 wp_die();
587 }
588
589 }
590
591 ob_end_clean();
592 $ob_get_clean = ob_get_clean();
593 echo json_encode( $response );
594 wp_die();
595 }
596
597 public function deactivate_plugin_option(){
598 // Run a security check.
599 check_ajax_referer( 'chart-ajax-deactivate-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
600
601 // Check for permissions.
602 if ( ! current_user_can( 'manage_options' ) ) {
603 ob_end_clean();
604 $ob_get_clean = ob_get_clean();
605 echo json_encode(array(
606 'option' => ''
607 ));
608 wp_die();
609 }
610
611 if( is_user_logged_in() ) {
612 $request_value = isset( $_REQUEST['upgrade_plugin'] ) ? sanitize_text_field( $_REQUEST['upgrade_plugin'] ) : '';
613 $upgrade_option = get_option( 'ays_chart_builder_upgrade_plugin', '' );
614
615 if ( $upgrade_option === '' ) {
616 add_option( 'ays_chart_builder_upgrade_plugin', $request_value );
617 } else {
618 update_option( 'ays_chart_builder_upgrade_plugin', $request_value );
619 }
620
621 $response = array(
622 'option' => get_option( 'ays_chart_builder_upgrade_plugin', '' ),
623 );
624
625 wp_send_json_success( $response );
626 } else {
627 ob_end_clean();
628 $ob_get_clean = ob_get_clean();
629 echo json_encode(array(
630 'option' => ''
631 ));
632 wp_die();
633 }
634 }
635
636 public function chart_builder_admin_footer($a){
637 if(isset($_REQUEST['page'])){
638 if(false !== strpos( sanitize_text_field( $_REQUEST['page'] ), $this->plugin_name)){
639 ?>
640 <div class="ays-chart-footer-support-box">
641 <span class="ays-chart-footer-link-row"><a href="https://wordpress.org/support/plugin/chart-builder" target="_blank"><?php echo __( "Support", "chart-builder"); ?></a></span>
642 <span class="ays-chart-footer-slash-row">/</span>
643 <span class="ays-chart-footer-link-row"><a href="https://ays-pro.com/wordpress-chart-builder-plugin-user-manual" target="_blank"><?php echo __( "Docs", "chart-builder"); ?></a></span>
644 <span class="ays-chart-footer-slash-row">/</span>
645 <span class="ays-chart-footer-link-row"><a href="https://ays-demo.com/chart-builder-plugin-suggestion-box" target="_blank"><?php echo __( "Suggest a Feature", "chart-builder"); ?></a></span>
646 </div>
647 <p style="font-size:13px;text-align:center;font-style:italic;">
648 <span style="margin-left:0px;margin-right:10px;" class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
649 <span><?php echo esc_html(__( "If you love our plugin, please do big favor and rate us on", "chart-builder")); ?></span>
650 <a target="_blank" href='https://wordpress.org/support/plugin/chart-builder/reviews/'>WordPress.org</a>
651 <span class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
652 </p>
653 <?php
654 }
655 }
656 }
657
658 // Chart Builder Elementor widget init
659 public function chart_builder_el_widgets_registered() {
660 // We check if the Elementor plugin has been installed / activated.
661 if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
662 // get our own widgets up and running:
663 // copied from widgets-manager.php
664 if ( class_exists( 'Elementor\Plugin' ) ) {
665 if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
666 $elementor = Elementor\Plugin::instance();
667 if ( isset( $elementor->widgets_manager ) ) {
668 if ( method_exists( $elementor->widgets_manager, 'register_widget_type' ) ) {
669 wp_enqueue_style($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
670 $widget_file = 'plugins/elementor/chart-builder-elementor.php';
671 $template_file = locate_template( $widget_file );
672 if ( !$template_file || !is_readable( $template_file ) ) {
673 $template_file = CHART_BUILDER_DIR . 'pb_templates/chart-builder-elementor.php';
674 }
675 if ( $template_file && is_readable( $template_file ) ) {
676 require_once $template_file;
677 Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Elementor\Widget_Chart_Builder_Elementor() );
678 }
679 }
680 }
681 }
682 }
683 }
684 }
685
686 public function fetch_post_type_props(){
687 $nonce = isset( $_POST['nonce'] ) ? wp_verify_nonce( sanitize_text_field( $_POST['nonce'] ), 'cbuilder-fetch-post-type-props' ) : '';
688 if ( $nonce ) {
689 $results = CBFunctions()->get_post_type_properties( sanitize_text_field( $_POST['post_type'] ) );
690
691 return array(
692 'success' => true,
693 'fields' => $results,
694 );
695 }
696
697 return array(
698 'success' => false,
699 );
700 }
701
702 public static function get_max_id( $table ) {
703 global $wpdb;
704 $db_table = $wpdb->prefix . CHART_BUILDER_DB_PREFIX . $table;
705
706 $sql = "SELECT MAX(id) FROM {$db_table}";
707
708 $result = intval( $wpdb->get_var( $sql ) );
709
710 return $result;
711 }
712
713 public static function ays_restriction_string($type, $x, $length){
714 $output = "";
715 switch($type){
716 case "char":
717 if(strlen($x)<=$length){
718 $output = $x;
719 } else {
720 $output = substr($x,0,$length) . '...';
721 }
722 break;
723 case "word":
724 $res = explode(" ", $x);
725 if(count($res)<=$length){
726 $output = implode(" ",$res);
727 } else {
728 $res = array_slice($res,0,$length);
729 $output = implode(" ",$res) . '...';
730 }
731 break;
732 }
733 return $output;
734 }
735
736 public function ays_chart_sale_banner(){
737 // 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' )) {
738 // update_option('ays_chart_sale_btn', 1);
739 // update_option('ays_chart_sale_date', current_time( 'mysql' ));
740 // }
741
742 $ays_chart_sale_date = get_option('ays_chart_sale_date');
743
744 $val = 60*60*24*5;
745
746 $current_date = current_time( 'mysql' );
747 $date_diff = strtotime($current_date) - intval(strtotime($ays_chart_sale_date)) ;
748
749 $days_diff = $date_diff / $val;
750
751 if(intval($days_diff) > 0 ){
752 update_option('ays_chart_sale_btn', 0);
753 }
754
755 $ays_chart_builder_flag = intval(get_option('ays_chart_sale_btn'));
756 if( $ays_chart_builder_flag == 0 ){
757 if (isset($_GET['page']) && strpos($_GET['page'], CHART_BUILDER_NAME) !== false) {
758 if( !(Chart_Builder_Admin::get_max_id('charts') <= 1) ){
759 // $this->ays_chart_sale_message_30_emma($ays_chart_builder_flag);
760 // $this->ays_chart_sale_message20($ays_chart_builder_flag);
761 // $this->ays_chart_helloween_message($ays_chart_builder_flag);
762 // $this->ays_chart_black_friday_message($ays_chart_builder_flag);
763 // $this->ays_chart_christmas_message($ays_chart_builder_flag);
764 // $this->ays_chart_silver_bundle_message($ays_chart_builder_flag);
765 $this->ays_chart_black_friday_message_2024($ays_chart_builder_flag);
766 }
767 }
768 }
769 }
770
771 public function ays_chart_dismiss_button(){
772
773 $data = array(
774 'status' => false,
775 );
776
777 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_chart_dismiss_button') {
778 if( (isset( $_REQUEST['_ajax_nonce'] ) && wp_verify_nonce( $_REQUEST['_ajax_nonce'], $this->plugin_name . '-sale-banner' )) && current_user_can( 'manage_options' )){
779 update_option('ays_chart_sale_btn', 1);
780 update_option('ays_chart_sale_date', current_time( 'mysql' ));
781 $data['status'] = true;
782 }
783 }
784
785 ob_end_clean();
786 $ob_get_clean = ob_get_clean();
787 echo json_encode($data);
788 wp_die();
789
790 }
791
792 // 30% Sale Emma
793 public function ays_chart_sale_message_30_emma($ishmar){
794 if($ishmar == 0 ){
795 $content = array();
796 $content[] = '<div id="ays-chart-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_chart_dicount_info">';
797 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
798
799 $content[] = '<div class="ays-chart-discount-box-sale-image"></div>';
800 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
801
802 $content[] = '<div class="ays-chart-dicount-wrap-text-box-texts">';
803 $content[] = '<div>
804 <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;">
805 <span class="ays-chart-new-mega-bundle-limited-text">Limited</span> Offer for Chart Builder </a> <br>
806 </div>';
807 $content[] = '</div>';
808
809 $content[] = '<div style="font-size: 17px;">';
810 $content[] = '<img style="width: 24px;height: 24px;" src="' . esc_attr(CHART_BUILDER_ADMIN_URL) . '/images/icons/guarantee-new.png">';
811 $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>';
812
813 $content[] = '</div>';
814
815
816
817 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
818
819 $content[] = '<form action="" method="POST">';
820 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
821 if( current_user_can( 'manage_options' ) ){
822 $content[] = '<button class="btn btn-link ays-button" name="ays_chart_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B;
823 ">Dismiss ad</button>';
824 $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
825 }
826 $content[] = '</div>';
827 $content[] = '</form>';
828
829 $content[] = '</div>';
830
831 $content[] = '</div>';
832
833 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
834
835 $content[] = '<div id="ays-chart-countdown-main-container">';
836 $content[] = '<div class="ays-chart-countdown-container">';
837
838 $content[] = '<div id="ays-chart-countdown">';
839
840 $content[] = '<div style="font-weight: 500;">';
841 $content[] = __( "Offer ends in:", "chart-builder" );
842 $content[] = '</div>';
843
844 $content[] = '<ul>';
845 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
846 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
847 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
848 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
849 $content[] = '</ul>';
850 $content[] = '</div>';
851
852 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
853 $content[] = '<span>🚀</span>';
854 $content[] = '<span>⌛</span>';
855 $content[] = '<span>🔥</span>';
856 $content[] = '<span>💣</span>';
857 $content[] = '</div>';
858
859 $content[] = '</div>';
860 $content[] = '</div>';
861
862 $content[] = '</div>';
863
864 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
865 $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>';
866 $content[] = '<span >One-time payment</span>';
867 $content[] = '</div>';
868 $content[] = '</div>';
869 $content[] = '</div>';
870
871 $content = implode( '', $content );
872 echo html_entity_decode(esc_html( $content ));
873 }
874 }
875
876 // Self 20% sale
877 public static function ays_chart_sale_message20($ishmar){
878 if($ishmar == 0 ){
879 $content = array();
880
881 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
882 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
883 // $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>';
884
885 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
886
887 $content[] = '<div class="ays-chart-dicount-sale-name-discount-box">';
888 $content[] = '<span class="ays-chart-new-chart-pro-title">';
889 $content[] = __( "<span><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:#ffffff; text-decoration: underline;'>Chart Builder</a></span>", CHART_BUILDER_NAME );
890 $content[] = '</span>';
891 $content[] = '<div>';
892 $content[] = '<img src="' . CHART_BUILDER_ADMIN_URL . '/images/ays-chart-banner-sale-30.svg" style="width: 70px;">';
893 $content[] = '</div>';
894 $content[] = '</div>';
895
896 $content[] = '<span class="ays-chart-new-chart-pro-desc">';
897 $content[] = '<img class="ays-chart-new-chart-pro-guaranteeicon" src="' . CHART_BUILDER_ADMIN_URL . '/images/chart-builder-guaranteeicon.webp" style="width: 30px;">';
898 $content[] = __( "30 Days Money Back Guarantee", CHART_BUILDER_NAME );
899 $content[] = '</span>';
900
901 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-chart">';
902 $content[] = '<form method="POST">';
903 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
904 if (current_user_can( 'manage_options' )) {
905 $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>';
906 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
907 }
908 $content[] = '</div>';
909 $content[] = '</form>';
910 $content[] = '</div>';
911
912 $content[] = '</div>';
913
914 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
915
916 $content[] = '<div id="ays-chart-countdown-main-container">';
917 $content[] = '<div class="ays-chart-countdown-container">';
918 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
919 $content[] = __( "Offer ends in:", CHART_BUILDER_NAME );
920
921 $content[] = '<ul style="padding: 0">';
922 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . __( 'Days', CHART_BUILDER_NAME ) . '</li>';
923 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . __( 'Hours', CHART_BUILDER_NAME ) . '</li>';
924 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . __( 'Minutes', CHART_BUILDER_NAME ) . '</li>';
925 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . __( 'Seconds', CHART_BUILDER_NAME ) . '</li>';
926 $content[] = '</ul>';
927 $content[] = '</div>';
928
929 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
930 $content[] = '<span>🚀</span>';
931 $content[] = '<span>⌛</span>';
932 $content[] = '<span>🔥</span>';
933 $content[] = '<span>💣</span>';
934 $content[] = '</div>';
935 $content[] = '</div>';
936 $content[] = '</div>';
937
938 $content[] = '</div>';
939
940 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
941 $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" style="" >' . __( 'Buy Now', CHART_BUILDER_NAME ) . '</a>';
942 $content[] = '<span class="ays-chart-dicount-one-time-text">';
943 $content[] = __( "One-time payment", CHART_BUILDER_NAME );
944 $content[] = '</span>';
945 $content[] = '</div>';
946
947 $content[] = '</div>';
948
949 $content[] = '</div>';
950
951 $content = implode( '', $content );
952 echo $content;
953 }
954 }
955
956 // Helloween banner
957 public static function ays_chart_helloween_message($ishmar){
958 if($ishmar == 0 ){
959 $content = array();
960
961 $content[] = '<div id="ays-chart-dicount-month-main-helloween" class="notice notice-success is-dismissible ays_chart_dicount_info">';
962 $content[] = '<div id="ays-chart-dicount-month-helloween" class="ays_chart_dicount_month_helloween">';
963 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-limited">';
964
965 $content[] = '<p>';
966 $content[] = __( "Limited Time
967 <span class='ays-chart-dicount-wrap-color-helloween' style='color:#b2ff00;'>30%</span>
968 <span>
969 SALE on
970 </span>
971 <br>
972 <span style='' class='ays-chart-helloween-bundle'>
973 <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;'>
974 Chart Builder
975 </a>
976 </span>", CHART_BUILDER_NAME );
977 $content[] = '</p>';
978 $content[] = '<p>';
979 $content[] = __( "Hurry up!
980 <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;'>
981 Check it out!
982 </a>", CHART_BUILDER_NAME );
983 $content[] = '</p>';
984
985 $content[] = '</div>';
986
987
988 $content[] = '<div class="ays-chart-helloween-bundle-buy-now-timer">';
989 $content[] = '<div class="ays-chart-dicount-wrap-box-helloween-timer">';
990 $content[] = '<div id="ays-chart-countdown-main-container" class="ays-chart-countdown-main-container-helloween">';
991 $content[] = '<div class="ays-chart-countdown-container-helloween">';
992 $content[] = '<div id="ays-chart-countdown">';
993 $content[] = '<ul>';
994 $content[] = '<li><p><span id="ays-chart-countdown-days"></span><span>days</span></p></li>';
995 $content[] = '<li><p><span id="ays-chart-countdown-hours"></span><span>Hours</span></p></li>';
996 $content[] = '<li><p><span id="ays-chart-countdown-minutes"></span><span>Mins</span></p></li>';
997 $content[] = '<li><p><span id="ays-chart-countdown-seconds"></span><span>Secs</span></p></li>';
998 $content[] = '</ul>';
999 $content[] = '</div>';
1000
1001 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1002 $content[] = '<span>🚀</span>';
1003 $content[] = '<span>⌛</span>';
1004 $content[] = '<span>🔥</span>';
1005 $content[] = '<span>💣</span>';
1006 $content[] = '</div>';
1007
1008 $content[] = '</div>';
1009
1010 $content[] = '</div>';
1011
1012 $content[] = '</div>';
1013 $content[] = '<div class="ays-chart-dicount-wrap-box ays-buy-now-button-box-helloween">';
1014 $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_NAME ) . '</a>';
1015 $content[] = '</div>';
1016 $content[] = '</div>';
1017
1018 $content[] = '</div>';
1019
1020 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-helloween">';
1021 $content[] = '<form method="POST">';
1022 $content[] = '<div id="ays-chart-dismiss-buttons-content-helloween">';
1023 if( current_user_can( 'manage_options' ) ){
1024 $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>';
1025 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1026 }
1027 $content[] = '</div>';
1028 $content[] = '</form>';
1029
1030 $content[] = '</div>';
1031 // $content[] = '<button type="button" class="notice-dismiss">';
1032 // $content[] = '</button>';
1033 $content[] = '</div>';
1034
1035 $content = implode( '', $content );
1036
1037 echo $content;
1038 }
1039 }
1040
1041 // Black Friday banner
1042 public static function ays_chart_black_friday_message($ishmar){
1043 if($ishmar == 0 ){
1044 $content = array();
1045
1046 $content[] = '<div id="ays-chart-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1047 $content[] = '<div id="ays-chart-dicount-black-friday-month" class="ays_chart_dicount_month">';
1048 $content[] = '<div class="ays-chart-dicount-black-friday-box">';
1049 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-box-80" style="width: 70%;">';
1050 $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>';
1051 $content[] = '<div class="ays-chart-dicount-black-friday-title-row">' . __( 'Chart Builder plugin', "chart-builder" ) . '</div>';
1052 $content[] = '</div>';
1053
1054 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box ays-chart-dicount-black-friday-wrap-text-box">';
1055 $content[] = '<div class="ays-chart-dicount-black-friday-text-row">' . __( '20% off', "chart-builder" ) . '</div>';
1056 $content[] = '</div>';
1057
1058 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1059 $content[] = '<div id="ays-chart-countdown-main-container">';
1060 $content[] = '<div class="ays-chart-countdown-container">';
1061 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1062 $content[] = '<ul>';
1063 $content[] = '<li><span id="ays-chart-countdown-days">0</span>' . __( 'Days', "chart-builder" ) . '</li>';
1064 $content[] = '<li><span id="ays-chart-countdown-hours">0</span>' . __( 'Hours', "chart-builder" ) . '</li>';
1065 $content[] = '<li><span id="ays-chart-countdown-minutes">0</span>' . __( 'Minutes', "chart-builder" ) . '</li>';
1066 $content[] = '<li><span id="ays-chart-countdown-seconds">0</span>' . __( 'Seconds', "chart-builder" ) . '</li>';
1067 $content[] = '</ul>';
1068 $content[] = '</div>';
1069 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1070 $content[] = '<span>🚀</span>';
1071 $content[] = '<span>⌛</span>';
1072 $content[] = '<span>🔥</span>';
1073 $content[] = '<span>💣</span>';
1074 $content[] = '</div>';
1075 $content[] = '</div>';
1076 $content[] = '</div>';
1077 $content[] = '</div>';
1078
1079 $content[] = '<div class="ays-chart-dicount-black-friday-wrap-box" style="width: 25%;">';
1080 $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>';
1081 $content[] = '</div>';
1082 $content[] = '</div>';
1083 $content[] = '</div>';
1084
1085 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-black-friday">';
1086 $content[] = '<form method="POST">';
1087 $content[] = '<div id="ays-chart-dismiss-buttons-content-black-friday">';
1088 if( current_user_can( 'manage_options' ) ){
1089 $content[] = '<button class="btn btn-link ays-button-black-friday" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', "chart-builder" ) . '</button>';
1090 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1091 }
1092 $content[] = '</div>';
1093 $content[] = '</form>';
1094 $content[] = '</div>';
1095 $content[] = '</div>';
1096
1097 $content = implode( '', $content );
1098
1099 echo $content;
1100 }
1101 }
1102
1103 // Christmas banner
1104 public static function ays_chart_christmas_message($ishmar){
1105 if($ishmar == 0 ){
1106 $content = array();
1107
1108 $content[] = '<div id="ays-chart-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1109 $content[] = '<div id="ays-chart-dicount-christmas-month" class="ays_chart_dicount_month">';
1110 $content[] = '<div class="ays-chart-dicount-christmas-box">';
1111 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box ays-chart-dicount-christmas-wrap-box-80">';
1112 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Limited Time', CHART_BUILDER_NAME ) .' '. '<a href="https://ays-pro.com/wordpress/chart-builder" class="ays-chart-dicount-christmas-button-sale" target="_blank">' . __( '40%', CHART_BUILDER_NAME ) . '</a>' . ' SALE</div>';
1113 $content[] = '<div class="ays-chart-dicount-christmas-title-row">' . __( 'Chart Builder Plugin', CHART_BUILDER_NAME ) . '</div>';
1114 $content[] = '</div>';
1115
1116 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1117 $content[] = '<div id="ays-chart-countdown-main-container">';
1118 $content[] = '<div class="ays-chart-countdown-container">';
1119 $content[] = '<div id="ays-chart-countdown" style="display: block;">';
1120 $content[] = '<ul>';
1121 $content[] = '<li><span id="ays-chart-countdown-days"></span>' . __( 'Days', CHART_BUILDER_NAME ) . '</li>';
1122 $content[] = '<li><span id="ays-chart-countdown-hours"></span>' . __( 'Hours', CHART_BUILDER_NAME ) . '</li>';
1123 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>' . __( 'Minutes', CHART_BUILDER_NAME ) . '</li>';
1124 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>' . __( 'Seconds', CHART_BUILDER_NAME ) . '</li>';
1125 $content[] = '</ul>';
1126 $content[] = '</div>';
1127 $content[] = '<div id="ays-chart-countdown-content" class="emoji" style="display: none;">';
1128 $content[] = '<span>🚀</span>';
1129 $content[] = '<span>⌛</span>';
1130 $content[] = '<span>🔥</span>';
1131 $content[] = '<span>💣</span>';
1132 $content[] = '</div>';
1133 $content[] = '</div>';
1134 $content[] = '</div>';
1135 $content[] = '</div>';
1136
1137 $content[] = '<div class="ays-chart-dicount-christmas-wrap-box" style="width: 25%;">';
1138 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder" class="ays-chart-dicount-christmas-button-buy-now" target="_blank">' . __( 'BUY NOW!', CHART_BUILDER_NAME ) . '</a>';
1139 $content[] = '</div>';
1140 $content[] = '</div>';
1141 $content[] = '</div>';
1142
1143 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form-christmas">';
1144 $content[] = '<form method="POST">';
1145 $content[] = '<div id="ays-chart-dismiss-buttons-content-christmas">';
1146 $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_chart_sale_btn" style="">' . __( 'Dismiss ad', CHART_BUILDER_NAME ) . '</button>';
1147 $content[] = '</div>';
1148 $content[] = '</form>';
1149 $content[] = '</div>';
1150 $content[] = '</div>';
1151
1152 $content = implode( '', $content );
1153
1154 echo $content;
1155 }
1156 }
1157
1158 // Silver Bundle
1159 public function ays_chart_silver_bundle_message($ishmar){
1160 if($ishmar == 0 ){
1161 $content = array();
1162
1163 $content[] = '<div id="ays-chart-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1164 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1165 $content[] = '<a href="https://ays-pro.com/silver-bundle" target="_blank" class="ays-chart-sale-banner-link"><img src="' . CHART_BUILDER_ADMIN_URL . '/images/silver_bundle_logo_box.png"></a>';
1166
1167 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1168
1169 $content[] = '<strong style="font-weight: bold;">';
1170 $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_NAME );
1171 $content[] = '</strong>';
1172
1173 $content[] = '<br>';
1174
1175 $content[] = '<strong>';
1176 $content[] = __( "Hurry up! <a href='https://ays-pro.com/silver-bundle' target='_blank'>Check it out!</a>", CHART_BUILDER_NAME );
1177 $content[] = '</strong>';
1178
1179 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1180
1181 $content[] = '<form method="POST">';
1182 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1183 $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>';
1184 $content[] = '</div>';
1185 $content[] = '</form>';
1186
1187 $content[] = '</div>';
1188
1189 $content[] = '</div>';
1190
1191 $content[] = '<div class="ays-chart-dicount-wrap-box">';
1192
1193 $content[] = '<div id="ays-chart-countdown-main-container">';
1194 $content[] = '<div class="ays-chart-countdown-container">';
1195
1196 $content[] = '<div id="ays-chart-countdown">';
1197 $content[] = '<ul>';
1198 $content[] = '<li><span id="ays-chart-countdown-days"></span>days</li>';
1199 $content[] = '<li><span id="ays-chart-countdown-hours"></span>Hours</li>';
1200 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>Minutes</li>';
1201 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>Seconds</li>';
1202 $content[] = '</ul>';
1203 $content[] = '</div>';
1204
1205 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1206 $content[] = '<span>🚀</span>';
1207 $content[] = '<span>⌛</span>';
1208 $content[] = '<span>🔥</span>';
1209 $content[] = '<span>💣</span>';
1210 $content[] = '</div>';
1211
1212 $content[] = '</div>';
1213 $content[] = '</div>';
1214
1215 $content[] = '</div>';
1216
1217 $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_NAME ) . '</a>';
1218 $content[] = '</div>';
1219 $content[] = '</div>';
1220
1221 $content = implode( '', $content );
1222 echo $content;
1223 }
1224 }
1225
1226 // Black Friday 2024
1227 public function ays_chart_black_friday_message_2024($ishmar){
1228 if($ishmar == 0 ){
1229 $content = array();
1230
1231 $content[] = '<div id="ays-chart-black-friday-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1232 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1233
1234 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1235
1236 $content[] = '<div id="ays-chart-countdown-main-container">';
1237 $content[] = '<div class="ays-chart-countdown-container">';
1238
1239 $content[] = '<div id="ays-chart-countdown">';
1240
1241 $content[] = '<div>';
1242 $content[] = __( "Offer ends in:", CHART_BUILDER_NAME );
1243 $content[] = '</div>';
1244
1245 $content[] = '<ul>';
1246 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", CHART_BUILDER_NAME ) .'</li>';
1247 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", CHART_BUILDER_NAME ) .'</li>';
1248 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", CHART_BUILDER_NAME ) .'</li>';
1249 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", CHART_BUILDER_NAME ) .'</li>';
1250 $content[] = '</ul>';
1251 $content[] = '</div>';
1252
1253 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1254 $content[] = '<span></span>';
1255 $content[] = '<span></span>';
1256 $content[] = '<span></span>';
1257 $content[] = '<span></span>';
1258 $content[] = '</div>';
1259
1260 $content[] = '</div>';
1261 $content[] = '</div>';
1262
1263 $content[] = '</div>';
1264
1265 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1266 $content[] = '<div>';
1267
1268 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1269 $content[] = __( "<span><a href='https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-sale-banner' class='ays-chart-black-friday-bundle-title-link' target='_blank'>Black Friday Sale</a></span>", CHART_BUILDER_NAME );
1270 $content[] = '</span>';
1271
1272 $content[] = '</br>';
1273
1274 $content[] = '<span class="ays-chart-black-friday-bundle-desc">';
1275 $content[] = '<a class="ays-chart-black-friday-bundle-desc" href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-sale-banner" class="ays-chart-black-friday-bundle-title-link" target="_blank">';
1276 $content[] = __( "20% OFF", CHART_BUILDER_NAME );
1277 $content[] = '</a>';
1278 $content[] = '</span>';
1279 $content[] = '</div>';
1280
1281 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1282
1283 $content[] = '<form action="" method="POST">';
1284 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1285 if( current_user_can( 'manage_options' ) ){
1286 $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_NAME ) .'</button>';
1287 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1288 }
1289 $content[] = '</div>';
1290 $content[] = '</form>';
1291
1292 $content[] = '</div>';
1293
1294 $content[] = '</div>';
1295
1296 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-black-friday-bundle-coupon-text-box">';
1297 $content[] = '<div class="ays-chart-black-friday-bundle-coupon-row">';
1298 $content[] = 'bfdeal20off';
1299 $content[] = '</div>';
1300
1301 $content[] = '<div class="ays-chart-black-friday-bundle-text-row">';
1302 $content[] = __( '20% Extra Discount Coupon', CHART_BUILDER_NAME );
1303 $content[] = '</div>';
1304 $content[] = '</div>';
1305
1306 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1307 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-sale-banner" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', CHART_BUILDER_NAME ) . '</a>';
1308 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1309 $content[] = __( "One-time payment", CHART_BUILDER_NAME );
1310 $content[] = '</span>';
1311 $content[] = '</div>';
1312 $content[] = '</div>';
1313 $content[] = '</div>';
1314
1315 $content = implode( '', $content );
1316 echo $content;
1317 }
1318 }
1319
1320
1321 public function ays_chart_update_banner_time(){
1322
1323 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
1324 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
1325 $next_3_days = date('M d, Y H:i:s', $date);
1326
1327 $ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1328
1329 if ( !$ays_chart_banner_time || is_null( $ays_chart_banner_time ) ) {
1330 update_option('ays_chart_20_bundle_banner_time', $next_3_days );
1331 }
1332
1333 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1334
1335 $val = 60*60*24*0.5; // half day
1336 // $val = 60; // for testing | 1 min
1337
1338 $current_date = current_time( 'mysql' );
1339 $date_diff = strtotime($current_date) - intval(strtotime($get_ays_chart_banner_time));
1340
1341 $days_diff = $date_diff / $val;
1342 if(intval($days_diff) > 0 ){
1343 update_option('ays_chart_20_bundle_banner_time', $next_3_days);
1344 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1345 }
1346
1347 return $get_ays_chart_banner_time;
1348 }
1349
1350 public function author_user_search() {
1351 check_ajax_referer( 'cbuilder-author-user-search', 'security' );
1352 $params = $_REQUEST['params'];
1353 $search = isset($params['search']) && $params['search'] != '' ? sanitize_text_field( $params['search'] ) : null;
1354 $checked = isset($params['val']) && $params['val'] !='' ? sanitize_text_field( $params['val'] ) : null;
1355 $args = 'search=';
1356 if ($search !== null) {
1357 $args .= '*';
1358 $args .= $search;
1359 $args .= '*';
1360 }
1361
1362 $users = get_users($args);
1363
1364 $content_text = array(
1365 'results' => array()
1366 );
1367
1368 foreach ($users as $key => $value) {
1369 if ($checked !== null) {
1370 if ( !is_array( $checked ) ) {
1371 $checked2 = $checked;
1372 $checked = array();
1373 $checked[] = absint($checked2);
1374 }
1375 if (in_array($value->ID, $checked)) {
1376 continue;
1377 } else {
1378 $content_text['results'][] = array(
1379 'id' => $value->ID,
1380 'text' => $value->data->display_name,
1381 );
1382 }
1383 } else {
1384 $content_text['results'][] = array(
1385 'id' => $value->ID,
1386 'text' => $value->data->display_name,
1387 );
1388 }
1389 }
1390
1391 ob_end_clean();
1392 echo json_encode($content_text);
1393 wp_die();
1394 }
1395
1396 /**
1397 * Determine if the plugin/addon installations are allowed.
1398 *
1399 * @since 6.4.0.4
1400 *
1401 * @param string $type Should be `plugin` or `addon`.
1402 *
1403 * @return bool
1404 */
1405 public static function ays_chart_can_install( $type ) {
1406
1407 return self::ays_chart_can_do( 'install', $type );
1408 }
1409
1410 /**
1411 * Determine if the plugin/addon activations are allowed.
1412 *
1413 * @since 6.4.0.4
1414 *
1415 * @param string $type Should be `plugin` or `addon`.
1416 *
1417 * @return bool
1418 */
1419 public static function ays_chart_can_activate( $type ) {
1420
1421 return self::ays_chart_can_do( 'activate', $type );
1422 }
1423
1424 /**
1425 * Determine if the plugin/addon installations/activations are allowed.
1426 *
1427 * @since 6.4.0.4
1428 *
1429 * @param string $what Should be 'activate' or 'install'.
1430 * @param string $type Should be `plugin` or `addon`.
1431 *
1432 * @return bool
1433 */
1434 public static function ays_chart_can_do( $what, $type ) {
1435
1436 if ( ! in_array( $what, array( 'install', 'activate' ), true ) ) {
1437 return false;
1438 }
1439
1440 if ( ! in_array( $type, array( 'plugin', 'addon' ), true ) ) {
1441 return false;
1442 }
1443
1444 $capability = $what . '_plugins';
1445
1446 if ( ! current_user_can( $capability ) ) {
1447 return false;
1448 }
1449
1450 // Determine whether file modifications are allowed and it is activation permissions checking.
1451 if ( $what === 'install' && ! wp_is_file_mod_allowed( 'ays_chart_can_install' ) ) {
1452 return false;
1453 }
1454
1455 // All plugin checks are done.
1456 if ( $type === 'plugin' ) {
1457 return true;
1458 }
1459 return false;
1460 }
1461
1462 /**
1463 * Activate plugin.
1464 *
1465 * @since 1.0.0
1466 * @since 6.4.0.4 Updated the permissions checking.
1467 */
1468 public function ays_chart_activate_plugin() {
1469
1470 // Run a security check.
1471 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1472
1473 // Check for permissions.
1474 if ( ! current_user_can( 'activate_plugins' ) ) {
1475 wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', 'chart-builder' ) );
1476 }
1477
1478 $type = 'addon';
1479
1480 if ( isset( $_POST['plugin'] ) ) {
1481
1482 if ( ! empty( $_POST['type'] ) ) {
1483 $type = sanitize_key( $_POST['type'] );
1484 }
1485
1486 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
1487 $activate = activate_plugins( $plugin );
1488
1489 if ( ! is_wp_error( $activate ) ) {
1490 if ( $type === 'plugin' ) {
1491 wp_send_json_success( esc_html__( 'Plugin activated.', 'chart-builder' ) );
1492 } else {
1493 ( esc_html__( 'Addon activated.', 'chart-builder' ) );
1494 }
1495 }
1496 }
1497
1498 if ( $type === 'plugin' ) {
1499 wp_send_json_error( esc_html__( 'Could not activate the plugin. Please activate it on the Plugins page.', 'chart-builder' ) );
1500 }
1501
1502 wp_send_json_error( esc_html__( 'Could not activate the addon. Please activate it on the Plugins page.', 'chart-builder' ) );
1503 }
1504
1505 /**
1506 * Install addon.
1507 *
1508 * @since 1.0.0
1509 * @since 6.4.0.4 Updated the permissions checking.
1510 */
1511 public function ays_chart_install_plugin() {
1512
1513 // Run a security check.
1514 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1515
1516 $generic_error = esc_html__( 'There was an error while performing your request.', 'chart-builder' );
1517 $type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
1518
1519 // Check if new installations are allowed.
1520 if ( ! self::ays_chart_can_install( $type ) ) {
1521 wp_send_json_error( $generic_error );
1522 }
1523
1524 $error = $type === 'plugin'
1525 ? esc_html__( 'Could not install the plugin. Please download and install it manually.', 'chart-builder' )
1526 : "";
1527
1528 $plugin_url = ! empty( $_POST['plugin'] ) ? esc_url_raw( wp_unslash( $_POST['plugin'] ) ) : '';
1529
1530 if ( empty( $plugin_url ) ) {
1531 wp_send_json_error( $error );
1532 }
1533
1534 // Prepare variables.
1535 $url = esc_url_raw(
1536 add_query_arg(
1537 [
1538 'page' => 'chart-builder-featured-plugins',
1539 ],
1540 admin_url( 'admin.php' )
1541 )
1542 );
1543
1544 ob_start();
1545 $creds = request_filesystem_credentials( $url, '', false, false, null );
1546
1547 // Hide the filesystem credentials form.
1548 ob_end_clean();
1549
1550 // Check for file system permissions.
1551 if ( $creds === false ) {
1552 wp_send_json_error( $error );
1553 }
1554
1555 if ( ! WP_Filesystem( $creds ) ) {
1556 wp_send_json_error( $error );
1557 }
1558
1559 /*
1560 * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
1561 */
1562 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-upgrader.php';
1563 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-install-skin.php';
1564 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-skin.php';
1565
1566
1567 // Do not allow WordPress to search/download translations, as this will break JS output.
1568 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1569
1570 // Create the plugin upgrader with our custom skin.
1571 $installer = new ChartBuilder\Helpers\ChartBuilderPluginSilentUpgrader( new Chart_Builder_Install_Skin() );
1572
1573 // Error check.
1574 if ( ! method_exists( $installer, 'install' ) ) {
1575 wp_send_json_error( $error );
1576 }
1577
1578 $installer->install( $plugin_url );
1579
1580 // Flush the cache and return the newly installed plugin basename.
1581 wp_cache_flush();
1582
1583 $plugin_basename = $installer->plugin_info();
1584
1585 if ( empty( $plugin_basename ) ) {
1586 wp_send_json_error( $error );
1587 }
1588
1589 $result = array(
1590 'msg' => $generic_error,
1591 'is_activated' => false,
1592 'basename' => $plugin_basename,
1593 );
1594
1595 // Check for permissions.
1596 if ( ! current_user_can( 'activate_plugins' ) ) {
1597 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed.', 'chart-builder' ) : "";
1598
1599 wp_send_json_success( $result );
1600 }
1601
1602 // Activate the plugin silently.
1603 $activated = activate_plugin( $plugin_basename );
1604 remove_action( 'activated_plugin', array( 'ays_sccp_activation_redirect_method', 'gallery_p_gallery_activation_redirect_method', 'poll_maker_activation_redirect_method' ), 100 );
1605
1606 if ( ! is_wp_error( $activated ) ) {
1607
1608 $result['is_activated'] = true;
1609 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed and activated.', 'chart-builder' ) : esc_html__( 'Addon installed and activated.', 'chart-builder' );
1610
1611 wp_send_json_success( $result );
1612 }
1613
1614 // Fallback error just in case.
1615 wp_send_json_error( $result );
1616 }
1617
1618 /**
1619 * List of AM plugins that we propose to install.
1620 *
1621 * @since 6.4.0.4
1622 *
1623 * @return array
1624 */
1625 protected function get_am_plugins() {
1626 if ( !isset( $_SESSION ) ) {
1627 session_start();
1628 }
1629
1630 $images_url = CHART_BUILDER_ADMIN_URL . '/images/icons/';
1631
1632 $plugin_slug = array(
1633 'quiz-maker',
1634 'survey-maker',
1635 'poll-maker',
1636 'ays-popup-box',
1637 'secure-copy-content-protection',
1638 'gallery-photo-gallery',
1639 'ays-chatgpt-assistant',
1640 'easy-form',
1641 );
1642
1643 $plugin_url_arr = array();
1644 foreach ($plugin_slug as $key => $slug) {
1645 if ( isset( $_SESSION['ays_chart_our_product_links'] ) && !empty( $_SESSION['ays_chart_our_product_links'] )
1646 && isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && !empty( $_SESSION['ays_chart_our_product_links'][$slug] ) ) {
1647 $plugin_url = (isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && $_SESSION['ays_chart_our_product_links'][$slug] != "") ? esc_url( $_SESSION['ays_chart_our_product_links'][$slug] ) : "";
1648 } else {
1649 $latest_version = $this->ays_chart_get_latest_plugin_version($slug);
1650 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.zip';
1651 if ( $latest_version != '' ) {
1652 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.'. $latest_version .'.zip';
1653 $_SESSION['ays_chart_our_product_links'][$slug] = $plugin_url;
1654 }
1655 }
1656
1657 $plugin_url_arr[$slug] = $plugin_url;
1658 }
1659
1660 $plugins_array = array(
1661 'quiz-maker/quiz-maker.php' => array(
1662 'icon' => $images_url . 'icon-quiz-128x128.png',
1663 'name' => __( 'Quiz Maker', "easy-form" ),
1664 'desc' => __( 'Create powerful and engaging quizzes, tests, and exams in minutes.', "easy-form" ),
1665 'desc_hidden' => __( 'Build an unlimited number of quizzes and questions.', "easy-form" ),
1666 'wporg' => 'https://wordpress.org/plugins/quiz-maker/',
1667 'buy_now' => 'https://ays-pro.com/wordpress/quiz-maker/',
1668 'url' => $plugin_url_arr['quiz-maker'],
1669 ),
1670 'survey-maker/survey-maker.php' => array(
1671 'icon' => $images_url . 'icon-survey-128x128.png',
1672 'name' => __( 'Survey Maker', 'chart-builder' ),
1673 'desc' => __( 'Make amazing online surveys and get real-time feedback quickly and easily.', 'chart-builder' ),
1674 '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' ),
1675 'wporg' => 'https://wordpress.org/plugins/survey-maker/',
1676 'buy_now' => 'https://ays-pro.com/wordpress/survey-maker',
1677 'url' => $plugin_url_arr['survey-maker'],
1678 ),
1679 'poll-maker/poll-maker-ays.php' => array(
1680 'icon' => $images_url . 'icon-poll-128x128.png',
1681 'name' => __( 'Poll Maker', 'chart-builder' ),
1682 'desc' => __( 'Create amazing online polls for your WordPress website super easily.', 'chart-builder' ),
1683 'desc_hidden' => __( 'Build up various types of polls in a minute and get instant feedback on any topic or product.', 'chart-builder' ),
1684 'wporg' => 'https://wordpress.org/plugins/poll-maker/',
1685 'buy_now' => 'https://ays-pro.com/wordpress/poll-maker/',
1686 'url' => $plugin_url_arr['poll-maker'],
1687 ),
1688 'ays-popup-box/ays-pb.php' => array(
1689 'icon' => $images_url . 'icon-popup-128x128.png',
1690 'name' => __( 'Popup Box', 'chart-builder' ),
1691 'desc' => __( 'Popup everything you want! Create informative and promotional popups all in one plugin.', 'chart-builder' ),
1692 'desc_hidden' => __( 'Attract your visitors and convert them into email subscribers and paying customers.', 'chart-builder' ),
1693 'wporg' => 'https://wordpress.org/plugins/ays-popup-box/',
1694 'buy_now' => 'https://ays-pro.com/wordpress/popup-box/',
1695 'url' => $plugin_url_arr['ays-popup-box'],
1696 ),
1697 'secure-copy-content-protection/secure-copy-content-protection.php' => array(
1698 'icon' => $images_url . 'icon-sccp-128x128.png',
1699 'name' => __( 'Secure Copy Content Protection', 'chart-builder' ),
1700 'desc' => __( 'Disable the right click, copy paste, content selection and copy shortcut keys on your website.', 'chart-builder' ),
1701 'desc_hidden' => __( 'Protect web content from being plagiarized. Prevent plagiarism from your website with this easy to use plugin.', 'chart-builder' ),
1702 'wporg' => 'https://wordpress.org/plugins/secure-copy-content-protection/',
1703 'buy_now' => 'https://ays-pro.com/wordpress/secure-copy-content-protection/',
1704 'url' => $plugin_url_arr['secure-copy-content-protection'],
1705 ),
1706 'gallery-photo-gallery/gallery-photo-gallery.php' => array(
1707 'icon' => $images_url . 'icon-gallery-128x128.jpg',
1708 'name' => __( 'Gallery Photo Gallery', 'chart-builder' ),
1709 'desc' => __( 'Create unlimited galleries and include unlimited images in those galleries.', 'chart-builder' ),
1710 'desc_hidden' => __( 'Represent images in an attractive way. Attract people with your own single and multiple free galleries from your photo library.', 'chart-builder' ),
1711 'wporg' => 'https://wordpress.org/plugins/gallery-photo-gallery/',
1712 'buy_now' => 'https://ays-pro.com/wordpress/photo-gallery/',
1713 'url' => $plugin_url_arr['gallery-photo-gallery'],
1714 ),
1715 'ays-chatgpt-assistant/ays-chatgpt-assistant.php' => array(
1716 'icon' => $images_url . 'icon-chatgpt-128x128.png',
1717 'name' => __( 'AI Assistant with ChatGPT', 'chart-builder' ),
1718 'desc' => __( 'ChatGPT AI Assistant plugin gives you the ability to automate various tasks related to content creation and programming.', 'chart-builder' ),
1719 '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' ),
1720 'wporg' => 'https://wordpress.org/plugins/ays-chatgpt-assistant/',
1721 'buy_now' => 'https://ays-pro.com/wordpress/chatgpt-assistant',
1722 'url' => $plugin_url_arr['ays-chatgpt-assistant'],
1723 ),
1724 'easy-form/easy-form.php' => array(
1725 'icon' => $images_url . 'icon-form-128x128.png',
1726 'name' => __( 'Easy Form', 'chart-builder' ),
1727 'desc' => __( 'Choose the best WordPress form builder plugin. ', 'chart-builder' ),
1728 'desc_hidden' => __( 'Create contact forms, payment forms, surveys, and many more custom forms. Build forms easily with us.', 'chart-builder' ),
1729 'wporg' => 'https://wordpress.org/plugins/easy-form/',
1730 'buy_now' => 'https://ays-pro.com/wordpress/easy-form',
1731 'url' => $plugin_url_arr['easy-form'],
1732 ),
1733 );
1734
1735 return $plugins_array;
1736 }
1737
1738 protected function ays_chart_get_latest_plugin_version( $slug ){
1739
1740 if ( is_null( $slug ) || empty($slug) ) {
1741 return "";
1742 }
1743
1744 $version_latest = "";
1745
1746 if ( ! function_exists( 'plugins_api' ) ) {
1747 require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
1748 }
1749
1750 // set the arguments to get latest info from repository via API ##
1751 $args = array(
1752 'slug' => $slug,
1753 'fields' => array(
1754 'version' => true,
1755 )
1756 );
1757
1758 /** Prepare our query */
1759 $call_api = plugins_api( 'plugin_information', $args );
1760
1761 /** Check for Errors & Display the results */
1762 if ( is_wp_error( $call_api ) ) {
1763 $api_error = $call_api->get_error_message();
1764 } else {
1765
1766 //echo $call_api;
1767 // everything ##
1768 if ( ! empty( $call_api->version ) ) {
1769 $version_latest = $call_api->version;
1770 }
1771 }
1772
1773 return $version_latest;
1774 }
1775
1776 /**
1777 * Get AM plugin data to display in the Addons section of About tab.
1778 *
1779 * @since 6.4.0.4
1780 *
1781 * @param string $plugin Plugin slug.
1782 * @param array $details Plugin details.
1783 * @param array $all_plugins List of all plugins.
1784 *
1785 * @return array
1786 */
1787 protected function get_plugin_data( $plugin, $details, $all_plugins ) {
1788
1789 $have_pro = ( ! empty( $details['pro'] ) && ! empty( $details['pro']['plug'] ) );
1790 $show_pro = false;
1791
1792 $plugin_data = array();
1793
1794 if ( $have_pro ) {
1795 if ( array_key_exists( $plugin, $all_plugins ) ) {
1796 if ( is_plugin_active( $plugin ) ) {
1797 $show_pro = true;
1798 }
1799 }
1800 if ( array_key_exists( $details['pro']['plug'], $all_plugins ) ) {
1801 $show_pro = true;
1802 }
1803 if ( $show_pro ) {
1804 $plugin = $details['pro']['plug'];
1805 $details = $details['pro'];
1806 }
1807 }
1808
1809 if ( array_key_exists( $plugin, $all_plugins ) ) {
1810 if ( is_plugin_active( $plugin ) ) {
1811 // Status text/status.
1812 $plugin_data['status_class'] = 'status-active';
1813 $plugin_data['status_text'] = esc_html__( 'Active', 'chart-builder' );
1814 // Button text/status.
1815 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info disabled';
1816 $plugin_data['action_text'] = esc_html__( 'Activated', 'chart-builder' );
1817 $plugin_data['plugin_src'] = esc_attr( $plugin );
1818 } else {
1819 // Status text/status.
1820 $plugin_data['status_class'] = 'status-installed';
1821 $plugin_data['status_text'] = esc_html__( 'Inactive', 'chart-builder' );
1822 // Button text/status.
1823 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
1824 $plugin_data['action_text'] = esc_html__( 'Activate', 'chart-builder' );
1825 $plugin_data['plugin_src'] = esc_attr( $plugin );
1826 }
1827 } else {
1828 // Doesn't exist, install.
1829 // Status text/status.
1830 $plugin_data['status_class'] = 'status-missing';
1831
1832 if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) {
1833 $plugin_data['status_class'] = 'status-go-to-url';
1834 }
1835 $plugin_data['status_text'] = esc_html__( 'Not Installed', 'chart-builder' );
1836 // Button text/status.
1837 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
1838 $plugin_data['action_text'] = esc_html__( 'Install Plugin', 'chart-builder' );
1839 $plugin_data['plugin_src'] = esc_url( $details['url'] );
1840 }
1841
1842 $plugin_data['details'] = $details;
1843
1844 return $plugin_data;
1845 }
1846
1847 /**
1848 * Display the Addons section of About tab.
1849 *
1850 * @since 6.4.0.4
1851 */
1852 public function output_about_addons() {
1853
1854 if ( ! function_exists( 'get_plugins' ) ) {
1855 require_once ABSPATH . 'wp-admin/includes/plugin.php';
1856 }
1857
1858 $all_plugins = get_plugins();
1859 $am_plugins = $this->get_am_plugins();
1860 $can_install_plugins = self::ays_chart_can_install( 'plugin' );
1861 $can_activate_plugins = self::ays_chart_can_activate( 'plugin' );
1862
1863 $content = '';
1864 $content.= '<div class="ays-chart-cards-block">';
1865 foreach ( $am_plugins as $plugin => $details ){
1866
1867 $plugin_data = $this->get_plugin_data( $plugin, $details, $all_plugins );
1868 $plugin_ready_to_activate = $can_activate_plugins
1869 && isset( $plugin_data['status_class'] )
1870 && $plugin_data['status_class'] === 'status-installed';
1871 $plugin_not_activated = ! isset( $plugin_data['status_class'] )
1872 || $plugin_data['status_class'] !== 'status-active';
1873
1874 $plugin_action_class = ( isset( $plugin_data['action_class'] ) && esc_attr( $plugin_data['action_class'] ) != "" ) ? esc_attr( $plugin_data['action_class'] ) : "";
1875
1876 $plugin_action_class_disbaled = "";
1877 if ( strpos($plugin_action_class, 'status-active') !== false ) {
1878 $plugin_action_class_disbaled = "disbaled='true'";
1879 }
1880
1881 $content .= '
1882 <div class="ays-chart-card">
1883 <div class="ays-chart-card__content flexible">
1884 <div class="ays-chart-card__content-img-box">
1885 <img class="ays-chart-card__img" src="'. esc_url( $plugin_data['details']['icon'] ) .'" alt="'. esc_attr( $plugin_data['details']['name'] ) .'">
1886 </div>
1887 <div class="ays-chart-card__text-block">
1888 <h5 class="ays-chart-card__title">'. esc_html( $plugin_data['details']['name'] ) .'</h5>
1889 <p class="ays-chart-card__text">'. wp_kses_post( $plugin_data['details']['desc'] ) .'
1890 <span class="ays-chart-card__text-hidden">
1891 '. wp_kses_post( $plugin_data['details']['desc_hidden'] ) .'
1892 </span>
1893 </p>
1894 </div>
1895 </div>
1896 <div class="ays-chart-card__footer">';
1897 if ( $can_install_plugins || $plugin_ready_to_activate || ! $details['wporg'] ) {
1898 $content .= '<button class="'. esc_attr( $plugin_data['action_class'] ) .'" data-plugin="'. esc_attr( $plugin_data['plugin_src'] ) .'" data-type="plugin" '. $plugin_action_class_disbaled .'>
1899 '. wp_kses_post( $plugin_data['action_text'] ) .'
1900 </button>';
1901 }
1902 elseif ( $plugin_not_activated ) {
1903 $content .= '<a href="'. esc_url( $details['wporg'] ) .'" target="_blank" rel="noopener noreferrer">
1904 '. esc_html_e( 'WordPress.org', 'chart-builder' ) .'
1905 <span aria-hidden="true" class="dashicons dashicons-external"></span>
1906 </a>';
1907 }
1908 $content .='
1909 <a target="_blank" href="'. esc_url( $plugin_data['details']['buy_now'] ) .'" class="ays-chart-card__btn-primary">'. __('Buy Now', $this->plugin_name) .'</a>
1910 </div>
1911 </div>';
1912 }
1913 $install_plugin_nonce = wp_create_nonce( $this->plugin_name . '-install-plugin-nonce' );
1914 $content.= '<input type="hidden" id="ays_chart_ajax_install_plugin_nonce" name="ays_chart_ajax_install_plugin_nonce" value="'. $install_plugin_nonce .'">';
1915 $content.= '</div>';
1916
1917 echo $content;
1918 }
1919
1920 /**
1921 * Returns the data from Quiz maker.
1922 *
1923 * @access public
1924 */
1925 public function fetch_quiz_maker_data(){
1926 check_ajax_referer( 'cbuilder-fetch-quiz-maker-data', 'security' );
1927
1928 $params = $_POST['params'];
1929 if ( !isset($params) || empty($params) ) {
1930 return array(
1931 'success' => false,
1932 'data' => array(
1933 'msg' => __( "Something went wrong.", "chart-builder" )
1934 )
1935 );
1936 }
1937
1938 $query = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
1939 if ( $query == '' ) {
1940 return array(
1941 'success' => false,
1942 'data' => array(
1943 'msg' => __( "No data given.", "chart-builder" )
1944 )
1945 );
1946 }
1947 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : null;
1948 $user_id = get_current_user_id();
1949
1950 $return_results = CBFunctions()->get_quiz_query($query, $quiz_id, $user_id);
1951
1952 if (empty($return_results)) {
1953 return array(
1954 'success' => false,
1955 'data' => array(
1956 'msg' => __( "Something went wrong.", "chart-builder" )
1957 )
1958 );
1959 }
1960
1961 $result_values = $return_results['result'];
1962 $query = $return_results['query'];
1963
1964 if (empty($result_values)) {
1965 return array(
1966 'success' => false,
1967 'data' => array(
1968 'msg' => $return_results['message']
1969 )
1970 );
1971 }
1972
1973 if (count($return_results['result'][0]) != 1 ) {
1974 $results = array();
1975 $headers = array();
1976 if ( $result_values ) {
1977 $row_num = 0;
1978 foreach ( $result_values as $row ) {
1979 $result = array();
1980 foreach ( $row as $k => $v ) {
1981 $result[] = $v;
1982 if ( $row_num === 0 ) {
1983 $headers[] = $k;
1984 }
1985 }
1986 $results[] = $result;
1987 $row_num++;
1988 }
1989 }
1990 } else if (count($return_results['result'][0]) == 1) {
1991 $results = array();
1992 $headers = array();
1993 if ( $result_values ) {
1994 $row_num = 0;
1995 foreach ( $result_values as $index => $row ) {
1996 $result = array();
1997 foreach ( $row as $k => $v ) {
1998 $result[] = strval($index) + 1;
1999 $result[] = $v;
2000 if ( $row_num === 0 ) {
2001 $headers[] = 'Quiz';
2002 $headers[] = $k;
2003 }
2004 }
2005 $results[] = $result;
2006 $row_num++;
2007 }
2008 }
2009 }
2010
2011 if (empty($results)) {
2012 return array(
2013 'success' => false,
2014 'data' => array(
2015 'msg' => $return_results['message']
2016 )
2017 );
2018 }
2019
2020 foreach ($results as $key => $value) {
2021 if (!isset($value) || count($value) <= 1 && $key != 0) {
2022 unset($results[$key]);
2023 }
2024 }
2025
2026 array_unshift($results, $headers);
2027 $results = array_values( $results );
2028 $data = $results;
2029
2030 $headers = $results[0];
2031 unset( $results[0] );
2032
2033 $html = CBFunctions()->get_table_html( $headers, $results );
2034
2035 return array(
2036 'success' => true,
2037 'data' => array(
2038 'table' => $html,
2039 'data' => $data
2040 )
2041 );
2042 }
2043
2044 /**
2045 * Saves the Quiz maker data.
2046 *
2047 * @access public
2048 */
2049 public function save_quiz_maker_data() {
2050 check_ajax_referer( 'cbuilder-save-quiz-maker-data', 'security' );
2051
2052 $params = $_POST['params'];
2053 if ( !isset($params) || empty($params) ) {
2054 return array(
2055 'success' => false,
2056 'data' => array(
2057 'msg' => __( "Something went wrong.", "chart-builder" )
2058 )
2059 );
2060 }
2061
2062 $query_id = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2063 if ( $query_id == '' ) {
2064 return array(
2065 'success' => false,
2066 'data' => array(
2067 'msg' => __( "No data given.", "chart-builder" )
2068 )
2069 );
2070 }
2071
2072 $chart_id = isset( $params['chart_id'] ) ? absint( $params['chart_id'] ) : 0;
2073 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : 0;
2074 $user_id = get_current_user_id();
2075
2076 if ( $chart_id >= 0 ) {
2077
2078 $return_results = CBFunctions()->get_quiz_query($query_id, $quiz_id, $user_id);
2079
2080 if (empty($return_results)) {
2081 return array(
2082 'success' => false,
2083 'data' => array(
2084 'msg' => __( "Something went wrong.", "chart-builder" )
2085 )
2086 );
2087 }
2088
2089 $result_values = $return_results['result'];
2090 $query = $return_results['query'];
2091
2092 if (empty($result_values)) {
2093 return array(
2094 'success' => false,
2095 'data' => array(
2096 'msg' => $return_results['message']
2097 )
2098 );
2099 }
2100
2101 if ( !empty($result_values) && count($return_results['result'][0]) != 1 ) {
2102 $results = array();
2103 $headers = array();
2104 if ( $result_values ) {
2105 $row_num = 0;
2106 foreach ( $result_values as $row ) {
2107 $result = array();
2108 foreach ( $row as $k => $v ) {
2109 $result[] = $v;
2110 if ( $row_num === 0 ) {
2111 $headers[] = $k;
2112 }
2113 }
2114 $results[] = $result;
2115 $row_num++;
2116 }
2117 }
2118 } else if (count($return_results['result'][0]) == 1) {
2119 $results = array();
2120 $headers = array();
2121 if ( $result_values ) {
2122 $row_num = 0;
2123 foreach ( $result_values as $index => $row ) {
2124 $result = array();
2125 foreach ( $row as $k => $v ) {
2126 $result[] = strval($index) + 1;
2127 $result[] = $v;
2128 if ( $row_num === 0 ) {
2129 $headers[] = 'Quiz';
2130 $headers[] = $k;
2131 }
2132 }
2133 $results[] = $result;
2134 $row_num++;
2135 }
2136 }
2137 }
2138
2139 $source_type = 'quiz_maker';
2140 $option_name_for_data = $chart_id == 0 ? 'ays_chart_quiz_maker_results_temp' : 'ays_chart_quiz_maker_results_' . $chart_id;
2141 $option_name_for_quiz = $chart_id == 0 ? 'ays_chart_quiz_maker_quiz_data_temp' : 'ays_chart_quiz_maker_quiz_data_' . $chart_id;
2142
2143 update_option( $option_name_for_data, array(
2144 'source_type' => $source_type,
2145 'source' => $query,
2146 'data' => $results,
2147 ) );
2148 update_option( $option_name_for_quiz, array(
2149 'quiz_query' => $query_id,
2150 'quiz_id' => $quiz_id
2151 ) );
2152
2153 } else {
2154 return array(
2155 'success' => false,
2156 'data' => array(
2157 'msg' => __( 'Given incorrect Chart ID.', "chart-builder")
2158 )
2159 );
2160 }
2161
2162 return array(
2163 'success' => true,
2164 'data' => array(
2165 'msg' => __( 'Data was successfully saved.', "chart-builder" )
2166 )
2167 );
2168 }
2169
2170 /**
2171 * Chart page action hooks
2172 */
2173
2174 /**
2175 * Chart page sources contents
2176 * @param $args
2177 */
2178 public function ays_chart_page_source_contents( $args ){
2179 $chart_source_type = $args['chart_source_type'];
2180
2181 if ($chart_source_type === 'chart-js') {
2182 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings_chartjs', array(), $args );
2183 } else {
2184 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings', array(), $args );
2185 }
2186
2187 $source_type = $args['source_type'];
2188
2189 $sources = array();
2190 foreach ( $sources_contents as $key => $sources_content ) {
2191 $collapsed = $key == $source_type ? 'false' : 'true';
2192
2193 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="'. $collapsed .'">';
2194 if( isset( $sources_content['title'] ) ){
2195 $content .= '<legend class="ays-accordion-options-header">';
2196 $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">
2197 <g>
2198 <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" />
2199 </g>
2200 </svg>';
2201
2202 $content .= '<span>'. $sources_content['title'] .'</span></legend>';
2203 }
2204
2205 $content .= '<div class="ays-accordion-options-content">';
2206 $content .= $sources_content['content'];
2207 $content .= '</div>';
2208
2209 $content .= '</fieldset>';
2210
2211 $sources[] = $content;
2212 }
2213 $content_for_escape = implode('' , $sources );
2214 echo html_entity_decode(esc_html( $content_for_escape ));
2215 }
2216
2217 public function source_contents_import_from_csv_settings( $sources, $args ){
2218 $html_class_prefix = $args['html_class_prefix'];
2219 $html_name_prefix = $args['html_name_prefix'];
2220
2221 ob_start();
2222 ?>
2223 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2224 <div class="ays-pro-features-v2-big-buttons-box">
2225 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2226 <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>
2227 <div class="ays-pro-features-v2-video-text">
2228 <?php echo __("Watch Video" , "chart-builder"); ?>
2229 </div>
2230 </a>
2231 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2232 <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>
2233 <div class="ays-pro-features-v2-upgrade-text">
2234 <?php echo __("Upgrade" , "chart-builder"); ?>
2235 </div>
2236 </a>
2237 </div>
2238 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2239 <div class="<?php echo esc_attr($html_class_prefix) ?>file-import-form">
2240 <h6><?php echo __("Choose what kind of data would you like to upload.", "chart-builder"); ?></h6>
2241 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>import-files-file-type">
2242 <option value="csv">CSV File</option>
2243 </select>
2244 <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 __("Choose the format of the file you are going to import.", "chart-builder"); ?></span>
2245 <p class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example" style="font-size: 15px; font-style: italic;">Example:
2246 <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>
2247 </p>
2248 <div>
2249 <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" />
2250 </div>
2251 <div class='ays-chart-file-import-success'></div>
2252 <div class='ays-chart-file-import-error'></div>
2253 <div class="ays-chart-buttons-group">
2254 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-fetch">
2255 <?php echo __( 'Show Results', "chart-builder" ); ?>
2256 </button>
2257 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-show-on-chart">
2258 <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>
2259 <?php echo __( 'Preview', "chart-builder" ); ?>
2260 </button>
2261 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-save">
2262 <?php echo __( 'Save data', "chart-builder" ); ?>
2263 </button>
2264 </div>
2265 </div>
2266 </div>
2267 </div>
2268 <?php
2269 $content = ob_get_clean();
2270
2271 $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") . '">
2272 <i class="ays_fa ays_fa_info_circle"></i>
2273 </a>';
2274
2275 $sources['file_import'] = array(
2276 'content' => $content,
2277 'title' => $title
2278 );
2279
2280 return $sources;
2281 }
2282
2283 public function source_contents_import_from_db_settings( $sources, $args ){
2284 $html_class_prefix = $args['html_class_prefix'];
2285 $html_name_prefix = $args['html_name_prefix'];
2286
2287 ob_start();
2288 ?>
2289 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2290 <div class="ays-pro-features-v2-big-buttons-box">
2291 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2292 <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>
2293 <div class="ays-pro-features-v2-video-text">
2294 <?php echo __("Watch Video" , "chart-builder"); ?>
2295 </div>
2296 </a>
2297 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2298 <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>
2299 <div class="ays-pro-features-v2-upgrade-text">
2300 <?php echo __("Upgrade" , "chart-builder"); ?>
2301 </div>
2302 </a>
2303 </div>
2304 <div class="<?= $html_class_prefix ?>source-data-main-wrap">
2305 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2306 <div id="ays-chart-db-query">
2307 <div class="<?= $html_class_prefix ?>-db-query-form">
2308 <div id="db-query-form">
2309 <input type="hidden" name="chart_id" value="1">
2310 <textarea name="query" class="<?= $html_class_prefix ?>db-query" placeholder="<?php echo __( "Add your query here.", $this->plugin_name ); ?>"></textarea>
2311 <div class='db-wizard-success'></div>
2312 <div class='db-wizard-error'></div>
2313 </div>
2314 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2315 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-fetch">
2316 <?php echo __( 'Show Results', "chart-builder" ); ?>
2317 </button>
2318 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-show-on-chart">
2319 <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>
2320 <?php echo __( 'Preview', "chart-builder" ); ?>
2321 </button>
2322 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-save">
2323 <?php echo __( 'Save data', "chart-builder" ); ?>
2324 </button>
2325 </div>
2326 </div>
2327 <div class="db-wizard-hints">
2328 <ul>
2329 <!-- <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> -->
2330 <li><?php echo sprintf( __( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', $this->plugin_name ), '<span class="ays-chart-emboss">', '</span>' ); ?></li>
2331 </ul>
2332 </div>
2333 </div>
2334 </div>
2335 </div>
2336 </div>
2337 <?php
2338 $content = ob_get_clean();
2339
2340 $title = __( 'Connect to Database', $this->plugin_name ) . ' <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.",$this->plugin_name) . '">
2341 <i class="ays_fa ays_fa_info_circle"></i>
2342 </a>';
2343
2344 $sources['import_from_db'] = array(
2345 'content' => $content,
2346 'title' => $title
2347 );
2348
2349 return $sources;
2350 }
2351
2352 public function source_contents_import_from_external_db_settings( $sources, $args ){
2353 $html_class_prefix = $args['html_class_prefix'];
2354 $html_name_prefix = $args['html_name_prefix'];
2355
2356 ob_start();
2357 ?>
2358 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2359 <div class="ays-pro-features-v2-big-buttons-box">
2360 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2361 <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>
2362 <div class="ays-pro-features-v2-upgrade-text">
2363 <?php echo __("Upgrade" , "chart-builder"); ?>
2364 </div>
2365 </a>
2366 </div>
2367 <div class="<?= $html_class_prefix ?>source-data-main-wrap">
2368 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2369 <div class="form-group row mb-2">
2370 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2371 <label class="form-label">
2372 <?php echo esc_html(__('Use custom database settings for this chart', "chart-builder")); ?>
2373 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __(".","chart-builder") ); ?>">
2374 <i class="ays_fa ays_fa_info_circle"></i>
2375 </a>
2376 </label>
2377 </div>
2378 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2379 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2380 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" type="checkbox" />
2381 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2382 </label>
2383 </div>
2384 </div>
2385 <div id="ays-chart-external-db-query">
2386 <div class="<?= $html_class_prefix ?>-db-query-form">
2387 <div id="external-db-query-form">
2388 <input type="hidden" name="chart_id" value="1">
2389 <textarea name="query" class="<?= $html_class_prefix ?>external-db-query" placeholder="<?php echo __( "Add your query here.", $this->plugin_name ); ?>"></textarea>
2390 <div class='db-wizard-success'></div>
2391 <div class='db-wizard-error'></div>
2392 </div>
2393 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2394 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-fetch">
2395 <?php echo __( 'Show Results', "chart-builder" ); ?>
2396 </button>
2397 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-show-on-chart">
2398 <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>
2399 <?php echo __( 'Preview', "chart-builder" ); ?>
2400 </button>
2401 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-save">
2402 <?php echo __( 'Save data', "chart-builder" ); ?>
2403 </button>
2404 </div>
2405 </div>
2406 <div class="db-wizard-hints">
2407 <ul>
2408 <!-- <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> -->
2409 <li><?php echo sprintf( __( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', $this->plugin_name ), '<span class="ays-chart-emboss">', '</span>' ); ?></li>
2410 </ul>
2411 </div>
2412 </div>
2413 </div>
2414 </div>
2415 </div>
2416 <?php
2417 $content = ob_get_clean();
2418
2419 $title = __( 'Connect to External Database', $this->plugin_name ) . ' <a class="ays_help" data-bs-toggle="tooltip" title="' . __("Insert the Database query and fetch data from an external database.", $this->plugin_name) . '">
2420 <i class="ays_fa ays_fa_info_circle"></i>
2421 </a>';
2422
2423 $sources['import_from_external_db'] = array(
2424 'content' => $content,
2425 'title' => $title
2426 );
2427
2428 return $sources;
2429 }
2430
2431 public function source_contents_quiz_maker_integration_settings( $sources, $args ){
2432 global $wpdb;
2433 $chart_id = $args['chart_id'];
2434 $html_class_prefix = $args['html_class_prefix'];
2435 $html_name_prefix = $args['html_name_prefix'];
2436 $source = $args['source'];
2437 $settings = $args['settings'];
2438 $quiz_queries = $args['quiz_queries'];
2439 $quiz_query_tooltips = $args['quiz_query_tooltips'];
2440 $quiz_id = $args['quiz_id'];
2441 $quiz_query = $args['quiz_query'];
2442
2443 if ( !is_plugin_active('quiz-maker/quiz-maker.php') ) {
2444 // $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") . '">
2445 // <i class="ays_fa ays_fa_info_circle"></i>
2446 // </a>', '<br>', '<b>', '</b>');
2447 // $content = $this->blockquote_content_quiz;
2448 // $sources['quiz_maker'] = array(
2449 // 'content' => $content,
2450 // 'title' => $title
2451 // );
2452
2453 return $sources;
2454 }
2455
2456 $sql = "SELECT `title`, `id` FROM " . $wpdb->prefix . "aysquiz_quizes WHERE `published` = 1 AND `question_ids` <> ''";
2457 $quizes = $wpdb->get_results($sql, "ARRAY_A");
2458
2459 ob_start();
2460 ?>
2461 <div class="ays-accordion-data-main-wrap">
2462 <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">
2463 <div id="<?php echo esc_attr($html_class_prefix) ?>quiz-maker-form">
2464 <input type="hidden" class="<?php echo esc_attr($html_class_prefix) ?>chart-id" value="<?= $chart_id ?>">
2465 <div class="<?= $html_class_prefix ?>select-quiz-maker-data-query-container" id="<?= $html_class_prefix ?>quiz-queries">
2466 <a class="ays_help <?= $html_class_prefix ?>quiz-query-tooltip" data-bs-toggle="tooltip" data-bs-html="true" title="<?php echo isset($quiz_query) ? $quiz_query_tooltips[$quiz_query] : __( 'Select a query to display quiz data.', $this->plugin_name ) ?>">
2467 <i class="ays_fa ays_fa_info_circle"></i>
2468 </a>
2469 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-data-query" name="<?= $html_name_prefix ?>quiz_query">
2470 <option value=""><?= __( "Select query", "chart-builder" ) ?></option>
2471 <?php foreach ( $quiz_queries as $id => $q):
2472 $disabled = preg_replace('/[^0-9]/', '', $id) <= 6 ? "false" : "true" ; ?>
2473 <option value="<?= $id ?>" <?= $quiz_query == $id ? 'selected' : '' ?> <?php echo 'is-pro="'.$disabled.'"'; ?>><?= $q ?></option>
2474 <?php endforeach; ?>
2475 </select>
2476 </div>
2477 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz-container">
2478 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz" name="<?= $html_name_prefix ?>quiz_id">
2479 <option value="0"><?= __( "Select quiz", "chart-builder" ) ?></option>
2480 <?php foreach ( $quizes as $quiz): ?>
2481 <option value="<?= $quiz['id'] ?>" <?= $quiz_id == $quiz['id'] ? 'selected' : '' ?> ><?= $quiz['title'] ?></option>
2482 <?php endforeach; ?>
2483 </select>
2484 </div>
2485 <div id="ays-chart-quiz-maker-success"></div>
2486 <div id="ays-chart-quiz-maker-error"></div>
2487 <div class="ays-chart-buttons-group">
2488 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-fetch">
2489 <?php echo __( 'Show Results', "chart-builder" ); ?>
2490 </button>
2491 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-show-on-chart">
2492 <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>
2493 <?php echo __( 'Preview', "chart-builder" ); ?>
2494 </button>
2495 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-save">
2496 <?php echo __( 'Save data', "chart-builder" ); ?>
2497 </button>
2498 </div>
2499 </div>
2500 <div>
2501 <a href="https://www.youtube.com/watch?v=vqx76dw6NC8" target="_blank" style="text-decoration:none;font-style:italic"><?php echo __('How to Connect Quizzes to Charts', 'chart-builder'); ?></a>
2502 </div>
2503 </div>
2504 </div>
2505 <?php
2506 $content = ob_get_clean();
2507
2508 $title = sprintf( __( 'Get Quiz Maker data', $this->plugin_name ) . ' <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.",$this->plugin_name) . '">
2509 <i class="ays_fa ays_fa_info_circle"></i>
2510 </a>', '<br>', '<b>', '</b>');
2511 $sources['quiz_maker'] = array(
2512 'content' => $content,
2513 'title' => $title
2514 );
2515
2516 return $sources;
2517 }
2518
2519 public function source_contents_woocommerce_integration_settings( $sources, $args ){
2520 if ( !is_plugin_active('woocommerce/woocommerce.php') ) {
2521 return $sources;
2522 }
2523
2524 $chart_id = $args['chart_id'];
2525 $html_class_prefix = $args['html_class_prefix'];
2526 $html_name_prefix = $args['html_name_prefix'];
2527 ob_start();
2528 ?>
2529 <div class="ays-accordion-data-main-wrap ays-accordion-data-main-wrap-woocommerce ays-pro-features-v2-main-box" style="padding:10px;">
2530 <div class="ays-pro-features-v2-big-buttons-box">
2531 <div class="ays-pro-features-v2-video-button"></div>
2532 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2533 <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>
2534 <div class="ays-pro-features-v2-upgrade-text">
2535 <?php echo __("Upgrade" , "chart-builder"); ?>
2536 </div>
2537 </a>
2538 </div>
2539 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2540 <div id="ays-chart-woocommerce-datas">
2541 <div class="<?= $html_class_prefix ?>woocommerce-datas-form">
2542 <div id="woocommerce-datas-form">
2543 <input type="hidden" name="chart_id" value="<?= $chart_id ?>">
2544 <div class="<?= $html_class_prefix ?>woocommerce-datas-query-container" id="<?= $html_class_prefix ?>woocommerce-datas-container-id" >
2545 <a class="ays_help <?= $html_class_prefix ?>woocommerce-datas-tooltip" data-bs-toggle="tooltip" data-bs-html="true" title="<?php echo __( 'Select a query to display data.', $this->plugin_name ) ?>">
2546 <i class="ays_fa ays_fa_info_circle"></i>
2547 </a>
2548 <select class="form-select" style="max-width: none;" id="<?= $html_class_prefix ?>woocommerce-datas-select" name="<?php echo esc_attr($html_name_prefix); ?>settings[woocommerce_data_id]">
2549 <option value=""><?= __( 'Select query', $this->plugin_name ) ?></option>
2550 </select>
2551 </div>
2552 <div class='ays-chart-woocommerce-datas-success'></div>
2553 <div class='ays-chart-woocommerce-datas-error'></div>
2554 </div>
2555 <div class="ays-chart-buttons-group">
2556 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-fetch">
2557 <?php echo __( 'Show Results', "chart-builder" ); ?>
2558 </button>
2559 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-show-on-chart">
2560 <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>
2561 <?php echo __( 'Preview', "chart-builder" ); ?>
2562 </button>
2563 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-save">
2564 <?php echo __( 'Save data', "chart-builder" ); ?>
2565 </button>
2566 </div>
2567 </div>
2568 </div>
2569 </div>
2570 </div>
2571 <?php
2572 $content = ob_get_clean();
2573
2574 $title = sprintf( __( 'Get WooCommerce data', $this->plugin_name ) . ' <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="' . __("By using this option, you can display the WooCommerce statistics by charts.%s %sNote:%s The WooCommerce plugin must be active.",$this->plugin_name) . '">
2575 <i class="ays_fa ays_fa_info_circle"></i>
2576 </a>', '<br>', '<b>', '</b>');
2577 $sources['woocommerce'] = array(
2578 'content' => $content,
2579 'title' => $title
2580 );
2581
2582 return $sources;
2583 }
2584
2585 public function source_contents_manual_settings( $sources, $args ){
2586 $html_class_prefix = $args['html_class_prefix'];
2587 $html_name_prefix = $args['html_name_prefix'];
2588 $source = $args['source'];
2589 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2590 $settings = $args['settings'];
2591 $source_chart_type = $args['source_chart_type'];
2592 $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : 'add';
2593
2594 if (isset($source) && !empty($source)) {
2595 if ( !isset( $source[0] ) ) {
2596 if (count($source[1]) > 2) {
2597 $titles = array();
2598 for ($i = 0; $i < count($source[1]); $i++) {
2599 array_push($titles, __("Title", $this->plugin_name).$i);
2600 }
2601 $source[0] = $titles;
2602 } else {
2603 $source[0] = array(
2604 __("Country", $this->plugin_name),
2605 __("Population", $this->plugin_name),
2606 );
2607 }
2608
2609 ksort($source);
2610 }
2611 }
2612
2613 if ($action == 'add') {
2614 foreach ($source as $key => $row) {
2615 $source[$key] = array_slice($row, 0, 2);
2616 }
2617 } else if ($action == 'edit') {
2618 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
2619 foreach ($source as $key => $row) {
2620 $source[$key] = array_slice($row, 0, 2);
2621 }
2622 }
2623 }
2624 ob_start();
2625 ?>
2626 <div class="ays-accordion-data-main-wrap">
2627 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2628 <?php if($source_chart_type != 'org_chart'): ?>
2629 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?= $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">
2630 <!-- <div class="<//?= $html_class_prefix ?>icons-box">
2631 <img class="<//?= $html_class_prefix ?>add-new-row" src="<//?php echo CHART_BUILDER_ADMIN_URL; ?>/images/icons/add-circle-outline.svg">
2632 </div> -->
2633 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2634 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2635 <?php if(!empty($source)):
2636 foreach($source as $source_id => $source_value):
2637 if(!empty($source_value) ):
2638 if ($source_id == 0): ?>
2639 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2640 <div class="ays-chart-empty-data-table-cell"></div>
2641 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2642 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2643 <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">
2644 <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;" />
2645 </svg>
2646 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2647 <input type="text" class="ays-text-input form-control <?= $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 stripslashes(esc_attr($each_source_value)); ?>" <?php echo $each_source_id == 0 ? "style='min-width:100px'" : "" ?>>
2648 <?php if ($each_source_id !== 0): ?>
2649 <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">
2650 <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;" />
2651 </svg>
2652 <?php endif; ?>
2653 </div>
2654 </div>
2655 <?php endforeach; ?>
2656 </div>
2657 <?php else: ?>
2658 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2659 <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">
2660 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2661 <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;" />
2662 </svg>
2663 </div>
2664 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
2665 <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">
2666 <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;" />
2667 </svg>
2668 </div>
2669 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2670 <?php if ($each_source_id == 0): ?>
2671 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-data-name-input-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2672 <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 htmlspecialchars(esc_attr($each_source_value)); ?>">
2673 </div>
2674 <?php else: ?>
2675 <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); ?>">
2676 <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 stripslashes(esc_attr($each_source_value)); ?>" step="any">
2677 </div>
2678 <?php endif; ?>
2679 <?php endforeach; ?>
2680 </div>
2681 <?php endif; ?>
2682 <?php endif; ?>
2683 <?php endforeach; ?>
2684 <?php else:?>
2685 <div class="<?= $html_class_prefix ?>chart-source-data-edit-block">
2686 <div style="height: 63.11px; padding: 0 15px;"></div>
2687 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box">
2688 <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">
2689 <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;" />
2690 </svg>
2691 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2692 <input type="text" class="ays-text-input form-control <?= $html_class_prefix ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[0][]" style='min-width:100px'>
2693 <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">
2694 <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;" />
2695 </svg>
2696 </div>
2697 </div>
2698 </div>
2699 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
2700 <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">
2701 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2702 <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" />
2703 </svg>
2704 </div>
2705 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
2706 <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">
2707 <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;" />
2708 </svg>
2709 </div>
2710 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
2711 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
2712 </div>
2713 <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">
2714 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
2715 </div>
2716 </div>
2717 <?php endif; ?>
2718 </div>
2719 <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">
2720 <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">
2721 <?php echo __( 'Add column', "chart-builder" ); ?>
2722 </div>
2723 </div>
2724 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
2725 <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">
2726 <?php echo __( 'Add row', "chart-builder" ); ?>
2727 </div>
2728 <br>
2729 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2730 <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>
2731 <?php echo __( 'Preview', "chart-builder" ); ?>
2732 </button>
2733 </div>
2734 <?php endif; ?>
2735 <div class="<?= $html_class_prefix ?>chart-source-data-main-org-type display_none cb-changable-manual cb-org_chart-manual">
2736 <div class="<?= $html_class_prefix ?>chart-source-data-content-org-type">
2737 <ul id="<?= $html_class_prefix ?>chart-source-data-edit-tree-content">
2738 </ul>
2739 </div>
2740 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2741 <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>
2742 <?php echo __( 'Preview', "chart-builder" ); ?>
2743 </button>
2744 </div>
2745 </div>
2746 </div>
2747 <?php
2748 $content = ob_get_clean();
2749
2750 $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") . '">
2751 <i class="ays_fa ays_fa_info_circle"></i>
2752 </a>';
2753
2754 $sources['manual'] = array(
2755 'content' => $content,
2756 'title' => $title
2757 );
2758
2759 return $sources;
2760 }
2761
2762 public function source_contents_manual_settings_chartjs( $sources, $args ){
2763 $html_class_prefix = $args['html_class_prefix'];
2764 $html_name_prefix = $args['html_name_prefix'];
2765 $source = $args['source'];
2766 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2767 $settings = $args['settings'];
2768 $source_chart_type = $args['source_chart_type'];
2769 $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : 'add';
2770
2771 ob_start();
2772 ?>
2773 <div class="ays-accordion-data-main-wrap">
2774 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2775 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?= $html_class_prefix ?>chart-source-data-manual">
2776 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2777 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2778 <?php if(!empty($source)):
2779 foreach($source as $source_id => $source_value):
2780 if(!empty($source_value) ):
2781 if ($source_id == 0): ?>
2782 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2783 <div class="ays-chart-empty-data-table-cell"></div>
2784 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2785 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2786 <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">
2787 <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;" />
2788 </svg>
2789 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2790 <input type="text" class="ays-text-input form-control <?= $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 stripslashes(esc_attr($each_source_value)); ?>" <?php echo $each_source_id == 0 ? "style='min-width:100px'" : "" ?>>
2791 <?php if ($each_source_id !== 0): ?>
2792 <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">
2793 <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;" />
2794 </svg>
2795 <?php endif; ?>
2796 </div>
2797 </div>
2798 <?php endforeach; ?>
2799 </div>
2800 <?php else: ?>
2801 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2802 <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">
2803 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2804 <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;" />
2805 </svg>
2806 </div>
2807 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
2808 <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">
2809 <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;" />
2810 </svg>
2811 </div>
2812 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2813 <?php if ($each_source_id == 0): ?>
2814 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-data-name-input-box" data-cell-id = "<?php echo esc_attr($each_source_id); ?>">
2815 <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 htmlspecialchars(esc_attr($each_source_value)); ?>">
2816 </div>
2817 <?php else: ?>
2818 <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); ?>">
2819 <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 stripslashes(esc_attr($each_source_value)); ?>" step="any">
2820 </div>
2821 <?php endif; ?>
2822 <?php endforeach; ?>
2823 </div>
2824 <?php endif; ?>
2825 <?php endif; ?>
2826 <?php endforeach; ?>
2827 <?php else:?>
2828 <div class="<?= $html_class_prefix ?>chart-source-data-edit-block">
2829 <div style="height: 63.11px; padding: 0 15px;"></div>
2830 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box">
2831 <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">
2832 <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;" />
2833 </svg>
2834 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2835 <input type="text" class="ays-text-input form-control <?= $html_class_prefix ?>chart-source-title-input" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[0][]" style='min-width:100px'>
2836 <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">
2837 <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;" />
2838 </svg>
2839 </div>
2840 </div>
2841 </div>
2842 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
2843 <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">
2844 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2845 <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" />
2846 </svg>
2847 </div>
2848 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
2849 <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">
2850 <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;" />
2851 </svg>
2852 </div>
2853 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
2854 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
2855 </div>
2856 <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">
2857 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
2858 </div>
2859 </div>
2860 <?php endif; ?>
2861 </div>
2862 <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">
2863 <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">
2864 <?php echo __( 'Add column', "chart-builder" ); ?>
2865 </div>
2866 </div>
2867 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
2868 <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">
2869 <?php echo __( 'Add row', "chart-builder" ); ?>
2870 </div>
2871 <br>
2872 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2873 <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>
2874 <?php echo __( 'Preview', "chart-builder" ); ?>
2875 </button>
2876 </div>
2877 </div>
2878 </div>
2879 <?php
2880 $content = ob_get_clean();
2881
2882 $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") . '">
2883 <i class="ays_fa ays_fa_info_circle"></i>
2884 </a>';
2885
2886 $sources['manual'] = array(
2887 'content' => $content,
2888 'title' => $title
2889 );
2890
2891 return $sources;
2892 }
2893
2894 /**
2895 * Chart page settings contents
2896 * @param $args
2897 */
2898 public function ays_chart_page_settings_contents( $args ){
2899 $chart_source_type = $args['chart_source_type'];
2900
2901 if ($chart_source_type === 'chart-js') {
2902 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings_chartjs', array(), $args );
2903 } else {
2904 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings', array(), $args );
2905 }
2906
2907 $sources = array();
2908 foreach ( $sources_contents as $key => $sources_content ) {
2909 $collapsed = $key == 'general_settings' ? 'false' : 'true';
2910
2911 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
2912 if(isset($sources_content['title'])){
2913 $content .= '<legend class="ays-accordion-options-header">';
2914 $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">
2915 <g>
2916 <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" />
2917 </g>
2918 </svg>';
2919
2920 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
2921 }
2922
2923 $content .= '<div class="ays-accordion-options-content">';
2924 $content .= $sources_content['content'];
2925 $content .= '</div>';
2926
2927 $content .= '</fieldset>';
2928
2929 $sources[] = $content;
2930 }
2931 $content_for_escape = implode('' , $sources );
2932 echo html_entity_decode(esc_html( $content_for_escape ));
2933 }
2934
2935 public function settings_contents_general_settings( $sources, $args ){
2936 $html_class_prefix = $args['html_class_prefix'];
2937 $html_name_prefix = $args['html_name_prefix'];
2938 $chart_description = $args['chart_description'];
2939 $create_author_data = $args['create_author_data'];
2940 $status = $args['status'];
2941 $settings = $args['settings'];
2942
2943 $show_title = $settings['show_title'];
2944 $show_description = $settings['show_description'];
2945 $enable_interactivity = $settings['enable_interactivity'];
2946 $maximized_view = $settings['maximized_view'];
2947
2948 ob_start();
2949 ?>
2950 <div class="ays-accordion-data-main-wrap">
2951 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
2952 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2953 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2954 <label for="ays-status" class="form-label">
2955 <?php echo esc_html(__('Status', "chart-builder")); ?>
2956 <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") ); ?>">
2957 <i class="ays_fa ays_fa_info_circle"></i>
2958 </a>
2959 </label>
2960 </div>
2961 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2962 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2963 <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' : ''; ?> >
2964 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2965 </label>
2966 </div>
2967 </div> <!-- Status -->
2968 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2969 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
2970 <label for="ays-chart-description" class="form-label">
2971 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
2972 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
2973 <i class="ays_fa ays_fa_info_circle"></i>
2974 </a>
2975 </label>
2976 </div>
2977 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
2978 <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>
2979 </div>
2980 </div> <!-- Chart description -->
2981 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
2982 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
2983 <label for="ays-chart-create-author" class="form-label">
2984 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
2985 <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")); ?>">
2986 <i class="ays_fa ays_fa_info_circle"></i>
2987 </a>
2988 </label>
2989 </div>
2990 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
2991 <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">
2992 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
2993 <?php if (isset($create_author_data['ID'])) : ?>
2994 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
2995 <?php endif; ?>
2996 </select>
2997 </div>
2998 </div> <!-- Change chart author -->
2999 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3000 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3001 <label for="ays-chart-show-title" class="form-label">
3002 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3003 <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") ); ?>">
3004 <i class="ays_fa ays_fa_info_circle"></i>
3005 </a>
3006 </label>
3007 </div>
3008 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3009 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3010 <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); ?> >
3011 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3012 </label>
3013 </div>
3014 </div> <!-- Show title -->
3015 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3016 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3017 <label for="ays-chart-show-description" class="form-label">
3018 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3019 <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") ); ?>">
3020 <i class="ays_fa ays_fa_info_circle"></i>
3021 </a>
3022 </label>
3023 </div>
3024 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3025 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3026 <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); ?> >
3027 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3028 </label>
3029 </div>
3030 </div> <!-- Show description -->
3031 <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">
3032 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3033 <label for="ays-chart-option-enable-interactivity" class="form-label">
3034 <?php echo esc_html(__('Enable interactivity', "chart-builder")); ?>
3035 <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") ); ?>">
3036 <i class="ays_fa ays_fa_info_circle"></i>
3037 </a>
3038 </label>
3039 </div>
3040 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3041 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3042 <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); ?> >
3043 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3044 </label>
3045 </div>
3046 </div> <!-- Enable interactivity -->
3047 <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">
3048 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3049 <label for="ays-chart-option-maximized-view" class="form-label">
3050 <?php echo esc_html(__('Maximized view', "chart-builder")); ?>
3051 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, maximizes the area of the chart.","chart-builder") ); ?>">
3052 <i class="ays_fa ays_fa_info_circle"></i>
3053 </a>
3054 </label>
3055 </div>
3056 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3057 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3058 <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); ?> >
3059 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3060 </label>
3061 </div>
3062 </div> <!-- Maximized view -->
3063 </div>
3064 </div>
3065 <?php
3066 $content = ob_get_clean();
3067
3068 $title = __( 'General Settings', "chart-builder" );
3069
3070 $sources['general_settings'] = array(
3071 'content' => $content,
3072 'title' => $title
3073 );
3074
3075 return $sources;
3076 }
3077
3078 public function settings_contents_general_settings_chartjs( $sources, $args ){
3079 $html_class_prefix = $args['html_class_prefix'];
3080 $html_name_prefix = $args['html_name_prefix'];
3081 $chart_description = $args['chart_description'];
3082 $create_author_data = $args['create_author_data'];
3083 $status = $args['status'];
3084 $settings = $args['settings'];
3085
3086 $show_title = $settings['show_title'];
3087 $show_description = $settings['show_description'];
3088
3089 ob_start();
3090 ?>
3091 <div class="ays-accordion-data-main-wrap">
3092 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3093 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3094 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3095 <label for="ays-status" class="form-label">
3096 <?php echo esc_html(__('Status', "chart-builder")); ?>
3097 <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") ); ?>">
3098 <i class="ays_fa ays_fa_info_circle"></i>
3099 </a>
3100 </label>
3101 </div>
3102 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3103 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3104 <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' : ''; ?> >
3105 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3106 </label>
3107 </div>
3108 </div> <!-- Status -->
3109 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3110 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3111 <label for="ays-chart-description" class="form-label">
3112 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3113 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3114 <i class="ays_fa ays_fa_info_circle"></i>
3115 </a>
3116 </label>
3117 </div>
3118 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3119 <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>
3120 </div>
3121 </div> <!-- Chart description -->
3122 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3123 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3124 <label for="ays-chart-create-author" class="form-label">
3125 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3126 <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")); ?>">
3127 <i class="ays_fa ays_fa_info_circle"></i>
3128 </a>
3129 </label>
3130 </div>
3131 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3132 <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">
3133 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3134 <?php if (isset($create_author_data['ID'])) : ?>
3135 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3136 <?php endif; ?>
3137 </select>
3138 </div>
3139 </div> <!-- Change chart author -->
3140 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3141 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3142 <label for="ays-chart-show-title" class="form-label">
3143 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3144 <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") ); ?>">
3145 <i class="ays_fa ays_fa_info_circle"></i>
3146 </a>
3147 </label>
3148 </div>
3149 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3150 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3151 <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); ?> >
3152 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3153 </label>
3154 </div>
3155 </div> <!-- Show title -->
3156 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3157 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3158 <label for="ays-chart-show-description" class="form-label">
3159 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3160 <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") ); ?>">
3161 <i class="ays_fa ays_fa_info_circle"></i>
3162 </a>
3163 </label>
3164 </div>
3165 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3166 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3167 <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); ?> >
3168 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3169 </label>
3170 </div>
3171 </div> <!-- Show description -->
3172 </div>
3173 </div>
3174 <?php
3175 $content = ob_get_clean();
3176
3177 $title = __( 'General Settings', "chart-builder" );
3178
3179 $sources['general_settings'] = array(
3180 'content' => $content,
3181 'title' => $title
3182 );
3183
3184 return $sources;
3185 }
3186
3187 public function settings_contents_tooltip_settings( $sources, $args ){
3188 $html_class_prefix = $args['html_class_prefix'];
3189 $html_name_prefix = $args['html_name_prefix'];
3190 $settings = $args['settings'];
3191
3192 $tooltip_trigger_options = $settings['tooltip_trigger_options'];
3193 $tooltip_trigger = $settings['tooltip_trigger'];
3194 $show_color_code = $settings['show_color_code'];
3195 $tooltip_italic = $settings['tooltip_italic'];
3196 $tooltip_bold = $settings['tooltip_bold'];
3197 $tooltip_bold_options = $settings['tooltip_bold_options'];
3198 $tooltip_text_color = $settings['tooltip_text_color'];
3199 $tooltip_font_size = $settings['tooltip_font_size'];
3200
3201 ob_start();
3202 ?>
3203 <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">
3204 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3205 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3206 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3207 <label for="ays-chart-option-tooltip-trigger">
3208 <?php echo esc_html(__( "Trigger", "chart-builder" )); ?>
3209 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose when to display the results on the chart.","chart-builder") ); ?>">
3210 <i class="ays_fa ays_fa_info_circle"></i>
3211 </a>
3212 </label>
3213 </div>
3214 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3215 <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]">
3216 <?php
3217 foreach ( $tooltip_trigger_options as $option_slug => $option ):
3218 $selected = ( $tooltip_trigger == $option_slug ) ? 'selected' : '';
3219 ?>
3220 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3221 <?php
3222 endforeach;
3223 ?>
3224 </select>
3225 </div>
3226 </div> <!-- Trigger -->
3227 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3228 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3229 <label for="ays-chart-option-show-color-code">
3230 <?php echo esc_html(__( "Show Color Code", "chart-builder" )); ?>
3231 <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") ); ?>">
3232 <i class="ays_fa ays_fa_info_circle"></i>
3233 </a>
3234 </label>
3235 </div>
3236 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3237 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3238 <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); ?> >
3239 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3240 </label>
3241 </div>
3242 </div> <!-- Show Color Code -->
3243 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3244 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3245 <label for="ays-chart-option-tooltip-text-color">
3246 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
3247 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
3248 <i class="ays_fa ays_fa_info_circle"></i>
3249 </a>
3250 </label>
3251 </div>
3252 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3253 <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) ?>">
3254 </div>
3255 </div> <!-- Text color -->
3256 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3257 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3258 <label for="ays-chart-option-tooltip-font-size" class="form-label">
3259 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3260 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo 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") ); ?>">
3261 <i class="ays_fa ays_fa_info_circle"></i>
3262 </a>
3263 </label>
3264 </div>
3265 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3266 <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) ?>">
3267 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3268 </div>
3269 </div> <!-- Font size -->
3270 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3271 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3272 <label for="ays-chart-option-tooltip-italic">
3273 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3274 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart tooltip text italic.","chart-builder") ); ?>">
3275 <i class="ays_fa ays_fa_info_circle"></i>
3276 </a>
3277 </label>
3278 </div>
3279 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3280 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3281 <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); ?> >
3282 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3283 </label>
3284 </div>
3285 </div> <!-- Italic text -->
3286 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3287 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3288 <label for="ays-chart-option-tooltip-bold">
3289 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3290 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose when to display the results on the chart.","chart-builder") ); ?>">
3291 <i class="ays_fa ays_fa_info_circle"></i>
3292 </a>
3293 </label>
3294 </div>
3295 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3296 <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]">
3297 <?php
3298 foreach ( $tooltip_bold_options as $option_slug => $option ):
3299 $selected = ( $tooltip_bold == $option_slug ) ? 'selected' : '';
3300 ?>
3301 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3302 <?php
3303 endforeach;
3304 ?>
3305 </select>
3306 </div>
3307 </div> <!-- Bold text -->
3308 </div>
3309 </div>
3310 <?php
3311 $content = ob_get_clean();
3312
3313 $title = __( 'Tooltip', "chart-builder" );
3314
3315 $sources['tooltip'] = array(
3316 'content' => $content,
3317 'title' => $title
3318 );
3319
3320 return $sources;
3321 }
3322
3323 public function settings_contents_legend_settings( $sources, $args ){
3324 $html_class_prefix = $args['html_class_prefix'];
3325 $html_name_prefix = $args['html_name_prefix'];
3326 $settings = $args['settings'];
3327 $legend_positions = $settings['legend_positions'];
3328 $legend_position = $settings['legend_position'];
3329 $legend_alignments = $settings['legend_alignments'];
3330 $legend_alignment = $settings['legend_alignment'];
3331 $legend_color = $settings['legend_color'];
3332 $legend_font_size = $settings['legend_font_size'];
3333 $legend_bold = $settings['legend_bold'];
3334 $legend_italic = $settings['legend_italic'];
3335
3336 ob_start();
3337 ?>
3338 <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">
3339 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3340 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3341 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3342 <label for="ays-chart-option-legend-position">
3343 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3344 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") ); ?>">
3345 <i class="ays_fa ays_fa_info_circle"></i>
3346 </a>
3347 </label>
3348 </div>
3349 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3350 <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]">
3351 <?php
3352 foreach ( $legend_positions as $option_slug => $option ):
3353 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
3354
3355 $type_class = '';
3356 if ($option_slug == 'left') {
3357 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3358 } else if ($option_slug == 'in') {
3359 $type_class = ' cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt ';
3360 } else if ($option_slug == 'labeled') {
3361 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3362 }
3363
3364 ?>
3365
3366 <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>
3367 <?php
3368 endforeach;
3369 ?>
3370 </select>
3371 </div>
3372 </div> <!-- Legend position -->
3373 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3374 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3375 <label for="ays-chart-option-legend-alignment">
3376 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
3377 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") ); ?>">
3378 <i class="ays_fa ays_fa_info_circle"></i>
3379 </a>
3380 </label>
3381 </div>
3382 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3383 <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]">
3384 <?php
3385 foreach ( $legend_alignments as $option_slug => $option ):
3386 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
3387 ?>
3388 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3389 <?php
3390 endforeach;
3391 ?>
3392 </select>
3393 </div>
3394 </div> <!-- Legend alignment -->
3395 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3396 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3397 <label for="ays-chart-option-legend-font-color">
3398 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
3399 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the font color for the chart legend.","chart-builder") ); ?>">
3400 <i class="ays_fa ays_fa_info_circle"></i>
3401 </a>
3402 </label>
3403 </div>
3404 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3405 <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) ?>">
3406 </div>
3407 </div> <!-- Legend font color -->
3408 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3409 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3410 <label for="ays-chart-option-legend-font-size" class="form-label">
3411 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3412 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo 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") ); ?>">
3413 <i class="ays_fa ays_fa_info_circle"></i>
3414 </a>
3415 </label>
3416 </div>
3417 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3418 <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) ?>">
3419 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3420 </div>
3421 </div> <!-- Font size -->
3422 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3423 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3424 <label for="ays-chart-option-legend-italic">
3425 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3426 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
3427 <i class="ays_fa ays_fa_info_circle"></i>
3428 </a>
3429 </label>
3430 </div>
3431 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3432 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3433 <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); ?> >
3434 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3435 </label>
3436 </div>
3437 </div> <!-- Italic text -->
3438 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3439 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3440 <label for="ays-chart-option-legend-bold">
3441 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3442 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
3443 <i class="ays_fa ays_fa_info_circle"></i>
3444 </a>
3445 </label>
3446 </div>
3447 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3448 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3449 <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); ?> >
3450 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3451 </label>
3452 </div>
3453 </div> <!-- Bold text -->
3454 </div>
3455 </div>
3456 <?php
3457 $content = ob_get_clean();
3458
3459 $title = __( 'Legend', "chart-builder" );
3460
3461 $sources['legend'] = array(
3462 'content' => $content,
3463 'title' => $title
3464 );
3465
3466 return $sources;
3467 }
3468
3469 public function settings_contents_horizontal_axis_settings( $sources, $args ){
3470 $html_class_prefix = $args['html_class_prefix'];
3471 $html_name_prefix = $args['html_name_prefix'];
3472 $settings = $args['settings'];
3473
3474 $haxis_title = $settings['haxis_title'];
3475 $axes_text_positions = $settings['axes_text_positions'];
3476 $haxis_text_position = $settings['haxis_text_position'];
3477 $haxis_direction = $settings['haxis_direction'];
3478 $haxis_text_color = $settings['haxis_text_color'];
3479 $haxis_baseline_color = $settings['haxis_baseline_color'];
3480 $haxis_slanted_options = $settings['haxis_slanted_options'];
3481 $haxis_slanted = $settings['haxis_slanted'];
3482 $haxis_slanted_text_angle = $settings['haxis_slanted_text_angle'];
3483 $haxis_show_text_every = $settings['haxis_show_text_every'];
3484 $haxis_format_options = $settings['axes_format_options'];
3485 $haxis_format = $settings['haxis_format'];
3486 $haxis_label_font_size = $settings['haxis_label_font_size'];
3487 $haxis_max_value = $settings['haxis_max_value'];
3488 $haxis_min_value = $settings['haxis_min_value'];
3489 $haxis_text_font_size = $settings['haxis_text_font_size'];
3490 $haxis_label_color = $settings['haxis_label_color'];
3491 $haxis_bold = $settings['haxis_bold'];
3492 $haxis_italic = $settings['haxis_italic'];
3493 $haxis_title_bold = $settings['haxis_title_bold'];
3494 $haxis_title_italic = $settings['haxis_title_italic'];
3495 $haxis_gridlines_count = $settings['haxis_gridlines_count'];
3496 $haxis_gridlines_color = $settings['haxis_gridlines_color'];
3497 $haxis_minor_gridlines_color = $settings['haxis_minor_gridlines_color'];
3498
3499 ob_start();
3500 ?>
3501 <div class="ays-accordion-data-main-wrap <?= $html_class_prefix ?>options-haxis-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
3502 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3503 <h6>Label</h6>
3504 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3505 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3506 <label for="ays-chart-option-haxis-title" class="form-label">
3507 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3508 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The title of the horizontal axis","chart-builder") ); ?>">
3509 <i class="ays_fa ays_fa_info_circle"></i>
3510 </a>
3511 </label>
3512 </div>
3513 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3514 <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) ?>">
3515 </div>
3516 </div> <!-- Horizontal axis label -->
3517 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3518 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3519 <label for="ays-chart-option-haxis-label-font-size" class="form-label">
3520 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3521 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis label.","chart-builder") ); ?>">
3522 <i class="ays_fa ays_fa_info_circle"></i>
3523 </a>
3524 </label>
3525 </div>
3526 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3527 <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) ?>">
3528 </div>
3529 </div> <!-- Horizontal axis label font size -->
3530 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3531 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3532 <label for="ays-chart-option-haxis-label-color">
3533 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3534 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
3535 <i class="ays_fa ays_fa_info_circle"></i>
3536 </a>
3537 </label>
3538 </div>
3539 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3540 <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) ?>">
3541 </div>
3542 </div> <!-- Horizontal axis label color -->
3543 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3544 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3545 <label for="ays-chart-option-haxis-title-italic">
3546 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3547 <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") ); ?>">
3548 <i class="ays_fa ays_fa_info_circle"></i>
3549 </a>
3550 </label>
3551 </div>
3552 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3553 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3554 <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); ?> >
3555 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3556 </label>
3557 </div>
3558 </div> <!-- Italic label -->
3559 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3560 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3561 <label for="ays-chart-option-haxis-title-bold">
3562 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3563 <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") ); ?>">
3564 <i class="ays_fa ays_fa_info_circle"></i>
3565 </a>
3566 </label>
3567 </div>
3568 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3569 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3570 <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); ?> >
3571 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3572 </label>
3573 </div>
3574 </div> <!-- Bold label -->
3575 <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">
3576 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3577 <label for="ays-chart-option-haxis-show-text-every" class="form-label">
3578 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
3579 <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") ); ?>">
3580 <i class="ays_fa ays_fa_info_circle"></i>
3581 </a>
3582 </label>
3583 </div>
3584 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3585 <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">
3586 </div>
3587 </div> <!-- Label interval -->
3588
3589 <br>
3590 <h6>Text</h6>
3591 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3592 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3593 <label for="ays-chart-option-haxis-text-position" class="form-label">
3594 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3595 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Position of the horizontal axis text, relative to the chart area.","chart-builder") ); ?>">
3596 <i class="ays_fa ays_fa_info_circle"></i>
3597 </a>
3598 </label>
3599 </div>
3600 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3601 <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]">
3602 <?php
3603 foreach ( $axes_text_positions as $option_slug => $option ):
3604 $selected = ( $haxis_text_position == $option_slug ) ? 'selected' : '';
3605 ?>
3606 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3607 <?php
3608 endforeach;
3609 ?>
3610 </select>
3611 </div>
3612 </div> <!-- Horizontal axis text position -->
3613 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3614 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3615 <label for="ays-chart-option-haxis-text-color">
3616 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3617 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis text.","chart-builder") ); ?>">
3618 <i class="ays_fa ays_fa_info_circle"></i>
3619 </a>
3620 </label>
3621 </div>
3622 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3623 <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) ?>">
3624 </div>
3625 </div> <!-- Horizontal axis text color -->
3626 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3627 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3628 <label for="ays-chart-option-haxis-text-font-size" class="form-label">
3629 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3630 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
3631 <i class="ays_fa ays_fa_info_circle"></i>
3632 </a>
3633 </label>
3634 </div>
3635 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3636 <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) ?>">
3637 </div>
3638 </div> <!-- Horizontal axis text font size -->
3639 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3640 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3641 <label for="ays-chart-option-haxis-text-direction">
3642 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
3643 <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") ); ?>">
3644 <i class="ays_fa ays_fa_info_circle"></i>
3645 </a>
3646 </label>
3647 </div>
3648 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3649 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3650 <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); ?> >
3651 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3652 </label>
3653 </div>
3654 </div> <!-- Horizontal axis text direction -->
3655 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3656 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3657 <label for="ays-chart-option-haxis-italic">
3658 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3659 <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") ); ?>">
3660 <i class="ays_fa ays_fa_info_circle"></i>
3661 </a>
3662 </label>
3663 </div>
3664 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3665 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3666 <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); ?> >
3667 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3668 </label>
3669 </div>
3670 </div> <!-- Italic text -->
3671 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3672 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3673 <label for="ays-chart-option-haxis-bold">
3674 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3675 <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") ); ?>">
3676 <i class="ays_fa ays_fa_info_circle"></i>
3677 </a>
3678 </label>
3679 </div>
3680 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3681 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3682 <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); ?> >
3683 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3684 </label>
3685 </div>
3686 </div> <!-- Bold text -->
3687 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3688 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3689 <label for="ays-chart-option-haxis-slanted-text" class="form-label">
3690 <?php echo esc_html(__( "Slanted text", "chart-builder" )); ?>
3691 <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") ); ?>">
3692 <i class="ays_fa ays_fa_info_circle"></i>
3693 </a>
3694 </label>
3695 </div>
3696 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3697 <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]">
3698 <?php
3699 foreach ( $haxis_slanted_options as $option_slug => $option ):
3700 $selected = ( $haxis_slanted == $option_slug ) ? 'selected' : '';
3701 ?>
3702 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3703 <?php
3704 endforeach;
3705 ?>
3706 </select>
3707 </div>
3708 </div> <!-- Horizontal axis slanted text -->
3709 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section <?php echo ($haxis_slanted == 'false') ? 'display_none' : ''; ?>">
3710 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3711 <label for="ays-chart-option-haxis-slanted-text-angle" class="form-label">
3712 <?php echo esc_html(__( "Slanted text angle", "chart-builder" )); ?>
3713 <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") ); ?>">
3714 <i class="ays_fa ays_fa_info_circle"></i>
3715 </a>
3716 </label>
3717 </div>
3718 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3719 <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">
3720 </div>
3721 </div> <!-- Horizontal axis slanted text angle -->
3722
3723 <br>
3724 <h6>Gridlines</h6>
3725 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3726 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3727 <label for="ays-chart-option-haxis-gridlines-count" class="form-label">
3728 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
3729 <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") ); ?>">
3730 <i class="ays_fa ays_fa_info_circle"></i>
3731 </a>
3732 </label>
3733 </div>
3734 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3735 <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) ?>">
3736 </div>
3737 </div> <!-- Horizontal axis gridlines count -->
3738 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3739 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3740 <label for="ays-chart-option-haxis-gridlines-color">
3741 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3742 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis gridlines.","chart-builder") ); ?>">
3743 <i class="ays_fa ays_fa_info_circle"></i>
3744 </a>
3745 </label>
3746 </div>
3747 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3748 <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) ?>">
3749 </div>
3750 </div> <!-- Horizontal axis gridlines color -->
3751 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3752 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3753 <label for="ays-chart-option-haxis-minor-gridlines-color">
3754 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
3755 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis minor gridlines.","chart-builder") ); ?>">
3756 <i class="ays_fa ays_fa_info_circle"></i>
3757 </a>
3758 </label>
3759 </div>
3760 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3761 <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) ?>">
3762 </div>
3763 </div> <!-- Horizontal axis minor gridlines color -->
3764 <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">
3765 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3766 <label for="ays-chart-option-haxis-baseline-color">
3767 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
3768 <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") ); ?>">
3769 <i class="ays_fa ays_fa_info_circle"></i>
3770 </a>
3771 </label>
3772 </div>
3773 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3774 <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) ?>">
3775 </div>
3776 </div> <!-- Horizontal axis baseline color -->
3777
3778 <br>
3779 <h6>Format</h6>
3780 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3781 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3782 <label for="ays-chart-option-haxis-format" class="form-label">
3783 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
3784 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
3785 echo htmlspecialchars( sprintf (
3786 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
3787 __('%sNone:%s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
3788 __('%sDecimal:%s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
3789 __('%sScientific:%s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
3790 __('%sCurrency:%s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
3791 __('%sPercent:%s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
3792 __('%sShort:%s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
3793 __('%sLong:%s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
3794 '<em>', '</em>',
3795 '<em>', '</em>',
3796 '<em>', '</em>',
3797 '<em>', '</em>',
3798 '<em>', '</em>',
3799 '<em>', '</em>',
3800 '<em>', '</em>'
3801 ) );
3802 ?>">
3803 <i class="ays_fa ays_fa_info_circle"></i>
3804 </a>
3805 </label>
3806 </div>
3807 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3808 <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]">
3809 <?php
3810 foreach ( $haxis_format_options as $option_slug => $option ):
3811 $selected = ( $haxis_format == $option_slug ) ? 'selected' : '';
3812 ?>
3813 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3814 <?php
3815 endforeach;
3816 ?>
3817 </select>
3818 </div>
3819 </div> <!-- Horizontal axis format -->
3820 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3821 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3822 <label for="ays-chart-option-haxis-max-value" class="form-label">
3823 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
3824 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
3825 <i class="ays_fa ays_fa_info_circle"></i>
3826 </a>
3827 </label>
3828 </div>
3829 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3830 <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) ?>">
3831 </div>
3832 </div> <!-- Horizontal axis max value -->
3833 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3834 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3835 <label for="ays-chart-option-haxis-min-value" class="form-label">
3836 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
3837 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
3838 <i class="ays_fa ays_fa_info_circle"></i>
3839 </a>
3840 </label>
3841 </div>
3842 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3843 <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) ?>">
3844 </div>
3845 </div> <!-- Horizontal axis min value -->
3846 </div>
3847 </div>
3848 <?php
3849 $content = ob_get_clean();
3850
3851 $title = __( 'Horizontal Axis Settings', "chart-builder" );
3852
3853 $sources['horizontal_axis'] = array(
3854 'content' => $content,
3855 'title' => $title
3856 );
3857
3858 return $sources;
3859 }
3860
3861 public function settings_contents_vertical_axis_settings( $sources, $args ){
3862 $html_class_prefix = $args['html_class_prefix'];
3863 $html_name_prefix = $args['html_name_prefix'];
3864 $settings = $args['settings'];
3865
3866 $vaxis_title = $settings['vaxis_title'];
3867 $axes_text_positions = $settings['axes_text_positions'];
3868 $vaxis_text_position = $settings['vaxis_text_position'];
3869 $vaxis_direction = $settings['vaxis_direction'];
3870 $vaxis_text_color = $settings['vaxis_text_color'];
3871 $vaxis_baseline_color = $settings['vaxis_baseline_color'];
3872 $vaxis_format_options = $settings['axes_format_options'];
3873 $vaxis_format = $settings['vaxis_format'];
3874 $vaxis_label_font_size = $settings['vaxis_label_font_size'];
3875 $vaxis_max_value = $settings['vaxis_max_value'];
3876 $vaxis_min_value = $settings['vaxis_min_value'];
3877 $vaxis_text_font_size = $settings['vaxis_text_font_size'];
3878 $vaxis_label_color = $settings['vaxis_label_color'];
3879 $vaxis_bold = $settings['vaxis_bold'];
3880 $vaxis_italic = $settings['vaxis_italic'];
3881 $vaxis_title_bold = $settings['vaxis_title_bold'];
3882 $vaxis_title_italic = $settings['vaxis_title_italic'];
3883 $vaxis_gridlines_count = $settings['vaxis_gridlines_count'];
3884 $vaxis_gridlines_color = $settings['vaxis_gridlines_color'];
3885 $vaxis_minor_gridlines_color = $settings['vaxis_minor_gridlines_color'];
3886
3887 ob_start();
3888 ?>
3889 <div class="ays-accordion-data-main-wrap <?= $html_class_prefix ?>options-vaxis-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
3890 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3891 <h6>Label</h6>
3892 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3893 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3894 <label for="ays-chart-option-vaxis-title" class="form-label">
3895 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3896 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The title of the vertical axis","chart-builder") ); ?>">
3897 <i class="ays_fa ays_fa_info_circle"></i>
3898 </a>
3899 </label>
3900 </div>
3901 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3902 <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) ?>">
3903 </div>
3904 </div> <!-- Vertical axis label -->
3905 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3906 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3907 <label for="ays-chart-option-vaxis-label-font-size" class="form-label">
3908 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3909 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the vertical axis label.","chart-builder") ); ?>">
3910 <i class="ays_fa ays_fa_info_circle"></i>
3911 </a>
3912 </label>
3913 </div>
3914 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3915 <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) ?>">
3916 </div>
3917 </div> <!-- Vertical axis label font size -->
3918 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3919 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3920 <label for="ays-chart-option-vaxis-label-color">
3921 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3922 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
3923 <i class="ays_fa ays_fa_info_circle"></i>
3924 </a>
3925 </label>
3926 </div>
3927 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3928 <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) ?>">
3929 </div>
3930 </div> <!-- Vertical axis label color -->
3931 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3932 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3933 <label for="ays-chart-option-vaxis-title-italic">
3934 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3935 <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") ); ?>">
3936 <i class="ays_fa ays_fa_info_circle"></i>
3937 </a>
3938 </label>
3939 </div>
3940 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3941 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3942 <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); ?> >
3943 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3944 </label>
3945 </div>
3946 </div> <!-- Italic label -->
3947 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3948 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3949 <label for="ays-chart-option-vaxis-title-bold">
3950 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3951 <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") ); ?>">
3952 <i class="ays_fa ays_fa_info_circle"></i>
3953 </a>
3954 </label>
3955 </div>
3956 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3957 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3958 <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); ?> >
3959 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3960 </label>
3961 </div>
3962 </div> <!-- Bold label -->
3963
3964 <br>
3965 <h6>Text</h6>
3966 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3967 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3968 <label for="ays-chart-option-vaxis-text-position" class="form-label">
3969 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3970 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Position of the vertical axis text, relative to the chart area.","chart-builder") ); ?>">
3971 <i class="ays_fa ays_fa_info_circle"></i>
3972 </a>
3973 </label>
3974 </div>
3975 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3976 <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]">
3977 <?php
3978 foreach ( $axes_text_positions as $option_slug => $option ):
3979 $selected = ( $vaxis_text_position == $option_slug ) ? 'selected' : '';
3980 ?>
3981 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3982 <?php
3983 endforeach;
3984 ?>
3985 </select>
3986 </div>
3987 </div> <!-- Vertical axis text position -->
3988 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3989 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3990 <label for="ays-chart-option-vaxis-text-color">
3991 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3992 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis text.","chart-builder") ); ?>">
3993 <i class="ays_fa ays_fa_info_circle"></i>
3994 </a>
3995 </label>
3996 </div>
3997 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3998 <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) ?>">
3999 </div>
4000 </div> <!-- Vertical axis text color -->
4001 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4002 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4003 <label for="ays-chart-option-vaxis-text-font-size" class="form-label">
4004 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4005 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
4006 <i class="ays_fa ays_fa_info_circle"></i>
4007 </a>
4008 </label>
4009 </div>
4010 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4011 <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) ?>">
4012 </div>
4013 </div> <!-- Vertical axis text font size -->
4014 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4015 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4016 <label for="ays-chart-option-vaxis-text-direction">
4017 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
4018 <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") ); ?>">
4019 <i class="ays_fa ays_fa_info_circle"></i>
4020 </a>
4021 </label>
4022 </div>
4023 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4024 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4025 <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); ?> >
4026 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4027 </label>
4028 </div>
4029 </div> <!-- Vertical axis text direction -->
4030 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4031 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4032 <label for="ays-chart-option-vaxis-italic">
4033 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
4034 <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") ); ?>">
4035 <i class="ays_fa ays_fa_info_circle"></i>
4036 </a>
4037 </label>
4038 </div>
4039 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4040 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4041 <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); ?> >
4042 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4043 </label>
4044 </div>
4045 </div> <!-- Italic text -->
4046 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4047 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4048 <label for="ays-chart-option-vaxis-bold">
4049 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
4050 <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") ); ?>">
4051 <i class="ays_fa ays_fa_info_circle"></i>
4052 </a>
4053 </label>
4054 </div>
4055 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4056 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4057 <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); ?> >
4058 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4059 </label>
4060 </div>
4061 </div> <!-- Bold text -->
4062
4063 <br>
4064 <h6>Gridlines</h6>
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-vaxis-gridlines-count" class="form-label">
4068 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
4069 <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") ); ?>">
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) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4075 <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) ?>">
4076 </div>
4077 </div> <!-- Vertical axis gridlines count -->
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-vaxis-gridlines-color">
4081 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4082 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis gridlines.","chart-builder") ); ?>">
4083 <i class="ays_fa ays_fa_info_circle"></i>
4084 </a>
4085 </label>
4086 </div>
4087 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4088 <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) ?>">
4089 </div>
4090 </div> <!-- Vertical axis gridlines color -->
4091 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4092 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4093 <label for="ays-chart-option-vaxis-minor-gridlines-color">
4094 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
4095 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis minor gridlines.","chart-builder") ); ?>">
4096 <i class="ays_fa ays_fa_info_circle"></i>
4097 </a>
4098 </label>
4099 </div>
4100 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4101 <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) ?>">
4102 </div>
4103 </div> <!-- Vertical axis minor gridlines color -->
4104 <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">
4105 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4106 <label for="ays-chart-option-vaxis-baseline-color">
4107 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4108 <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") ); ?>">
4109 <i class="ays_fa ays_fa_info_circle"></i>
4110 </a>
4111 </label>
4112 </div>
4113 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4114 <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) ?>">
4115 </div>
4116 </div> <!-- Vertical axis baseline color -->
4117
4118 <br>
4119 <h6>Format</h6>
4120 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4121 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4122 <label for="ays-chart-option-vaxis-format" class="form-label">
4123 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4124 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4125 echo htmlspecialchars( sprintf (
4126 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4127 __('%sNone:%s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4128 __('%sDecimal:%s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4129 __('%sScientific:%s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4130 __('%sCurrency:%s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4131 __('%sPercent:%s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4132 __('%sShort:%s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4133 __('%sLong:%s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4134 '<em>', '</em>',
4135 '<em>', '</em>',
4136 '<em>', '</em>',
4137 '<em>', '</em>',
4138 '<em>', '</em>',
4139 '<em>', '</em>',
4140 '<em>', '</em>'
4141 ) );
4142 ?>">
4143 <i class="ays_fa ays_fa_info_circle"></i>
4144 </a>
4145 </label>
4146 </div>
4147 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4148 <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]">
4149 <?php
4150 foreach ( $vaxis_format_options as $option_slug => $option ):
4151 $selected = ( $vaxis_format == $option_slug ) ? 'selected' : '';
4152 ?>
4153 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4154 <?php
4155 endforeach;
4156 ?>
4157 </select>
4158 </div>
4159 </div> <!-- Vertical axis format -->
4160 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4161 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4162 <label for="ays-chart-option-vaxis-max-value" class="form-label">
4163 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4164 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4165 <i class="ays_fa ays_fa_info_circle"></i>
4166 </a>
4167 </label>
4168 </div>
4169 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4170 <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) ?>">
4171 </div>
4172 </div> <!-- Vertical axis max value -->
4173 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4174 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4175 <label for="ays-chart-option-vaxis-min-value" class="form-label">
4176 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4177 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4178 <i class="ays_fa ays_fa_info_circle"></i>
4179 </a>
4180 </label>
4181 </div>
4182 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4183 <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) ?>">
4184 </div>
4185 </div> <!-- Vertical axis min value -->
4186 </div>
4187 </div>
4188 <?php
4189 $content = ob_get_clean();
4190
4191 $title = __( 'Vertical Axis Settings', "chart-builder" );
4192
4193 $sources['vertical_axis'] = array(
4194 'content' => $content,
4195 'title' => $title
4196 );
4197
4198 return $sources;
4199 }
4200
4201 public function settings_contents_animation_settings( $sources, $args ) {
4202 $html_class_prefix = $args['html_class_prefix'];
4203 $html_name_prefix = $args['html_name_prefix'];
4204 $settings = $args['settings'];
4205
4206 $enable_animation = $settings['enable_animation'];
4207 $animation_duration = $settings['animation_duration'];
4208 $animation_startup = $settings['animation_startup'];
4209 $animation_easing_options = $settings['animation_easing_options'];
4210 $animation_easing = $settings['animation_easing'];
4211
4212 ob_start();
4213 ?>
4214 <div class="ays-accordion-data-main-wrap <?= $html_class_prefix ?>options-animation-settings-tab cb-changable-tab cb-bar_chart-tab cb-column_chart-tab cb-line_chart-tab">
4215 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4216 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4217 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4218 <label for="ays-chart-option-enable-animation">
4219 <?php echo esc_html(__( "Enable chart animation", "chart-builder" )); ?>
4220 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable chart animation.","chart-builder") ); ?>">
4221 <i class="ays_fa ays_fa_info_circle"></i>
4222 </a>
4223 </label>
4224 </div>
4225 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4226 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4227 <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); ?> >
4228 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4229 </label>
4230 </div>
4231 </div> <!-- Enable animation -->
4232 <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'; ?>">
4233 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4234 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4235 <label for="ays-chart-option-animation-duration" class="form-label">
4236 <?php echo esc_html(__( "Duration", "chart-builder" )); ?>
4237 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The duration of the chart animation, in milliseconds.","chart-builder") ); ?>">
4238 <i class="ays_fa ays_fa_info_circle"></i>
4239 </a>
4240 </label>
4241 </div>
4242 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4243 <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) ?>">
4244 </div>
4245 </div> <!-- Animation duration -->
4246 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4247 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4248 <label for="ays-chart-option-animation-startup">
4249 <?php echo esc_html(__( "Startup", "chart-builder" )); ?>
4250 <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") ); ?>">
4251 <i class="ays_fa ays_fa_info_circle"></i>
4252 </a>
4253 </label>
4254 </div>
4255 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4256 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4257 <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); ?> >
4258 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4259 </label>
4260 </div>
4261 </div> <!-- Animation startup -->
4262 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4263 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4264 <label for="ays-chart-option-animation-easing" class="form-label">
4265 <?php echo esc_html(__( "Easing", "chart-builder" )); ?>
4266 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4267 echo htmlspecialchars( sprintf(
4268 "<p>" . __('The easing function applied to the chart animation. The following options are available:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4269 __('%sLinear:%s Constant speed.', "chart-builder") . "</li><li>" .
4270 __('%sEase in:%s Start slow and speed up.', "chart-builder") . "</li><li>" .
4271 __('%sEase out:%s Start fast and slow down.', "chart-builder") . "</li><li>" .
4272 __('%sEase in and out:%s Start slow, speed up, then slow down.', "chart-builder") . "</li></ul>",
4273 '<em>',
4274 '</em>',
4275 '<em>',
4276 '</em>',
4277 '<em>',
4278 '</em>',
4279 '<em>',
4280 '</em>'
4281 ) );
4282 ?>">
4283 <i class="ays_fa ays_fa_info_circle"></i>
4284 </a>
4285 </label>
4286 </div>
4287 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4288 <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]">
4289 <?php
4290 foreach ( $animation_easing_options as $option_slug => $option ):
4291 $selected = ( $animation_easing == $option_slug ) ? 'selected' : '';
4292 ?>
4293 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4294 <?php
4295 endforeach;
4296 ?>
4297 </select>
4298 </div>
4299 </div> <!-- Animation easing -->
4300 <div>
4301 </div>
4302 </div>
4303 <?php
4304 $content = ob_get_clean();
4305
4306 $title = __( 'Chart animation', "chart-builder" );
4307
4308 $sources['animation'] = array(
4309 'content' => $content,
4310 'title' => $title
4311 );
4312
4313 return $sources;
4314 }
4315
4316 public function settings_contents_live_chart_settings( $sources, $args ) {
4317 $html_class_prefix = $args['html_class_prefix'];
4318 $html_name_prefix = $args['html_name_prefix'];
4319
4320 ob_start();
4321 ?>
4322 <div class="ays-accordion-data-main-wrap <?= $html_class_prefix ?>options-live-chart-settings-tab">
4323 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4324 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4325 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4326 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4327 <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>
4328 <div class="ays-pro-features-v2-video-text">
4329 <?php echo __("Watch Video" , "chart-builder"); ?>
4330 </div>
4331 </a>
4332 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4333 <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>
4334 <div class="ays-pro-features-v2-upgrade-text">
4335 <?php echo __("Upgrade" , "chart-builder"); ?>
4336 </div>
4337 </a>
4338 </div>
4339 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4340 <label for="ays-chart-option-enable-live-chart">
4341 <?php echo esc_html(__( "Enable live chart", "chart-builder" )); ?>
4342 <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") ); ?>">
4343 <i class="ays_fa ays_fa_info_circle"></i>
4344 </a>
4345 </label>
4346 </div>
4347 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4348 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4349 <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">
4350 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4351 </label>
4352 </div>
4353 </div> <!-- Enable live chart -->
4354 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4355 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4356 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4357 <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>
4358 <div class="ays-pro-features-v2-video-text">
4359 <?php echo __("Watch Video" , "chart-builder"); ?>
4360 </div>
4361 </a>
4362 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4363 <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>
4364 <div class="ays-pro-features-v2-upgrade-text">
4365 <?php echo __("Upgrade" , "chart-builder"); ?>
4366 </div>
4367 </a>
4368 </div>
4369 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4370 <label for="ays-chart-option-live-chart-interval" class="form-label">
4371 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
4372 <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") ); ?>">
4373 <i class="ays_fa ays_fa_info_circle"></i>
4374 </a>
4375 </label>
4376 </div>
4377 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4378 <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">
4379 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">ms</div>
4380 </div>
4381 </div> <!-- Live chart interval -->
4382 </div>
4383 </div>
4384 <?php
4385 $content = ob_get_clean();
4386
4387 $title = __( 'Live Chart', "chart-builder" );
4388
4389 $sources['live_chart'] = array(
4390 'content' => $content,
4391 'title' => $title
4392 );
4393
4394 return $sources;
4395
4396 }
4397
4398 public function settings_contents_export_options( $sources, $args ){
4399 $html_class_prefix = $args['html_class_prefix'];
4400 $html_name_prefix = $args['html_name_prefix'];
4401 $settings = $args['settings'];
4402
4403 $enable_img = $settings['enable_img'];
4404
4405 ob_start();
4406 ?>
4407 <div class="ays-accordion-data-main-wrap <?= $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">
4408 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4409 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4410 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4411 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4412 <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>
4413 <div class="ays-pro-features-v2-video-text">
4414 <?php echo __("Watch Video" , "chart-builder"); ?>
4415 </div>
4416 </a>
4417 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4418 <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>
4419 <div class="ays-pro-features-v2-upgrade-text">
4420 <?php echo __("Upgrade" , "chart-builder"); ?>
4421 </div>
4422 </a>
4423 </div>
4424 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4425 <label for="ays-chart-option-export-print">
4426 <?php echo esc_html(__( "Print chart", "chart-builder" )); ?>
4427 <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") ); ?>">
4428 <i class="ays_fa ays_fa_info_circle"></i>
4429 </a>
4430 </label>
4431 </div>
4432 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4433 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4434 <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">
4435 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4436 </label>
4437 </div>
4438 </div> <!-- Print option end -->
4439 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4440 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4441 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4442 <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>
4443 <div class="ays-pro-features-v2-video-text">
4444 <?php echo __("Watch Video" , "chart-builder"); ?>
4445 </div>
4446 </a>
4447 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4448 <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>
4449 <div class="ays-pro-features-v2-upgrade-text">
4450 <?php echo __("Upgrade" , "chart-builder"); ?>
4451 </div>
4452 </a>
4453 </div>
4454 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4455 <label for="ays-chart-option-export-Excel">
4456 <?php echo esc_html(__( "Excel download", "chart-builder" )); ?>
4457 <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") ); ?>">
4458 <i class="ays_fa ays_fa_info_circle"></i>
4459 </a>
4460 </label>
4461 </div>
4462 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4463 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4464 <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">
4465 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4466 </label>
4467 </div>
4468 </div> <!-- Excel option end -->
4469 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4470 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4471 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4472 <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>
4473 <div class="ays-pro-features-v2-video-text">
4474 <?php echo __("Watch Video" , "chart-builder"); ?>
4475 </div>
4476 </a>
4477 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4478 <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>
4479 <div class="ays-pro-features-v2-upgrade-text">
4480 <?php echo __("Upgrade" , "chart-builder"); ?>
4481 </div>
4482 </a>
4483 </div>
4484 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4485 <label for="ays-chart-option-export-CSV">
4486 <?php echo esc_html(__( "CSV download", "chart-builder" )); ?>
4487 <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") ); ?>">
4488 <i class="ays_fa ays_fa_info_circle"></i>
4489 </a>
4490 </label>
4491 </div>
4492 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4493 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4494 <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">
4495 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4496 </label>
4497 </div>
4498 </div> <!-- CSV option end -->
4499 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4500 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4501 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4502 <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>
4503 <div class="ays-pro-features-v2-video-text">
4504 <?php echo __("Watch Video" , "chart-builder"); ?>
4505 </div>
4506 </a>
4507 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4508 <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>
4509 <div class="ays-pro-features-v2-upgrade-text">
4510 <?php echo __("Upgrade" , "chart-builder"); ?>
4511 </div>
4512 </a>
4513 </div>
4514 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4515 <label for="ays-chart-option-export-Copy">
4516 <?php echo esc_html(__( "Copy chart data", "chart-builder" )); ?>
4517 <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") ); ?>">
4518 <i class="ays_fa ays_fa_info_circle"></i>
4519 </a>
4520 </label>
4521 </div>
4522 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4523 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4524 <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">
4525 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4526 </label>
4527 </div>
4528 </div> <!-- Copy option end -->
4529 <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">
4530 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4531 <label for="ays-chart-option-export-img">
4532 <?php echo esc_html(__( "Download chart image", "chart-builder" )); ?>
4533 <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") ); ?>">
4534 <i class="ays_fa ays_fa_info_circle"></i>
4535 </a>
4536 </label>
4537 </div>
4538 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4539 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4540 <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 $enable_img?> >
4541 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4542 </label>
4543 </div>
4544 </div> <!-- IMG option end -->
4545 </div>
4546 </div>
4547 <?php
4548
4549 $content = ob_get_clean();
4550
4551 $title = __( 'Frontend Actions', "chart-builder" );
4552
4553 $sources['export_options'] = array(
4554 'content' => $content,
4555 'title' => $title
4556 );
4557
4558 return $sources;
4559 }
4560
4561 /**
4562 * Chart page styles contents
4563 * @param $args
4564 */
4565 public function ays_chart_page_styles_contents( $args ){
4566 $chart_source_type = $args['chart_source_type'];
4567
4568 if ($chart_source_type === 'chart-js') {
4569 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings_chartjs', array(), $args );
4570 } else {
4571 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings', array(), $args );
4572 }
4573
4574 $sources = array();
4575 foreach ( $sources_contents as $key => $sources_content ) {
4576 $collapsed = $key == 'chart' ? 'false' : 'true';
4577
4578 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
4579 if(isset($sources_content['title'])){
4580 $content .= '<legend class="ays-accordion-options-header">';
4581 $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">
4582 <g>
4583 <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" />
4584 </g>
4585 </svg>';
4586
4587 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
4588 }
4589
4590 $content .= '<div class="ays-accordion-options-content">';
4591 $content .= $sources_content['content'];
4592 $content .= '</div>';
4593
4594 $content .= '</fieldset>';
4595
4596 $sources[] = $content;
4597 }
4598 $content_for_escape = implode('' , $sources );
4599 echo html_entity_decode(esc_html( $content_for_escape ));
4600 }
4601
4602 public function settings_contents_chart_styles_settings( $sources, $args ){
4603 $html_class_prefix = $args['html_class_prefix'];
4604 $html_name_prefix = $args['html_name_prefix'];
4605 $settings = $args['settings'];
4606
4607 $width = $settings['width'];
4608 $width_format = $settings['width_format'];
4609 $title_positions = $settings['title_positions'];
4610 $position = $settings['position'];
4611 $width_format_options = $settings['width_format_options'];
4612 $responsive_width = $settings['responsive_width'];
4613 $height = $settings['height'];
4614 $height_format = $settings['height_format'];
4615 $font_size = $settings['font_size'];
4616 $org_chart_font_size_options = $settings['org_chart_font_size_options'];
4617 $org_chart_font_size = $settings['org_chart_font_size'];
4618 $background_color = $settings['background_color'];
4619 $transparent_background = $settings['transparent_background'];
4620 $border_width = $settings['border_width'];
4621 $border_radius = $settings['border_radius'];
4622 $border_color = $settings['border_color'];
4623 $box_shadow = $settings['box_shadow'];
4624 $box_shadow_color = $settings['box_shadow_color'];
4625 ob_start();
4626 ?>
4627 <div class="ays-accordion-data-main-wrap">
4628 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4629 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4630 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4631 <label for="ays-chart-option-width" class="form-label">
4632 <?php echo esc_html(__( "Width", "chart-builder" )); ?>
4633 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The width of the chart container, in percents.","chart-builder") ); ?>">
4634 <i class="ays_fa ays_fa_info_circle"></i>
4635 </a>
4636 </label>
4637 </div>
4638 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4639 <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) ?>">
4640 <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]">
4641 <?php
4642 foreach ( $width_format_options as $option_slug => $option ):
4643 $selected = ( $width_format == $option_slug ) ? 'selected' : '';
4644 ?>
4645 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4646 <?php
4647 endforeach;
4648 ?>
4649 </select>
4650 </div>
4651 </div> <!-- Width -->
4652 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4653 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4654 <label for="ays-chart-option-responsive-width" class="form-label">
4655 <?php echo esc_html(__( "Responsive Width", "chart-builder" )); ?>
4656 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("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") ); ?>">
4657 <i class="ays_fa ays_fa_info_circle"></i>
4658 </a>
4659 </label>
4660 </div>
4661 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4662 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4663 <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); ?> >
4664 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4665 </label>
4666 </div>
4667 </div> <!-- Responsive Width -->
4668 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4669 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4670 <label for="ays-chart-option-position">
4671 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4672 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart. Note: The changes will be visible when the width option is not set to 100%","chart-builder") ); ?>">
4673 <i class="ays_fa ays_fa_info_circle"></i>
4674 </a>
4675 </label>
4676 </div>
4677 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4678 <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]">
4679 <?php
4680 foreach ( $title_positions as $option_slug => $option ):
4681 $selected = ( $position == $option_slug ) ? 'selected' : '';
4682 ?>
4683 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4684 <?php
4685 endforeach;
4686 ?>
4687 </select>
4688 </div>
4689 </div> <!-- Title position -->
4690 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4691 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4692 <label for="ays-chart-option-height" class="form-label">
4693 <?php echo esc_html(__( "Height", "chart-builder" )); ?>
4694 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The height of the chart container, in pixels.","chart-builder") ); ?>">
4695 <i class="ays_fa ays_fa_info_circle"></i>
4696 </a>
4697 </label>
4698 </div>
4699 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4700 <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) ?>">
4701 <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]">
4702 <?php
4703 foreach ( $width_format_options as $option_slug => $option ):
4704 $selected = ( $height_format == $option_slug ) ? 'selected' : '';
4705 ?>
4706 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4707 <?php
4708 endforeach;
4709 ?>
4710 </select>
4711 </div>
4712 </div> <!-- Height -->
4713 <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">
4714 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4715 <label for="ays-chart-option-font-size" class="form-label">
4716 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4717 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart text.","chart-builder") ); ?>">
4718 <i class="ays_fa ays_fa_info_circle"></i>
4719 </a>
4720 </label>
4721 </div>
4722 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4723 <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) ?>">
4724 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
4725 </div>
4726 </div> <!-- Font size -->
4727 <div class="form-group row mb-2 <?= $html_class_prefix ?>options-section cb-changable-opt cb-org_chart-opt display_none">
4728 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
4729 <label for="ays-chart-option-org-chart-font-size" class="form-label">
4730 <?php echo __( "Element size", $this->plugin_name ); ?>
4731 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The size of the chart element.","chart-builder") ); ?>">
4732 <i class="ays_fa ays_fa_info_circle"></i>
4733 </a>
4734 </label>
4735 </div>
4736 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4737 <select class="<?= $html_class_prefix ?>option-select-input form-select" id="ays-chart-option-org-chart-font-size" name="<?php echo $html_name_prefix; ?>settings[org_chart_font_size]">
4738 <?php
4739 foreach ( $org_chart_font_size_options as $option_slug => $option ):
4740 $selected = ( $org_chart_font_size == $option_slug ) ? 'selected' : '';
4741 ?>
4742 <option value="<?php echo $option_slug; ?>" <?php echo $selected; ?>><?php echo $option; ?></option>
4743 <?php
4744 endforeach;
4745 ?>
4746 </select>
4747 </div>
4748 </div> <!-- Font size for org type -->
4749 <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">
4750 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4751 <label for="ays-chart-option-background-color">
4752 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
4753 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The background color of the chart container.","chart-builder") ); ?>">
4754 <i class="ays_fa ays_fa_info_circle"></i>
4755 </a>
4756 </label>
4757 </div>
4758 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4759 <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) ?>">
4760 </div>
4761 </div> <!-- Background color -->
4762 <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">
4763 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4764 <label for="ays-chart-option-transparent-background" class="form-label">
4765 <?php echo esc_html(__( "Transparent background", "chart-builder" )); ?>
4766 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("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") ); ?>">
4767 <i class="ays_fa ays_fa_info_circle"></i>
4768 </a>
4769 </label>
4770 </div>
4771 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4772 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4773 <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); ?> >
4774 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4775 </label>
4776 </div>
4777 </div> <!-- Transparent background -->
4778 <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">
4779 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4780 <label for="ays-chart-option-border-width">
4781 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
4782 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The width of the chart container border.","chart-builder") ); ?>">
4783 <i class="ays_fa ays_fa_info_circle"></i>
4784 </a>
4785 </label>
4786 </div>
4787 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4788 <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) ?>">
4789 </div>
4790 </div> <!-- Border Width -->
4791 <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">
4792 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4793 <label for="ays-chart-option-border-color">
4794 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
4795 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border color of the chart container.","chart-builder") ); ?>">
4796 <i class="ays_fa ays_fa_info_circle"></i>
4797 </a>
4798 </label>
4799 </div>
4800 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4801 <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) ?>">
4802 </div>
4803 </div> <!-- Border color -->
4804 <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">
4805 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4806 <label for="ays-chart-option-border-radius">
4807 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
4808 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border radius of the chart container.","chart-builder") ); ?>">
4809 <i class="ays_fa ays_fa_info_circle"></i>
4810 </a>
4811 </label>
4812 </div>
4813 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4814 <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) ?>">
4815 </div>
4816 </div> <!-- Border radius -->
4817 <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">
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-box-shadow" class="form-label">
4820 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
4821 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add shadow to chart's container.","chart-builder") ); ?>">
4822 <i class="ays_fa ays_fa_info_circle"></i>
4823 </a>
4824 </label>
4825 </div>
4826 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4827 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4828 <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); ?> >
4829 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4830 </label>
4831 </div>
4832 </div> <!-- box shadow -->
4833 <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">
4834 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4835 <label for="ays-chart-option-box-shadow-color" class="form-label">
4836 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
4837 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
4838 <i class="ays_fa ays_fa_info_circle"></i>
4839 </a>
4840 </label>
4841 </div>
4842 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4843 <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) ?>">
4844 </div>
4845 </div> <!-- box shadow color -->
4846 </div>
4847 </div>
4848 <?php
4849 $content = ob_get_clean();
4850
4851 $title = __( 'Chart', "chart-builder" );
4852
4853 $sources['chart'] = array(
4854 'content' => $content,
4855 'title' => $title
4856 );
4857
4858 return $sources;
4859 }
4860
4861 public function settings_contents_chart_area_styles_settings( $sources, $args ){
4862 $html_class_prefix = $args['html_class_prefix'];
4863 $html_name_prefix = $args['html_name_prefix'];
4864 $settings = $args['settings'];
4865
4866 $chart_background_color = $settings['chart_background_color'];
4867 $chart_border_color = $settings['chart_border_color'];
4868 $chart_left_margin = $settings['chart_left_margin'];
4869 $chart_right_margin = $settings['chart_right_margin'];
4870 $chart_top_margin = $settings['chart_top_margin'];
4871 $chart_bottom_margin = $settings['chart_bottom_margin'];
4872 $chart_border_width = $settings['chart_border_width'];
4873 ob_start();
4874 ?>
4875 <div class="ays-accordion-data-main-wrap">
4876 <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">
4877 <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">
4878 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4879 <label for="ays-chart-option-chart-background-color">
4880 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
4881 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The background color of the chart area.","chart-builder") ); ?>">
4882 <i class="ays_fa ays_fa_info_circle"></i>
4883 </a>
4884 </label>
4885 </div>
4886 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4887 <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) ?>">
4888 </div>
4889 </div> <!-- Chart Area background color -->
4890 <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">
4891 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4892 <label for="ays-chart-option-chart-border-width">
4893 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
4894 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border width of the chart area.","chart-builder") ); ?>">
4895 <i class="ays_fa ays_fa_info_circle"></i>
4896 </a>
4897 </label>
4898 </div>
4899 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4900 <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) ?>">
4901 </div>
4902 </div> <!-- Chart Area Border Width -->
4903 <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">
4904 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4905 <label for="ays-chart-option-chart-border-color">
4906 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
4907 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border color of the chart area.","chart-builder") ); ?>">
4908 <i class="ays_fa ays_fa_info_circle"></i>
4909 </a>
4910 </label>
4911 </div>
4912 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4913 <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) ?>">
4914 </div>
4915 </div> <!-- Chart Area border color -->
4916 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4917 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4918 <label for="ays-chart-option-chart-left-margin">
4919 <?php echo esc_html(__( "Left Margin", "chart-builder" )); ?>
4920 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the chart's distance from the left border. Leave blank for auto-positioning.","chart-builder") ); ?>">
4921 <i class="ays_fa ays_fa_info_circle"></i>
4922 </a>
4923 </label>
4924 </div>
4925 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4926 <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) ?>">
4927 </div>
4928 </div> <!-- Chart Area Left Margin -->
4929 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4930 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4931 <label for="ays-chart-option-chart-right-margin">
4932 <?php echo esc_html(__( "Right Margin", "chart-builder" )); ?>
4933 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the chart's distance from the right border. Leave blank for auto-positioning.","chart-builder") ); ?>">
4934 <i class="ays_fa ays_fa_info_circle"></i>
4935 </a>
4936 </label>
4937 </div>
4938 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4939 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-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) ?>">
4940 </div>
4941 </div> <!-- Chart Area Right Margin -->
4942 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4943 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4944 <label for="ays-chart-option-chart-top-margin">
4945 <?php echo esc_html(__( "Top Margin", "chart-builder" )); ?>
4946 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the chart's distance from the top border. Leave blank for auto-positioning.","chart-builder") ); ?>">
4947 <i class="ays_fa ays_fa_info_circle"></i>
4948 </a>
4949 </label>
4950 </div>
4951 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4952 <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) ?>">
4953 </div>
4954 </div> <!-- Chart Area Top Margin -->
4955 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4956 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4957 <label for="ays-chart-option-chart-bottom-margin">
4958 <?php echo esc_html(__( "Bottom Margin", "chart-builder" )); ?>
4959 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the chart's distance from the bottom border. Leave blank for auto-positioning.","chart-builder") ); ?>">
4960 <i class="ays_fa ays_fa_info_circle"></i>
4961 </a>
4962 </label>
4963 </div>
4964 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4965 <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) ?>">
4966 </div>
4967 </div> <!-- Chart Area Bottom Margin -->
4968 </div>
4969 </div>
4970 <?php
4971 $content = ob_get_clean();
4972
4973 $title = __( 'Chart Area', "chart-builder" );
4974
4975 $sources['chart_area'] = array(
4976 'content' => $content,
4977 'title' => $title
4978 );
4979
4980 return $sources;
4981 }
4982
4983 public function settings_contents_title_styles_settings( $sources, $args ){
4984 $html_class_prefix = $args['html_class_prefix'];
4985 $html_name_prefix = $args['html_name_prefix'];
4986 $settings = $args['settings'];
4987
4988 $title_color = $settings['title_color'];
4989 $title_shadow_color = $settings['title_shadow_color'];
4990 $title_font_size = $settings['title_font_size'];
4991 $title_gap = $settings['title_gap'];
4992 $title_gap_description = $settings['title_gap_description'];
4993 $title_positions = $settings['title_positions'];
4994 $title_position = $settings['title_position'];
4995 $title_bold = $settings['title_bold'];
4996 $title_text_shadow = $settings['title_text_shadow'];
4997 $title_italic = $settings['title_italic'];
4998 $text_transforms = $settings['text_transforms'];
4999 $text_decorations = $settings['text_decorations'];
5000 $title_text_transform = $settings['title_text_transform'];
5001 $title_text_decoration = $settings['title_text_decoration'];
5002 $title_letter_spacing = $settings['title_letter_spacing'];
5003 ob_start();
5004 ?>
5005 <div class="ays-accordion-data-main-wrap">
5006 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5007 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5008 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5009 <label for="ays-chart-option-title-color">
5010 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5011 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart title.","chart-builder") ); ?>">
5012 <i class="ays_fa ays_fa_info_circle"></i>
5013 </a>
5014 </label>
5015 </div>
5016 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5017 <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) ?>">
5018 </div>
5019 </div> <!-- Chart title color -->
5020 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5021 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5022 <label for="ays-chart-option-title-font-size" class="form-label">
5023 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5024 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart title.","chart-builder") ); ?>">
5025 <i class="ays_fa ays_fa_info_circle"></i>
5026 </a>
5027 </label>
5028 </div>
5029 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5030 <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) ?>">
5031 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5032 </div>
5033 </div> <!-- Chart title font size -->
5034 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5035 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5036 <label for="ays-chart-option-title-bold" class="form-label">
5037 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5038 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
5039 <i class="ays_fa ays_fa_info_circle"></i>
5040 </a>
5041 </label>
5042 </div>
5043 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5044 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5045 <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); ?> >
5046 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5047 </label>
5048 </div>
5049 </div> <!-- Title bold -->
5050 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5051 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5052 <label for="ays-chart-option-title-italic" class="form-label">
5053 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5054 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
5055 <i class="ays_fa ays_fa_info_circle"></i>
5056 </a>
5057 </label>
5058 </div>
5059 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5060 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5061 <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); ?> >
5062 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5063 </label>
5064 </div>
5065 </div> <!-- Title italic -->
5066 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5067 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5068 <label for="ays-chart-option-title-position">
5069 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5070 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart title.","chart-builder") ); ?>">
5071 <i class="ays_fa ays_fa_info_circle"></i>
5072 </a>
5073 </label>
5074 </div>
5075 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5076 <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]">
5077 <?php
5078 foreach ( $title_positions as $option_slug => $option ):
5079 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5080 ?>
5081 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5082 <?php
5083 endforeach;
5084 ?>
5085 </select>
5086 </div>
5087 </div> <!-- Title position -->
5088 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5089 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5090 <label for="ays-chart-option-title-gap" class="form-label">
5091 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5092 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title and the chart container.","chart-builder") ); ?>">
5093 <i class="ays_fa ays_fa_info_circle"></i>
5094 </a>
5095 </label>
5096 </div>
5097 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5098 <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) ?>">
5099 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5100 </div>
5101 </div> <!-- Chart title gap -->
5102 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5103 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5104 <label for="ays-chart-option-title-gap-description" class="form-label">
5105 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5106 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title and the chart description.","chart-builder") ); ?>">
5107 <i class="ays_fa ays_fa_info_circle"></i>
5108 </a>
5109 </label>
5110 </div>
5111 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5112 <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) ?>">
5113 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5114 </div>
5115 </div> <!-- Chart title gap -->
5116 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5117 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5118 <label for="ays-chart-option-title-text-transform">
5119 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5120 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5121 <i class="ays_fa ays_fa_info_circle"></i>
5122 </a>
5123 </label>
5124 </div>
5125 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5126 <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]">
5127 <?php
5128 foreach ( $text_transforms as $option_slug => $option ):
5129 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5130 ?>
5131 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5132 <?php
5133 endforeach;
5134 ?>
5135 </select>
5136 </div>
5137 </div> <!-- Title text transform -->
5138 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5139 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5140 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5141 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5142 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5143 <i class="ays_fa ays_fa_info_circle"></i>
5144 </a>
5145 </label>
5146 </div>
5147 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5148 <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) ?>">
5149 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5150 </div>
5151 </div> <!-- Chart title letter spacing -->
5152 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5153 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5154 <label for="ays-chart-option-title-text-decoration">
5155 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5156 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5157 <i class="ays_fa ays_fa_info_circle"></i>
5158 </a>
5159 </label>
5160 </div>
5161 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5162 <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]">
5163 <?php
5164 foreach ( $text_decorations as $option_slug => $option ):
5165 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5166 ?>
5167 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5168 <?php
5169 endforeach;
5170 ?>
5171 </select>
5172 </div>
5173 </div> <!-- Title text decoration -->
5174 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5175 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5176 <label for="ays-chart-option-title-text-shadow" class="form-label">
5177 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5178 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add a text shadow to chart title.","chart-builder") ); ?>">
5179 <i class="ays_fa ays_fa_info_circle"></i>
5180 </a>
5181 </label>
5182 </div>
5183 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5184 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5185 <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); ?> >
5186 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5187 </label>
5188 </div>
5189 </div> <!-- Title bold -->
5190 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5191 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5192 <label for="ays-chart-option-title-shadow-color">
5193 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5194 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5195 <i class="ays_fa ays_fa_info_circle"></i>
5196 </a>
5197 </label>
5198 </div>
5199 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5200 <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) ?>">
5201 </div>
5202 </div> <!-- Chart title color -->
5203 </div>
5204 </div>
5205 <?php
5206 $content = ob_get_clean();
5207
5208 $title = __( 'Title', "chart-builder" );
5209
5210 $sources['title'] = array(
5211 'content' => $content,
5212 'title' => $title
5213 );
5214
5215 return $sources;
5216 }
5217
5218 public function settings_contents_title_styles_settings_chartjs( $sources, $args ){
5219 $html_class_prefix = $args['html_class_prefix'];
5220 $html_name_prefix = $args['html_name_prefix'];
5221 $settings = $args['settings'];
5222
5223 $title_color = $settings['title_color'];
5224 $title_shadow_color = $settings['title_shadow_color'];
5225 $title_font_size = $settings['title_font_size'];
5226 $title_gap = $settings['title_gap'];
5227 $title_gap_description = $settings['title_gap_description'];
5228 $title_positions = $settings['title_positions'];
5229 $title_position = $settings['title_position'];
5230 $title_bold = $settings['title_bold'];
5231 $title_text_shadow = $settings['title_text_shadow'];
5232 $title_italic = $settings['title_italic'];
5233 $text_transforms = $settings['text_transforms'];
5234 $text_decorations = $settings['text_decorations'];
5235 $title_text_transform = $settings['title_text_transform'];
5236 $title_text_decoration = $settings['title_text_decoration'];
5237 $title_letter_spacing = $settings['title_letter_spacing'];
5238 ob_start();
5239 ?>
5240 <div class="ays-accordion-data-main-wrap">
5241 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5242 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5243 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5244 <label for="ays-chart-option-title-color">
5245 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5246 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart title.","chart-builder") ); ?>">
5247 <i class="ays_fa ays_fa_info_circle"></i>
5248 </a>
5249 </label>
5250 </div>
5251 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5252 <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) ?>">
5253 </div>
5254 </div> <!-- Chart title color -->
5255 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5256 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5257 <label for="ays-chart-option-title-font-size" class="form-label">
5258 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5259 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart title.","chart-builder") ); ?>">
5260 <i class="ays_fa ays_fa_info_circle"></i>
5261 </a>
5262 </label>
5263 </div>
5264 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5265 <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) ?>">
5266 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5267 </div>
5268 </div> <!-- Chart title font size -->
5269 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5270 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5271 <label for="ays-chart-option-title-bold" class="form-label">
5272 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5273 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
5274 <i class="ays_fa ays_fa_info_circle"></i>
5275 </a>
5276 </label>
5277 </div>
5278 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5279 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5280 <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); ?> >
5281 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5282 </label>
5283 </div>
5284 </div> <!-- Title bold -->
5285 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5286 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5287 <label for="ays-chart-option-title-italic" class="form-label">
5288 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5289 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
5290 <i class="ays_fa ays_fa_info_circle"></i>
5291 </a>
5292 </label>
5293 </div>
5294 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5295 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5296 <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); ?> >
5297 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5298 </label>
5299 </div>
5300 </div> <!-- Title italic -->
5301 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5302 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5303 <label for="ays-chart-option-title-position">
5304 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5305 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart title.","chart-builder") ); ?>">
5306 <i class="ays_fa ays_fa_info_circle"></i>
5307 </a>
5308 </label>
5309 </div>
5310 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5311 <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]">
5312 <?php
5313 foreach ( $title_positions as $option_slug => $option ):
5314 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5315 ?>
5316 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5317 <?php
5318 endforeach;
5319 ?>
5320 </select>
5321 </div>
5322 </div> <!-- Title position -->
5323 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5324 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5325 <label for="ays-chart-option-title-gap" class="form-label">
5326 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5327 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title and the chart container.","chart-builder") ); ?>">
5328 <i class="ays_fa ays_fa_info_circle"></i>
5329 </a>
5330 </label>
5331 </div>
5332 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5333 <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) ?>">
5334 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5335 </div>
5336 </div> <!-- Chart title gap -->
5337 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5338 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5339 <label for="ays-chart-option-title-gap-description" class="form-label">
5340 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5341 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title and the chart description.","chart-builder") ); ?>">
5342 <i class="ays_fa ays_fa_info_circle"></i>
5343 </a>
5344 </label>
5345 </div>
5346 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5347 <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) ?>">
5348 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5349 </div>
5350 </div> <!-- Chart title gap -->
5351 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5352 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5353 <label for="ays-chart-option-title-text-transform">
5354 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5355 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5356 <i class="ays_fa ays_fa_info_circle"></i>
5357 </a>
5358 </label>
5359 </div>
5360 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5361 <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]">
5362 <?php
5363 foreach ( $text_transforms as $option_slug => $option ):
5364 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5365 ?>
5366 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5367 <?php
5368 endforeach;
5369 ?>
5370 </select>
5371 </div>
5372 </div> <!-- Title text transform -->
5373 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5374 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5375 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5376 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5377 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5378 <i class="ays_fa ays_fa_info_circle"></i>
5379 </a>
5380 </label>
5381 </div>
5382 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5383 <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) ?>">
5384 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5385 </div>
5386 </div> <!-- Chart title letter spacing -->
5387 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5388 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5389 <label for="ays-chart-option-title-text-decoration">
5390 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5391 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5392 <i class="ays_fa ays_fa_info_circle"></i>
5393 </a>
5394 </label>
5395 </div>
5396 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5397 <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]">
5398 <?php
5399 foreach ( $text_decorations as $option_slug => $option ):
5400 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5401 ?>
5402 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5403 <?php
5404 endforeach;
5405 ?>
5406 </select>
5407 </div>
5408 </div> <!-- Title text decoration -->
5409 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
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-title-text-shadow" class="form-label">
5412 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5413 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add a text shadow to chart title.","chart-builder") ); ?>">
5414 <i class="ays_fa ays_fa_info_circle"></i>
5415 </a>
5416 </label>
5417 </div>
5418 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5419 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5420 <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); ?> >
5421 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5422 </label>
5423 </div>
5424 </div> <!-- Title bold -->
5425 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5426 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5427 <label for="ays-chart-option-title-shadow-color">
5428 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5429 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5430 <i class="ays_fa ays_fa_info_circle"></i>
5431 </a>
5432 </label>
5433 </div>
5434 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5435 <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) ?>">
5436 </div>
5437 </div> <!-- Chart title color -->
5438 </div>
5439 </div>
5440 <?php
5441 $content = ob_get_clean();
5442
5443 $title = __( 'Title', "chart-builder" );
5444
5445 $sources['title'] = array(
5446 'content' => $content,
5447 'title' => $title
5448 );
5449
5450 return $sources;
5451 }
5452
5453 public function settings_contents_description_styles_settings( $sources, $args ){
5454 $html_class_prefix = $args['html_class_prefix'];
5455 $html_name_prefix = $args['html_name_prefix'];
5456 $settings = $args['settings'];
5457
5458 $description_color = $settings['description_color'];
5459 $description_font_size = $settings['description_font_size'];
5460 $title_positions = $settings['title_positions'];
5461 $description_position = $settings['description_position'];
5462 $description_bold = $settings['description_bold'];
5463 $description_text_shadow = $settings['description_text_shadow'];
5464 $description_shadow_color = $settings['description_shadow_color'];
5465 $description_italic = $settings['description_italic'];
5466 $text_transforms = $settings['text_transforms'];
5467 $text_decorations = $settings['text_decorations'];
5468 $description_text_transform = $settings['description_text_transform'];
5469 $description_text_decoration = $settings['description_text_decoration'];
5470 $description_letter_spacing = $settings['description_letter_spacing'];
5471
5472 ob_start();
5473 ?>
5474 <div class="ays-accordion-data-main-wrap">
5475 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5476 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5477 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5478 <label for="ays-chart-option-description-color">
5479 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5480 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart description.","chart-builder") ); ?>">
5481 <i class="ays_fa ays_fa_info_circle"></i>
5482 </a>
5483 </label>
5484 </div>
5485 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5486 <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) ?>">
5487 </div>
5488 </div> <!-- Chart description color -->
5489 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5490 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5491 <label for="ays-chart-option-description-font-size" class="form-label">
5492 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5493 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart description.","chart-builder") ); ?>">
5494 <i class="ays_fa ays_fa_info_circle"></i>
5495 </a>
5496 </label>
5497 </div>
5498 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5499 <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) ?>">
5500 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5501 </div>
5502 </div> <!-- Chart description font size -->
5503 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5504 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5505 <label for="ays-chart-option-description-bold" class="form-label">
5506 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5507 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
5508 <i class="ays_fa ays_fa_info_circle"></i>
5509 </a>
5510 </label>
5511 </div>
5512 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5513 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5514 <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); ?> >
5515 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5516 </label>
5517 </div>
5518 </div> <!-- Description bold -->
5519 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5520 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5521 <label for="ays-chart-option-description-italic" class="form-label">
5522 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5523 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
5524 <i class="ays_fa ays_fa_info_circle"></i>
5525 </a>
5526 </label>
5527 </div>
5528 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5529 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5530 <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); ?> >
5531 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5532 </label>
5533 </div>
5534 </div> <!-- Description italic -->
5535 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5536 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5537 <label for="ays-chart-option-description-position">
5538 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5539 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart description.","chart-builder") ); ?>">
5540 <i class="ays_fa ays_fa_info_circle"></i>
5541 </a>
5542 </label>
5543 </div>
5544 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5545 <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]">
5546 <?php
5547 foreach ( $title_positions as $option_slug => $option ):
5548 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
5549 ?>
5550 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5551 <?php
5552 endforeach;
5553 ?>
5554 </select>
5555 </div>
5556 </div> <!-- Description position -->
5557 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5558 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5559 <label for="ays-chart-option-description-text-transform">
5560 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5561 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5562 <i class="ays_fa ays_fa_info_circle"></i>
5563 </a>
5564 </label>
5565 </div>
5566 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5567 <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]">
5568 <?php
5569 foreach ( $text_transforms as $option_slug => $option ):
5570 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
5571 ?>
5572 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5573 <?php
5574 endforeach;
5575 ?>
5576 </select>
5577 </div>
5578 </div> <!-- description text transform -->
5579 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5580 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5581 <label for="ays-chart-option-description-letter-spacing" class="form-label">
5582 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5583 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
5584 <i class="ays_fa ays_fa_info_circle"></i>
5585 </a>
5586 </label>
5587 </div>
5588 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5589 <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) ?>">
5590 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5591 </div>
5592 </div> <!-- Chart description letter spacing -->
5593 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5594 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5595 <label for="ays-chart-option-description-text-decoration">
5596 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5597 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5598 <i class="ays_fa ays_fa_info_circle"></i>
5599 </a>
5600 </label>
5601 </div>
5602 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5603 <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]">
5604 <?php
5605 foreach ( $text_decorations as $option_slug => $option ):
5606 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
5607 ?>
5608 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5609 <?php
5610 endforeach;
5611 ?>
5612 </select>
5613 </div>
5614 </div> <!-- description text decoration -->
5615 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5616 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5617 <label for="ays-chart-option-description-text-shadow" class="form-label">
5618 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5619 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add a text shadow to chart description.","chart-builder") ); ?>">
5620 <i class="ays_fa ays_fa_info_circle"></i>
5621 </a>
5622 </label>
5623 </div>
5624 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5625 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5626 <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); ?> >
5627 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5628 </label>
5629 </div>
5630 </div> <!-- description bold -->
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-description-shadow-color">
5634 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5635 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart description.","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-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) ?>">
5642 </div>
5643 </div> <!-- Chart title color -->
5644 </div>
5645 </div>
5646 <?php
5647 $content = ob_get_clean();
5648
5649 $title = __( 'Description', "chart-builder" );
5650
5651 $sources['description'] = array(
5652 'content' => $content,
5653 'title' => $title
5654 );
5655
5656 return $sources;
5657 }
5658
5659 public function settings_contents_description_styles_settings_chartjs( $sources, $args ){
5660 $html_class_prefix = $args['html_class_prefix'];
5661 $html_name_prefix = $args['html_name_prefix'];
5662 $settings = $args['settings'];
5663
5664 $description_color = $settings['description_color'];
5665 $description_font_size = $settings['description_font_size'];
5666 $title_positions = $settings['title_positions'];
5667 $description_position = $settings['description_position'];
5668 $description_bold = $settings['description_bold'];
5669 $description_text_shadow = $settings['description_text_shadow'];
5670 $description_shadow_color = $settings['description_shadow_color'];
5671 $description_italic = $settings['description_italic'];
5672 $text_transforms = $settings['text_transforms'];
5673 $text_decorations = $settings['text_decorations'];
5674 $description_text_transform = $settings['description_text_transform'];
5675 $description_text_decoration = $settings['description_text_decoration'];
5676 $description_letter_spacing = $settings['description_letter_spacing'];
5677
5678 ob_start();
5679 ?>
5680 <div class="ays-accordion-data-main-wrap">
5681 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5682 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5683 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5684 <label for="ays-chart-option-description-color">
5685 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5686 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart description.","chart-builder") ); ?>">
5687 <i class="ays_fa ays_fa_info_circle"></i>
5688 </a>
5689 </label>
5690 </div>
5691 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5692 <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) ?>">
5693 </div>
5694 </div> <!-- Chart description color -->
5695 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5696 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5697 <label for="ays-chart-option-description-font-size" class="form-label">
5698 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5699 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart description.","chart-builder") ); ?>">
5700 <i class="ays_fa ays_fa_info_circle"></i>
5701 </a>
5702 </label>
5703 </div>
5704 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5705 <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) ?>">
5706 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5707 </div>
5708 </div> <!-- Chart description font size -->
5709 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5710 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5711 <label for="ays-chart-option-description-bold" class="form-label">
5712 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5713 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
5714 <i class="ays_fa ays_fa_info_circle"></i>
5715 </a>
5716 </label>
5717 </div>
5718 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5719 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5720 <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); ?> >
5721 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5722 </label>
5723 </div>
5724 </div> <!-- Description bold -->
5725 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5726 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5727 <label for="ays-chart-option-description-italic" class="form-label">
5728 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5729 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
5730 <i class="ays_fa ays_fa_info_circle"></i>
5731 </a>
5732 </label>
5733 </div>
5734 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5735 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5736 <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); ?> >
5737 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5738 </label>
5739 </div>
5740 </div> <!-- Description italic -->
5741 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5742 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5743 <label for="ays-chart-option-description-position">
5744 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5745 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart description.","chart-builder") ); ?>">
5746 <i class="ays_fa ays_fa_info_circle"></i>
5747 </a>
5748 </label>
5749 </div>
5750 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5751 <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]">
5752 <?php
5753 foreach ( $title_positions as $option_slug => $option ):
5754 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
5755 ?>
5756 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5757 <?php
5758 endforeach;
5759 ?>
5760 </select>
5761 </div>
5762 </div> <!-- Description position -->
5763 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5764 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5765 <label for="ays-chart-option-description-text-transform">
5766 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5767 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5768 <i class="ays_fa ays_fa_info_circle"></i>
5769 </a>
5770 </label>
5771 </div>
5772 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5773 <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]">
5774 <?php
5775 foreach ( $text_transforms as $option_slug => $option ):
5776 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
5777 ?>
5778 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5779 <?php
5780 endforeach;
5781 ?>
5782 </select>
5783 </div>
5784 </div> <!-- description text transform -->
5785 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5786 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5787 <label for="ays-chart-option-description-letter-spacing" class="form-label">
5788 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5789 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
5790 <i class="ays_fa ays_fa_info_circle"></i>
5791 </a>
5792 </label>
5793 </div>
5794 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5795 <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) ?>">
5796 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5797 </div>
5798 </div> <!-- Chart description letter spacing -->
5799 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5800 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5801 <label for="ays-chart-option-description-text-decoration">
5802 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5803 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5804 <i class="ays_fa ays_fa_info_circle"></i>
5805 </a>
5806 </label>
5807 </div>
5808 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5809 <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]">
5810 <?php
5811 foreach ( $text_decorations as $option_slug => $option ):
5812 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
5813 ?>
5814 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5815 <?php
5816 endforeach;
5817 ?>
5818 </select>
5819 </div>
5820 </div> <!-- description text decoration -->
5821 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5822 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5823 <label for="ays-chart-option-description-text-shadow" class="form-label">
5824 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5825 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add a text shadow to chart description.","chart-builder") ); ?>">
5826 <i class="ays_fa ays_fa_info_circle"></i>
5827 </a>
5828 </label>
5829 </div>
5830 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5831 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5832 <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); ?> >
5833 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5834 </label>
5835 </div>
5836 </div> <!-- description bold -->
5837 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5838 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5839 <label for="ays-chart-option-description-shadow-color">
5840 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5841 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart description.","chart-builder") ); ?>">
5842 <i class="ays_fa ays_fa_info_circle"></i>
5843 </a>
5844 </label>
5845 </div>
5846 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5847 <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) ?>">
5848 </div>
5849 </div> <!-- Chart title color -->
5850 </div>
5851 </div>
5852 <?php
5853 $content = ob_get_clean();
5854
5855 $title = __( 'Description', "chart-builder" );
5856
5857 $sources['description'] = array(
5858 'content' => $content,
5859 'title' => $title
5860 );
5861
5862 return $sources;
5863 }
5864
5865 /**
5866 * Chart page settings contents
5867 * @param $args
5868 */
5869 public function ays_chart_page_advanced_settings_contents( $args ){
5870 $chart_source_type = $args['chart_source_type'];
5871
5872 if ($chart_source_type === 'chart-js') {
5873 if ($args['source_chart_type'] !== 'pie_chart') {return;}
5874 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings_chartjs', array(), $args );
5875 } else {
5876 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings', array(), $args );
5877 }
5878
5879 $sources = array();
5880 foreach ( $sources_contents as $key => $sources_content ) {
5881 $collapsed = $key == 'advanced_settings' ? 'false' : 'true';
5882
5883 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
5884 if(isset($sources_content['title'])){
5885 $content .= '<legend class="ays-accordion-options-header">';
5886 $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">
5887 <g>
5888 <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" />
5889 </g>
5890 </svg>';
5891
5892 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
5893 }
5894
5895 $content .= '<div class="ays-accordion-options-content">';
5896 $content .= $sources_content['content'];
5897 $content .= '</div>';
5898
5899 $content .= '</fieldset>';
5900
5901 $sources[] = $content;
5902 }
5903 $content_for_escape = implode('' , $sources );
5904 echo html_entity_decode(esc_html( $content_for_escape ));
5905 }
5906
5907 public function settings_contents_advanced_settings( $sources, $args ){
5908 $html_class_prefix = $args['html_class_prefix'];
5909 $html_name_prefix = $args['html_name_prefix'];
5910 $settings = $args['settings'];
5911 $tab_title = $args['tab_name'];
5912
5913 $rotation_degree = $settings['rotation_degree'];
5914 $reverse_categories = $settings['reverse_categories'];
5915 $slice_border_color = $settings['slice_border_color'];
5916 $slice_texts = $settings['slice_texts'];
5917 $slice_text = $settings['slice_text'];
5918 $tooltip_text_options = $settings['tooltip_text_options'];
5919 $tooltip_text = $settings['tooltip_text'];
5920 $is_stacked = $settings['is_stacked'];
5921 $focus_target_options = $settings['focus_target_options'];
5922 $focus_target = $settings['focus_target'];
5923 $multiple_data_format_options = $settings['multiple_data_format_options'];
5924 $multiple_data_format = $settings['multiple_data_format'];
5925 $opacity = $settings['opacity'];
5926 $group_width = $settings['group_width'];
5927 $group_width_format = $settings['group_width_format'];
5928 $group_width_format_options = $settings['group_width_format_options'];
5929 $line_width = $settings['line_width'];
5930 $data_grouping_limit = $settings['data_grouping_limit'];
5931 $data_grouping_label = $settings['data_grouping_label'];
5932 $data_grouping_color = $settings['data_grouping_color'];
5933 $multiple_selection = $settings['multiple_selection'];
5934 $point_shape_options = $settings['point_shape_options'];
5935 $point_shape = $settings['point_shape'];
5936 $crosshair_trigger_options = $settings['crosshair_trigger_options'];
5937 $crosshair_trigger = $settings['crosshair_trigger'];
5938 $crosshair_orientation_options = $settings['crosshair_orientation_options'];
5939 $crosshair_orientation = $settings['crosshair_orientation'];
5940 $crosshair_opacity = $settings['crosshair_opacity'];
5941 $dash_style = $settings['dash_style'];
5942 $point_size = $settings['point_size'];
5943 $donut_hole_size = $settings['donut_hole_size'];
5944 $orientation = $settings['orientation'];
5945 $fill_nulls = $settings['fill_nulls'];
5946 $allow_collapse = $settings['allow_collapse'];
5947 $org_classname = $settings['org_classname'];
5948 $org_node_background_color = $settings['org_node_background_color'];
5949 $org_node_padding = $settings['org_node_padding'];
5950 $org_node_border_radius = $settings['org_node_border_radius'];
5951 $org_node_border_width = $settings['org_node_border_width'];
5952 $org_node_border_color = $settings['org_node_border_color'];
5953 $org_node_text_color = $settings['org_node_text_color'];
5954 $org_node_text_font_size = $settings['org_node_text_font_size'];
5955 $org_node_description_font_color = $settings['org_node_description_font_color'];
5956 $org_node_description_font_size = $settings['org_node_description_font_size'];
5957 $org_selected_classname = $settings['org_selected_classname'];
5958 $org_selected_node_background_color = $settings['org_selected_node_background_color'];
5959 $org_selected_node_text_color = $settings['org_selected_node_text_color'];
5960
5961 ob_start();
5962 ?>
5963 <div class="ays-accordion-data-main-wrap">
5964 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
5965 <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">
5966 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5967 <label for="ays-chart-option-rotation-degree" class="form-label">
5968 <?php echo esc_html(__( "Degree of chart rotation", "chart-builder" )); ?>
5969 <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") ); ?>">
5970 <i class="ays_fa ays_fa_info_circle"></i>
5971 </a>
5972 </label>
5973 </div>
5974 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5975 <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) ?>">
5976 </div>
5977 </div> <!-- Rotation degree -->
5978 <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">
5979 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5980 <label for="ays-chart-option-reverse-categories">
5981 <?php echo esc_html(__( "Reverse Categories", "chart-builder" )); ?>
5982 <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") ); ?>">
5983 <i class="ays_fa ays_fa_info_circle"></i>
5984 </a>
5985 </label>
5986 </div>
5987 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5988 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5989 <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); ?> >
5990 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5991 </label>
5992 </div>
5993 </div> <!-- Reverse Categories -->
5994 <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">
5995 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5996 <label for="ays-chart-option-slice-border-color">
5997 <?php echo esc_html(__( "Slice Border Color", "chart-builder" )); ?>
5998 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
5999 <i class="ays_fa ays_fa_info_circle"></i>
6000 </a>
6001 </label>
6002 </div>
6003 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6004 <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) ?>">
6005 </div>
6006 </div> <!-- Slice border color -->
6007 <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">
6008 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6009 <label for="ays-chart-option-slice-text">
6010 <?php echo esc_html(__( "Slice text", "chart-builder" )); ?>
6011 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the content of the text to be displayed on the pie slice.","chart-builder") ); ?>">
6012 <i class="ays_fa ays_fa_info_circle"></i>
6013 </a>
6014 </label>
6015 </div>
6016 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6017 <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]">
6018 <?php
6019 foreach ( $slice_texts as $option_slug => $option ):
6020 $selected = ( $slice_text == $option_slug ) ? 'selected' : '';
6021 ?>
6022 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6023 <?php
6024 endforeach;
6025 ?>
6026 </select>
6027 </div>
6028 </div> <!-- Slice text -->
6029 <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">
6030 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6031 <label for="ays-chart-option-tooltip-text">
6032 <?php echo esc_html(__( "Slice tooltip text", "chart-builder" )); ?>
6033 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose how to display the text in the chart tooltip.","chart-builder") ); ?>">
6034 <i class="ays_fa ays_fa_info_circle"></i>
6035 </a>
6036 </label>
6037 </div>
6038 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6039 <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]">
6040 <?php
6041 foreach ( $tooltip_text_options as $option_slug => $option ):
6042 $selected = ( $tooltip_text == $option_slug ) ? 'selected' : '';
6043 ?>
6044 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6045 <?php
6046 endforeach;
6047 ?>
6048 </select>
6049 </div>
6050 </div> <!-- Slice tooltip Text -->
6051 <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">
6052 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6053 <label for="ays-chart-option-data-grouping-limit" class="form-label">
6054 <?php echo esc_html(__( "Chart Data Grouping Limit", "chart-builder" )); ?>
6055 <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") ); ?>">
6056 <i class="ays_fa ays_fa_info_circle"></i>
6057 </a>
6058 </label>
6059 </div>
6060 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6061 <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">
6062 </div>
6063 </div> <!-- Data Grouping Limit -->
6064 <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">
6065 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6066 <label for="ays-chart-option-data-grouping-label" class="form-label">
6067 <?php echo esc_html(__( "Chart Data Grouping Label", "chart-builder" )); ?>
6068 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("A label for the combination slice that holds all slices below chart data grouping limit.","chart-builder") ); ?>">
6069 <i class="ays_fa ays_fa_info_circle"></i>
6070 </a>
6071 </label>
6072 </div>
6073 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6074 <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) ?>">
6075 </div>
6076 </div> <!-- Data Grouping Label -->
6077 <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">
6078 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6079 <label for="ays-chart-option-data-grouping-color">
6080 <?php echo esc_html(__( "Chart Data Grouping Color", "chart-builder" )); ?>
6081 <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") ); ?>">
6082 <i class="ays_fa ays_fa_info_circle"></i>
6083 </a>
6084 </label>
6085 </div>
6086 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6087 <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) ?>">
6088 </div>
6089 </div> <!-- Data Grouping Color -->
6090 <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">
6091 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6092 <label for="ays-chart-option-is-stacked">
6093 <?php echo esc_html(__( "Is stacked", "chart-builder" )); ?>
6094 <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") ); ?>">
6095 <i class="ays_fa ays_fa_info_circle"></i>
6096 </a>
6097 </label>
6098 </div>
6099 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6100 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6101 <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); ?> >
6102 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6103 </label>
6104 </div>
6105 </div> <!-- Is stacked -->
6106 <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">
6107 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6108 <label for="ays-chart-option-focus-target">
6109 <?php echo esc_html(__( "Focus target", "chart-builder" )); ?>
6110 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6111 echo htmlspecialchars( sprintf(
6112 "<p>" . __('There are two ways to focus the data table elements.', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6113 __('%sSingle data:%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>" .
6114 __('%sGroup data:%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>",
6115 '<em>',
6116 '</em>',
6117 '<em>',
6118 '</em>'
6119 ) );
6120 ?>">
6121 <i class="ays_fa ays_fa_info_circle"></i>
6122 </a>
6123 </label>
6124 </div>
6125 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6126 <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]">
6127 <?php
6128 foreach ( $focus_target_options as $option_slug => $option ):
6129 $selected = ( $focus_target == $option_slug ) ? 'selected' : '';
6130 ?>
6131 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6132 <?php
6133 endforeach;
6134 ?>
6135 </select>
6136 </div>
6137 </div> <!-- Focus target -->
6138 <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">
6139 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6140 <label for="ays-chart-option-opacity" class="form-label">
6141 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
6142 <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") ); ?>">
6143 <i class="ays_fa ays_fa_info_circle"></i>
6144 </a>
6145 </label>
6146 </div>
6147 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6148 <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">
6149 </div>
6150 </div> <!-- Data opacity -->
6151 <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">
6152 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6153 <label for="ays-chart-option-group-width">
6154 <?php echo esc_html(__( "Bar width", "chart-builder" )); ?>
6155 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6156 echo htmlspecialchars( sprintf(
6157 "<p>" . __('The width of the bars, specified in either of these formats:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6158 __('%sPixels:%s Set the width of the bars in pixels.', "chart-builder") . "</li><li>" .
6159 __('%sPercentage:%s Set the width of the bars in percentage.', "chart-builder") . "</li></ul>",
6160 '<em>',
6161 '</em>',
6162 '<em>',
6163 '</em>'
6164 ) );
6165 ?>">
6166 <i class="ays_fa ays_fa_info_circle"></i>
6167 </a>
6168 </label>
6169 </div>
6170 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6171 <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) ?>">
6172 <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]">
6173 <?php
6174 foreach ( $group_width_format_options as $option_slug => $option ):
6175 $selected = ( $group_width_format == $option_slug ) ? 'selected' : '';
6176 ?>
6177 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6178 <?php
6179 endforeach;
6180 ?>
6181 </select>
6182 </div>
6183 </div> <!-- Bars width -->
6184 <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">
6185 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6186 <label for="ays-chart-option-line-width" class="form-label">
6187 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
6188 <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") ); ?>">
6189 <i class="ays_fa ays_fa_info_circle"></i>
6190 </a>
6191 </label>
6192 </div>
6193 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6194 <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) ?>">
6195 </div>
6196 </div> <!-- Line width -->
6197 <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">
6198 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6199 <label for="ays-chart-option-multiple-selection">
6200 <?php echo esc_html(__( "Multiple data selection", "chart-builder" )); ?>
6201 <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") ); ?>">
6202 <i class="ays_fa ays_fa_info_circle"></i>
6203 </a>
6204 </label>
6205 </div>
6206 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6207 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6208 <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); ?> >
6209 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6210 </label>
6211 </div>
6212 </div> <!-- Multiple data selection -->
6213 <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">
6214 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6215 <label for="ays-chart-option-multiple-data-format">
6216 <?php echo esc_html(__( "Multiple data format", "chart-builder" )); ?>
6217 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6218 echo htmlspecialchars( sprintf(
6219 "<p>" . __('How multiple data selections are rolled up into tooltips:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6220 __('%sCategory:%s Group selected data by row titles.', "chart-builder") . "</li><li>" .
6221 __('%sSeries:%s Group selected data by column titles.', "chart-builder") . "</li><li>" .
6222 __('%sAuto:%s Group selected data by row titles, if they have the same titles or by column titles', "chart-builder") . "</li><li>" .
6223 __('%sNone:%s Show only one tooltip per selection.', "chart-builder") . "</li></ul>",
6224 '<em>',
6225 '</em>',
6226 '<em>',
6227 '</em>',
6228 '<em>',
6229 '</em>',
6230 '<em>',
6231 '</em>'
6232 ) );
6233 ?>">
6234 <i class="ays_fa ays_fa_info_circle"></i>
6235 </a>
6236 </label>
6237 </div>
6238 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6239 <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]">
6240 <?php
6241 foreach ( $multiple_data_format_options as $option_slug => $option ):
6242 $selected = ( $multiple_data_format == $option_slug ) ? 'selected' : '';
6243 ?>
6244 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6245 <?php
6246 endforeach;
6247 ?>
6248 </select>
6249 </div>
6250 </div> <!-- Multiple data format -->
6251 <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">
6252 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6253 <label for="ays-chart-option-point-shape">
6254 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
6255 <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") ); ?>">
6256 <i class="ays_fa ays_fa_info_circle"></i>
6257 </a>
6258 </label>
6259 </div>
6260 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6261 <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]">
6262 <?php
6263 foreach ( $point_shape_options as $option_slug => $option ):
6264 $selected = ( $point_shape == $option_slug ) ? 'selected' : '';
6265 ?>
6266 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6267 <?php
6268 endforeach;
6269 ?>
6270 </select>
6271 </div>
6272 </div> <!-- Point shape -->
6273 <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">
6274 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6275 <label for="ays-chart-option-point-size" class="form-label">
6276 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
6277 <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") ); ?>">
6278 <i class="ays_fa ays_fa_info_circle"></i>
6279 </a>
6280 </label>
6281 </div>
6282 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6283 <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) ?>">
6284 </div>
6285 </div> <!-- Point size -->
6286 <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">
6287 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6288 <label for="ays-chart-option-orientation">
6289 <?php echo esc_html(__( "Rotate Vertical", "chart-builder" )); ?>
6290 <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") ); ?>">
6291 <i class="ays_fa ays_fa_info_circle"></i>
6292 </a>
6293 </label>
6294 </div>
6295 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6296 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6297 <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); ?> >
6298 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6299 </label>
6300 </div>
6301 </div> <!-- Orientation -->
6302 <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">
6303 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6304 <label for="ays-chart-option-fill-nulls">
6305 <?php echo esc_html(__( "Autofill nulls", "chart-builder" )); ?>
6306 <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") ); ?>">
6307 <i class="ays_fa ays_fa_info_circle"></i>
6308 </a>
6309 </label>
6310 </div>
6311 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6312 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6313 <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); ?> >
6314 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6315 </label>
6316 </div>
6317 </div> <!-- Autofill nulls -->
6318 <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">
6319 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6320 <label for="ays-chart-option-crosshair-trigger">
6321 <?php echo esc_html(__( "Crosshair trigger", "chart-builder" )); ?>
6322 <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") ); ?>">
6323 <i class="ays_fa ays_fa_info_circle"></i>
6324 </a>
6325 </label>
6326 </div>
6327 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6328 <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]">
6329 <?php
6330 foreach ( $crosshair_trigger_options as $option_slug => $option ):
6331 $selected = ( $crosshair_trigger == $option_slug ) ? 'selected' : '';
6332 ?>
6333 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6334 <?php
6335 endforeach;
6336 ?>
6337 </select>
6338 </div>
6339 </div> <!-- Crosshair trigger -->
6340 <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">
6341 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6342 <label for="ays-chart-option-crosshair-orientation">
6343 <?php echo esc_html(__( "Crosshair orientation", "chart-builder" )); ?>
6344 <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") ); ?>">
6345 <i class="ays_fa ays_fa_info_circle"></i>
6346 </a>
6347 </label>
6348 </div>
6349 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6350 <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]">
6351 <?php
6352 foreach ( $crosshair_orientation_options as $option_slug => $option ):
6353 $selected = ( $crosshair_orientation == $option_slug ) ? 'selected' : '';
6354 ?>
6355 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6356 <?php
6357 endforeach;
6358 ?>
6359 </select>
6360 </div>
6361 </div> <!-- Crosshair orientation -->
6362 <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">
6363 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6364 <label for="ays-chart-option-crosshair-opacity" class="form-label">
6365 <?php echo esc_html(__( "Crosshair opacity", "chart-builder" )); ?>
6366 <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") ); ?>">
6367 <i class="ays_fa ays_fa_info_circle"></i>
6368 </a>
6369 </label>
6370 </div>
6371 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6372 <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">
6373 </div>
6374 </div> <!-- Crosshair opacity -->
6375 <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">
6376 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6377 <label for="ays-chart-option-dash-style" class="form-label">
6378 <?php echo esc_html(__( "Dash Pattern", "chart-builder" )); ?>
6379 <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") ); ?>">
6380 <i class="ays_fa ays_fa_info_circle"></i>
6381 </a>
6382 </label>
6383 </div>
6384 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6385 <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) ?>">
6386 </div>
6387 </div> <!-- Line dash pattern -->
6388 <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">
6389 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
6390 <label for="ays-chart-option-donut-hole-size">
6391 <?php echo __( "Hole size", $this->plugin_name ); ?>
6392 </label>
6393 </div>
6394 <div class="col-sm-7 <?= $html_class_prefix ?>input-align-right <?= $html_class_prefix ?>option-input">
6395 <input class="ays-text-input form-control <?= $html_class_prefix ?>option-text-input" id="ays-chart-option-donut-hole-size" type="number" min="0" max="1" step=".1" name="<?php echo $html_name_prefix; ?>settings[donut_hole_size]" value="<?= $donut_hole_size ?>">
6396 </div>
6397 </div> <!-- Donut hole size -->
6398 <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">
6399 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
6400 <div class="ays-pro-features-v2-video-button"></div>
6401 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
6402 <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>
6403 <div class="ays-pro-features-v2-upgrade-text">
6404 <?php echo __("Upgrade" , "chart-builder"); ?>
6405 </div>
6406 </a>
6407 </div>
6408 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
6409 <label for="ays-chart-option-curve-type">
6410 <?php echo __( "Line curve type", "chart-builder" ); ?>
6411 </label>
6412 </div>
6413 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6414 <select class="<?= $html_class_prefix ?>option-select-input form-select" id="ays-chart-option-line-curve-type" name="<?php echo $html_name_prefix; ?>settings[line_curve_type]">
6415 <option><?php echo __( "Straight", "chart-builder" ); ?></option>
6416 </select>
6417 </div>
6418 </div> <!-- Line curve type -->
6419 <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">
6420 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6421 <label for="ays-chart-option-allow-collapse">
6422 <?php echo esc_html(__( "Allow collapse", "chart-builder" )); ?>
6423 <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") ); ?>">
6424 <i class="ays_fa ays_fa_info_circle"></i>
6425 </a>
6426 </label>
6427 </div>
6428 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6429 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6430 <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); ?> >
6431 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6432 </label>
6433 </div>
6434 </div> <!-- Allow collapse -->
6435 <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">
6436 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6437 <label for="ays-chart-option-org-node-description-font-color">
6438 <?php echo esc_html(__( "Description color", "chart-builder" )); ?>
6439 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description text color of the node.","chart-builder") ); ?>">
6440 <i class="ays_fa ays_fa_info_circle"></i>
6441 </a>
6442 </label>
6443 </div>
6444 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6445 <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) ?>">
6446 </div>
6447 </div> <!-- Org Node Description color -->
6448 <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">
6449 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6450 <label for="ays-chart-option-org-node-description-font-size" class="form-label">
6451 <?php echo esc_html(__( "Description font size", "chart-builder" )); ?>
6452 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description font size of the node.","chart-builder") ); ?>">
6453 <i class="ays_fa ays_fa_info_circle"></i>
6454 </a>
6455 </label>
6456 </div>
6457 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6458 <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) ?>">
6459 </div>
6460 </div> <!-- Org Node Description font size -->
6461 <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">
6462 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6463 <label for="ays-chart-option-org-classname" class="form-label">
6464 <?php echo esc_html(__( "Custom CSS class", "chart-builder" )); ?>
6465 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("A class name to assign to node elements to specify styles for the chart elements.","chart-builder") ); ?>">
6466 <i class="ays_fa ays_fa_info_circle"></i>
6467 </a>
6468 </label>
6469 </div>
6470 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6471 <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) ?>">
6472 </div>
6473 </div> <!-- Org custom class -->
6474 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
6475 <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">
6476 <br>
6477 <blockquote>
6478 <?php echo sprintf(__( "%sNote:%s Custom CSS class must be set for the options below to take effect.", $this->plugin_name ), '<strong>', '</strong>'); ?>
6479 </blockquote>
6480 <br>
6481 </div>
6482 <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">
6483 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6484 <label for="ays-chart-option-org-node-background-color">
6485 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
6486 <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") ); ?>">
6487 <i class="ays_fa ays_fa_info_circle"></i>
6488 </a>
6489 </label>
6490 </div>
6491 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6492 <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) ?>">
6493 </div>
6494 </div> <!-- Org Node Background color -->
6495 <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">
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-org-node-padding" class="form-label">
6498 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
6499 <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") ); ?>">
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 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6505 <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) ?>">
6506 </div>
6507 </div> <!-- Org Node Padding -->
6508 <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">
6509 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6510 <label for="ays-chart-option-org-node-border-radius" class="form-label">
6511 <?php echo esc_html(__( "Border radius", "chart-builder" )); ?>
6512 <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") ); ?>">
6513 <i class="ays_fa ays_fa_info_circle"></i>
6514 </a>
6515 </label>
6516 </div>
6517 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6518 <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) ?>">
6519 </div>
6520 </div> <!-- Org Node Border radius -->
6521 <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">
6522 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6523 <label for="ays-chart-option-org-node-border-width" class="form-label">
6524 <?php echo esc_html(__( "Border width", "chart-builder" )); ?>
6525 <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") ); ?>">
6526 <i class="ays_fa ays_fa_info_circle"></i>
6527 </a>
6528 </label>
6529 </div>
6530 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6531 <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) ?>">
6532 </div>
6533 </div> <!-- Org Node Border width -->
6534 <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">
6535 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6536 <label for="ays-chart-option-org-node-border-color">
6537 <?php echo esc_html(__( "Border color", "chart-builder" )); ?>
6538 <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") ); ?>">
6539 <i class="ays_fa ays_fa_info_circle"></i>
6540 </a>
6541 </label>
6542 </div>
6543 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6544 <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) ?>">
6545 </div>
6546 </div> <!-- Org Node Background color -->
6547 <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">
6548 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6549 <label for="ays-chart-option-org-node-text-color">
6550 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6551 <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") ); ?>">
6552 <i class="ays_fa ays_fa_info_circle"></i>
6553 </a>
6554 </label>
6555 </div>
6556 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6557 <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) ?>">
6558 </div>
6559 </div> <!-- Org Node Text color -->
6560 <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">
6561 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6562 <label for="ays-chart-option-org-node-text-font-size" class="form-label">
6563 <?php echo esc_html(__( "Text font size", "chart-builder" )); ?>
6564 <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") ); ?>">
6565 <i class="ays_fa ays_fa_info_circle"></i>
6566 </a>
6567 </label>
6568 </div>
6569 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6570 <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) ?>">
6571 </div>
6572 </div> <!-- Org Node Text font size -->
6573 </div> <!-- Org custom class options -->
6574 <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">
6575 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6576 <label for="ays-chart-option-org-selected-classname" class="form-label">
6577 <?php echo esc_html(__( "Selected node custom CSS class", "chart-builder" )); ?>
6578 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("A class name to assign to node elements to specify styles for the selected chart elements.","chart-builder") ); ?>">
6579 <i class="ays_fa ays_fa_info_circle"></i>
6580 </a>
6581 </label>
6582 </div>
6583 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6584 <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) ?>">
6585 </div>
6586 </div> <!-- Org custom selected class -->
6587 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
6588 <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">
6589 <br>
6590 <blockquote>
6591 <?php echo sprintf(__( "%sNote:%s Selected node custom CSS class must be set for the options below to take effect.", $this->plugin_name ), '<strong>', '</strong>'); ?>
6592 </blockquote>
6593 <br>
6594 </div>
6595 <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">
6596 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6597 <label for="ays-chart-option-org-selected-node-background-color">
6598 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
6599 <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") ); ?>">
6600 <i class="ays_fa ays_fa_info_circle"></i>
6601 </a>
6602 </label>
6603 </div>
6604 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6605 <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) ?>">
6606 </div>
6607 </div> <!-- Org selected Node Background color -->
6608 <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">
6609 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6610 <label for="ays-chart-option-org-selected-node-text-color">
6611 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6612 <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") ); ?>">
6613 <i class="ays_fa ays_fa_info_circle"></i>
6614 </a>
6615 </label>
6616 </div>
6617 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6618 <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) ?>">
6619 </div>
6620 </div> <!-- Org selected Node text color -->
6621 </div> <!-- Org custom selected class options -->
6622 </div>
6623 </div>
6624 <?php
6625 $content = ob_get_clean();
6626
6627 $sources['advanced_settings'] = array(
6628 'content' => $content,
6629 'title' => $tab_title
6630 );
6631
6632 return $sources;
6633 }
6634
6635 public function settings_contents_advanced_settings_chartjs( $sources, $args ){
6636 $html_class_prefix = $args['html_class_prefix'];
6637 $html_name_prefix = $args['html_name_prefix'];
6638 $settings = $args['settings'];
6639 $tab_title = $args['tab_name'];
6640
6641 $outer_radius = $settings['outer_radius'];
6642 $slice_spacing = $settings['slice_spacing'];
6643 $circumference = $settings['circumference'];
6644 $start_angle = $settings['start_angle'];
6645 // $index_axis = $settings['index_axis'];
6646
6647 ob_start();
6648 ?>
6649 <div class="ays-accordion-data-main-wrap">
6650 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
6651 <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">
6652 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6653 <label for="ays-chart-option-outer-radius" class="form-label">
6654 <?php echo esc_html(__( "Outer Radius", "chart-builder" )); ?>
6655 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The outer radius of the chart.","chart-builder") ); ?>">
6656 <i class="ays_fa ays_fa_info_circle"></i>
6657 </a>
6658 </label>
6659 </div>
6660 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6661 <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) ?>">
6662 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6663 </div>
6664 </div> <!-- Outer Radius -->
6665 <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">
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-slice-spacing" class="form-label">
6668 <?php echo esc_html(__( "Slices Spacing", "chart-builder" )); ?>
6669 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Fixed arc offset (in pixels).","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 <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) ?>">
6676 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6677 </div>
6678 </div> <!-- Slice Spacing -->
6679 <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">
6680 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6681 <label for="ays-chart-option-circumference" class="form-label">
6682 <?php echo esc_html(__( "Arc Coverage", "chart-builder" )); ?>
6683 <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") ); ?>">
6684 <i class="ays_fa ays_fa_info_circle"></i>
6685 </a>
6686 </label>
6687 </div>
6688 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6689 <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) ?>">
6690 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
6691 </div>
6692 </div> <!-- Arc Coverage -->
6693 <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">
6694 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6695 <label for="ays-chart-option-start-angle" class="form-label">
6696 <?php echo esc_html(__( "Start Angle", "chart-builder" )); ?>
6697 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Starting angle to draw arcs from.","chart-builder") ); ?>">
6698 <i class="ays_fa ays_fa_info_circle"></i>
6699 </a>
6700 </label>
6701 </div>
6702 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6703 <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) ?>">
6704 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
6705 </div>
6706 </div> <!-- Start Angle -->
6707 <!-- <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">
6708 <div class="col-sm-5 d-flex align-items-center <?php // echo esc_attr($html_class_prefix) ?>option-title">
6709 <label for="ays-chart-option-index-axis">
6710 <?php // echo esc_html(__( "Horizontal ", "chart-builder" )); ?>
6711 <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") ); ?>">
6712 <i class="ays_fa ays_fa_info_circle"></i>
6713 </a>
6714 </label>
6715 </div>
6716 <div class="col-sm-7 py-1 <?php // echo esc_attr($html_class_prefix) ?>input-align-right">
6717 <label class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6718 <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); ?> >
6719 <span class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php // echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6720 </label>
6721 </div>
6722 </div> Reverse Categories -->
6723 </div>
6724 </div>
6725 <?php
6726 $content = ob_get_clean();
6727
6728 $sources['advanced_settings'] = array(
6729 'content' => $content,
6730 'title' => $tab_title
6731 );
6732
6733 return $sources;
6734 }
6735
6736 public function settings_contents_slices_settings( $sources, $args ){
6737 $html_class_prefix = $args['html_class_prefix'];
6738 $html_name_prefix = $args['html_name_prefix'];
6739 $settings = $args['settings'];
6740 $source = $args['source'];
6741 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
6742 $source_chart_type = $args['source_chart_type'];
6743 $settings = $args['settings'];
6744 $title_row = array_shift($source);
6745
6746 if (isset($source) && !empty($source)) {
6747 if ( !isset( $source[0] ) ) {
6748 if (count($source[1]) > 2) {
6749 $titles = array();
6750 for ($i = 0; $i < count($source[1]); $i++) {
6751 array_push($titles, __("Title", $this->plugin_name).$i);
6752 }
6753 $source[0] = $titles;
6754 } else {
6755 $source[0] = array(
6756 __("Country", $this->plugin_name),
6757 __("Population", $this->plugin_name),
6758 );
6759 }
6760
6761 ksort($source);
6762 }
6763 }
6764
6765 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6766 foreach ($source as $key => $row) {
6767 $source[$key] = array_slice($row, 0, 2);
6768 }
6769 }
6770
6771 ob_start();
6772 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6773 $slice_color = $settings['slice_color'];
6774 $slice_colors_default = $settings['slice_colors_default'];
6775 $slice_offset = $settings['slice_offset'];
6776 $slice_text_color = $settings['slice_text_color'];
6777
6778 ?>
6779 <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">
6780 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6781 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
6782 <?php
6783 foreach ( $source as $key => $val ):
6784 ?>
6785 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
6786 <legend class="ays-slices-accordion-options-header">
6787 <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">
6788 <g>
6789 <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" />
6790 </g>
6791 </svg>
6792 <span><?php echo $val[0]; ?></span>
6793 </legend>
6794 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
6795 <div class="ays-slices-accordion-data-main-wrap">
6796 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6797 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6798 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6799 <label for="ays-chart-option-slice-color">
6800 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6801 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color to use for this slice.","chart-builder") ); ?>">
6802 <i class="ays_fa ays_fa_info_circle"></i>
6803 </a>
6804 </label>
6805 </div>
6806 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6807 <input type="color"
6808 id="ays-chart-option-slice-color-<?php echo $key; ?>"
6809 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6810 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo $key; ?>]"
6811 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : $slice_colors_default[$key]; ?>"
6812 data-slice-id="<?php echo $key; ?>">
6813 </div>
6814 </div> <!-- Slice color -->
6815 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6816 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6817 <label for="ays-chart-option-slice-offset" class="form-label">
6818 <?php echo esc_html(__( "Offset", "chart-builder" )); ?>
6819 <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") ); ?>">
6820 <i class="ays_fa ays_fa_info_circle"></i>
6821 </a>
6822 </label>
6823 </div>
6824 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6825 <input type="number"
6826 id="ays-chart-option-slice-offset-<?php echo $key; ?>"
6827 class="ays-chart-option-slice-offset ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
6828 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_offset][<?php echo $key; ?>]"
6829 value="<?php echo isset($slice_offset[$key]) ? esc_attr($slice_offset[$key]) : 0 ; ?>"
6830 data-slice-id="<?php echo $key; ?>"
6831 step=".01" min="0.0" max="1.0">
6832 </div>
6833 </div> <!-- Slice offset -->
6834 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6835 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6836 <label for="ays-chart-option-slice-text-color">
6837 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6838 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color to use for the text of this slice.","chart-builder") ); ?>">
6839 <i class="ays_fa ays_fa_info_circle"></i>
6840 </a>
6841 </label>
6842 </div>
6843 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6844 <input type="color"
6845 id="ays-chart-option-slice-text-color-<?php echo $key; ?>"
6846 class="ays-chart-option-slice-text-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6847 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text_color][<?php echo $key; ?>]"
6848 value="<?php echo isset($slice_text_color[$key]) ? esc_attr($slice_text_color[$key]) : '#ffffff'; ?>"
6849 data-slice-id="<?php echo $key; ?>">
6850 </div>
6851 </div> <!-- Slice color -->
6852 </div>
6853 </div>
6854 </div>
6855 </fieldset>
6856 <?php
6857 endforeach;
6858 ?>
6859 </div>
6860 </div>
6861 <br>
6862 <blockquote>
6863 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
6864 </blockquote>
6865 </div>
6866 <?php
6867
6868 } else {
6869 ?>
6870 <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>
6871 <?php
6872 }
6873
6874 $content = ob_get_clean();
6875
6876 $title = __( 'Slices settings', "chart-builder" );
6877
6878 $sources['slices_settings'] = array(
6879 'content' => $content,
6880 'title' => $title
6881 );
6882
6883 return $sources;
6884 }
6885
6886 public function settings_contents_series_settings( $sources, $args ){
6887 $html_class_prefix = $args['html_class_prefix'];
6888 $html_name_prefix = $args['html_name_prefix'];
6889 $settings = $args['settings'];
6890 $source = $args['source'];
6891 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
6892 $source_chart_type = $args['source_chart_type'];
6893
6894 $line_width = $settings['line_width'];
6895 $point_size = $settings['point_size'];
6896 $point_shape_options = $settings['point_shape_options'];
6897 $point_shape = $settings['point_shape'];
6898
6899 if (isset($source) && !empty($source)) {
6900 if ( !isset( $source[0] ) ) {
6901 if (count($source[1]) > 2) {
6902 $titles = array();
6903 for ($i = 0; $i < count($source[1]); $i++) {
6904 array_push($titles, __("Title", $this->plugin_name).$i);
6905 }
6906 $source[0] = $titles;
6907 } else {
6908 $source[0] = array(
6909 __("Country", $this->plugin_name),
6910 __("Population", $this->plugin_name),
6911 );
6912 }
6913
6914 ksort($source);
6915 }
6916 }
6917
6918 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6919 foreach ($source as $key => $row) {
6920 $source[$key] = array_slice($row, 0, 2);
6921 }
6922 }
6923
6924 ob_start();
6925 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'line_chart' || $source_chart_type == 'bar_chart' || $source_chart_type == 'column_chart') {
6926 $series_row = array_shift($source);
6927 $title = array_shift($series_row);
6928 $series_color = $settings['series_color'];
6929 $series_colors_default = $settings['series_colors_default'];
6930 $series_visible_in_legend = $settings['series_visible_in_legend'];
6931 $series_line_width = $settings['series_line_width'];
6932 $series_point_size = $settings['series_point_size'];
6933 $series_point_shape = $settings['series_point_shape'];
6934
6935 ?>
6936 <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">
6937 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6938 <div class="<?php echo esc_attr($html_class_prefix) ?>series-settings">
6939 <?php
6940 foreach ( $series_row as $key => $val ):
6941 ?>
6942 <fieldset class="ays-series-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-series-<?php echo esc_attr($key); ?>" data-collapsed="true">
6943 <legend class="ays-series-accordion-options-header">
6944 <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">
6945 <g>
6946 <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" />
6947 </g>
6948 </svg>
6949 <span><?php echo $val; ?></span>
6950 </legend>
6951 <div class="ays-series-accordion-options-content ays-series-accordion-options-content">
6952 <div class="ays-series-accordion-data-main-wrap">
6953 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6954 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6955 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6956 <label for="ays-chart-option-series-color">
6957 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6958 </label>
6959 </div>
6960 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6961 <input type="color"
6962 id="ays-chart-option-series-color-<?php echo $key; ?>"
6963 class="ays-chart-option-series-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6964 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_color][<?php echo $key; ?>]"
6965 value="<?php echo isset($series_color[$key]) ? esc_attr($series_color[$key]) : $series_colors_default[$key]; ?>"
6966 data-series-id="<?php echo $key; ?>">
6967 </div>
6968 </div> <!-- series color -->
6969 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6970 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6971 <label for="ays-chart-option-series-visible-in-legend">
6972 <?php echo esc_html(__( "Visible in legend", "chart-builder" )); ?>
6973 <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") ); ?>">
6974 <i class="ays_fa ays_fa_info_circle"></i>
6975 </a>
6976 </label>
6977 </div>
6978 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6979 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6980 <input type="checkbox"
6981 id="ays-chart-option-series-visible-in-legend-<?php echo $key; ?>"
6982 class="ays-chart-option-series-visible-in-legend <?php echo esc_attr($html_class_prefix) ?>toggle-switch"
6983 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_visible_in_legend][<?php echo $key; ?>]"
6984 value="on"
6985 data-series-id="<?php echo $key; ?>"
6986 <?php echo isset($series_visible_in_legend[$key]) && $series_visible_in_legend[$key] == 'on' ? 'checked' : (!isset($series_color[$key]) ? 'checked' : ''); ?> >
6987 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6988 </label>
6989 </div>
6990 </div> <!-- Series visible in legend -->
6991 <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">
6992 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6993 <label for="ays-chart-option-series-line-width">
6994 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
6995 <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") ); ?>">
6996 <i class="ays_fa ays_fa_info_circle"></i>
6997 </a>
6998 </label>
6999 </div>
7000 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7001 <input type="number"
7002 id="ays-chart-option-series-line-width-<?php echo $key; ?>"
7003 class="ays-chart-option-series-line-width ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7004 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_line_width][<?php echo $key; ?>]"
7005 value="<?php echo isset($series_line_width[$key]) ? esc_attr($series_line_width[$key]) : $line_width; ?>"
7006 data-series-id="<?php echo $key; ?>">
7007 </div>
7008 </div> <!-- Line width -->
7009 <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">
7010 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7011 <label for="ays-chart-option-series-point-size">
7012 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
7013 <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") ); ?>">
7014 <i class="ays_fa ays_fa_info_circle"></i>
7015 </a>
7016 </label>
7017 </div>
7018 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7019 <input type="number"
7020 id="ays-chart-option-series-point-size-<?php echo $key; ?>"
7021 class="ays-chart-option-series-point-size ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7022 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_size][<?php echo $key; ?>]"
7023 value="<?php echo isset($series_point_size[$key]) ? esc_attr($series_point_size[$key]) : $point_size; ?>"
7024 data-series-id="<?php echo $key; ?>">
7025 </div>
7026 </div> <!-- Point size -->
7027 <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">
7028 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7029 <label for="ays-chart-option-series-point-shape">
7030 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
7031 <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") ); ?>">
7032 <i class="ays_fa ays_fa_info_circle"></i>
7033 </a>
7034 </label>
7035 </div>
7036 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7037 <select
7038 id="ays-chart-option-series-point-shape-<?php echo $key; ?>"
7039 class="ays-chart-option-series-point-shape <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select"
7040 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_shape][<?php echo $key; ?>]"
7041 data-series-id="<?php echo $key; ?>">
7042 >
7043 <?php
7044 $value = isset($series_point_shape[$key]) ? esc_attr($series_point_shape[$key]) : $point_shape;
7045 foreach ( $point_shape_options as $option_slug => $option ):
7046 $selected = ( $value === $option_slug ) ? 'selected' : '';
7047 ?>
7048 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7049 <?php
7050 endforeach;
7051 ?>
7052 </select>
7053 </div>
7054 </div> <!-- Point shape -->
7055 </div>
7056 </div>
7057 </div>
7058 </fieldset>
7059 <?php
7060 endforeach;
7061 ?>
7062 </div>
7063 </div>
7064 <br>
7065 <blockquote>
7066 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
7067 <br>
7068 <?php echo sprintf(__( "%sNote:%s If you are not able to set the options, disable the row settings feature.", $this->plugin_name ), '<strong>', '</strong>'); ?>
7069 </blockquote>
7070 </div>
7071 <?php
7072
7073 } else {
7074 ?>
7075 <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>
7076 <?php
7077 }
7078
7079 $content = ob_get_clean();
7080
7081 $title = __( 'Series settings', "chart-builder" );
7082
7083 $sources['series_settings'] = array(
7084 'content' => $content,
7085 'title' => $title
7086 );
7087
7088 return $sources;
7089 }
7090
7091 public function settings_contents_row_settings( $sources, $args ){
7092 $html_class_prefix = $args['html_class_prefix'];
7093 $html_name_prefix = $args['html_name_prefix'];
7094 $settings = $args['settings'];
7095 $source = $args['source'];
7096 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7097 $source_chart_type = $args['source_chart_type'];
7098
7099 if (isset($source) && !empty($source)) {
7100 if ( !isset( $source[0] ) ) {
7101 if (count($source[1]) > 2) {
7102 $titles = array();
7103 for ($i = 0; $i < count($source[1]); $i++) {
7104 array_push($titles, __("Title", $this->plugin_name).$i);
7105 }
7106 $source[0] = $titles;
7107 } else {
7108 $source[0] = array(
7109 __("Country", $this->plugin_name),
7110 __("Population", $this->plugin_name),
7111 );
7112 }
7113
7114 ksort($source);
7115 }
7116 }
7117
7118 array_shift($source);
7119 $rows = array_column($source, 0);
7120
7121 $enable_row_settings = $settings['enable_row_settings'];
7122 $series_color = $settings['series_color'][0] ?? '#3366cc';
7123 $rows_color = $settings['rows_color'];
7124 $rows_opacity = $settings['rows_opacity'];
7125
7126 ob_start();
7127 ?>
7128 <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">
7129 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7130 <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">
7131 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7132 <label for="ays-chart-option-enable-row-settings">
7133 <?php echo esc_html(__( "Enable row settings", "chart-builder" )); ?>
7134 <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") ); ?>">
7135 <i class="ays_fa ays_fa_info_circle"></i>
7136 </a>
7137 </label>
7138 </div>
7139 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7140 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7141 <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); ?> >
7142 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7143 </label>
7144 </div>
7145 </div> <!-- Enable row settings -->
7146 <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'; ?>">
7147 <br>
7148 <?php
7149 foreach ( $rows as $key => $val ):
7150 ?>
7151 <fieldset class="ays-rows-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-rows-<?php echo esc_attr($key); ?>" data-collapsed="true">
7152 <legend class="ays-rows-accordion-options-header">
7153 <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">
7154 <g>
7155 <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" />
7156 </g>
7157 </svg>
7158 <span><?php echo $val; ?></span>
7159 </legend>
7160 <div class="ays-rows-accordion-options-content ays-rows-accordion-options-content">
7161 <div class="ays-rows-accordion-data-main-wrap">
7162 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7163 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7164 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7165 <label for="ays-chart-option-rows-color">
7166 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7167 </label>
7168 </div>
7169 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7170 <input type="color"
7171 id="ays-chart-option-rows-color-<?php echo $key; ?>"
7172 class="ays-chart-option-rows-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7173 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_color][<?php echo $key; ?>]"
7174 value="<?php echo isset($rows_color[$key]) && '' !== $rows_color[$key] ? esc_attr($rows_color[$key]) : $series_color; ?>"
7175 data-rows-id="<?php echo $key; ?>">
7176 </div>
7177 </div> <!-- color -->
7178 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
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-rows-color">
7181 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
7182 </label>
7183 </div>
7184 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7185 <input type="number"
7186 id="ays-chart-option-rows-opacity-<?php echo $key; ?>"
7187 class="ays-chart-option-rows-opacity ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7188 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_opacity][<?php echo $key; ?>]"
7189 value="<?php echo isset($rows_opacity[$key]) && '' !== $rows_opacity[$key] ? esc_attr($rows_opacity[$key]) : 1.0; ?>"
7190 data-rows-id="<?php echo $key; ?>"
7191 step=".1" min="0" max="1">
7192 </div>
7193 </div> <!-- opacity -->
7194 </div>
7195 </div>
7196 </div>
7197 </fieldset>
7198 <?php
7199 endforeach;
7200 ?>
7201 <br>
7202 <blockquote>
7203 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
7204 <br>
7205 <?php echo sprintf(__( "%sNote:%s The applied styles will work only if the chart has one column.", $this->plugin_name ), '<strong>', '</strong>'); ?>
7206 </blockquote>
7207 </div>
7208 <div class="<?php echo esc_attr($html_class_prefix) ?>not-hidden-options-section <?php echo $enable_row_settings === 'checked' ? 'display_none' : ''; ?>">
7209 <br>
7210 <blockquote>
7211 <?php echo sprintf(__( "%sNote:%s If this option is disabled, the general options will be set from the series settings.", $this->plugin_name ), '<strong>', '</strong>'); ?>
7212 </blockquote>
7213 </div>
7214 </div>
7215 </div>
7216 <?php
7217 $content = ob_get_clean();
7218
7219 $title = __( 'Row settings', "chart-builder" );
7220
7221 $sources['row_settings'] = array(
7222 'content' => $content,
7223 'title' => $title
7224 );
7225
7226 return $sources;
7227 }
7228 }
7229