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

7,334 lines 524.8 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_christmas_message($ays_chart_builder_flag);
763 // $this->ays_chart_silver_bundle_message($ays_chart_builder_flag);
764 // $this->ays_chart_black_friday_message_2024($ays_chart_builder_flag);
765 $this->ays_chart_christmas_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/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner' class='ays-chart-black-friday-bundle-title-link' target='_blank'>Black Friday Sale</a></span>", CHART_BUILDER_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/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner" class="ays-chart-black-friday-bundle-title-link" target="_blank">';
1276 $content[] = __( "50% 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-dicount-wrap-text-box">';
1297 $content[] = '<span class="ays-chart-black-friday-bundle-title">';
1298 $content[] = '<a class="ays-chart-black-friday-bundle-title-link" href="https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner" target="_blank">';
1299 $content[] = __( 'Silver Bundle', "ays-popup-box" );
1300 $content[] = '</a>';
1301 $content[] = '</span>';
1302 $content[] = '</div>';
1303
1304 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1305 $content[] = '<a href="https://ays-pro.com/silver-bundle?utm_source=chart-free-dashboard&utm_medium=chart-sale-banner&utm_campaign=black-friday-silver-bundle-sale-banner" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', CHART_BUILDER_NAME ) . '</a>';
1306 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1307 $content[] = __( "One-time payment", CHART_BUILDER_NAME );
1308 $content[] = '</span>';
1309 $content[] = '</div>';
1310 $content[] = '</div>';
1311 $content[] = '</div>';
1312
1313 $content = implode( '', $content );
1314 echo $content;
1315 }
1316 }
1317
1318 // Christmas Top Banner 2024
1319 public function ays_chart_christmas_message_2024($ishmar){
1320 if($ishmar == 0 ){
1321 $content = array();
1322
1323 $content[] = '<div id="ays-chart-christmas-top-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
1324 $content[] = '<div id="ays-chart-dicount-month" class="ays_chart_dicount_month">';
1325
1326 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-countdown-box">';
1327
1328 $content[] = '<div id="ays-chart-countdown-main-container">';
1329 $content[] = '<div class="ays-chart-countdown-container">';
1330
1331 $content[] = '<div id="ays-chart-countdown">';
1332
1333 $content[] = '<div>';
1334 $content[] = __( "Offer ends in:", CHART_BUILDER_NAME );
1335 $content[] = '</div>';
1336
1337 $content[] = '<ul style="padding-left: 0;">';
1338 $content[] = '<li><span id="ays-chart-countdown-days"></span>'. __( "Days", CHART_BUILDER_NAME ) .'</li>';
1339 $content[] = '<li><span id="ays-chart-countdown-hours"></span>'. __( "Hours", CHART_BUILDER_NAME ) .'</li>';
1340 $content[] = '<li><span id="ays-chart-countdown-minutes"></span>'. __( "Minutes", CHART_BUILDER_NAME ) .'</li>';
1341 $content[] = '<li><span id="ays-chart-countdown-seconds"></span>'. __( "Seconds", CHART_BUILDER_NAME ) .'</li>';
1342 $content[] = '</ul>';
1343 $content[] = '</div>';
1344
1345 $content[] = '<div id="ays-chart-countdown-content" class="emoji">';
1346 $content[] = '<span>🚀</span>';
1347 $content[] = '<span>⌛</span>';
1348 $content[] = '<span>🔥</span>';
1349 $content[] = '<span>💣</span>';
1350 $content[] = '</div>';
1351
1352 $content[] = '</div>';
1353 $content[] = '</div>';
1354
1355 $content[] = '</div>';
1356
1357 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-text-box">';
1358 $content[] = '<div>';
1359
1360 $content[] = '<span class="ays-chart-christmas-top-bundle-title">';
1361 $content[] = __( "<span><a href='https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner' class='ays-chart-christmas-top-bundle-title-link' target='_blank'>Christmas Sale</a></span>", CHART_BUILDER_NAME );
1362 $content[] = '</span>';
1363
1364 $content[] = '</br>';
1365
1366 $content[] = '<span class="ays-chart-christmas-top-bundle-desc">';
1367 $content[] = '<a class="ays-chart-christmas-top-bundle-desc" href="https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner" class="ays-chart-christmas-top-bundle-title-link" target="_blank">';
1368 $content[] = __( "20% Extra OFF", CHART_BUILDER_NAME );
1369 $content[] = '</a>';
1370 $content[] = '</span>';
1371 $content[] = '</div>';
1372
1373 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-chart-dismiss-buttons-container-for-form">';
1374
1375 $content[] = '<form action="" method="POST">';
1376 $content[] = '<div id="ays-chart-dismiss-buttons-content">';
1377 if( current_user_can( 'manage_options' ) ){
1378 $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>';
1379 $content[] = wp_nonce_field( CHART_BUILDER_NAME . '-sale-banner' , CHART_BUILDER_NAME . '-sale-banner' );
1380 }
1381 $content[] = '</div>';
1382 $content[] = '</form>';
1383
1384 $content[] = '</div>';
1385
1386 $content[] = '</div>';
1387
1388 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-christmas-top-bundle-coupon-text-box">';
1389 $content[] = '<div class="ays-chart-christmas-top-bundle-coupon-row">';
1390 $content[] = 'xmas20off';
1391 $content[] = '</div>';
1392
1393 $content[] = '<div class="ays-chart-christmas-top-bundle-text-row">';
1394 $content[] = __( '20% Extra Discount Coupon', CHART_BUILDER_NAME );
1395 $content[] = '</div>';
1396 $content[] = '</div>';
1397
1398 $content[] = '<div class="ays-chart-dicount-wrap-box ays-chart-dicount-wrap-button-box">';
1399 $content[] = '<a href="https://ays-pro.com/wordpress/chart-builder?utm_source=dashboard&utm_medium=chart-free&utm_campaign=christmas-sale-banner" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', CHART_BUILDER_NAME ) . '</a>';
1400 $content[] = '<span class="ays-chart-dicount-one-time-text">';
1401 $content[] = __( "One-time payment", CHART_BUILDER_NAME );
1402 $content[] = '</span>';
1403 $content[] = '</div>';
1404 $content[] = '</div>';
1405 $content[] = '</div>';
1406
1407 $content = implode( '', $content );
1408 echo $content;
1409 }
1410 }
1411
1412 public function ays_chart_update_banner_time(){
1413
1414 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
1415 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
1416 $next_3_days = date('M d, Y H:i:s', $date);
1417
1418 $ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1419
1420 if ( !$ays_chart_banner_time || is_null( $ays_chart_banner_time ) ) {
1421 update_option('ays_chart_20_bundle_banner_time', $next_3_days );
1422 }
1423
1424 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1425
1426 $val = 60*60*24*0.5; // half day
1427 // $val = 60; // for testing | 1 min
1428
1429 $current_date = current_time( 'mysql' );
1430 $date_diff = strtotime($current_date) - intval(strtotime($get_ays_chart_banner_time));
1431
1432 $days_diff = $date_diff / $val;
1433 if(intval($days_diff) > 0 ){
1434 update_option('ays_chart_20_bundle_banner_time', $next_3_days);
1435 $get_ays_chart_banner_time = get_option('ays_chart_20_bundle_banner_time');
1436 }
1437
1438 return $get_ays_chart_banner_time;
1439 }
1440
1441 public function author_user_search() {
1442 check_ajax_referer( 'cbuilder-author-user-search', 'security' );
1443 $params = $_REQUEST['params'];
1444 $search = isset($params['search']) && $params['search'] != '' ? sanitize_text_field( $params['search'] ) : null;
1445 $checked = isset($params['val']) && $params['val'] !='' ? sanitize_text_field( $params['val'] ) : null;
1446 $args = 'search=';
1447 if ($search !== null) {
1448 $args .= '*';
1449 $args .= $search;
1450 $args .= '*';
1451 }
1452
1453 $users = get_users($args);
1454
1455 $content_text = array(
1456 'results' => array()
1457 );
1458
1459 foreach ($users as $key => $value) {
1460 if ($checked !== null) {
1461 if ( !is_array( $checked ) ) {
1462 $checked2 = $checked;
1463 $checked = array();
1464 $checked[] = absint($checked2);
1465 }
1466 if (in_array($value->ID, $checked)) {
1467 continue;
1468 } else {
1469 $content_text['results'][] = array(
1470 'id' => $value->ID,
1471 'text' => $value->data->display_name,
1472 );
1473 }
1474 } else {
1475 $content_text['results'][] = array(
1476 'id' => $value->ID,
1477 'text' => $value->data->display_name,
1478 );
1479 }
1480 }
1481
1482 ob_end_clean();
1483 echo json_encode($content_text);
1484 wp_die();
1485 }
1486
1487 /**
1488 * Determine if the plugin/addon installations are allowed.
1489 *
1490 * @since 6.4.0.4
1491 *
1492 * @param string $type Should be `plugin` or `addon`.
1493 *
1494 * @return bool
1495 */
1496 public static function ays_chart_can_install( $type ) {
1497
1498 return self::ays_chart_can_do( 'install', $type );
1499 }
1500
1501 /**
1502 * Determine if the plugin/addon activations are allowed.
1503 *
1504 * @since 6.4.0.4
1505 *
1506 * @param string $type Should be `plugin` or `addon`.
1507 *
1508 * @return bool
1509 */
1510 public static function ays_chart_can_activate( $type ) {
1511
1512 return self::ays_chart_can_do( 'activate', $type );
1513 }
1514
1515 /**
1516 * Determine if the plugin/addon installations/activations are allowed.
1517 *
1518 * @since 6.4.0.4
1519 *
1520 * @param string $what Should be 'activate' or 'install'.
1521 * @param string $type Should be `plugin` or `addon`.
1522 *
1523 * @return bool
1524 */
1525 public static function ays_chart_can_do( $what, $type ) {
1526
1527 if ( ! in_array( $what, array( 'install', 'activate' ), true ) ) {
1528 return false;
1529 }
1530
1531 if ( ! in_array( $type, array( 'plugin', 'addon' ), true ) ) {
1532 return false;
1533 }
1534
1535 $capability = $what . '_plugins';
1536
1537 if ( ! current_user_can( $capability ) ) {
1538 return false;
1539 }
1540
1541 // Determine whether file modifications are allowed and it is activation permissions checking.
1542 if ( $what === 'install' && ! wp_is_file_mod_allowed( 'ays_chart_can_install' ) ) {
1543 return false;
1544 }
1545
1546 // All plugin checks are done.
1547 if ( $type === 'plugin' ) {
1548 return true;
1549 }
1550 return false;
1551 }
1552
1553 /**
1554 * Activate plugin.
1555 *
1556 * @since 1.0.0
1557 * @since 6.4.0.4 Updated the permissions checking.
1558 */
1559 public function ays_chart_activate_plugin() {
1560
1561 // Run a security check.
1562 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1563
1564 // Check for permissions.
1565 if ( ! current_user_can( 'activate_plugins' ) ) {
1566 wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', 'chart-builder' ) );
1567 }
1568
1569 $type = 'addon';
1570
1571 if ( isset( $_POST['plugin'] ) ) {
1572
1573 if ( ! empty( $_POST['type'] ) ) {
1574 $type = sanitize_key( $_POST['type'] );
1575 }
1576
1577 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
1578 $activate = activate_plugins( $plugin );
1579
1580 if ( ! is_wp_error( $activate ) ) {
1581 if ( $type === 'plugin' ) {
1582 wp_send_json_success( esc_html__( 'Plugin activated.', 'chart-builder' ) );
1583 } else {
1584 ( esc_html__( 'Addon activated.', 'chart-builder' ) );
1585 }
1586 }
1587 }
1588
1589 if ( $type === 'plugin' ) {
1590 wp_send_json_error( esc_html__( 'Could not activate the plugin. Please activate it on the Plugins page.', 'chart-builder' ) );
1591 }
1592
1593 wp_send_json_error( esc_html__( 'Could not activate the addon. Please activate it on the Plugins page.', 'chart-builder' ) );
1594 }
1595
1596 /**
1597 * Install addon.
1598 *
1599 * @since 1.0.0
1600 * @since 6.4.0.4 Updated the permissions checking.
1601 */
1602 public function ays_chart_install_plugin() {
1603
1604 // Run a security check.
1605 check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1606
1607 $generic_error = esc_html__( 'There was an error while performing your request.', 'chart-builder' );
1608 $type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
1609
1610 // Check if new installations are allowed.
1611 if ( ! self::ays_chart_can_install( $type ) ) {
1612 wp_send_json_error( $generic_error );
1613 }
1614
1615 $error = $type === 'plugin'
1616 ? esc_html__( 'Could not install the plugin. Please download and install it manually.', 'chart-builder' )
1617 : "";
1618
1619 $plugin_url = ! empty( $_POST['plugin'] ) ? esc_url_raw( wp_unslash( $_POST['plugin'] ) ) : '';
1620
1621 if ( empty( $plugin_url ) ) {
1622 wp_send_json_error( $error );
1623 }
1624
1625 // Prepare variables.
1626 $url = esc_url_raw(
1627 add_query_arg(
1628 [
1629 'page' => 'chart-builder-featured-plugins',
1630 ],
1631 admin_url( 'admin.php' )
1632 )
1633 );
1634
1635 ob_start();
1636 $creds = request_filesystem_credentials( $url, '', false, false, null );
1637
1638 // Hide the filesystem credentials form.
1639 ob_end_clean();
1640
1641 // Check for file system permissions.
1642 if ( $creds === false ) {
1643 wp_send_json_error( $error );
1644 }
1645
1646 if ( ! WP_Filesystem( $creds ) ) {
1647 wp_send_json_error( $error );
1648 }
1649
1650 /*
1651 * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
1652 */
1653 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-upgrader.php';
1654 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-install-skin.php';
1655 require_once CHART_BUILDER_DIR . 'includes/admin/class-chart-builder-skin.php';
1656
1657
1658 // Do not allow WordPress to search/download translations, as this will break JS output.
1659 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1660
1661 // Create the plugin upgrader with our custom skin.
1662 $installer = new ChartBuilder\Helpers\ChartBuilderPluginSilentUpgrader( new Chart_Builder_Install_Skin() );
1663
1664 // Error check.
1665 if ( ! method_exists( $installer, 'install' ) ) {
1666 wp_send_json_error( $error );
1667 }
1668
1669 $installer->install( $plugin_url );
1670
1671 // Flush the cache and return the newly installed plugin basename.
1672 wp_cache_flush();
1673
1674 $plugin_basename = $installer->plugin_info();
1675
1676 if ( empty( $plugin_basename ) ) {
1677 wp_send_json_error( $error );
1678 }
1679
1680 $result = array(
1681 'msg' => $generic_error,
1682 'is_activated' => false,
1683 'basename' => $plugin_basename,
1684 );
1685
1686 // Check for permissions.
1687 if ( ! current_user_can( 'activate_plugins' ) ) {
1688 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed.', 'chart-builder' ) : "";
1689
1690 wp_send_json_success( $result );
1691 }
1692
1693 // Activate the plugin silently.
1694 $activated = activate_plugin( $plugin_basename );
1695 remove_action( 'activated_plugin', array( 'ays_sccp_activation_redirect_method', 'gallery_p_gallery_activation_redirect_method', 'poll_maker_activation_redirect_method' ), 100 );
1696
1697 if ( ! is_wp_error( $activated ) ) {
1698
1699 $result['is_activated'] = true;
1700 $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed and activated.', 'chart-builder' ) : esc_html__( 'Addon installed and activated.', 'chart-builder' );
1701
1702 wp_send_json_success( $result );
1703 }
1704
1705 // Fallback error just in case.
1706 wp_send_json_error( $result );
1707 }
1708
1709 /**
1710 * List of AM plugins that we propose to install.
1711 *
1712 * @since 6.4.0.4
1713 *
1714 * @return array
1715 */
1716 protected function get_am_plugins() {
1717 if ( !isset( $_SESSION ) ) {
1718 session_start();
1719 }
1720
1721 $images_url = CHART_BUILDER_ADMIN_URL . '/images/icons/';
1722
1723 $plugin_slug = array(
1724 'quiz-maker',
1725 'survey-maker',
1726 'poll-maker',
1727 'ays-popup-box',
1728 'secure-copy-content-protection',
1729 'gallery-photo-gallery',
1730 'ays-chatgpt-assistant',
1731 'easy-form',
1732 );
1733
1734 $plugin_url_arr = array();
1735 foreach ($plugin_slug as $key => $slug) {
1736 if ( isset( $_SESSION['ays_chart_our_product_links'] ) && !empty( $_SESSION['ays_chart_our_product_links'] )
1737 && isset( $_SESSION['ays_chart_our_product_links'][$slug] ) && !empty( $_SESSION['ays_chart_our_product_links'][$slug] ) ) {
1738 $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] ) : "";
1739 } else {
1740 $latest_version = $this->ays_chart_get_latest_plugin_version($slug);
1741 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.zip';
1742 if ( $latest_version != '' ) {
1743 $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.'. $latest_version .'.zip';
1744 $_SESSION['ays_chart_our_product_links'][$slug] = $plugin_url;
1745 }
1746 }
1747
1748 $plugin_url_arr[$slug] = $plugin_url;
1749 }
1750
1751 $plugins_array = array(
1752 'quiz-maker/quiz-maker.php' => array(
1753 'icon' => $images_url . 'icon-quiz-128x128.png',
1754 'name' => __( 'Quiz Maker', "easy-form" ),
1755 'desc' => __( 'Create powerful and engaging quizzes, tests, and exams in minutes.', "easy-form" ),
1756 'desc_hidden' => __( 'Build an unlimited number of quizzes and questions.', "easy-form" ),
1757 'wporg' => 'https://wordpress.org/plugins/quiz-maker/',
1758 'buy_now' => 'https://ays-pro.com/wordpress/quiz-maker/',
1759 'url' => $plugin_url_arr['quiz-maker'],
1760 ),
1761 'survey-maker/survey-maker.php' => array(
1762 'icon' => $images_url . 'icon-survey-128x128.png',
1763 'name' => __( 'Survey Maker', 'chart-builder' ),
1764 'desc' => __( 'Make amazing online surveys and get real-time feedback quickly and easily.', 'chart-builder' ),
1765 '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' ),
1766 'wporg' => 'https://wordpress.org/plugins/survey-maker/',
1767 'buy_now' => 'https://ays-pro.com/wordpress/survey-maker',
1768 'url' => $plugin_url_arr['survey-maker'],
1769 ),
1770 'poll-maker/poll-maker-ays.php' => array(
1771 'icon' => $images_url . 'icon-poll-128x128.png',
1772 'name' => __( 'Poll Maker', 'chart-builder' ),
1773 'desc' => __( 'Create amazing online polls for your WordPress website super easily.', 'chart-builder' ),
1774 'desc_hidden' => __( 'Build up various types of polls in a minute and get instant feedback on any topic or product.', 'chart-builder' ),
1775 'wporg' => 'https://wordpress.org/plugins/poll-maker/',
1776 'buy_now' => 'https://ays-pro.com/wordpress/poll-maker/',
1777 'url' => $plugin_url_arr['poll-maker'],
1778 ),
1779 'ays-popup-box/ays-pb.php' => array(
1780 'icon' => $images_url . 'icon-popup-128x128.png',
1781 'name' => __( 'Popup Box', 'chart-builder' ),
1782 'desc' => __( 'Popup everything you want! Create informative and promotional popups all in one plugin.', 'chart-builder' ),
1783 'desc_hidden' => __( 'Attract your visitors and convert them into email subscribers and paying customers.', 'chart-builder' ),
1784 'wporg' => 'https://wordpress.org/plugins/ays-popup-box/',
1785 'buy_now' => 'https://ays-pro.com/wordpress/popup-box/',
1786 'url' => $plugin_url_arr['ays-popup-box'],
1787 ),
1788 'secure-copy-content-protection/secure-copy-content-protection.php' => array(
1789 'icon' => $images_url . 'icon-sccp-128x128.png',
1790 'name' => __( 'Secure Copy Content Protection', 'chart-builder' ),
1791 'desc' => __( 'Disable the right click, copy paste, content selection and copy shortcut keys on your website.', 'chart-builder' ),
1792 'desc_hidden' => __( 'Protect web content from being plagiarized. Prevent plagiarism from your website with this easy to use plugin.', 'chart-builder' ),
1793 'wporg' => 'https://wordpress.org/plugins/secure-copy-content-protection/',
1794 'buy_now' => 'https://ays-pro.com/wordpress/secure-copy-content-protection/',
1795 'url' => $plugin_url_arr['secure-copy-content-protection'],
1796 ),
1797 'gallery-photo-gallery/gallery-photo-gallery.php' => array(
1798 'icon' => $images_url . 'icon-gallery-128x128.jpg',
1799 'name' => __( 'Gallery Photo Gallery', 'chart-builder' ),
1800 'desc' => __( 'Create unlimited galleries and include unlimited images in those galleries.', 'chart-builder' ),
1801 'desc_hidden' => __( 'Represent images in an attractive way. Attract people with your own single and multiple free galleries from your photo library.', 'chart-builder' ),
1802 'wporg' => 'https://wordpress.org/plugins/gallery-photo-gallery/',
1803 'buy_now' => 'https://ays-pro.com/wordpress/photo-gallery/',
1804 'url' => $plugin_url_arr['gallery-photo-gallery'],
1805 ),
1806 'ays-chatgpt-assistant/ays-chatgpt-assistant.php' => array(
1807 'icon' => $images_url . 'icon-chatgpt-128x128.png',
1808 'name' => __( 'AI Assistant with ChatGPT', 'chart-builder' ),
1809 'desc' => __( 'ChatGPT AI Assistant plugin gives you the ability to automate various tasks related to content creation and programming.', 'chart-builder' ),
1810 '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' ),
1811 'wporg' => 'https://wordpress.org/plugins/ays-chatgpt-assistant/',
1812 'buy_now' => 'https://ays-pro.com/wordpress/chatgpt-assistant',
1813 'url' => $plugin_url_arr['ays-chatgpt-assistant'],
1814 ),
1815 'easy-form/easy-form.php' => array(
1816 'icon' => $images_url . 'icon-form-128x128.png',
1817 'name' => __( 'Easy Form', 'chart-builder' ),
1818 'desc' => __( 'Choose the best WordPress form builder plugin. ', 'chart-builder' ),
1819 'desc_hidden' => __( 'Create contact forms, payment forms, surveys, and many more custom forms. Build forms easily with us.', 'chart-builder' ),
1820 'wporg' => 'https://wordpress.org/plugins/easy-form/',
1821 'buy_now' => 'https://ays-pro.com/wordpress/easy-form',
1822 'url' => $plugin_url_arr['easy-form'],
1823 ),
1824 );
1825
1826 return $plugins_array;
1827 }
1828
1829 protected function ays_chart_get_latest_plugin_version( $slug ){
1830
1831 if ( is_null( $slug ) || empty($slug) ) {
1832 return "";
1833 }
1834
1835 $version_latest = "";
1836
1837 if ( ! function_exists( 'plugins_api' ) ) {
1838 require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
1839 }
1840
1841 // set the arguments to get latest info from repository via API ##
1842 $args = array(
1843 'slug' => $slug,
1844 'fields' => array(
1845 'version' => true,
1846 )
1847 );
1848
1849 /** Prepare our query */
1850 $call_api = plugins_api( 'plugin_information', $args );
1851
1852 /** Check for Errors & Display the results */
1853 if ( is_wp_error( $call_api ) ) {
1854 $api_error = $call_api->get_error_message();
1855 } else {
1856
1857 //echo $call_api;
1858 // everything ##
1859 if ( ! empty( $call_api->version ) ) {
1860 $version_latest = $call_api->version;
1861 }
1862 }
1863
1864 return $version_latest;
1865 }
1866
1867 /**
1868 * Get AM plugin data to display in the Addons section of About tab.
1869 *
1870 * @since 6.4.0.4
1871 *
1872 * @param string $plugin Plugin slug.
1873 * @param array $details Plugin details.
1874 * @param array $all_plugins List of all plugins.
1875 *
1876 * @return array
1877 */
1878 protected function get_plugin_data( $plugin, $details, $all_plugins ) {
1879
1880 $have_pro = ( ! empty( $details['pro'] ) && ! empty( $details['pro']['plug'] ) );
1881 $show_pro = false;
1882
1883 $plugin_data = array();
1884
1885 if ( $have_pro ) {
1886 if ( array_key_exists( $plugin, $all_plugins ) ) {
1887 if ( is_plugin_active( $plugin ) ) {
1888 $show_pro = true;
1889 }
1890 }
1891 if ( array_key_exists( $details['pro']['plug'], $all_plugins ) ) {
1892 $show_pro = true;
1893 }
1894 if ( $show_pro ) {
1895 $plugin = $details['pro']['plug'];
1896 $details = $details['pro'];
1897 }
1898 }
1899
1900 if ( array_key_exists( $plugin, $all_plugins ) ) {
1901 if ( is_plugin_active( $plugin ) ) {
1902 // Status text/status.
1903 $plugin_data['status_class'] = 'status-active';
1904 $plugin_data['status_text'] = esc_html__( 'Active', 'chart-builder' );
1905 // Button text/status.
1906 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info disabled';
1907 $plugin_data['action_text'] = esc_html__( 'Activated', 'chart-builder' );
1908 $plugin_data['plugin_src'] = esc_attr( $plugin );
1909 } else {
1910 // Status text/status.
1911 $plugin_data['status_class'] = 'status-installed';
1912 $plugin_data['status_text'] = esc_html__( 'Inactive', 'chart-builder' );
1913 // Button text/status.
1914 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
1915 $plugin_data['action_text'] = esc_html__( 'Activate', 'chart-builder' );
1916 $plugin_data['plugin_src'] = esc_attr( $plugin );
1917 }
1918 } else {
1919 // Doesn't exist, install.
1920 // Status text/status.
1921 $plugin_data['status_class'] = 'status-missing';
1922
1923 if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) {
1924 $plugin_data['status_class'] = 'status-go-to-url';
1925 }
1926 $plugin_data['status_text'] = esc_html__( 'Not Installed', 'chart-builder' );
1927 // Button text/status.
1928 $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-chart-card__btn-info';
1929 $plugin_data['action_text'] = esc_html__( 'Install Plugin', 'chart-builder' );
1930 $plugin_data['plugin_src'] = esc_url( $details['url'] );
1931 }
1932
1933 $plugin_data['details'] = $details;
1934
1935 return $plugin_data;
1936 }
1937
1938 /**
1939 * Display the Addons section of About tab.
1940 *
1941 * @since 6.4.0.4
1942 */
1943 public function output_about_addons() {
1944
1945 if ( ! function_exists( 'get_plugins' ) ) {
1946 require_once ABSPATH . 'wp-admin/includes/plugin.php';
1947 }
1948
1949 $all_plugins = get_plugins();
1950 $am_plugins = $this->get_am_plugins();
1951 $can_install_plugins = self::ays_chart_can_install( 'plugin' );
1952 $can_activate_plugins = self::ays_chart_can_activate( 'plugin' );
1953
1954 $content = '';
1955 $content.= '<div class="ays-chart-cards-block">';
1956 foreach ( $am_plugins as $plugin => $details ){
1957
1958 $plugin_data = $this->get_plugin_data( $plugin, $details, $all_plugins );
1959 $plugin_ready_to_activate = $can_activate_plugins
1960 && isset( $plugin_data['status_class'] )
1961 && $plugin_data['status_class'] === 'status-installed';
1962 $plugin_not_activated = ! isset( $plugin_data['status_class'] )
1963 || $plugin_data['status_class'] !== 'status-active';
1964
1965 $plugin_action_class = ( isset( $plugin_data['action_class'] ) && esc_attr( $plugin_data['action_class'] ) != "" ) ? esc_attr( $plugin_data['action_class'] ) : "";
1966
1967 $plugin_action_class_disbaled = "";
1968 if ( strpos($plugin_action_class, 'status-active') !== false ) {
1969 $plugin_action_class_disbaled = "disbaled='true'";
1970 }
1971
1972 $content .= '
1973 <div class="ays-chart-card">
1974 <div class="ays-chart-card__content flexible">
1975 <div class="ays-chart-card__content-img-box">
1976 <img class="ays-chart-card__img" src="'. esc_url( $plugin_data['details']['icon'] ) .'" alt="'. esc_attr( $plugin_data['details']['name'] ) .'">
1977 </div>
1978 <div class="ays-chart-card__text-block">
1979 <h5 class="ays-chart-card__title">'. esc_html( $plugin_data['details']['name'] ) .'</h5>
1980 <p class="ays-chart-card__text">'. wp_kses_post( $plugin_data['details']['desc'] ) .'
1981 <span class="ays-chart-card__text-hidden">
1982 '. wp_kses_post( $plugin_data['details']['desc_hidden'] ) .'
1983 </span>
1984 </p>
1985 </div>
1986 </div>
1987 <div class="ays-chart-card__footer">';
1988 if ( $can_install_plugins || $plugin_ready_to_activate || ! $details['wporg'] ) {
1989 $content .= '<button class="'. esc_attr( $plugin_data['action_class'] ) .'" data-plugin="'. esc_attr( $plugin_data['plugin_src'] ) .'" data-type="plugin" '. $plugin_action_class_disbaled .'>
1990 '. wp_kses_post( $plugin_data['action_text'] ) .'
1991 </button>';
1992 }
1993 elseif ( $plugin_not_activated ) {
1994 $content .= '<a href="'. esc_url( $details['wporg'] ) .'" target="_blank" rel="noopener noreferrer">
1995 '. esc_html_e( 'WordPress.org', 'chart-builder' ) .'
1996 <span aria-hidden="true" class="dashicons dashicons-external"></span>
1997 </a>';
1998 }
1999 $content .='
2000 <a target="_blank" href="'. esc_url( $plugin_data['details']['buy_now'] ) .'" class="ays-chart-card__btn-primary">'. __('Buy Now', $this->plugin_name) .'</a>
2001 </div>
2002 </div>';
2003 }
2004 $install_plugin_nonce = wp_create_nonce( $this->plugin_name . '-install-plugin-nonce' );
2005 $content.= '<input type="hidden" id="ays_chart_ajax_install_plugin_nonce" name="ays_chart_ajax_install_plugin_nonce" value="'. $install_plugin_nonce .'">';
2006 $content.= '</div>';
2007
2008 echo $content;
2009 }
2010
2011 /**
2012 * Returns the data from Quiz maker.
2013 *
2014 * @access public
2015 */
2016 public function fetch_quiz_maker_data(){
2017 check_ajax_referer( 'cbuilder-fetch-quiz-maker-data', 'security' );
2018
2019 $params = $_POST['params'];
2020 if ( !isset($params) || empty($params) ) {
2021 return array(
2022 'success' => false,
2023 'data' => array(
2024 'msg' => __( "Something went wrong.", "chart-builder" )
2025 )
2026 );
2027 }
2028
2029 $query = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2030 if ( $query == '' ) {
2031 return array(
2032 'success' => false,
2033 'data' => array(
2034 'msg' => __( "No data given.", "chart-builder" )
2035 )
2036 );
2037 }
2038 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : null;
2039 $user_id = get_current_user_id();
2040
2041 $return_results = CBFunctions()->get_quiz_query($query, $quiz_id, $user_id);
2042
2043 if (empty($return_results)) {
2044 return array(
2045 'success' => false,
2046 'data' => array(
2047 'msg' => __( "Something went wrong.", "chart-builder" )
2048 )
2049 );
2050 }
2051
2052 $result_values = $return_results['result'];
2053 $query = $return_results['query'];
2054
2055 if (empty($result_values)) {
2056 return array(
2057 'success' => false,
2058 'data' => array(
2059 'msg' => $return_results['message']
2060 )
2061 );
2062 }
2063
2064 if (count($return_results['result'][0]) != 1 ) {
2065 $results = array();
2066 $headers = array();
2067 if ( $result_values ) {
2068 $row_num = 0;
2069 foreach ( $result_values as $row ) {
2070 $result = array();
2071 foreach ( $row as $k => $v ) {
2072 $result[] = $v;
2073 if ( $row_num === 0 ) {
2074 $headers[] = $k;
2075 }
2076 }
2077 $results[] = $result;
2078 $row_num++;
2079 }
2080 }
2081 } else if (count($return_results['result'][0]) == 1) {
2082 $results = array();
2083 $headers = array();
2084 if ( $result_values ) {
2085 $row_num = 0;
2086 foreach ( $result_values as $index => $row ) {
2087 $result = array();
2088 foreach ( $row as $k => $v ) {
2089 $result[] = strval($index) + 1;
2090 $result[] = $v;
2091 if ( $row_num === 0 ) {
2092 $headers[] = 'Quiz';
2093 $headers[] = $k;
2094 }
2095 }
2096 $results[] = $result;
2097 $row_num++;
2098 }
2099 }
2100 }
2101
2102 if (empty($results)) {
2103 return array(
2104 'success' => false,
2105 'data' => array(
2106 'msg' => $return_results['message']
2107 )
2108 );
2109 }
2110
2111 foreach ($results as $key => $value) {
2112 if (!isset($value) || count($value) <= 1 && $key != 0) {
2113 unset($results[$key]);
2114 }
2115 }
2116
2117 array_unshift($results, $headers);
2118 $results = array_values( $results );
2119 $data = $results;
2120
2121 $headers = $results[0];
2122 unset( $results[0] );
2123
2124 $html = CBFunctions()->get_table_html( $headers, $results );
2125
2126 return array(
2127 'success' => true,
2128 'data' => array(
2129 'table' => $html,
2130 'data' => $data
2131 )
2132 );
2133 }
2134
2135 /**
2136 * Saves the Quiz maker data.
2137 *
2138 * @access public
2139 */
2140 public function save_quiz_maker_data() {
2141 check_ajax_referer( 'cbuilder-save-quiz-maker-data', 'security' );
2142
2143 $params = $_POST['params'];
2144 if ( !isset($params) || empty($params) ) {
2145 return array(
2146 'success' => false,
2147 'data' => array(
2148 'msg' => __( "Something went wrong.", "chart-builder" )
2149 )
2150 );
2151 }
2152
2153 $query_id = isset($params['query']) && $params['query'] !== '' ? $params['query'] : '';
2154 if ( $query_id == '' ) {
2155 return array(
2156 'success' => false,
2157 'data' => array(
2158 'msg' => __( "No data given.", "chart-builder" )
2159 )
2160 );
2161 }
2162
2163 $chart_id = isset( $params['chart_id'] ) ? absint( $params['chart_id'] ) : 0;
2164 $quiz_id = isset($params['quizID']) && $params['quizID'] !== '' ? $params['quizID'] : 0;
2165 $user_id = get_current_user_id();
2166
2167 if ( $chart_id >= 0 ) {
2168
2169 $return_results = CBFunctions()->get_quiz_query($query_id, $quiz_id, $user_id);
2170
2171 if (empty($return_results)) {
2172 return array(
2173 'success' => false,
2174 'data' => array(
2175 'msg' => __( "Something went wrong.", "chart-builder" )
2176 )
2177 );
2178 }
2179
2180 $result_values = $return_results['result'];
2181 $query = $return_results['query'];
2182
2183 if (empty($result_values)) {
2184 return array(
2185 'success' => false,
2186 'data' => array(
2187 'msg' => $return_results['message']
2188 )
2189 );
2190 }
2191
2192 if ( !empty($result_values) && count($return_results['result'][0]) != 1 ) {
2193 $results = array();
2194 $headers = array();
2195 if ( $result_values ) {
2196 $row_num = 0;
2197 foreach ( $result_values as $row ) {
2198 $result = array();
2199 foreach ( $row as $k => $v ) {
2200 $result[] = $v;
2201 if ( $row_num === 0 ) {
2202 $headers[] = $k;
2203 }
2204 }
2205 $results[] = $result;
2206 $row_num++;
2207 }
2208 }
2209 } else if (count($return_results['result'][0]) == 1) {
2210 $results = array();
2211 $headers = array();
2212 if ( $result_values ) {
2213 $row_num = 0;
2214 foreach ( $result_values as $index => $row ) {
2215 $result = array();
2216 foreach ( $row as $k => $v ) {
2217 $result[] = strval($index) + 1;
2218 $result[] = $v;
2219 if ( $row_num === 0 ) {
2220 $headers[] = 'Quiz';
2221 $headers[] = $k;
2222 }
2223 }
2224 $results[] = $result;
2225 $row_num++;
2226 }
2227 }
2228 }
2229
2230 $source_type = 'quiz_maker';
2231 $option_name_for_data = $chart_id == 0 ? 'ays_chart_quiz_maker_results_temp' : 'ays_chart_quiz_maker_results_' . $chart_id;
2232 $option_name_for_quiz = $chart_id == 0 ? 'ays_chart_quiz_maker_quiz_data_temp' : 'ays_chart_quiz_maker_quiz_data_' . $chart_id;
2233
2234 update_option( $option_name_for_data, array(
2235 'source_type' => $source_type,
2236 'source' => $query,
2237 'data' => $results,
2238 ) );
2239 update_option( $option_name_for_quiz, array(
2240 'quiz_query' => $query_id,
2241 'quiz_id' => $quiz_id
2242 ) );
2243
2244 } else {
2245 return array(
2246 'success' => false,
2247 'data' => array(
2248 'msg' => __( 'Given incorrect Chart ID.', "chart-builder")
2249 )
2250 );
2251 }
2252
2253 return array(
2254 'success' => true,
2255 'data' => array(
2256 'msg' => __( 'Data was successfully saved.', "chart-builder" )
2257 )
2258 );
2259 }
2260
2261 /**
2262 * Chart page action hooks
2263 */
2264
2265 /**
2266 * Chart page sources contents
2267 * @param $args
2268 */
2269 public function ays_chart_page_source_contents( $args ){
2270 $chart_source_type = $args['chart_source_type'];
2271
2272 if ($chart_source_type === 'chart-js') {
2273 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings_chartjs', array(), $args );
2274 } else {
2275 $sources_contents = apply_filters( 'ays_cb_chart_page_sources_contents_settings', array(), $args );
2276 }
2277
2278 $source_type = $args['source_type'];
2279
2280 $sources = array();
2281 foreach ( $sources_contents as $key => $sources_content ) {
2282 $collapsed = $key == $source_type ? 'false' : 'true';
2283
2284 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="'. $collapsed .'">';
2285 if( isset( $sources_content['title'] ) ){
2286 $content .= '<legend class="ays-accordion-options-header">';
2287 $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">
2288 <g>
2289 <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" />
2290 </g>
2291 </svg>';
2292
2293 $content .= '<span>'. $sources_content['title'] .'</span></legend>';
2294 }
2295
2296 $content .= '<div class="ays-accordion-options-content">';
2297 $content .= $sources_content['content'];
2298 $content .= '</div>';
2299
2300 $content .= '</fieldset>';
2301
2302 $sources[] = $content;
2303 }
2304 $content_for_escape = implode('' , $sources );
2305 echo html_entity_decode(esc_html( $content_for_escape ));
2306 }
2307
2308 public function source_contents_import_from_csv_settings( $sources, $args ){
2309 $html_class_prefix = $args['html_class_prefix'];
2310 $html_name_prefix = $args['html_name_prefix'];
2311
2312 ob_start();
2313 ?>
2314 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2315 <div class="ays-pro-features-v2-big-buttons-box">
2316 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2317 <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>
2318 <div class="ays-pro-features-v2-video-text">
2319 <?php echo __("Watch Video" , "chart-builder"); ?>
2320 </div>
2321 </a>
2322 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2323 <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>
2324 <div class="ays-pro-features-v2-upgrade-text">
2325 <?php echo __("Upgrade" , "chart-builder"); ?>
2326 </div>
2327 </a>
2328 </div>
2329 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main">
2330 <div class="<?php echo esc_attr($html_class_prefix) ?>file-import-form">
2331 <h6><?php echo __("Choose what kind of data would you like to upload.", "chart-builder"); ?></h6>
2332 <select class="form-select" style="max-width: none;" id="<?php echo esc_attr($html_class_prefix) ?>import-files-file-type">
2333 <option value="csv">CSV File</option>
2334 </select>
2335 <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>
2336 <p class="<?php echo esc_attr($html_class_prefix) ?>csv-export-example" style="font-size: 15px; font-style: italic;">Example:
2337 <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>
2338 </p>
2339 <div>
2340 <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" />
2341 </div>
2342 <div class='ays-chart-file-import-success'></div>
2343 <div class='ays-chart-file-import-error'></div>
2344 <div class="ays-chart-buttons-group">
2345 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-fetch">
2346 <?php echo __( 'Show Results', "chart-builder" ); ?>
2347 </button>
2348 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-show-on-chart">
2349 <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>
2350 <?php echo __( 'Preview', "chart-builder" ); ?>
2351 </button>
2352 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-file-import-save">
2353 <?php echo __( 'Save data', "chart-builder" ); ?>
2354 </button>
2355 </div>
2356 </div>
2357 </div>
2358 </div>
2359 <?php
2360 $content = ob_get_clean();
2361
2362 $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") . '">
2363 <i class="ays_fa ays_fa_info_circle"></i>
2364 </a>';
2365
2366 $sources['file_import'] = array(
2367 'content' => $content,
2368 'title' => $title
2369 );
2370
2371 return $sources;
2372 }
2373
2374 public function source_contents_import_from_db_settings( $sources, $args ){
2375 $html_class_prefix = $args['html_class_prefix'];
2376 $html_name_prefix = $args['html_name_prefix'];
2377
2378 ob_start();
2379 ?>
2380 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2381 <div class="ays-pro-features-v2-big-buttons-box">
2382 <a href="https://www.youtube.com/watch?v=tZ8K3y0qOEY" target="_blank" class="ays-pro-features-v2-video-button">
2383 <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>
2384 <div class="ays-pro-features-v2-video-text">
2385 <?php echo __("Watch Video" , "chart-builder"); ?>
2386 </div>
2387 </a>
2388 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2389 <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>
2390 <div class="ays-pro-features-v2-upgrade-text">
2391 <?php echo __("Upgrade" , "chart-builder"); ?>
2392 </div>
2393 </a>
2394 </div>
2395 <div class="<?= $html_class_prefix ?>source-data-main-wrap">
2396 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2397 <div id="ays-chart-db-query">
2398 <div class="<?= $html_class_prefix ?>-db-query-form">
2399 <div id="db-query-form">
2400 <input type="hidden" name="chart_id" value="1">
2401 <textarea name="query" class="<?= $html_class_prefix ?>db-query" placeholder="<?php echo __( "Add your query here.", $this->plugin_name ); ?>"></textarea>
2402 <div class='db-wizard-success'></div>
2403 <div class='db-wizard-error'></div>
2404 </div>
2405 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2406 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-fetch">
2407 <?php echo __( 'Show Results', "chart-builder" ); ?>
2408 </button>
2409 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-show-on-chart">
2410 <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>
2411 <?php echo __( 'Preview', "chart-builder" ); ?>
2412 </button>
2413 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-query-save">
2414 <?php echo __( 'Save data', "chart-builder" ); ?>
2415 </button>
2416 </div>
2417 </div>
2418 <div class="db-wizard-hints">
2419 <ul>
2420 <!-- <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> -->
2421 <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>
2422 </ul>
2423 </div>
2424 </div>
2425 </div>
2426 </div>
2427 </div>
2428 <?php
2429 $content = ob_get_clean();
2430
2431 $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) . '">
2432 <i class="ays_fa ays_fa_info_circle"></i>
2433 </a>';
2434
2435 $sources['import_from_db'] = array(
2436 'content' => $content,
2437 'title' => $title
2438 );
2439
2440 return $sources;
2441 }
2442
2443 public function source_contents_import_from_external_db_settings( $sources, $args ){
2444 $html_class_prefix = $args['html_class_prefix'];
2445 $html_name_prefix = $args['html_name_prefix'];
2446
2447 ob_start();
2448 ?>
2449 <div class="ays-accordion-data-main-wrap ays-pro-features-v2-main-box" style="padding:10px;">
2450 <div class="ays-pro-features-v2-big-buttons-box">
2451 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2452 <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>
2453 <div class="ays-pro-features-v2-upgrade-text">
2454 <?php echo __("Upgrade" , "chart-builder"); ?>
2455 </div>
2456 </a>
2457 </div>
2458 <div class="<?= $html_class_prefix ?>source-data-main-wrap">
2459 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2460 <div class="form-group row mb-2">
2461 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
2462 <label class="form-label">
2463 <?php echo esc_html(__('Use custom database settings for this chart', "chart-builder")); ?>
2464 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __(".","chart-builder") ); ?>">
2465 <i class="ays_fa ays_fa_info_circle"></i>
2466 </a>
2467 </label>
2468 </div>
2469 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
2470 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
2471 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" type="checkbox" />
2472 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
2473 </label>
2474 </div>
2475 </div>
2476 <div id="ays-chart-external-db-query">
2477 <div class="<?= $html_class_prefix ?>-db-query-form">
2478 <div id="external-db-query-form">
2479 <input type="hidden" name="chart_id" value="1">
2480 <textarea name="query" class="<?= $html_class_prefix ?>external-db-query" placeholder="<?php echo __( "Add your query here.", $this->plugin_name ); ?>"></textarea>
2481 <div class='db-wizard-success'></div>
2482 <div class='db-wizard-error'></div>
2483 </div>
2484 <div class="ays-chart-db-query-form-button ays-chart-buttons-group">
2485 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-fetch">
2486 <?php echo __( 'Show Results', "chart-builder" ); ?>
2487 </button>
2488 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-show-on-chart">
2489 <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>
2490 <?php echo __( 'Preview', "chart-builder" ); ?>
2491 </button>
2492 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-external-query-save">
2493 <?php echo __( 'Save data', "chart-builder" ); ?>
2494 </button>
2495 </div>
2496 </div>
2497 <div class="db-wizard-hints">
2498 <ul>
2499 <!-- <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> -->
2500 <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>
2501 </ul>
2502 </div>
2503 </div>
2504 </div>
2505 </div>
2506 </div>
2507 <?php
2508 $content = ob_get_clean();
2509
2510 $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) . '">
2511 <i class="ays_fa ays_fa_info_circle"></i>
2512 </a>';
2513
2514 $sources['import_from_external_db'] = array(
2515 'content' => $content,
2516 'title' => $title
2517 );
2518
2519 return $sources;
2520 }
2521
2522 public function source_contents_quiz_maker_integration_settings( $sources, $args ){
2523 global $wpdb;
2524 $chart_id = $args['chart_id'];
2525 $html_class_prefix = $args['html_class_prefix'];
2526 $html_name_prefix = $args['html_name_prefix'];
2527 $source = $args['source'];
2528 $settings = $args['settings'];
2529 $quiz_queries = $args['quiz_queries'];
2530 $quiz_query_tooltips = $args['quiz_query_tooltips'];
2531 $quiz_id = $args['quiz_id'];
2532 $quiz_query = $args['quiz_query'];
2533
2534 if ( !is_plugin_active('quiz-maker/quiz-maker.php') ) {
2535 // $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") . '">
2536 // <i class="ays_fa ays_fa_info_circle"></i>
2537 // </a>', '<br>', '<b>', '</b>');
2538 // $content = $this->blockquote_content_quiz;
2539 // $sources['quiz_maker'] = array(
2540 // 'content' => $content,
2541 // 'title' => $title
2542 // );
2543
2544 return $sources;
2545 }
2546
2547 $sql = "SELECT `title`, `id` FROM " . $wpdb->prefix . "aysquiz_quizes WHERE `published` = 1 AND `question_ids` <> ''";
2548 $quizes = $wpdb->get_results($sql, "ARRAY_A");
2549
2550 ob_start();
2551 ?>
2552 <div class="ays-accordion-data-main-wrap">
2553 <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">
2554 <div id="<?php echo esc_attr($html_class_prefix) ?>quiz-maker-form">
2555 <input type="hidden" class="<?php echo esc_attr($html_class_prefix) ?>chart-id" value="<?= $chart_id ?>">
2556 <div class="<?= $html_class_prefix ?>select-quiz-maker-data-query-container" id="<?= $html_class_prefix ?>quiz-queries">
2557 <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 ) ?>">
2558 <i class="ays_fa ays_fa_info_circle"></i>
2559 </a>
2560 <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">
2561 <option value=""><?= __( "Select query", "chart-builder" ) ?></option>
2562 <?php foreach ( $quiz_queries as $id => $q):
2563 $disabled = preg_replace('/[^0-9]/', '', $id) <= 6 ? "false" : "true" ; ?>
2564 <option value="<?= $id ?>" <?= $quiz_query == $id ? 'selected' : '' ?> <?php echo 'is-pro="'.$disabled.'"'; ?>><?= $q ?></option>
2565 <?php endforeach; ?>
2566 </select>
2567 </div>
2568 <div class="<?php echo esc_attr($html_class_prefix) ?>select-quiz-maker-quiz-container">
2569 <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">
2570 <option value="0"><?= __( "Select quiz", "chart-builder" ) ?></option>
2571 <?php foreach ( $quizes as $quiz): ?>
2572 <option value="<?= $quiz['id'] ?>" <?= $quiz_id == $quiz['id'] ? 'selected' : '' ?> ><?= $quiz['title'] ?></option>
2573 <?php endforeach; ?>
2574 </select>
2575 </div>
2576 <div id="ays-chart-quiz-maker-success"></div>
2577 <div id="ays-chart-quiz-maker-error"></div>
2578 <div class="ays-chart-buttons-group">
2579 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-fetch">
2580 <?php echo __( 'Show Results', "chart-builder" ); ?>
2581 </button>
2582 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-show-on-chart">
2583 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.722 6.59785C12.2407 3.47754 10.0017 1.90723 7.00009 1.90723C3.99697 1.90723 1.75947 3.47754 0.278215 6.59941C0.218802 6.72522 0.187988 6.86263 0.187988 7.00176C0.187988 7.14089 0.218802 7.27829 0.278215 7.4041C1.75947 10.5244 3.99853 12.0947 7.00009 12.0947C10.0032 12.0947 12.2407 10.5244 13.722 7.40254C13.8423 7.14941 13.8423 6.85566 13.722 6.59785ZM7.00009 10.9697C4.47978 10.9697 2.63447 9.6916 1.3329 7.00098C2.63447 4.31035 4.47978 3.03223 7.00009 3.03223C9.5204 3.03223 11.3657 4.31035 12.6673 7.00098C11.3673 9.6916 9.52197 10.9697 7.00009 10.9697ZM6.93759 4.25098C5.41884 4.25098 4.18759 5.48223 4.18759 7.00098C4.18759 8.51973 5.41884 9.75098 6.93759 9.75098C8.45634 9.75098 9.68759 8.51973 9.68759 7.00098C9.68759 5.48223 8.45634 4.25098 6.93759 4.25098ZM6.93759 8.75098C5.9704 8.75098 5.18759 7.96816 5.18759 7.00098C5.18759 6.03379 5.9704 5.25098 6.93759 5.25098C7.90478 5.25098 8.68759 6.03379 8.68759 7.00098C8.68759 7.96816 7.90478 8.75098 6.93759 8.75098Z" fill="#14524A" /></svg>
2584 <?php echo __( 'Preview', "chart-builder" ); ?>
2585 </button>
2586 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-quiz-maker-save">
2587 <?php echo __( 'Save data', "chart-builder" ); ?>
2588 </button>
2589 </div>
2590 </div>
2591 <div>
2592 <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>
2593 </div>
2594 </div>
2595 </div>
2596 <?php
2597 $content = ob_get_clean();
2598
2599 $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) . '">
2600 <i class="ays_fa ays_fa_info_circle"></i>
2601 </a>', '<br>', '<b>', '</b>');
2602 $sources['quiz_maker'] = array(
2603 'content' => $content,
2604 'title' => $title
2605 );
2606
2607 return $sources;
2608 }
2609
2610 public function source_contents_woocommerce_integration_settings( $sources, $args ){
2611 if ( !is_plugin_active('woocommerce/woocommerce.php') ) {
2612 return $sources;
2613 }
2614
2615 $chart_id = $args['chart_id'];
2616 $html_class_prefix = $args['html_class_prefix'];
2617 $html_name_prefix = $args['html_name_prefix'];
2618 ob_start();
2619 ?>
2620 <div class="ays-accordion-data-main-wrap ays-accordion-data-main-wrap-woocommerce ays-pro-features-v2-main-box" style="padding:10px;">
2621 <div class="ays-pro-features-v2-big-buttons-box">
2622 <div class="ays-pro-features-v2-video-button"></div>
2623 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
2624 <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>
2625 <div class="ays-pro-features-v2-upgrade-text">
2626 <?php echo __("Upgrade" , "chart-builder"); ?>
2627 </div>
2628 </a>
2629 </div>
2630 <div class="<?= $html_class_prefix ?>chart-source-data-main">
2631 <div id="ays-chart-woocommerce-datas">
2632 <div class="<?= $html_class_prefix ?>woocommerce-datas-form">
2633 <div id="woocommerce-datas-form">
2634 <input type="hidden" name="chart_id" value="<?= $chart_id ?>">
2635 <div class="<?= $html_class_prefix ?>woocommerce-datas-query-container" id="<?= $html_class_prefix ?>woocommerce-datas-container-id" >
2636 <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 ) ?>">
2637 <i class="ays_fa ays_fa_info_circle"></i>
2638 </a>
2639 <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]">
2640 <option value=""><?= __( 'Select query', $this->plugin_name ) ?></option>
2641 </select>
2642 </div>
2643 <div class='ays-chart-woocommerce-datas-success'></div>
2644 <div class='ays-chart-woocommerce-datas-error'></div>
2645 </div>
2646 <div class="ays-chart-buttons-group">
2647 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-fetch">
2648 <?php echo __( 'Show Results', "chart-builder" ); ?>
2649 </button>
2650 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-show-on-chart">
2651 <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>
2652 <?php echo __( 'Preview', "chart-builder" ); ?>
2653 </button>
2654 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns" id="ays-chart-woocommerce-datas-save">
2655 <?php echo __( 'Save data', "chart-builder" ); ?>
2656 </button>
2657 </div>
2658 </div>
2659 </div>
2660 </div>
2661 </div>
2662 <?php
2663 $content = ob_get_clean();
2664
2665 $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) . '">
2666 <i class="ays_fa ays_fa_info_circle"></i>
2667 </a>', '<br>', '<b>', '</b>');
2668 $sources['woocommerce'] = array(
2669 'content' => $content,
2670 'title' => $title
2671 );
2672
2673 return $sources;
2674 }
2675
2676 public function source_contents_manual_settings( $sources, $args ){
2677 $html_class_prefix = $args['html_class_prefix'];
2678 $html_name_prefix = $args['html_name_prefix'];
2679 $source = $args['source'];
2680 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2681 $settings = $args['settings'];
2682 $source_chart_type = $args['source_chart_type'];
2683 $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : 'add';
2684
2685 if (isset($source) && !empty($source)) {
2686 if ( !isset( $source[0] ) ) {
2687 if (count($source[1]) > 2) {
2688 $titles = array();
2689 for ($i = 0; $i < count($source[1]); $i++) {
2690 array_push($titles, __("Title", $this->plugin_name).$i);
2691 }
2692 $source[0] = $titles;
2693 } else {
2694 $source[0] = array(
2695 __("Country", $this->plugin_name),
2696 __("Population", $this->plugin_name),
2697 );
2698 }
2699
2700 ksort($source);
2701 }
2702 }
2703
2704 if ($action == 'add') {
2705 foreach ($source as $key => $row) {
2706 $source[$key] = array_slice($row, 0, 2);
2707 }
2708 } else if ($action == 'edit') {
2709 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
2710 foreach ($source as $key => $row) {
2711 $source[$key] = array_slice($row, 0, 2);
2712 }
2713 }
2714 }
2715 ob_start();
2716 ?>
2717 <div class="ays-accordion-data-main-wrap">
2718 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2719 <?php if($source_chart_type != 'org_chart'): ?>
2720 <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">
2721 <!-- <div class="<//?= $html_class_prefix ?>icons-box">
2722 <img class="<//?= $html_class_prefix ?>add-new-row" src="<//?php echo CHART_BUILDER_ADMIN_URL; ?>/images/icons/add-circle-outline.svg">
2723 </div> -->
2724 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2725 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2726 <?php if(!empty($source)):
2727 foreach($source as $source_id => $source_value):
2728 if(!empty($source_value) ):
2729 if ($source_id == 0): ?>
2730 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2731 <div class="ays-chart-empty-data-table-cell"></div>
2732 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2733 <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); ?>">
2734 <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">
2735 <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;" />
2736 </svg>
2737 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2738 <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'" : "" ?>>
2739 <?php if ($each_source_id !== 0): ?>
2740 <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">
2741 <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;" />
2742 </svg>
2743 <?php endif; ?>
2744 </div>
2745 </div>
2746 <?php endforeach; ?>
2747 </div>
2748 <?php else: ?>
2749 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2750 <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">
2751 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2752 <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;" />
2753 </svg>
2754 </div>
2755 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
2756 <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">
2757 <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;" />
2758 </svg>
2759 </div>
2760 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2761 <?php if ($each_source_id == 0): ?>
2762 <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); ?>">
2763 <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)); ?>">
2764 </div>
2765 <?php else: ?>
2766 <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); ?>">
2767 <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">
2768 </div>
2769 <?php endif; ?>
2770 <?php endforeach; ?>
2771 </div>
2772 <?php endif; ?>
2773 <?php endif; ?>
2774 <?php endforeach; ?>
2775 <?php else:?>
2776 <div class="<?= $html_class_prefix ?>chart-source-data-edit-block">
2777 <div style="height: 63.11px; padding: 0 15px;"></div>
2778 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box">
2779 <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">
2780 <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;" />
2781 </svg>
2782 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2783 <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'>
2784 <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">
2785 <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;" />
2786 </svg>
2787 </div>
2788 </div>
2789 </div>
2790 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
2791 <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">
2792 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2793 <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" />
2794 </svg>
2795 </div>
2796 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
2797 <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">
2798 <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;" />
2799 </svg>
2800 </div>
2801 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
2802 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
2803 </div>
2804 <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">
2805 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
2806 </div>
2807 </div>
2808 <?php endif; ?>
2809 </div>
2810 <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">
2811 <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">
2812 <?php echo __( 'Add column', "chart-builder" ); ?>
2813 </div>
2814 </div>
2815 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
2816 <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">
2817 <?php echo __( 'Add row', "chart-builder" ); ?>
2818 </div>
2819 <br>
2820 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2821 <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>
2822 <?php echo __( 'Preview', "chart-builder" ); ?>
2823 </button>
2824 </div>
2825 <?php endif; ?>
2826 <div class="<?= $html_class_prefix ?>chart-source-data-main-org-type display_none cb-changable-manual cb-org_chart-manual">
2827 <div class="<?= $html_class_prefix ?>chart-source-data-content-org-type">
2828 <ul id="<?= $html_class_prefix ?>chart-source-data-edit-tree-content">
2829 </ul>
2830 </div>
2831 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2832 <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>
2833 <?php echo __( 'Preview', "chart-builder" ); ?>
2834 </button>
2835 </div>
2836 </div>
2837 </div>
2838 <?php
2839 $content = ob_get_clean();
2840
2841 $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") . '">
2842 <i class="ays_fa ays_fa_info_circle"></i>
2843 </a>';
2844
2845 $sources['manual'] = array(
2846 'content' => $content,
2847 'title' => $title
2848 );
2849
2850 return $sources;
2851 }
2852
2853 public function source_contents_manual_settings_chartjs( $sources, $args ){
2854 $html_class_prefix = $args['html_class_prefix'];
2855 $html_name_prefix = $args['html_name_prefix'];
2856 $source = $args['source'];
2857 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
2858 $settings = $args['settings'];
2859 $source_chart_type = $args['source_chart_type'];
2860 $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : 'add';
2861
2862 ob_start();
2863 ?>
2864 <div class="ays-accordion-data-main-wrap">
2865 <div class="<?php echo esc_attr($html_class_prefix) ?>source-data-main-wrap">
2866 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-main <?= $html_class_prefix ?>chart-source-data-manual">
2867 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content-container">
2868 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-content">
2869 <?php if(!empty($source)):
2870 foreach($source as $source_id => $source_value):
2871 if(!empty($source_value) ):
2872 if ($source_id == 0): ?>
2873 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2874 <div class="ays-chart-empty-data-table-cell"></div>
2875 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2876 <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); ?>">
2877 <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">
2878 <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;" />
2879 </svg>
2880 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2881 <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'" : "" ?>>
2882 <?php if ($each_source_id !== 0): ?>
2883 <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">
2884 <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;" />
2885 </svg>
2886 <?php endif; ?>
2887 </div>
2888 </div>
2889 <?php endforeach; ?>
2890 </div>
2891 <?php else: ?>
2892 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id = "<?php echo esc_attr($source_id); ?>">
2893 <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">
2894 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2895 <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;" />
2896 </svg>
2897 </div>
2898 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box">
2899 <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">
2900 <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;" />
2901 </svg>
2902 </div>
2903 <?php foreach($source_value as $each_source_id => $each_source_value): ?>
2904 <?php if ($each_source_id == 0): ?>
2905 <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); ?>">
2906 <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)); ?>">
2907 </div>
2908 <?php else: ?>
2909 <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); ?>">
2910 <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">
2911 </div>
2912 <?php endif; ?>
2913 <?php endforeach; ?>
2914 </div>
2915 <?php endif; ?>
2916 <?php endif; ?>
2917 <?php endforeach; ?>
2918 <?php else:?>
2919 <div class="<?= $html_class_prefix ?>chart-source-data-edit-block">
2920 <div style="height: 63.11px; padding: 0 15px;"></div>
2921 <div class="<?= $html_class_prefix ?>chart-source-data-input-box <?= $html_class_prefix ?>chart-source-title-box">
2922 <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">
2923 <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;" />
2924 </svg>
2925 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-titles-box-item">
2926 <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'>
2927 <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">
2928 <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;" />
2929 </svg>
2930 </div>
2931 </div>
2932 </div>
2933 <div class = "<?php echo esc_attr($html_class_prefix) ?>chart-source-data-edit-block" data-source-id="1">
2934 <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">
2935 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
2936 <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" />
2937 </svg>
2938 </div>
2939 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>icons-remove-box" >
2940 <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">
2941 <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;" />
2942 </svg>
2943 </div>
2944 <div class="<?php echo esc_attr($html_class_prefix) ?>chart-source-data-input-box">
2945 <input type="text" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" >
2946 </div>
2947 <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">
2948 <input type="number" class="ays-text-input form-control" name="<?php echo esc_attr($html_name_prefix); ?>chart_source_data[1][]" step="any">
2949 </div>
2950 </div>
2951 <?php endif; ?>
2952 </div>
2953 <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">
2954 <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">
2955 <?php echo __( 'Add column', "chart-builder" ); ?>
2956 </div>
2957 </div>
2958 <div class="<?php echo esc_attr($html_class_prefix) ?>icons-box <?php echo esc_attr($html_class_prefix) ?>add-new-row-box">
2959 <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">
2960 <?php echo __( 'Add row', "chart-builder" ); ?>
2961 </div>
2962 <br>
2963 <button class="<?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttns <?php echo esc_attr($html_class_prefix) ?>show-on-chart-bttn">
2964 <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>
2965 <?php echo __( 'Preview', "chart-builder" ); ?>
2966 </button>
2967 </div>
2968 </div>
2969 </div>
2970 <?php
2971 $content = ob_get_clean();
2972
2973 $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") . '">
2974 <i class="ays_fa ays_fa_info_circle"></i>
2975 </a>';
2976
2977 $sources['manual'] = array(
2978 'content' => $content,
2979 'title' => $title
2980 );
2981
2982 return $sources;
2983 }
2984
2985 /**
2986 * Chart page settings contents
2987 * @param $args
2988 */
2989 public function ays_chart_page_settings_contents( $args ){
2990 $chart_source_type = $args['chart_source_type'];
2991
2992 if ($chart_source_type === 'chart-js') {
2993 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings_chartjs', array(), $args );
2994 } else {
2995 $sources_contents = apply_filters( 'ays_cb_chart_page_settings_contents_settings', array(), $args );
2996 }
2997
2998 $sources = array();
2999 foreach ( $sources_contents as $key => $sources_content ) {
3000 $collapsed = $key == 'general_settings' ? 'false' : 'true';
3001
3002 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
3003 if(isset($sources_content['title'])){
3004 $content .= '<legend class="ays-accordion-options-header">';
3005 $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">
3006 <g>
3007 <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" />
3008 </g>
3009 </svg>';
3010
3011 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
3012 }
3013
3014 $content .= '<div class="ays-accordion-options-content">';
3015 $content .= $sources_content['content'];
3016 $content .= '</div>';
3017
3018 $content .= '</fieldset>';
3019
3020 $sources[] = $content;
3021 }
3022 $content_for_escape = implode('' , $sources );
3023 echo html_entity_decode(esc_html( $content_for_escape ));
3024 }
3025
3026 public function settings_contents_general_settings( $sources, $args ){
3027 $html_class_prefix = $args['html_class_prefix'];
3028 $html_name_prefix = $args['html_name_prefix'];
3029 $chart_description = $args['chart_description'];
3030 $create_author_data = $args['create_author_data'];
3031 $status = $args['status'];
3032 $settings = $args['settings'];
3033
3034 $show_title = $settings['show_title'];
3035 $show_description = $settings['show_description'];
3036 $enable_interactivity = $settings['enable_interactivity'];
3037 $maximized_view = $settings['maximized_view'];
3038
3039 ob_start();
3040 ?>
3041 <div class="ays-accordion-data-main-wrap">
3042 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3043 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3044 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3045 <label for="ays-status" class="form-label">
3046 <?php echo esc_html(__('Status', "chart-builder")); ?>
3047 <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") ); ?>">
3048 <i class="ays_fa ays_fa_info_circle"></i>
3049 </a>
3050 </label>
3051 </div>
3052 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3053 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3054 <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' : ''; ?> >
3055 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3056 </label>
3057 </div>
3058 </div> <!-- Status -->
3059 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3060 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3061 <label for="ays-chart-description" class="form-label">
3062 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3063 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3064 <i class="ays_fa ays_fa_info_circle"></i>
3065 </a>
3066 </label>
3067 </div>
3068 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3069 <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>
3070 </div>
3071 </div> <!-- Chart description -->
3072 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3073 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3074 <label for="ays-chart-create-author" class="form-label">
3075 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3076 <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")); ?>">
3077 <i class="ays_fa ays_fa_info_circle"></i>
3078 </a>
3079 </label>
3080 </div>
3081 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3082 <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">
3083 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3084 <?php if (isset($create_author_data['ID'])) : ?>
3085 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3086 <?php endif; ?>
3087 </select>
3088 </div>
3089 </div> <!-- Change chart author -->
3090 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3091 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3092 <label for="ays-chart-show-title" class="form-label">
3093 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3094 <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") ); ?>">
3095 <i class="ays_fa ays_fa_info_circle"></i>
3096 </a>
3097 </label>
3098 </div>
3099 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3100 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3101 <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); ?> >
3102 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3103 </label>
3104 </div>
3105 </div> <!-- Show title -->
3106 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3107 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3108 <label for="ays-chart-show-description" class="form-label">
3109 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3110 <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") ); ?>">
3111 <i class="ays_fa ays_fa_info_circle"></i>
3112 </a>
3113 </label>
3114 </div>
3115 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3116 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3117 <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); ?> >
3118 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3119 </label>
3120 </div>
3121 </div> <!-- Show description -->
3122 <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">
3123 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3124 <label for="ays-chart-option-enable-interactivity" class="form-label">
3125 <?php echo esc_html(__('Enable interactivity', "chart-builder")); ?>
3126 <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") ); ?>">
3127 <i class="ays_fa ays_fa_info_circle"></i>
3128 </a>
3129 </label>
3130 </div>
3131 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3132 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3133 <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); ?> >
3134 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3135 </label>
3136 </div>
3137 </div> <!-- Enable interactivity -->
3138 <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">
3139 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3140 <label for="ays-chart-option-maximized-view" class="form-label">
3141 <?php echo esc_html(__('Maximized view', "chart-builder")); ?>
3142 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("If checked, maximizes the area of the chart.","chart-builder") ); ?>">
3143 <i class="ays_fa ays_fa_info_circle"></i>
3144 </a>
3145 </label>
3146 </div>
3147 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3148 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3149 <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); ?> >
3150 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3151 </label>
3152 </div>
3153 </div> <!-- Maximized view -->
3154 </div>
3155 </div>
3156 <?php
3157 $content = ob_get_clean();
3158
3159 $title = __( 'General Settings', "chart-builder" );
3160
3161 $sources['general_settings'] = array(
3162 'content' => $content,
3163 'title' => $title
3164 );
3165
3166 return $sources;
3167 }
3168
3169 public function settings_contents_general_settings_chartjs( $sources, $args ){
3170 $html_class_prefix = $args['html_class_prefix'];
3171 $html_name_prefix = $args['html_name_prefix'];
3172 $chart_description = $args['chart_description'];
3173 $create_author_data = $args['create_author_data'];
3174 $status = $args['status'];
3175 $settings = $args['settings'];
3176
3177 $show_title = $settings['show_title'];
3178 $show_description = $settings['show_description'];
3179
3180 ob_start();
3181 ?>
3182 <div class="ays-accordion-data-main-wrap">
3183 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3184 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3185 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3186 <label for="ays-status" class="form-label">
3187 <?php echo esc_html(__('Status', "chart-builder")); ?>
3188 <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") ); ?>">
3189 <i class="ays_fa ays_fa_info_circle"></i>
3190 </a>
3191 </label>
3192 </div>
3193 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3194 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3195 <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' : ''; ?> >
3196 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3197 </label>
3198 </div>
3199 </div> <!-- Status -->
3200 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3201 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3202 <label for="ays-chart-description" class="form-label">
3203 <?php echo esc_html(__( "Description", "chart-builder" )); ?>
3204 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Set the chart description","chart-builder") ); ?>">
3205 <i class="ays_fa ays_fa_info_circle"></i>
3206 </a>
3207 </label>
3208 </div>
3209 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3210 <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>
3211 </div>
3212 </div> <!-- Chart description -->
3213 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3214 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3215 <label for="ays-chart-create-author" class="form-label">
3216 <?php echo esc_html(__('Change the author of the current chart',"chart-builder")); ?>
3217 <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")); ?>">
3218 <i class="ays_fa ays_fa_info_circle"></i>
3219 </a>
3220 </label>
3221 </div>
3222 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3223 <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">
3224 <option value=""><?php echo esc_html(__('Select User',"chart-builder"))?></option>
3225 <?php if (isset($create_author_data['ID'])) : ?>
3226 <option value="<?php echo esc_html($create_author_data['ID'])?>" selected><?php echo esc_html($create_author_data['display_name'])?></option>
3227 <?php endif; ?>
3228 </select>
3229 </div>
3230 </div> <!-- Change chart author -->
3231 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3232 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3233 <label for="ays-chart-show-title" class="form-label">
3234 <?php echo esc_html(__('Show chart title', "chart-builder")); ?>
3235 <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") ); ?>">
3236 <i class="ays_fa ays_fa_info_circle"></i>
3237 </a>
3238 </label>
3239 </div>
3240 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3241 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3242 <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); ?> >
3243 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3244 </label>
3245 </div>
3246 </div> <!-- Show title -->
3247 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3248 <div class="col-sm-5 <?php echo esc_attr($html_class_prefix) ?>option-title">
3249 <label for="ays-chart-show-description" class="form-label">
3250 <?php echo esc_html(__('Show chart description', "chart-builder")); ?>
3251 <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") ); ?>">
3252 <i class="ays_fa ays_fa_info_circle"></i>
3253 </a>
3254 </label>
3255 </div>
3256 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3257 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3258 <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); ?> >
3259 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3260 </label>
3261 </div>
3262 </div> <!-- Show description -->
3263 </div>
3264 </div>
3265 <?php
3266 $content = ob_get_clean();
3267
3268 $title = __( 'General Settings', "chart-builder" );
3269
3270 $sources['general_settings'] = array(
3271 'content' => $content,
3272 'title' => $title
3273 );
3274
3275 return $sources;
3276 }
3277
3278 public function settings_contents_tooltip_settings( $sources, $args ){
3279 $html_class_prefix = $args['html_class_prefix'];
3280 $html_name_prefix = $args['html_name_prefix'];
3281 $settings = $args['settings'];
3282
3283 $tooltip_trigger_options = $settings['tooltip_trigger_options'];
3284 $tooltip_trigger = $settings['tooltip_trigger'];
3285 $show_color_code = $settings['show_color_code'];
3286 $tooltip_italic = $settings['tooltip_italic'];
3287 $tooltip_bold = $settings['tooltip_bold'];
3288 $tooltip_bold_options = $settings['tooltip_bold_options'];
3289 $tooltip_text_color = $settings['tooltip_text_color'];
3290 $tooltip_font_size = $settings['tooltip_font_size'];
3291
3292 ob_start();
3293 ?>
3294 <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">
3295 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3296 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3297 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3298 <label for="ays-chart-option-tooltip-trigger">
3299 <?php echo esc_html(__( "Trigger", "chart-builder" )); ?>
3300 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose when to display the results on the chart.","chart-builder") ); ?>">
3301 <i class="ays_fa ays_fa_info_circle"></i>
3302 </a>
3303 </label>
3304 </div>
3305 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3306 <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]">
3307 <?php
3308 foreach ( $tooltip_trigger_options as $option_slug => $option ):
3309 $selected = ( $tooltip_trigger == $option_slug ) ? 'selected' : '';
3310 ?>
3311 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3312 <?php
3313 endforeach;
3314 ?>
3315 </select>
3316 </div>
3317 </div> <!-- Trigger -->
3318 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3319 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3320 <label for="ays-chart-option-show-color-code">
3321 <?php echo esc_html(__( "Show Color Code", "chart-builder" )); ?>
3322 <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") ); ?>">
3323 <i class="ays_fa ays_fa_info_circle"></i>
3324 </a>
3325 </label>
3326 </div>
3327 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3328 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3329 <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); ?> >
3330 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3331 </label>
3332 </div>
3333 </div> <!-- Show Color Code -->
3334 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3335 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3336 <label for="ays-chart-option-tooltip-text-color">
3337 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
3338 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the tooltip text.","chart-builder") ); ?>">
3339 <i class="ays_fa ays_fa_info_circle"></i>
3340 </a>
3341 </label>
3342 </div>
3343 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3344 <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) ?>">
3345 </div>
3346 </div> <!-- Text color -->
3347 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3348 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3349 <label for="ays-chart-option-tooltip-font-size" class="form-label">
3350 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3351 <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") ); ?>">
3352 <i class="ays_fa ays_fa_info_circle"></i>
3353 </a>
3354 </label>
3355 </div>
3356 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3357 <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) ?>">
3358 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3359 </div>
3360 </div> <!-- Font size -->
3361 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3362 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3363 <label for="ays-chart-option-tooltip-italic">
3364 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3365 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart tooltip text italic.","chart-builder") ); ?>">
3366 <i class="ays_fa ays_fa_info_circle"></i>
3367 </a>
3368 </label>
3369 </div>
3370 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3371 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3372 <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); ?> >
3373 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3374 </label>
3375 </div>
3376 </div> <!-- Italic text -->
3377 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3378 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3379 <label for="ays-chart-option-tooltip-bold">
3380 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3381 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose when to display the results on the chart.","chart-builder") ); ?>">
3382 <i class="ays_fa ays_fa_info_circle"></i>
3383 </a>
3384 </label>
3385 </div>
3386 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3387 <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]">
3388 <?php
3389 foreach ( $tooltip_bold_options as $option_slug => $option ):
3390 $selected = ( $tooltip_bold == $option_slug ) ? 'selected' : '';
3391 ?>
3392 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3393 <?php
3394 endforeach;
3395 ?>
3396 </select>
3397 </div>
3398 </div> <!-- Bold text -->
3399 </div>
3400 </div>
3401 <?php
3402 $content = ob_get_clean();
3403
3404 $title = __( 'Tooltip', "chart-builder" );
3405
3406 $sources['tooltip'] = array(
3407 'content' => $content,
3408 'title' => $title
3409 );
3410
3411 return $sources;
3412 }
3413
3414 public function settings_contents_legend_settings( $sources, $args ){
3415 $html_class_prefix = $args['html_class_prefix'];
3416 $html_name_prefix = $args['html_name_prefix'];
3417 $settings = $args['settings'];
3418 $legend_positions = $settings['legend_positions'];
3419 $legend_position = $settings['legend_position'];
3420 $legend_alignments = $settings['legend_alignments'];
3421 $legend_alignment = $settings['legend_alignment'];
3422 $legend_color = $settings['legend_color'];
3423 $legend_font_size = $settings['legend_font_size'];
3424 $legend_bold = $settings['legend_bold'];
3425 $legend_italic = $settings['legend_italic'];
3426
3427 ob_start();
3428 ?>
3429 <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">
3430 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3431 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3432 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3433 <label for="ays-chart-option-legend-position">
3434 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3435 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the appropriate position for the chart legend.","chart-builder") ); ?>">
3436 <i class="ays_fa ays_fa_info_circle"></i>
3437 </a>
3438 </label>
3439 </div>
3440 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3441 <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]">
3442 <?php
3443 foreach ( $legend_positions as $option_slug => $option ):
3444 $selected = ( $legend_position == $option_slug ) ? 'selected' : '';
3445
3446 $type_class = '';
3447 if ($option_slug == 'left') {
3448 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3449 } else if ($option_slug == 'in') {
3450 $type_class = ' cb-changable-opt cb-bar_chart-opt cb-column_chart-opt cb-line_chart-opt ';
3451 } else if ($option_slug == 'labeled') {
3452 $type_class = ' cb-changable-opt cb-pie_chart-opt cb-donut_chart-opt ';
3453 }
3454
3455 ?>
3456
3457 <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>
3458 <?php
3459 endforeach;
3460 ?>
3461 </select>
3462 </div>
3463 </div> <!-- Legend position -->
3464 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3465 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3466 <label for="ays-chart-option-legend-alignment">
3467 <?php echo esc_html(__( "Alignment", "chart-builder" )); ?>
3468 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the appropriate alignment for the chart legend.","chart-builder") ); ?>">
3469 <i class="ays_fa ays_fa_info_circle"></i>
3470 </a>
3471 </label>
3472 </div>
3473 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3474 <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]">
3475 <?php
3476 foreach ( $legend_alignments as $option_slug => $option ):
3477 $selected = ( $legend_alignment == $option_slug ) ? 'selected' : '';
3478 ?>
3479 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3480 <?php
3481 endforeach;
3482 ?>
3483 </select>
3484 </div>
3485 </div> <!-- Legend alignment -->
3486 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3487 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3488 <label for="ays-chart-option-legend-font-color">
3489 <?php echo esc_html(__( "Font Color", "chart-builder" )); ?>
3490 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose the font color for the chart legend.","chart-builder") ); ?>">
3491 <i class="ays_fa ays_fa_info_circle"></i>
3492 </a>
3493 </label>
3494 </div>
3495 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3496 <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) ?>">
3497 </div>
3498 </div> <!-- Legend font color -->
3499 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3500 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3501 <label for="ays-chart-option-legend-font-size" class="form-label">
3502 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3503 <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") ); ?>">
3504 <i class="ays_fa ays_fa_info_circle"></i>
3505 </a>
3506 </label>
3507 </div>
3508 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3509 <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) ?>">
3510 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
3511 </div>
3512 </div> <!-- Font size -->
3513 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3514 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3515 <label for="ays-chart-option-legend-italic">
3516 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
3517 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text italic.","chart-builder") ); ?>">
3518 <i class="ays_fa ays_fa_info_circle"></i>
3519 </a>
3520 </label>
3521 </div>
3522 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3523 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3524 <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); ?> >
3525 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3526 </label>
3527 </div>
3528 </div> <!-- Italic text -->
3529 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3530 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3531 <label for="ays-chart-option-legend-bold">
3532 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
3533 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable this option to make chart legend text bold.","chart-builder") ); ?>">
3534 <i class="ays_fa ays_fa_info_circle"></i>
3535 </a>
3536 </label>
3537 </div>
3538 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3539 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3540 <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); ?> >
3541 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3542 </label>
3543 </div>
3544 </div> <!-- Bold text -->
3545 </div>
3546 </div>
3547 <?php
3548 $content = ob_get_clean();
3549
3550 $title = __( 'Legend', "chart-builder" );
3551
3552 $sources['legend'] = array(
3553 'content' => $content,
3554 'title' => $title
3555 );
3556
3557 return $sources;
3558 }
3559
3560 public function settings_contents_horizontal_axis_settings( $sources, $args ){
3561 $html_class_prefix = $args['html_class_prefix'];
3562 $html_name_prefix = $args['html_name_prefix'];
3563 $settings = $args['settings'];
3564
3565 $haxis_title = $settings['haxis_title'];
3566 $axes_text_positions = $settings['axes_text_positions'];
3567 $haxis_text_position = $settings['haxis_text_position'];
3568 $haxis_direction = $settings['haxis_direction'];
3569 $haxis_text_color = $settings['haxis_text_color'];
3570 $haxis_baseline_color = $settings['haxis_baseline_color'];
3571 $haxis_slanted_options = $settings['haxis_slanted_options'];
3572 $haxis_slanted = $settings['haxis_slanted'];
3573 $haxis_slanted_text_angle = $settings['haxis_slanted_text_angle'];
3574 $haxis_show_text_every = $settings['haxis_show_text_every'];
3575 $haxis_format_options = $settings['axes_format_options'];
3576 $haxis_format = $settings['haxis_format'];
3577 $haxis_label_font_size = $settings['haxis_label_font_size'];
3578 $haxis_max_value = $settings['haxis_max_value'];
3579 $haxis_min_value = $settings['haxis_min_value'];
3580 $haxis_text_font_size = $settings['haxis_text_font_size'];
3581 $haxis_label_color = $settings['haxis_label_color'];
3582 $haxis_bold = $settings['haxis_bold'];
3583 $haxis_italic = $settings['haxis_italic'];
3584 $haxis_title_bold = $settings['haxis_title_bold'];
3585 $haxis_title_italic = $settings['haxis_title_italic'];
3586 $haxis_gridlines_count = $settings['haxis_gridlines_count'];
3587 $haxis_gridlines_color = $settings['haxis_gridlines_color'];
3588 $haxis_minor_gridlines_color = $settings['haxis_minor_gridlines_color'];
3589
3590 ob_start();
3591 ?>
3592 <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">
3593 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3594 <h6>Label</h6>
3595 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3596 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3597 <label for="ays-chart-option-haxis-title" class="form-label">
3598 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3599 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The title of the horizontal axis","chart-builder") ); ?>">
3600 <i class="ays_fa ays_fa_info_circle"></i>
3601 </a>
3602 </label>
3603 </div>
3604 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3605 <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) ?>">
3606 </div>
3607 </div> <!-- Horizontal axis label -->
3608 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3609 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3610 <label for="ays-chart-option-haxis-label-font-size" class="form-label">
3611 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3612 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis label.","chart-builder") ); ?>">
3613 <i class="ays_fa ays_fa_info_circle"></i>
3614 </a>
3615 </label>
3616 </div>
3617 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3618 <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) ?>">
3619 </div>
3620 </div> <!-- Horizontal axis label font size -->
3621 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3622 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3623 <label for="ays-chart-option-haxis-label-color">
3624 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3625 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
3626 <i class="ays_fa ays_fa_info_circle"></i>
3627 </a>
3628 </label>
3629 </div>
3630 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3631 <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) ?>">
3632 </div>
3633 </div> <!-- Horizontal axis label color -->
3634 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3635 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3636 <label for="ays-chart-option-haxis-title-italic">
3637 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3638 <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") ); ?>">
3639 <i class="ays_fa ays_fa_info_circle"></i>
3640 </a>
3641 </label>
3642 </div>
3643 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3644 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3645 <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); ?> >
3646 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3647 </label>
3648 </div>
3649 </div> <!-- Italic label -->
3650 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3651 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3652 <label for="ays-chart-option-haxis-title-bold">
3653 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3654 <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") ); ?>">
3655 <i class="ays_fa ays_fa_info_circle"></i>
3656 </a>
3657 </label>
3658 </div>
3659 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3660 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3661 <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); ?> >
3662 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3663 </label>
3664 </div>
3665 </div> <!-- Bold label -->
3666 <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">
3667 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3668 <label for="ays-chart-option-haxis-show-text-every" class="form-label">
3669 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
3670 <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") ); ?>">
3671 <i class="ays_fa ays_fa_info_circle"></i>
3672 </a>
3673 </label>
3674 </div>
3675 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3676 <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">
3677 </div>
3678 </div> <!-- Label interval -->
3679
3680 <br>
3681 <h6>Text</h6>
3682 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3683 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3684 <label for="ays-chart-option-haxis-text-position" class="form-label">
3685 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
3686 <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") ); ?>">
3687 <i class="ays_fa ays_fa_info_circle"></i>
3688 </a>
3689 </label>
3690 </div>
3691 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3692 <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]">
3693 <?php
3694 foreach ( $axes_text_positions as $option_slug => $option ):
3695 $selected = ( $haxis_text_position == $option_slug ) ? 'selected' : '';
3696 ?>
3697 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3698 <?php
3699 endforeach;
3700 ?>
3701 </select>
3702 </div>
3703 </div> <!-- Horizontal axis text position -->
3704 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3705 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3706 <label for="ays-chart-option-haxis-text-color">
3707 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3708 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis text.","chart-builder") ); ?>">
3709 <i class="ays_fa ays_fa_info_circle"></i>
3710 </a>
3711 </label>
3712 </div>
3713 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3714 <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) ?>">
3715 </div>
3716 </div> <!-- Horizontal axis text color -->
3717 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3718 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3719 <label for="ays-chart-option-haxis-text-font-size" class="form-label">
3720 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
3721 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
3722 <i class="ays_fa ays_fa_info_circle"></i>
3723 </a>
3724 </label>
3725 </div>
3726 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3727 <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) ?>">
3728 </div>
3729 </div> <!-- Horizontal axis text font size -->
3730 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3731 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3732 <label for="ays-chart-option-haxis-text-direction">
3733 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
3734 <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") ); ?>">
3735 <i class="ays_fa ays_fa_info_circle"></i>
3736 </a>
3737 </label>
3738 </div>
3739 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3740 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3741 <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); ?> >
3742 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3743 </label>
3744 </div>
3745 </div> <!-- Horizontal axis text direction -->
3746 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3747 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3748 <label for="ays-chart-option-haxis-italic">
3749 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
3750 <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") ); ?>">
3751 <i class="ays_fa ays_fa_info_circle"></i>
3752 </a>
3753 </label>
3754 </div>
3755 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3756 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3757 <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); ?> >
3758 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3759 </label>
3760 </div>
3761 </div> <!-- Italic text -->
3762 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3763 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3764 <label for="ays-chart-option-haxis-bold">
3765 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
3766 <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") ); ?>">
3767 <i class="ays_fa ays_fa_info_circle"></i>
3768 </a>
3769 </label>
3770 </div>
3771 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3772 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
3773 <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); ?> >
3774 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
3775 </label>
3776 </div>
3777 </div> <!-- Bold text -->
3778 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3779 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3780 <label for="ays-chart-option-haxis-slanted-text" class="form-label">
3781 <?php echo esc_html(__( "Slanted text", "chart-builder" )); ?>
3782 <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") ); ?>">
3783 <i class="ays_fa ays_fa_info_circle"></i>
3784 </a>
3785 </label>
3786 </div>
3787 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3788 <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]">
3789 <?php
3790 foreach ( $haxis_slanted_options as $option_slug => $option ):
3791 $selected = ( $haxis_slanted == $option_slug ) ? 'selected' : '';
3792 ?>
3793 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3794 <?php
3795 endforeach;
3796 ?>
3797 </select>
3798 </div>
3799 </div> <!-- Horizontal axis slanted text -->
3800 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section <?php echo ($haxis_slanted == 'false') ? 'display_none' : ''; ?>">
3801 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3802 <label for="ays-chart-option-haxis-slanted-text-angle" class="form-label">
3803 <?php echo esc_html(__( "Slanted text angle", "chart-builder" )); ?>
3804 <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") ); ?>">
3805 <i class="ays_fa ays_fa_info_circle"></i>
3806 </a>
3807 </label>
3808 </div>
3809 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3810 <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">
3811 </div>
3812 </div> <!-- Horizontal axis slanted text angle -->
3813
3814 <br>
3815 <h6>Gridlines</h6>
3816 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3817 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3818 <label for="ays-chart-option-haxis-gridlines-count" class="form-label">
3819 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
3820 <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") ); ?>">
3821 <i class="ays_fa ays_fa_info_circle"></i>
3822 </a>
3823 </label>
3824 </div>
3825 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3826 <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) ?>">
3827 </div>
3828 </div> <!-- Horizontal axis gridlines count -->
3829 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3830 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3831 <label for="ays-chart-option-haxis-gridlines-color">
3832 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
3833 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis gridlines.","chart-builder") ); ?>">
3834 <i class="ays_fa ays_fa_info_circle"></i>
3835 </a>
3836 </label>
3837 </div>
3838 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3839 <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) ?>">
3840 </div>
3841 </div> <!-- Horizontal axis gridlines color -->
3842 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3843 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3844 <label for="ays-chart-option-haxis-minor-gridlines-color">
3845 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
3846 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis minor gridlines.","chart-builder") ); ?>">
3847 <i class="ays_fa ays_fa_info_circle"></i>
3848 </a>
3849 </label>
3850 </div>
3851 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3852 <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) ?>">
3853 </div>
3854 </div> <!-- Horizontal axis minor gridlines color -->
3855 <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">
3856 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3857 <label for="ays-chart-option-haxis-baseline-color">
3858 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
3859 <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") ); ?>">
3860 <i class="ays_fa ays_fa_info_circle"></i>
3861 </a>
3862 </label>
3863 </div>
3864 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3865 <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) ?>">
3866 </div>
3867 </div> <!-- Horizontal axis baseline color -->
3868
3869 <br>
3870 <h6>Format</h6>
3871 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3872 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3873 <label for="ays-chart-option-haxis-format" class="form-label">
3874 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
3875 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
3876 echo htmlspecialchars( sprintf (
3877 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
3878 __('%sNone:%s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
3879 __('%sDecimal:%s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
3880 __('%sScientific:%s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
3881 __('%sCurrency:%s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
3882 __('%sPercent:%s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
3883 __('%sShort:%s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
3884 __('%sLong:%s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
3885 '<em>', '</em>',
3886 '<em>', '</em>',
3887 '<em>', '</em>',
3888 '<em>', '</em>',
3889 '<em>', '</em>',
3890 '<em>', '</em>',
3891 '<em>', '</em>'
3892 ) );
3893 ?>">
3894 <i class="ays_fa ays_fa_info_circle"></i>
3895 </a>
3896 </label>
3897 </div>
3898 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3899 <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]">
3900 <?php
3901 foreach ( $haxis_format_options as $option_slug => $option ):
3902 $selected = ( $haxis_format == $option_slug ) ? 'selected' : '';
3903 ?>
3904 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
3905 <?php
3906 endforeach;
3907 ?>
3908 </select>
3909 </div>
3910 </div> <!-- Horizontal axis format -->
3911 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3912 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3913 <label for="ays-chart-option-haxis-max-value" class="form-label">
3914 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
3915 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
3916 <i class="ays_fa ays_fa_info_circle"></i>
3917 </a>
3918 </label>
3919 </div>
3920 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3921 <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) ?>">
3922 </div>
3923 </div> <!-- Horizontal axis max value -->
3924 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3925 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3926 <label for="ays-chart-option-haxis-min-value" class="form-label">
3927 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
3928 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
3929 <i class="ays_fa ays_fa_info_circle"></i>
3930 </a>
3931 </label>
3932 </div>
3933 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
3934 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-haxis-min-value" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[haxis_min_value]" value="<?php echo esc_attr($haxis_min_value) ?>">
3935 </div>
3936 </div> <!-- Horizontal axis min value -->
3937 </div>
3938 </div>
3939 <?php
3940 $content = ob_get_clean();
3941
3942 $title = __( 'Horizontal Axis Settings', "chart-builder" );
3943
3944 $sources['horizontal_axis'] = array(
3945 'content' => $content,
3946 'title' => $title
3947 );
3948
3949 return $sources;
3950 }
3951
3952 public function settings_contents_vertical_axis_settings( $sources, $args ){
3953 $html_class_prefix = $args['html_class_prefix'];
3954 $html_name_prefix = $args['html_name_prefix'];
3955 $settings = $args['settings'];
3956
3957 $vaxis_title = $settings['vaxis_title'];
3958 $axes_text_positions = $settings['axes_text_positions'];
3959 $vaxis_text_position = $settings['vaxis_text_position'];
3960 $vaxis_direction = $settings['vaxis_direction'];
3961 $vaxis_text_color = $settings['vaxis_text_color'];
3962 $vaxis_baseline_color = $settings['vaxis_baseline_color'];
3963 $vaxis_format_options = $settings['axes_format_options'];
3964 $vaxis_format = $settings['vaxis_format'];
3965 $vaxis_label_font_size = $settings['vaxis_label_font_size'];
3966 $vaxis_max_value = $settings['vaxis_max_value'];
3967 $vaxis_min_value = $settings['vaxis_min_value'];
3968 $vaxis_text_font_size = $settings['vaxis_text_font_size'];
3969 $vaxis_label_color = $settings['vaxis_label_color'];
3970 $vaxis_bold = $settings['vaxis_bold'];
3971 $vaxis_italic = $settings['vaxis_italic'];
3972 $vaxis_title_bold = $settings['vaxis_title_bold'];
3973 $vaxis_title_italic = $settings['vaxis_title_italic'];
3974 $vaxis_gridlines_count = $settings['vaxis_gridlines_count'];
3975 $vaxis_gridlines_color = $settings['vaxis_gridlines_color'];
3976 $vaxis_minor_gridlines_color = $settings['vaxis_minor_gridlines_color'];
3977
3978 ob_start();
3979 ?>
3980 <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">
3981 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
3982 <h6>Label</h6>
3983 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3984 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3985 <label for="ays-chart-option-vaxis-title" class="form-label">
3986 <?php echo esc_html(__( "Label", "chart-builder" )); ?>
3987 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The title of the vertical axis","chart-builder") ); ?>">
3988 <i class="ays_fa ays_fa_info_circle"></i>
3989 </a>
3990 </label>
3991 </div>
3992 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
3993 <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) ?>">
3994 </div>
3995 </div> <!-- Vertical axis label -->
3996 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
3997 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
3998 <label for="ays-chart-option-vaxis-label-font-size" class="form-label">
3999 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4000 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the vertical axis label.","chart-builder") ); ?>">
4001 <i class="ays_fa ays_fa_info_circle"></i>
4002 </a>
4003 </label>
4004 </div>
4005 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4006 <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) ?>">
4007 </div>
4008 </div> <!-- Vertical axis label font size -->
4009 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4010 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4011 <label for="ays-chart-option-vaxis-label-color">
4012 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4013 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the horizontal axis label.","chart-builder") ); ?>">
4014 <i class="ays_fa ays_fa_info_circle"></i>
4015 </a>
4016 </label>
4017 </div>
4018 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4019 <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) ?>">
4020 </div>
4021 </div> <!-- Vertical axis label color -->
4022 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4023 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4024 <label for="ays-chart-option-vaxis-title-italic">
4025 <?php echo esc_html(__( "Italic", "chart-builder" )); ?>
4026 <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") ); ?>">
4027 <i class="ays_fa ays_fa_info_circle"></i>
4028 </a>
4029 </label>
4030 </div>
4031 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4032 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4033 <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); ?> >
4034 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4035 </label>
4036 </div>
4037 </div> <!-- Italic label -->
4038 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4039 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4040 <label for="ays-chart-option-vaxis-title-bold">
4041 <?php echo esc_html(__( "Bold", "chart-builder" )); ?>
4042 <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") ); ?>">
4043 <i class="ays_fa ays_fa_info_circle"></i>
4044 </a>
4045 </label>
4046 </div>
4047 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4048 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4049 <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); ?> >
4050 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4051 </label>
4052 </div>
4053 </div> <!-- Bold label -->
4054
4055 <br>
4056 <h6>Text</h6>
4057 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4058 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4059 <label for="ays-chart-option-vaxis-text-position" class="form-label">
4060 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4061 <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") ); ?>">
4062 <i class="ays_fa ays_fa_info_circle"></i>
4063 </a>
4064 </label>
4065 </div>
4066 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4067 <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]">
4068 <?php
4069 foreach ( $axes_text_positions as $option_slug => $option ):
4070 $selected = ( $vaxis_text_position == $option_slug ) ? 'selected' : '';
4071 ?>
4072 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4073 <?php
4074 endforeach;
4075 ?>
4076 </select>
4077 </div>
4078 </div> <!-- Vertical axis text position -->
4079 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4080 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4081 <label for="ays-chart-option-vaxis-text-color">
4082 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4083 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis text.","chart-builder") ); ?>">
4084 <i class="ays_fa ays_fa_info_circle"></i>
4085 </a>
4086 </label>
4087 </div>
4088 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4089 <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) ?>">
4090 </div>
4091 </div> <!-- Vertical axis text color -->
4092 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4093 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4094 <label for="ays-chart-option-vaxis-text-font-size" class="form-label">
4095 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4096 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The font size of the horizontal axis text.","chart-builder") ); ?>">
4097 <i class="ays_fa ays_fa_info_circle"></i>
4098 </a>
4099 </label>
4100 </div>
4101 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4102 <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) ?>">
4103 </div>
4104 </div> <!-- Vertical axis text font size -->
4105 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4106 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4107 <label for="ays-chart-option-vaxis-text-direction">
4108 <?php echo esc_html(__( "Reverse Direction", "chart-builder" )); ?>
4109 <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") ); ?>">
4110 <i class="ays_fa ays_fa_info_circle"></i>
4111 </a>
4112 </label>
4113 </div>
4114 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4115 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4116 <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); ?> >
4117 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4118 </label>
4119 </div>
4120 </div> <!-- Vertical axis text direction -->
4121 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4122 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4123 <label for="ays-chart-option-vaxis-italic">
4124 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
4125 <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") ); ?>">
4126 <i class="ays_fa ays_fa_info_circle"></i>
4127 </a>
4128 </label>
4129 </div>
4130 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4131 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4132 <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); ?> >
4133 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4134 </label>
4135 </div>
4136 </div> <!-- Italic text -->
4137 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4138 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4139 <label for="ays-chart-option-vaxis-bold">
4140 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
4141 <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") ); ?>">
4142 <i class="ays_fa ays_fa_info_circle"></i>
4143 </a>
4144 </label>
4145 </div>
4146 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4147 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4148 <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); ?> >
4149 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4150 </label>
4151 </div>
4152 </div> <!-- Bold text -->
4153
4154 <br>
4155 <h6>Gridlines</h6>
4156 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4157 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4158 <label for="ays-chart-option-vaxis-gridlines-count" class="form-label">
4159 <?php echo esc_html(__( "Count", "chart-builder" )); ?>
4160 <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") ); ?>">
4161 <i class="ays_fa ays_fa_info_circle"></i>
4162 </a>
4163 </label>
4164 </div>
4165 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4166 <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) ?>">
4167 </div>
4168 </div> <!-- Vertical axis gridlines count -->
4169 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4170 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4171 <label for="ays-chart-option-vaxis-gridlines-color">
4172 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
4173 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis gridlines.","chart-builder") ); ?>">
4174 <i class="ays_fa ays_fa_info_circle"></i>
4175 </a>
4176 </label>
4177 </div>
4178 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4179 <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) ?>">
4180 </div>
4181 </div> <!-- Vertical axis gridlines color -->
4182 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4183 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4184 <label for="ays-chart-option-vaxis-minor-gridlines-color">
4185 <?php echo esc_html(__( "Minor gridlines color", "chart-builder" )); ?>
4186 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the vertical axis minor gridlines.","chart-builder") ); ?>">
4187 <i class="ays_fa ays_fa_info_circle"></i>
4188 </a>
4189 </label>
4190 </div>
4191 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4192 <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) ?>">
4193 </div>
4194 </div> <!-- Vertical axis minor gridlines color -->
4195 <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">
4196 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4197 <label for="ays-chart-option-vaxis-baseline-color">
4198 <?php echo esc_html(__( "Baseline color", "chart-builder" )); ?>
4199 <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") ); ?>">
4200 <i class="ays_fa ays_fa_info_circle"></i>
4201 </a>
4202 </label>
4203 </div>
4204 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4205 <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) ?>">
4206 </div>
4207 </div> <!-- Vertical axis baseline color -->
4208
4209 <br>
4210 <h6>Format</h6>
4211 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4212 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4213 <label for="ays-chart-option-vaxis-format" class="form-label">
4214 <?php echo esc_html(__( "Format", "chart-builder" )); ?>
4215 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4216 echo htmlspecialchars( sprintf (
4217 "<p>" . __('A format string for numeric axis labels. You can choose any of the following:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4218 __('%sNone:%s Displays numbers with no formatting (e.g., 8000000)', "chart-builder") . "</li><li>" .
4219 __('%sDecimal:%s Displays numbers with thousands separators (e.g., 8,000,000)', "chart-builder") . "</li><li>" .
4220 __('%sScientific:%s Displays numbers in scientific notation (e.g., 8e6)', "chart-builder") . "</li><li>" .
4221 __('%sCurrency:%s Displays numbers in the local currency (e.g., $8,000,000.00)', "chart-builder") . "</li><li>" .
4222 __('%sPercent:%s Displays numbers as percentages (e.g., 800,000,000%%)', "chart-builder") . "</li><li>" .
4223 __('%sShort:%s Displays abbreviated numbers (e.g., 8M)', "chart-builder") . "</li><li>" .
4224 __('%sLong:%s Displays numbers as full words (e.g., 8 million)', "chart-builder") . "</li></ul>",
4225 '<em>', '</em>',
4226 '<em>', '</em>',
4227 '<em>', '</em>',
4228 '<em>', '</em>',
4229 '<em>', '</em>',
4230 '<em>', '</em>',
4231 '<em>', '</em>'
4232 ) );
4233 ?>">
4234 <i class="ays_fa ays_fa_info_circle"></i>
4235 </a>
4236 </label>
4237 </div>
4238 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4239 <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]">
4240 <?php
4241 foreach ( $vaxis_format_options as $option_slug => $option ):
4242 $selected = ( $vaxis_format == $option_slug ) ? 'selected' : '';
4243 ?>
4244 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4245 <?php
4246 endforeach;
4247 ?>
4248 </select>
4249 </div>
4250 </div> <!-- Vertical axis format -->
4251 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4252 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4253 <label for="ays-chart-option-vaxis-max-value" class="form-label">
4254 <?php echo esc_html(__( "Max value", "chart-builder" )); ?>
4255 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The maximum value of the axis.","chart-builder") ); ?>">
4256 <i class="ays_fa ays_fa_info_circle"></i>
4257 </a>
4258 </label>
4259 </div>
4260 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4261 <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) ?>">
4262 </div>
4263 </div> <!-- Vertical axis max value -->
4264 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4265 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4266 <label for="ays-chart-option-vaxis-min-value" class="form-label">
4267 <?php echo esc_html(__( "Min value", "chart-builder" )); ?>
4268 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The minimum value of the axis.","chart-builder") ); ?>">
4269 <i class="ays_fa ays_fa_info_circle"></i>
4270 </a>
4271 </label>
4272 </div>
4273 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4274 <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) ?>">
4275 </div>
4276 </div> <!-- Vertical axis min value -->
4277 </div>
4278 </div>
4279 <?php
4280 $content = ob_get_clean();
4281
4282 $title = __( 'Vertical Axis Settings', "chart-builder" );
4283
4284 $sources['vertical_axis'] = array(
4285 'content' => $content,
4286 'title' => $title
4287 );
4288
4289 return $sources;
4290 }
4291
4292 public function settings_contents_animation_settings( $sources, $args ) {
4293 $html_class_prefix = $args['html_class_prefix'];
4294 $html_name_prefix = $args['html_name_prefix'];
4295 $settings = $args['settings'];
4296
4297 $enable_animation = $settings['enable_animation'];
4298 $animation_duration = $settings['animation_duration'];
4299 $animation_startup = $settings['animation_startup'];
4300 $animation_easing_options = $settings['animation_easing_options'];
4301 $animation_easing = $settings['animation_easing'];
4302
4303 ob_start();
4304 ?>
4305 <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">
4306 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4307 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4308 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4309 <label for="ays-chart-option-enable-animation">
4310 <?php echo esc_html(__( "Enable chart animation", "chart-builder" )); ?>
4311 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Enable chart animation.","chart-builder") ); ?>">
4312 <i class="ays_fa ays_fa_info_circle"></i>
4313 </a>
4314 </label>
4315 </div>
4316 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4317 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4318 <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); ?> >
4319 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4320 </label>
4321 </div>
4322 </div> <!-- Enable animation -->
4323 <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'; ?>">
4324 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4325 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4326 <label for="ays-chart-option-animation-duration" class="form-label">
4327 <?php echo esc_html(__( "Duration", "chart-builder" )); ?>
4328 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The duration of the chart animation, in milliseconds.","chart-builder") ); ?>">
4329 <i class="ays_fa ays_fa_info_circle"></i>
4330 </a>
4331 </label>
4332 </div>
4333 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4334 <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) ?>">
4335 </div>
4336 </div> <!-- Animation duration -->
4337 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4338 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4339 <label for="ays-chart-option-animation-startup">
4340 <?php echo esc_html(__( "Startup", "chart-builder" )); ?>
4341 <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") ); ?>">
4342 <i class="ays_fa ays_fa_info_circle"></i>
4343 </a>
4344 </label>
4345 </div>
4346 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4347 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4348 <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); ?> >
4349 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4350 </label>
4351 </div>
4352 </div> <!-- Animation startup -->
4353 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4354 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4355 <label for="ays-chart-option-animation-easing" class="form-label">
4356 <?php echo esc_html(__( "Easing", "chart-builder" )); ?>
4357 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
4358 echo htmlspecialchars( sprintf(
4359 "<p>" . __('The easing function applied to the chart animation. The following options are available:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
4360 __('%sLinear:%s Constant speed.', "chart-builder") . "</li><li>" .
4361 __('%sEase in:%s Start slow and speed up.', "chart-builder") . "</li><li>" .
4362 __('%sEase out:%s Start fast and slow down.', "chart-builder") . "</li><li>" .
4363 __('%sEase in and out:%s Start slow, speed up, then slow down.', "chart-builder") . "</li></ul>",
4364 '<em>',
4365 '</em>',
4366 '<em>',
4367 '</em>',
4368 '<em>',
4369 '</em>',
4370 '<em>',
4371 '</em>'
4372 ) );
4373 ?>">
4374 <i class="ays_fa ays_fa_info_circle"></i>
4375 </a>
4376 </label>
4377 </div>
4378 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4379 <select class="<?php echo esc_attr($html_class_prefix) ?>option-select-input form-select" id="ays-chart-option-animation-easing" name="<?php echo esc_attr($html_name_prefix); ?>settings[animation_easing]">
4380 <?php
4381 foreach ( $animation_easing_options as $option_slug => $option ):
4382 $selected = ( $animation_easing == $option_slug ) ? 'selected' : '';
4383 ?>
4384 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4385 <?php
4386 endforeach;
4387 ?>
4388 </select>
4389 </div>
4390 </div> <!-- Animation easing -->
4391 <div>
4392 </div>
4393 </div>
4394 <?php
4395 $content = ob_get_clean();
4396
4397 $title = __( 'Chart animation', "chart-builder" );
4398
4399 $sources['animation'] = array(
4400 'content' => $content,
4401 'title' => $title
4402 );
4403
4404 return $sources;
4405 }
4406
4407 public function settings_contents_live_chart_settings( $sources, $args ) {
4408 $html_class_prefix = $args['html_class_prefix'];
4409 $html_name_prefix = $args['html_name_prefix'];
4410
4411 ob_start();
4412 ?>
4413 <div class="ays-accordion-data-main-wrap <?= $html_class_prefix ?>options-live-chart-settings-tab">
4414 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4415 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4416 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4417 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4418 <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>
4419 <div class="ays-pro-features-v2-video-text">
4420 <?php echo __("Watch Video" , "chart-builder"); ?>
4421 </div>
4422 </a>
4423 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4424 <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>
4425 <div class="ays-pro-features-v2-upgrade-text">
4426 <?php echo __("Upgrade" , "chart-builder"); ?>
4427 </div>
4428 </a>
4429 </div>
4430 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4431 <label for="ays-chart-option-enable-live-chart">
4432 <?php echo esc_html(__( "Enable live chart", "chart-builder" )); ?>
4433 <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") ); ?>">
4434 <i class="ays_fa ays_fa_info_circle"></i>
4435 </a>
4436 </label>
4437 </div>
4438 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4439 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4440 <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">
4441 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4442 </label>
4443 </div>
4444 </div> <!-- Enable live chart -->
4445 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4446 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4447 <a href="https://www.youtube.com/watch?v=lhTqZmFUNz4" target="_blank" class="ays-pro-features-v2-video-button">
4448 <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>
4449 <div class="ays-pro-features-v2-video-text">
4450 <?php echo __("Watch Video" , "chart-builder"); ?>
4451 </div>
4452 </a>
4453 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4454 <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>
4455 <div class="ays-pro-features-v2-upgrade-text">
4456 <?php echo __("Upgrade" , "chart-builder"); ?>
4457 </div>
4458 </a>
4459 </div>
4460 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4461 <label for="ays-chart-option-live-chart-interval" class="form-label">
4462 <?php echo esc_html(__( "Interval", "chart-builder" )); ?>
4463 <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") ); ?>">
4464 <i class="ays_fa ays_fa_info_circle"></i>
4465 </a>
4466 </label>
4467 </div>
4468 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4469 <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">
4470 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">ms</div>
4471 </div>
4472 </div> <!-- Live chart interval -->
4473 </div>
4474 </div>
4475 <?php
4476 $content = ob_get_clean();
4477
4478 $title = __( 'Live Chart', "chart-builder" );
4479
4480 $sources['live_chart'] = array(
4481 'content' => $content,
4482 'title' => $title
4483 );
4484
4485 return $sources;
4486
4487 }
4488
4489 public function settings_contents_export_options( $sources, $args ){
4490 $html_class_prefix = $args['html_class_prefix'];
4491 $html_name_prefix = $args['html_name_prefix'];
4492 $settings = $args['settings'];
4493
4494 $enable_img = $settings['enable_img'];
4495
4496 ob_start();
4497 ?>
4498 <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">
4499 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4500 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4501 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4502 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4503 <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>
4504 <div class="ays-pro-features-v2-video-text">
4505 <?php echo __("Watch Video" , "chart-builder"); ?>
4506 </div>
4507 </a>
4508 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4509 <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>
4510 <div class="ays-pro-features-v2-upgrade-text">
4511 <?php echo __("Upgrade" , "chart-builder"); ?>
4512 </div>
4513 </a>
4514 </div>
4515 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4516 <label for="ays-chart-option-export-print">
4517 <?php echo esc_html(__( "Print chart", "chart-builder" )); ?>
4518 <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") ); ?>">
4519 <i class="ays_fa ays_fa_info_circle"></i>
4520 </a>
4521 </label>
4522 </div>
4523 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4524 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4525 <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">
4526 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4527 </label>
4528 </div>
4529 </div> <!-- Print option end -->
4530 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4531 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4532 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4533 <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>
4534 <div class="ays-pro-features-v2-video-text">
4535 <?php echo __("Watch Video" , "chart-builder"); ?>
4536 </div>
4537 </a>
4538 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4539 <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>
4540 <div class="ays-pro-features-v2-upgrade-text">
4541 <?php echo __("Upgrade" , "chart-builder"); ?>
4542 </div>
4543 </a>
4544 </div>
4545 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4546 <label for="ays-chart-option-export-Excel">
4547 <?php echo esc_html(__( "Excel download", "chart-builder" )); ?>
4548 <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") ); ?>">
4549 <i class="ays_fa ays_fa_info_circle"></i>
4550 </a>
4551 </label>
4552 </div>
4553 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4554 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4555 <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">
4556 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4557 </label>
4558 </div>
4559 </div> <!-- Excel option end -->
4560 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4561 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4562 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4563 <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>
4564 <div class="ays-pro-features-v2-video-text">
4565 <?php echo __("Watch Video" , "chart-builder"); ?>
4566 </div>
4567 </a>
4568 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4569 <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>
4570 <div class="ays-pro-features-v2-upgrade-text">
4571 <?php echo __("Upgrade" , "chart-builder"); ?>
4572 </div>
4573 </a>
4574 </div>
4575 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4576 <label for="ays-chart-option-export-CSV">
4577 <?php echo esc_html(__( "CSV download", "chart-builder" )); ?>
4578 <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") ); ?>">
4579 <i class="ays_fa ays_fa_info_circle"></i>
4580 </a>
4581 </label>
4582 </div>
4583 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4584 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4585 <input class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch" id="ays-chart-option-export-csv" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[enable_csv]" value="on">
4586 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4587 </label>
4588 </div>
4589 </div> <!-- CSV option end -->
4590 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section ays-pro-features-v2-main-box">
4591 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
4592 <a href="https://www.youtube.com/watch?v=9UqLXG5NU_I" target="_blank" class="ays-pro-features-v2-video-button">
4593 <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>
4594 <div class="ays-pro-features-v2-video-text">
4595 <?php echo __("Watch Video" , "chart-builder"); ?>
4596 </div>
4597 </a>
4598 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
4599 <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>
4600 <div class="ays-pro-features-v2-upgrade-text">
4601 <?php echo __("Upgrade" , "chart-builder"); ?>
4602 </div>
4603 </a>
4604 </div>
4605 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4606 <label for="ays-chart-option-export-Copy">
4607 <?php echo esc_html(__( "Copy chart data", "chart-builder" )); ?>
4608 <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") ); ?>">
4609 <i class="ays_fa ays_fa_info_circle"></i>
4610 </a>
4611 </label>
4612 </div>
4613 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4614 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4615 <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">
4616 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4617 </label>
4618 </div>
4619 </div> <!-- Copy option end -->
4620 <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">
4621 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4622 <label for="ays-chart-option-export-img">
4623 <?php echo esc_html(__( "Download chart image", "chart-builder" )); ?>
4624 <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") ); ?>">
4625 <i class="ays_fa ays_fa_info_circle"></i>
4626 </a>
4627 </label>
4628 </div>
4629 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4630 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4631 <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?> >
4632 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4633 </label>
4634 </div>
4635 </div> <!-- IMG option end -->
4636 </div>
4637 </div>
4638 <?php
4639
4640 $content = ob_get_clean();
4641
4642 $title = __( 'Frontend Actions', "chart-builder" );
4643
4644 $sources['export_options'] = array(
4645 'content' => $content,
4646 'title' => $title
4647 );
4648
4649 return $sources;
4650 }
4651
4652 /**
4653 * Chart page styles contents
4654 * @param $args
4655 */
4656 public function ays_chart_page_styles_contents( $args ){
4657 $chart_source_type = $args['chart_source_type'];
4658
4659 if ($chart_source_type === 'chart-js') {
4660 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings_chartjs', array(), $args );
4661 } else {
4662 $sources_contents = apply_filters( 'ays_cb_chart_page_styles_contents_settings', array(), $args );
4663 }
4664
4665 $sources = array();
4666 foreach ( $sources_contents as $key => $sources_content ) {
4667 $collapsed = $key == 'chart' ? 'false' : 'true';
4668
4669 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
4670 if(isset($sources_content['title'])){
4671 $content .= '<legend class="ays-accordion-options-header">';
4672 $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">
4673 <g>
4674 <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" />
4675 </g>
4676 </svg>';
4677
4678 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
4679 }
4680
4681 $content .= '<div class="ays-accordion-options-content">';
4682 $content .= $sources_content['content'];
4683 $content .= '</div>';
4684
4685 $content .= '</fieldset>';
4686
4687 $sources[] = $content;
4688 }
4689 $content_for_escape = implode('' , $sources );
4690 echo html_entity_decode(esc_html( $content_for_escape ));
4691 }
4692
4693 public function settings_contents_chart_styles_settings( $sources, $args ){
4694 $html_class_prefix = $args['html_class_prefix'];
4695 $html_name_prefix = $args['html_name_prefix'];
4696 $settings = $args['settings'];
4697
4698 $width = $settings['width'];
4699 $width_format = $settings['width_format'];
4700 $title_positions = $settings['title_positions'];
4701 $position = $settings['position'];
4702 $width_format_options = $settings['width_format_options'];
4703 $responsive_width = $settings['responsive_width'];
4704 $height = $settings['height'];
4705 $height_format = $settings['height_format'];
4706 $font_size = $settings['font_size'];
4707 $org_chart_font_size_options = $settings['org_chart_font_size_options'];
4708 $org_chart_font_size = $settings['org_chart_font_size'];
4709 $background_color = $settings['background_color'];
4710 $transparent_background = $settings['transparent_background'];
4711 $border_width = $settings['border_width'];
4712 $border_width_with_title = $settings['border_width_with_title'];
4713 $border_radius = $settings['border_radius'];
4714 $border_color = $settings['border_color'];
4715 $box_shadow = $settings['box_shadow'];
4716 $box_shadow_color = $settings['box_shadow_color'];
4717 ob_start();
4718 ?>
4719 <div class="ays-accordion-data-main-wrap">
4720 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
4721 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4722 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4723 <label for="ays-chart-option-width" class="form-label">
4724 <?php echo esc_html(__( "Width", "chart-builder" )); ?>
4725 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The width of the chart container, in percents.","chart-builder") ); ?>">
4726 <i class="ays_fa ays_fa_info_circle"></i>
4727 </a>
4728 </label>
4729 </div>
4730 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4731 <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) ?>">
4732 <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]">
4733 <?php
4734 foreach ( $width_format_options as $option_slug => $option ):
4735 $selected = ( $width_format == $option_slug ) ? 'selected' : '';
4736 ?>
4737 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4738 <?php
4739 endforeach;
4740 ?>
4741 </select>
4742 </div>
4743 </div> <!-- Width -->
4744 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4745 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4746 <label for="ays-chart-option-responsive-width" class="form-label">
4747 <?php echo esc_html(__( "Responsive Width", "chart-builder" )); ?>
4748 <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") ); ?>">
4749 <i class="ays_fa ays_fa_info_circle"></i>
4750 </a>
4751 </label>
4752 </div>
4753 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4754 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4755 <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); ?> >
4756 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4757 </label>
4758 </div>
4759 </div> <!-- Responsive Width -->
4760 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4761 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4762 <label for="ays-chart-option-position">
4763 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
4764 <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") ); ?>">
4765 <i class="ays_fa ays_fa_info_circle"></i>
4766 </a>
4767 </label>
4768 </div>
4769 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4770 <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]">
4771 <?php
4772 foreach ( $title_positions as $option_slug => $option ):
4773 $selected = ( $position == $option_slug ) ? 'selected' : '';
4774 ?>
4775 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4776 <?php
4777 endforeach;
4778 ?>
4779 </select>
4780 </div>
4781 </div> <!-- Title position -->
4782 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
4783 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4784 <label for="ays-chart-option-height" class="form-label">
4785 <?php echo esc_html(__( "Height", "chart-builder" )); ?>
4786 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The height of the chart container, in pixels.","chart-builder") ); ?>">
4787 <i class="ays_fa ays_fa_info_circle"></i>
4788 </a>
4789 </label>
4790 </div>
4791 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4792 <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) ?>">
4793 <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]">
4794 <?php
4795 foreach ( $width_format_options as $option_slug => $option ):
4796 $selected = ( $height_format == $option_slug ) ? 'selected' : '';
4797 ?>
4798 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
4799 <?php
4800 endforeach;
4801 ?>
4802 </select>
4803 </div>
4804 </div> <!-- Height -->
4805 <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">
4806 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4807 <label for="ays-chart-option-font-size" class="form-label">
4808 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
4809 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart text.","chart-builder") ); ?>">
4810 <i class="ays_fa ays_fa_info_circle"></i>
4811 </a>
4812 </label>
4813 </div>
4814 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4815 <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) ?>">
4816 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
4817 </div>
4818 </div> <!-- Font size -->
4819 <div class="form-group row mb-2 <?= $html_class_prefix ?>options-section cb-changable-opt cb-org_chart-opt display_none">
4820 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
4821 <label for="ays-chart-option-org-chart-font-size" class="form-label">
4822 <?php echo __( "Element size", $this->plugin_name ); ?>
4823 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The size of the chart element.","chart-builder") ); ?>">
4824 <i class="ays_fa ays_fa_info_circle"></i>
4825 </a>
4826 </label>
4827 </div>
4828 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4829 <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]">
4830 <?php
4831 foreach ( $org_chart_font_size_options as $option_slug => $option ):
4832 $selected = ( $org_chart_font_size == $option_slug ) ? 'selected' : '';
4833 ?>
4834 <option value="<?php echo $option_slug; ?>" <?php echo $selected; ?>><?php echo $option; ?></option>
4835 <?php
4836 endforeach;
4837 ?>
4838 </select>
4839 </div>
4840 </div> <!-- Font size for org type -->
4841 <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">
4842 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4843 <label for="ays-chart-option-background-color">
4844 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
4845 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The background color of the chart container.","chart-builder") ); ?>">
4846 <i class="ays_fa ays_fa_info_circle"></i>
4847 </a>
4848 </label>
4849 </div>
4850 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4851 <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) ?>">
4852 </div>
4853 </div> <!-- Background color -->
4854 <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">
4855 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4856 <label for="ays-chart-option-transparent-background" class="form-label">
4857 <?php echo esc_html(__( "Transparent background", "chart-builder" )); ?>
4858 <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") ); ?>">
4859 <i class="ays_fa ays_fa_info_circle"></i>
4860 </a>
4861 </label>
4862 </div>
4863 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4864 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4865 <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); ?> >
4866 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4867 </label>
4868 </div>
4869 </div> <!-- Transparent background -->
4870 <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">
4871 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4872 <label for="ays-chart-option-border-width">
4873 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
4874 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The width of the chart container border.","chart-builder") ); ?>">
4875 <i class="ays_fa ays_fa_info_circle"></i>
4876 </a>
4877 </label>
4878 </div>
4879 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4880 <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) ?>">
4881 </div>
4882 </div> <!-- Border Width -->
4883 <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">
4884 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4885 <label for="ays-chart-option-border-color">
4886 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
4887 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border color of the chart container.","chart-builder") ); ?>">
4888 <i class="ays_fa ays_fa_info_circle"></i>
4889 </a>
4890 </label>
4891 </div>
4892 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4893 <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) ?>">
4894 </div>
4895 </div> <!-- Border color -->
4896 <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">
4897 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4898 <label for="ays-chart-option-border-radius">
4899 <?php echo esc_html(__( "Border Radius", "chart-builder" )); ?>
4900 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border radius of the chart container.","chart-builder") ); ?>">
4901 <i class="ays_fa ays_fa_info_circle"></i>
4902 </a>
4903 </label>
4904 </div>
4905 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4906 <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) ?>">
4907 </div>
4908 </div> <!-- Border radius -->
4909 <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">
4910 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4911 <label for="ays-chart-option-box-shadow" class="form-label">
4912 <?php echo esc_html(__( "Box Shadow", "chart-builder" )); ?>
4913 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to add shadow to chart's container.","chart-builder") ); ?>">
4914 <i class="ays_fa ays_fa_info_circle"></i>
4915 </a>
4916 </label>
4917 </div>
4918 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4919 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
4920 <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); ?> >
4921 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
4922 </label>
4923 </div>
4924 </div> <!-- box shadow -->
4925 <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">
4926 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4927 <label for="ays-chart-option-box-shadow-color" class="form-label">
4928 <?php echo esc_html(__( "Box Shadow Color", "chart-builder" )); ?>
4929 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose chart container's box shadow color.","chart-builder") ); ?>">
4930 <i class="ays_fa ays_fa_info_circle"></i>
4931 </a>
4932 </label>
4933 </div>
4934 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4935 <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) ?>">
4936 </div>
4937 </div> <!-- box shadow color -->
4938 <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">
4939 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4940 <label for="ays-chart-option-border-width-with-title">
4941 <?php echo esc_html(__( "Border Width (including title)", "chart-builder" )); ?>
4942 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The width of the chart container border including chart title and description.","chart-builder") ); ?>">
4943 <i class="ays_fa ays_fa_info_circle"></i>
4944 </a>
4945 </label>
4946 </div>
4947 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
4948 <input class="ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input" id="ays-chart-option-border-width-with-title" type="number" name="<?php echo esc_attr($html_name_prefix); ?>settings[border_width_with_title]" value="<?php echo esc_attr($border_width_with_title) ?>">
4949 </div>
4950 </div> <!-- Border Width with title -->
4951 </div>
4952 </div>
4953 <?php
4954 $content = ob_get_clean();
4955
4956 $title = __( 'Chart', "chart-builder" );
4957
4958 $sources['chart'] = array(
4959 'content' => $content,
4960 'title' => $title
4961 );
4962
4963 return $sources;
4964 }
4965
4966 public function settings_contents_chart_area_styles_settings( $sources, $args ){
4967 $html_class_prefix = $args['html_class_prefix'];
4968 $html_name_prefix = $args['html_name_prefix'];
4969 $settings = $args['settings'];
4970
4971 $chart_background_color = $settings['chart_background_color'];
4972 $chart_border_color = $settings['chart_border_color'];
4973 $chart_left_margin = $settings['chart_left_margin'];
4974 $chart_right_margin = $settings['chart_right_margin'];
4975 $chart_top_margin = $settings['chart_top_margin'];
4976 $chart_bottom_margin = $settings['chart_bottom_margin'];
4977 $chart_border_width = $settings['chart_border_width'];
4978 ob_start();
4979 ?>
4980 <div class="ays-accordion-data-main-wrap">
4981 <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">
4982 <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">
4983 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4984 <label for="ays-chart-option-chart-background-color">
4985 <?php echo esc_html(__( "Background Color", "chart-builder" )); ?>
4986 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The background color of the chart area.","chart-builder") ); ?>">
4987 <i class="ays_fa ays_fa_info_circle"></i>
4988 </a>
4989 </label>
4990 </div>
4991 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
4992 <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) ?>">
4993 </div>
4994 </div> <!-- Chart Area background color -->
4995 <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">
4996 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
4997 <label for="ays-chart-option-chart-border-width">
4998 <?php echo esc_html(__( "Border Width", "chart-builder" )); ?>
4999 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border width of the chart area.","chart-builder") ); ?>">
5000 <i class="ays_fa ays_fa_info_circle"></i>
5001 </a>
5002 </label>
5003 </div>
5004 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5005 <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) ?>">
5006 </div>
5007 </div> <!-- Chart Area Border Width -->
5008 <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">
5009 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5010 <label for="ays-chart-option-chart-border-color">
5011 <?php echo esc_html(__( "Border Color", "chart-builder" )); ?>
5012 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The border color of the chart area.","chart-builder") ); ?>">
5013 <i class="ays_fa ays_fa_info_circle"></i>
5014 </a>
5015 </label>
5016 </div>
5017 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5018 <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) ?>">
5019 </div>
5020 </div> <!-- Chart Area border color -->
5021 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5022 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5023 <label for="ays-chart-option-chart-left-margin">
5024 <?php echo esc_html(__( "Left Margin", "chart-builder" )); ?>
5025 <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") ); ?>">
5026 <i class="ays_fa ays_fa_info_circle"></i>
5027 </a>
5028 </label>
5029 </div>
5030 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5031 <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) ?>">
5032 </div>
5033 </div> <!-- Chart Area Left Margin -->
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-chart-right-margin">
5037 <?php echo esc_html(__( "Right Margin", "chart-builder" )); ?>
5038 <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") ); ?>">
5039 <i class="ays_fa ays_fa_info_circle"></i>
5040 </a>
5041 </label>
5042 </div>
5043 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5044 <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) ?>">
5045 </div>
5046 </div> <!-- Chart Area Right Margin -->
5047 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5048 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5049 <label for="ays-chart-option-chart-top-margin">
5050 <?php echo esc_html(__( "Top Margin", "chart-builder" )); ?>
5051 <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") ); ?>">
5052 <i class="ays_fa ays_fa_info_circle"></i>
5053 </a>
5054 </label>
5055 </div>
5056 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5057 <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) ?>">
5058 </div>
5059 </div> <!-- Chart Area Top Margin -->
5060 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5061 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5062 <label for="ays-chart-option-chart-bottom-margin">
5063 <?php echo esc_html(__( "Bottom Margin", "chart-builder" )); ?>
5064 <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") ); ?>">
5065 <i class="ays_fa ays_fa_info_circle"></i>
5066 </a>
5067 </label>
5068 </div>
5069 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5070 <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) ?>">
5071 </div>
5072 </div> <!-- Chart Area Bottom Margin -->
5073 </div>
5074 </div>
5075 <?php
5076 $content = ob_get_clean();
5077
5078 $title = __( 'Chart Area', "chart-builder" );
5079
5080 $sources['chart_area'] = array(
5081 'content' => $content,
5082 'title' => $title
5083 );
5084
5085 return $sources;
5086 }
5087
5088 public function settings_contents_title_styles_settings( $sources, $args ){
5089 $html_class_prefix = $args['html_class_prefix'];
5090 $html_name_prefix = $args['html_name_prefix'];
5091 $settings = $args['settings'];
5092
5093 $title_color = $settings['title_color'];
5094 $title_shadow_color = $settings['title_shadow_color'];
5095 $title_font_size = $settings['title_font_size'];
5096 $title_gap = $settings['title_gap'];
5097 $title_gap_description = $settings['title_gap_description'];
5098 $title_positions = $settings['title_positions'];
5099 $title_position = $settings['title_position'];
5100 $title_bold = $settings['title_bold'];
5101 $title_text_shadow = $settings['title_text_shadow'];
5102 $title_italic = $settings['title_italic'];
5103 $text_transforms = $settings['text_transforms'];
5104 $text_decorations = $settings['text_decorations'];
5105 $title_text_transform = $settings['title_text_transform'];
5106 $title_text_decoration = $settings['title_text_decoration'];
5107 $title_letter_spacing = $settings['title_letter_spacing'];
5108 ob_start();
5109 ?>
5110 <div class="ays-accordion-data-main-wrap">
5111 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5112 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5113 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5114 <label for="ays-chart-option-title-color">
5115 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5116 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart title.","chart-builder") ); ?>">
5117 <i class="ays_fa ays_fa_info_circle"></i>
5118 </a>
5119 </label>
5120 </div>
5121 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5122 <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) ?>">
5123 </div>
5124 </div> <!-- Chart title color -->
5125 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5126 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5127 <label for="ays-chart-option-title-font-size" class="form-label">
5128 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5129 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart title.","chart-builder") ); ?>">
5130 <i class="ays_fa ays_fa_info_circle"></i>
5131 </a>
5132 </label>
5133 </div>
5134 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5135 <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) ?>">
5136 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5137 </div>
5138 </div> <!-- Chart title font size -->
5139 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5140 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5141 <label for="ays-chart-option-title-bold" class="form-label">
5142 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5143 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
5144 <i class="ays_fa ays_fa_info_circle"></i>
5145 </a>
5146 </label>
5147 </div>
5148 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5149 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5150 <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); ?> >
5151 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5152 </label>
5153 </div>
5154 </div> <!-- Title bold -->
5155 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5156 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5157 <label for="ays-chart-option-title-italic" class="form-label">
5158 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5159 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
5160 <i class="ays_fa ays_fa_info_circle"></i>
5161 </a>
5162 </label>
5163 </div>
5164 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5165 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5166 <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); ?> >
5167 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5168 </label>
5169 </div>
5170 </div> <!-- Title italic -->
5171 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5172 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5173 <label for="ays-chart-option-title-position">
5174 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5175 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart title.","chart-builder") ); ?>">
5176 <i class="ays_fa ays_fa_info_circle"></i>
5177 </a>
5178 </label>
5179 </div>
5180 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5181 <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]">
5182 <?php
5183 foreach ( $title_positions as $option_slug => $option ):
5184 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5185 ?>
5186 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5187 <?php
5188 endforeach;
5189 ?>
5190 </select>
5191 </div>
5192 </div> <!-- Title position -->
5193 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5194 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5195 <label for="ays-chart-option-title-gap" class="form-label">
5196 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5197 <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") ); ?>">
5198 <i class="ays_fa ays_fa_info_circle"></i>
5199 </a>
5200 </label>
5201 </div>
5202 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5203 <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) ?>">
5204 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5205 </div>
5206 </div> <!-- Chart title gap -->
5207 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5208 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5209 <label for="ays-chart-option-title-gap-description" class="form-label">
5210 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5211 <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") ); ?>">
5212 <i class="ays_fa ays_fa_info_circle"></i>
5213 </a>
5214 </label>
5215 </div>
5216 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5217 <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) ?>">
5218 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5219 </div>
5220 </div> <!-- Chart title gap -->
5221 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5222 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5223 <label for="ays-chart-option-title-text-transform">
5224 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5225 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5226 <i class="ays_fa ays_fa_info_circle"></i>
5227 </a>
5228 </label>
5229 </div>
5230 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5231 <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]">
5232 <?php
5233 foreach ( $text_transforms as $option_slug => $option ):
5234 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5235 ?>
5236 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5237 <?php
5238 endforeach;
5239 ?>
5240 </select>
5241 </div>
5242 </div> <!-- Title text transform -->
5243 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5244 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5245 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5246 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5247 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5248 <i class="ays_fa ays_fa_info_circle"></i>
5249 </a>
5250 </label>
5251 </div>
5252 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5253 <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) ?>">
5254 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5255 </div>
5256 </div> <!-- Chart title letter spacing -->
5257 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5258 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5259 <label for="ays-chart-option-title-text-decoration">
5260 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5261 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5262 <i class="ays_fa ays_fa_info_circle"></i>
5263 </a>
5264 </label>
5265 </div>
5266 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5267 <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]">
5268 <?php
5269 foreach ( $text_decorations as $option_slug => $option ):
5270 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5271 ?>
5272 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5273 <?php
5274 endforeach;
5275 ?>
5276 </select>
5277 </div>
5278 </div> <!-- Title text decoration -->
5279 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5280 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5281 <label for="ays-chart-option-title-text-shadow" class="form-label">
5282 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5283 <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") ); ?>">
5284 <i class="ays_fa ays_fa_info_circle"></i>
5285 </a>
5286 </label>
5287 </div>
5288 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5289 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5290 <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); ?> >
5291 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5292 </label>
5293 </div>
5294 </div> <!-- Title bold -->
5295 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5296 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5297 <label for="ays-chart-option-title-shadow-color">
5298 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5299 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5300 <i class="ays_fa ays_fa_info_circle"></i>
5301 </a>
5302 </label>
5303 </div>
5304 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5305 <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) ?>">
5306 </div>
5307 </div> <!-- Chart title color -->
5308 </div>
5309 </div>
5310 <?php
5311 $content = ob_get_clean();
5312
5313 $title = __( 'Title', "chart-builder" );
5314
5315 $sources['title'] = array(
5316 'content' => $content,
5317 'title' => $title
5318 );
5319
5320 return $sources;
5321 }
5322
5323 public function settings_contents_title_styles_settings_chartjs( $sources, $args ){
5324 $html_class_prefix = $args['html_class_prefix'];
5325 $html_name_prefix = $args['html_name_prefix'];
5326 $settings = $args['settings'];
5327
5328 $title_color = $settings['title_color'];
5329 $title_shadow_color = $settings['title_shadow_color'];
5330 $title_font_size = $settings['title_font_size'];
5331 $title_gap = $settings['title_gap'];
5332 $title_gap_description = $settings['title_gap_description'];
5333 $title_positions = $settings['title_positions'];
5334 $title_position = $settings['title_position'];
5335 $title_bold = $settings['title_bold'];
5336 $title_text_shadow = $settings['title_text_shadow'];
5337 $title_italic = $settings['title_italic'];
5338 $text_transforms = $settings['text_transforms'];
5339 $text_decorations = $settings['text_decorations'];
5340 $title_text_transform = $settings['title_text_transform'];
5341 $title_text_decoration = $settings['title_text_decoration'];
5342 $title_letter_spacing = $settings['title_letter_spacing'];
5343 ob_start();
5344 ?>
5345 <div class="ays-accordion-data-main-wrap">
5346 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5347 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5348 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5349 <label for="ays-chart-option-title-color">
5350 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5351 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart title.","chart-builder") ); ?>">
5352 <i class="ays_fa ays_fa_info_circle"></i>
5353 </a>
5354 </label>
5355 </div>
5356 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5357 <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) ?>">
5358 </div>
5359 </div> <!-- Chart title color -->
5360 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5361 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5362 <label for="ays-chart-option-title-font-size" class="form-label">
5363 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5364 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart title.","chart-builder") ); ?>">
5365 <i class="ays_fa ays_fa_info_circle"></i>
5366 </a>
5367 </label>
5368 </div>
5369 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5370 <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) ?>">
5371 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5372 </div>
5373 </div> <!-- Chart title font size -->
5374 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5375 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5376 <label for="ays-chart-option-title-bold" class="form-label">
5377 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5378 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text bold.","chart-builder") ); ?>">
5379 <i class="ays_fa ays_fa_info_circle"></i>
5380 </a>
5381 </label>
5382 </div>
5383 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5384 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5385 <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); ?> >
5386 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5387 </label>
5388 </div>
5389 </div> <!-- Title bold -->
5390 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5391 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5392 <label for="ays-chart-option-title-italic" class="form-label">
5393 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5394 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart title text italic.","chart-builder") ); ?>">
5395 <i class="ays_fa ays_fa_info_circle"></i>
5396 </a>
5397 </label>
5398 </div>
5399 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5400 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5401 <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); ?> >
5402 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5403 </label>
5404 </div>
5405 </div> <!-- Title italic -->
5406 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5407 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5408 <label for="ays-chart-option-title-position">
5409 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5410 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart title.","chart-builder") ); ?>">
5411 <i class="ays_fa ays_fa_info_circle"></i>
5412 </a>
5413 </label>
5414 </div>
5415 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5416 <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]">
5417 <?php
5418 foreach ( $title_positions as $option_slug => $option ):
5419 $selected = ( $title_position == $option_slug ) ? 'selected' : '';
5420 ?>
5421 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5422 <?php
5423 endforeach;
5424 ?>
5425 </select>
5426 </div>
5427 </div> <!-- Title position -->
5428 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5429 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5430 <label for="ays-chart-option-title-gap" class="form-label">
5431 <?php echo esc_html(__( "Gap", "chart-builder" )); ?>
5432 <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") ); ?>">
5433 <i class="ays_fa ays_fa_info_circle"></i>
5434 </a>
5435 </label>
5436 </div>
5437 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5438 <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) ?>">
5439 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5440 </div>
5441 </div> <!-- Chart title gap -->
5442 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5443 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5444 <label for="ays-chart-option-title-gap-description" class="form-label">
5445 <?php echo esc_html(__( "Distance from description", "chart-builder" )); ?>
5446 <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") ); ?>">
5447 <i class="ays_fa ays_fa_info_circle"></i>
5448 </a>
5449 </label>
5450 </div>
5451 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5452 <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) ?>">
5453 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5454 </div>
5455 </div> <!-- Chart title gap -->
5456 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5457 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5458 <label for="ays-chart-option-title-text-transform">
5459 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5460 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5461 <i class="ays_fa ays_fa_info_circle"></i>
5462 </a>
5463 </label>
5464 </div>
5465 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5466 <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]">
5467 <?php
5468 foreach ( $text_transforms as $option_slug => $option ):
5469 $selected = ( $title_text_transform == $option_slug ) ? 'selected' : '';
5470 ?>
5471 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5472 <?php
5473 endforeach;
5474 ?>
5475 </select>
5476 </div>
5477 </div> <!-- Title text transform -->
5478 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5479 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5480 <label for="ays-chart-option-title-letter-spacing" class="form-label">
5481 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5482 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart title letters.","chart-builder") ); ?>">
5483 <i class="ays_fa ays_fa_info_circle"></i>
5484 </a>
5485 </label>
5486 </div>
5487 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5488 <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) ?>">
5489 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5490 </div>
5491 </div> <!-- Chart title letter spacing -->
5492 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5493 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5494 <label for="ays-chart-option-title-text-decoration">
5495 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5496 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart title.","chart-builder") ); ?>">
5497 <i class="ays_fa ays_fa_info_circle"></i>
5498 </a>
5499 </label>
5500 </div>
5501 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5502 <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]">
5503 <?php
5504 foreach ( $text_decorations as $option_slug => $option ):
5505 $selected = ( $title_text_decoration == $option_slug ) ? 'selected' : '';
5506 ?>
5507 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5508 <?php
5509 endforeach;
5510 ?>
5511 </select>
5512 </div>
5513 </div> <!-- Title text decoration -->
5514 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5515 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5516 <label for="ays-chart-option-title-text-shadow" class="form-label">
5517 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5518 <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") ); ?>">
5519 <i class="ays_fa ays_fa_info_circle"></i>
5520 </a>
5521 </label>
5522 </div>
5523 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5524 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5525 <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); ?> >
5526 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5527 </label>
5528 </div>
5529 </div> <!-- Title bold -->
5530 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5531 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5532 <label for="ays-chart-option-title-shadow-color">
5533 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5534 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart title.","chart-builder") ); ?>">
5535 <i class="ays_fa ays_fa_info_circle"></i>
5536 </a>
5537 </label>
5538 </div>
5539 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5540 <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) ?>">
5541 </div>
5542 </div> <!-- Chart title color -->
5543 </div>
5544 </div>
5545 <?php
5546 $content = ob_get_clean();
5547
5548 $title = __( 'Title', "chart-builder" );
5549
5550 $sources['title'] = array(
5551 'content' => $content,
5552 'title' => $title
5553 );
5554
5555 return $sources;
5556 }
5557
5558 public function settings_contents_description_styles_settings( $sources, $args ){
5559 $html_class_prefix = $args['html_class_prefix'];
5560 $html_name_prefix = $args['html_name_prefix'];
5561 $settings = $args['settings'];
5562
5563 $description_color = $settings['description_color'];
5564 $description_font_size = $settings['description_font_size'];
5565 $title_positions = $settings['title_positions'];
5566 $description_position = $settings['description_position'];
5567 $description_bold = $settings['description_bold'];
5568 $description_text_shadow = $settings['description_text_shadow'];
5569 $description_shadow_color = $settings['description_shadow_color'];
5570 $description_italic = $settings['description_italic'];
5571 $text_transforms = $settings['text_transforms'];
5572 $text_decorations = $settings['text_decorations'];
5573 $description_text_transform = $settings['description_text_transform'];
5574 $description_text_decoration = $settings['description_text_decoration'];
5575 $description_letter_spacing = $settings['description_letter_spacing'];
5576
5577 ob_start();
5578 ?>
5579 <div class="ays-accordion-data-main-wrap">
5580 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5581 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5582 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5583 <label for="ays-chart-option-description-color">
5584 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5585 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart description.","chart-builder") ); ?>">
5586 <i class="ays_fa ays_fa_info_circle"></i>
5587 </a>
5588 </label>
5589 </div>
5590 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5591 <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) ?>">
5592 </div>
5593 </div> <!-- Chart description color -->
5594 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5595 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5596 <label for="ays-chart-option-description-font-size" class="form-label">
5597 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5598 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart description.","chart-builder") ); ?>">
5599 <i class="ays_fa ays_fa_info_circle"></i>
5600 </a>
5601 </label>
5602 </div>
5603 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5604 <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) ?>">
5605 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5606 </div>
5607 </div> <!-- Chart description font size -->
5608 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5609 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5610 <label for="ays-chart-option-description-bold" class="form-label">
5611 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5612 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
5613 <i class="ays_fa ays_fa_info_circle"></i>
5614 </a>
5615 </label>
5616 </div>
5617 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5618 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5619 <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); ?> >
5620 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5621 </label>
5622 </div>
5623 </div> <!-- Description bold -->
5624 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5625 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5626 <label for="ays-chart-option-description-italic" class="form-label">
5627 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5628 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
5629 <i class="ays_fa ays_fa_info_circle"></i>
5630 </a>
5631 </label>
5632 </div>
5633 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5634 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5635 <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); ?> >
5636 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5637 </label>
5638 </div>
5639 </div> <!-- Description italic -->
5640 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5641 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5642 <label for="ays-chart-option-description-position">
5643 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5644 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart description.","chart-builder") ); ?>">
5645 <i class="ays_fa ays_fa_info_circle"></i>
5646 </a>
5647 </label>
5648 </div>
5649 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5650 <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]">
5651 <?php
5652 foreach ( $title_positions as $option_slug => $option ):
5653 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
5654 ?>
5655 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5656 <?php
5657 endforeach;
5658 ?>
5659 </select>
5660 </div>
5661 </div> <!-- Description position -->
5662 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5663 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5664 <label for="ays-chart-option-description-text-transform">
5665 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5666 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5667 <i class="ays_fa ays_fa_info_circle"></i>
5668 </a>
5669 </label>
5670 </div>
5671 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5672 <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]">
5673 <?php
5674 foreach ( $text_transforms as $option_slug => $option ):
5675 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
5676 ?>
5677 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5678 <?php
5679 endforeach;
5680 ?>
5681 </select>
5682 </div>
5683 </div> <!-- description text transform -->
5684 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5685 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5686 <label for="ays-chart-option-description-letter-spacing" class="form-label">
5687 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5688 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
5689 <i class="ays_fa ays_fa_info_circle"></i>
5690 </a>
5691 </label>
5692 </div>
5693 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5694 <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) ?>">
5695 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5696 </div>
5697 </div> <!-- Chart description letter spacing -->
5698 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5699 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5700 <label for="ays-chart-option-description-text-decoration">
5701 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5702 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5703 <i class="ays_fa ays_fa_info_circle"></i>
5704 </a>
5705 </label>
5706 </div>
5707 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5708 <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]">
5709 <?php
5710 foreach ( $text_decorations as $option_slug => $option ):
5711 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
5712 ?>
5713 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5714 <?php
5715 endforeach;
5716 ?>
5717 </select>
5718 </div>
5719 </div> <!-- description text decoration -->
5720 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5721 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5722 <label for="ays-chart-option-description-text-shadow" class="form-label">
5723 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5724 <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") ); ?>">
5725 <i class="ays_fa ays_fa_info_circle"></i>
5726 </a>
5727 </label>
5728 </div>
5729 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5730 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5731 <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); ?> >
5732 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5733 </label>
5734 </div>
5735 </div> <!-- description bold -->
5736 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5737 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5738 <label for="ays-chart-option-description-shadow-color">
5739 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5740 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart description.","chart-builder") ); ?>">
5741 <i class="ays_fa ays_fa_info_circle"></i>
5742 </a>
5743 </label>
5744 </div>
5745 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5746 <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) ?>">
5747 </div>
5748 </div> <!-- Chart title color -->
5749 </div>
5750 </div>
5751 <?php
5752 $content = ob_get_clean();
5753
5754 $title = __( 'Description', "chart-builder" );
5755
5756 $sources['description'] = array(
5757 'content' => $content,
5758 'title' => $title
5759 );
5760
5761 return $sources;
5762 }
5763
5764 public function settings_contents_description_styles_settings_chartjs( $sources, $args ){
5765 $html_class_prefix = $args['html_class_prefix'];
5766 $html_name_prefix = $args['html_name_prefix'];
5767 $settings = $args['settings'];
5768
5769 $description_color = $settings['description_color'];
5770 $description_font_size = $settings['description_font_size'];
5771 $title_positions = $settings['title_positions'];
5772 $description_position = $settings['description_position'];
5773 $description_bold = $settings['description_bold'];
5774 $description_text_shadow = $settings['description_text_shadow'];
5775 $description_shadow_color = $settings['description_shadow_color'];
5776 $description_italic = $settings['description_italic'];
5777 $text_transforms = $settings['text_transforms'];
5778 $text_decorations = $settings['text_decorations'];
5779 $description_text_transform = $settings['description_text_transform'];
5780 $description_text_decoration = $settings['description_text_decoration'];
5781 $description_letter_spacing = $settings['description_letter_spacing'];
5782
5783 ob_start();
5784 ?>
5785 <div class="ays-accordion-data-main-wrap">
5786 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
5787 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5788 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5789 <label for="ays-chart-option-description-color">
5790 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
5791 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color of the chart description.","chart-builder") ); ?>">
5792 <i class="ays_fa ays_fa_info_circle"></i>
5793 </a>
5794 </label>
5795 </div>
5796 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5797 <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) ?>">
5798 </div>
5799 </div> <!-- Chart description color -->
5800 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5801 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5802 <label for="ays-chart-option-description-font-size" class="form-label">
5803 <?php echo esc_html(__( "Font size", "chart-builder" )); ?>
5804 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The font size of the chart description.","chart-builder") ); ?>">
5805 <i class="ays_fa ays_fa_info_circle"></i>
5806 </a>
5807 </label>
5808 </div>
5809 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5810 <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) ?>">
5811 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5812 </div>
5813 </div> <!-- Chart description font size -->
5814 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5815 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5816 <label for="ays-chart-option-description-bold" class="form-label">
5817 <?php echo esc_html(__( "Bold text", "chart-builder" )); ?>
5818 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text bold.","chart-builder") ); ?>">
5819 <i class="ays_fa ays_fa_info_circle"></i>
5820 </a>
5821 </label>
5822 </div>
5823 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5824 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5825 <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); ?> >
5826 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5827 </label>
5828 </div>
5829 </div> <!-- Description bold -->
5830 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5831 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5832 <label for="ays-chart-option-description-italic" class="form-label">
5833 <?php echo esc_html(__( "Italic text", "chart-builder" )); ?>
5834 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Tick this option to make the chart description text italic.","chart-builder") ); ?>">
5835 <i class="ays_fa ays_fa_info_circle"></i>
5836 </a>
5837 </label>
5838 </div>
5839 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5840 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5841 <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); ?> >
5842 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5843 </label>
5844 </div>
5845 </div> <!-- Description italic -->
5846 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5847 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5848 <label for="ays-chart-option-description-position">
5849 <?php echo esc_html(__( "Position", "chart-builder" )); ?>
5850 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The position of the chart description.","chart-builder") ); ?>">
5851 <i class="ays_fa ays_fa_info_circle"></i>
5852 </a>
5853 </label>
5854 </div>
5855 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5856 <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]">
5857 <?php
5858 foreach ( $title_positions as $option_slug => $option ):
5859 $selected = ( $description_position == $option_slug ) ? 'selected' : '';
5860 ?>
5861 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5862 <?php
5863 endforeach;
5864 ?>
5865 </select>
5866 </div>
5867 </div> <!-- Description position -->
5868 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5869 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5870 <label for="ays-chart-option-description-text-transform">
5871 <?php echo esc_html(__( "Text-transform", "chart-builder" )); ?>
5872 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5873 <i class="ays_fa ays_fa_info_circle"></i>
5874 </a>
5875 </label>
5876 </div>
5877 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5878 <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]">
5879 <?php
5880 foreach ( $text_transforms as $option_slug => $option ):
5881 $selected = ( $description_text_transform == $option_slug ) ? 'selected' : '';
5882 ?>
5883 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5884 <?php
5885 endforeach;
5886 ?>
5887 </select>
5888 </div>
5889 </div> <!-- description text transform -->
5890 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5891 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5892 <label for="ays-chart-option-description-letter-spacing" class="form-label">
5893 <?php echo esc_html(__( "Letter spacing", "chart-builder" )); ?>
5894 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify the space between the chart description letters.","chart-builder") ); ?>">
5895 <i class="ays_fa ays_fa_info_circle"></i>
5896 </a>
5897 </label>
5898 </div>
5899 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5900 <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) ?>">
5901 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
5902 </div>
5903 </div> <!-- Chart description letter spacing -->
5904 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5905 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5906 <label for="ays-chart-option-description-text-decoration">
5907 <?php echo esc_html(__( "Text-decoration", "chart-builder" )); ?>
5908 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Specify how to capitalize the text of the chart description.","chart-builder") ); ?>">
5909 <i class="ays_fa ays_fa_info_circle"></i>
5910 </a>
5911 </label>
5912 </div>
5913 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
5914 <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]">
5915 <?php
5916 foreach ( $text_decorations as $option_slug => $option ):
5917 $selected = ( $description_text_decoration == $option_slug ) ? 'selected' : '';
5918 ?>
5919 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
5920 <?php
5921 endforeach;
5922 ?>
5923 </select>
5924 </div>
5925 </div> <!-- description text decoration -->
5926 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5927 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5928 <label for="ays-chart-option-description-text-shadow" class="form-label">
5929 <?php echo esc_html(__( "Text shadow", "chart-builder" )); ?>
5930 <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") ); ?>">
5931 <i class="ays_fa ays_fa_info_circle"></i>
5932 </a>
5933 </label>
5934 </div>
5935 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5936 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
5937 <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); ?> >
5938 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
5939 </label>
5940 </div>
5941 </div> <!-- description bold -->
5942 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
5943 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
5944 <label for="ays-chart-option-description-shadow-color">
5945 <?php echo esc_html(__( "Text Shadow Color", "chart-builder" )); ?>
5946 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The text shadow color of the chart description.","chart-builder") ); ?>">
5947 <i class="ays_fa ays_fa_info_circle"></i>
5948 </a>
5949 </label>
5950 </div>
5951 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
5952 <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) ?>">
5953 </div>
5954 </div> <!-- Chart title color -->
5955 </div>
5956 </div>
5957 <?php
5958 $content = ob_get_clean();
5959
5960 $title = __( 'Description', "chart-builder" );
5961
5962 $sources['description'] = array(
5963 'content' => $content,
5964 'title' => $title
5965 );
5966
5967 return $sources;
5968 }
5969
5970 /**
5971 * Chart page settings contents
5972 * @param $args
5973 */
5974 public function ays_chart_page_advanced_settings_contents( $args ){
5975 $chart_source_type = $args['chart_source_type'];
5976
5977 if ($chart_source_type === 'chart-js') {
5978 if ($args['source_chart_type'] !== 'pie_chart') {return;}
5979 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings_chartjs', array(), $args );
5980 } else {
5981 $sources_contents = apply_filters( 'ays_cb_chart_page_advanced_settings_contents_settings', array(), $args );
5982 }
5983
5984 $sources = array();
5985 foreach ( $sources_contents as $key => $sources_content ) {
5986 $collapsed = $key == 'advanced_settings' ? 'false' : 'true';
5987
5988 $content = '<fieldset class="ays-accordion-options-container" data-collapsed="' . $collapsed . '">';
5989 if(isset($sources_content['title'])){
5990 $content .= '<legend class="ays-accordion-options-header">';
5991 $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">
5992 <g>
5993 <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" />
5994 </g>
5995 </svg>';
5996
5997 $content .= '<span>'. esc_html($sources_content['title']) .'</span></legend>';
5998 }
5999
6000 $content .= '<div class="ays-accordion-options-content">';
6001 $content .= $sources_content['content'];
6002 $content .= '</div>';
6003
6004 $content .= '</fieldset>';
6005
6006 $sources[] = $content;
6007 }
6008 $content_for_escape = implode('' , $sources );
6009 echo html_entity_decode(esc_html( $content_for_escape ));
6010 }
6011
6012 public function settings_contents_advanced_settings( $sources, $args ){
6013 $html_class_prefix = $args['html_class_prefix'];
6014 $html_name_prefix = $args['html_name_prefix'];
6015 $settings = $args['settings'];
6016 $tab_title = $args['tab_name'];
6017
6018 $rotation_degree = $settings['rotation_degree'];
6019 $reverse_categories = $settings['reverse_categories'];
6020 $slice_border_color = $settings['slice_border_color'];
6021 $slice_texts = $settings['slice_texts'];
6022 $slice_text = $settings['slice_text'];
6023 $tooltip_text_options = $settings['tooltip_text_options'];
6024 $tooltip_text = $settings['tooltip_text'];
6025 $is_stacked = $settings['is_stacked'];
6026 $focus_target_options = $settings['focus_target_options'];
6027 $focus_target = $settings['focus_target'];
6028 $multiple_data_format_options = $settings['multiple_data_format_options'];
6029 $multiple_data_format = $settings['multiple_data_format'];
6030 $opacity = $settings['opacity'];
6031 $group_width = $settings['group_width'];
6032 $group_width_format = $settings['group_width_format'];
6033 $group_width_format_options = $settings['group_width_format_options'];
6034 $line_width = $settings['line_width'];
6035 $data_grouping_limit = $settings['data_grouping_limit'];
6036 $data_grouping_label = $settings['data_grouping_label'];
6037 $data_grouping_color = $settings['data_grouping_color'];
6038 $multiple_selection = $settings['multiple_selection'];
6039 $point_shape_options = $settings['point_shape_options'];
6040 $point_shape = $settings['point_shape'];
6041 $crosshair_trigger_options = $settings['crosshair_trigger_options'];
6042 $crosshair_trigger = $settings['crosshair_trigger'];
6043 $crosshair_orientation_options = $settings['crosshair_orientation_options'];
6044 $crosshair_orientation = $settings['crosshair_orientation'];
6045 $crosshair_opacity = $settings['crosshair_opacity'];
6046 $dash_style = $settings['dash_style'];
6047 $point_size = $settings['point_size'];
6048 $donut_hole_size = $settings['donut_hole_size'];
6049 $orientation = $settings['orientation'];
6050 $fill_nulls = $settings['fill_nulls'];
6051 $allow_collapse = $settings['allow_collapse'];
6052 $org_classname = $settings['org_classname'];
6053 $org_node_background_color = $settings['org_node_background_color'];
6054 $org_node_padding = $settings['org_node_padding'];
6055 $org_node_border_radius = $settings['org_node_border_radius'];
6056 $org_node_border_width = $settings['org_node_border_width'];
6057 $org_node_border_color = $settings['org_node_border_color'];
6058 $org_node_text_color = $settings['org_node_text_color'];
6059 $org_node_text_font_size = $settings['org_node_text_font_size'];
6060 $org_node_description_font_color = $settings['org_node_description_font_color'];
6061 $org_node_description_font_size = $settings['org_node_description_font_size'];
6062 $org_selected_classname = $settings['org_selected_classname'];
6063 $org_selected_node_background_color = $settings['org_selected_node_background_color'];
6064 $org_selected_node_text_color = $settings['org_selected_node_text_color'];
6065
6066 ob_start();
6067 ?>
6068 <div class="ays-accordion-data-main-wrap">
6069 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
6070 <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">
6071 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6072 <label for="ays-chart-option-rotation-degree" class="form-label">
6073 <?php echo esc_html(__( "Degree of chart rotation", "chart-builder" )); ?>
6074 <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") ); ?>">
6075 <i class="ays_fa ays_fa_info_circle"></i>
6076 </a>
6077 </label>
6078 </div>
6079 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6080 <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) ?>">
6081 </div>
6082 </div> <!-- Rotation degree -->
6083 <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">
6084 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6085 <label for="ays-chart-option-reverse-categories">
6086 <?php echo esc_html(__( "Reverse Categories", "chart-builder" )); ?>
6087 <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") ); ?>">
6088 <i class="ays_fa ays_fa_info_circle"></i>
6089 </a>
6090 </label>
6091 </div>
6092 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6093 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6094 <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); ?> >
6095 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6096 </label>
6097 </div>
6098 </div> <!-- Reverse Categories -->
6099 <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">
6100 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6101 <label for="ays-chart-option-slice-border-color">
6102 <?php echo esc_html(__( "Slice Border Color", "chart-builder" )); ?>
6103 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The color of the slice borders.","chart-builder") ); ?>">
6104 <i class="ays_fa ays_fa_info_circle"></i>
6105 </a>
6106 </label>
6107 </div>
6108 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6109 <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) ?>">
6110 </div>
6111 </div> <!-- Slice border color -->
6112 <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">
6113 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6114 <label for="ays-chart-option-slice-text">
6115 <?php echo esc_html(__( "Slice text", "chart-builder" )); ?>
6116 <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") ); ?>">
6117 <i class="ays_fa ays_fa_info_circle"></i>
6118 </a>
6119 </label>
6120 </div>
6121 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6122 <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]">
6123 <?php
6124 foreach ( $slice_texts as $option_slug => $option ):
6125 $selected = ( $slice_text == $option_slug ) ? 'selected' : '';
6126 ?>
6127 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6128 <?php
6129 endforeach;
6130 ?>
6131 </select>
6132 </div>
6133 </div> <!-- Slice text -->
6134 <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">
6135 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6136 <label for="ays-chart-option-tooltip-text">
6137 <?php echo esc_html(__( "Slice tooltip text", "chart-builder" )); ?>
6138 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("Choose how to display the text in the chart tooltip.","chart-builder") ); ?>">
6139 <i class="ays_fa ays_fa_info_circle"></i>
6140 </a>
6141 </label>
6142 </div>
6143 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6144 <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]">
6145 <?php
6146 foreach ( $tooltip_text_options as $option_slug => $option ):
6147 $selected = ( $tooltip_text == $option_slug ) ? 'selected' : '';
6148 ?>
6149 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6150 <?php
6151 endforeach;
6152 ?>
6153 </select>
6154 </div>
6155 </div> <!-- Slice tooltip Text -->
6156 <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">
6157 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6158 <label for="ays-chart-option-data-grouping-limit" class="form-label">
6159 <?php echo esc_html(__( "Chart Data Grouping Limit", "chart-builder" )); ?>
6160 <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") ); ?>">
6161 <i class="ays_fa ays_fa_info_circle"></i>
6162 </a>
6163 </label>
6164 </div>
6165 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6166 <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">
6167 </div>
6168 </div> <!-- Data Grouping Limit -->
6169 <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">
6170 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6171 <label for="ays-chart-option-data-grouping-label" class="form-label">
6172 <?php echo esc_html(__( "Chart Data Grouping Label", "chart-builder" )); ?>
6173 <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") ); ?>">
6174 <i class="ays_fa ays_fa_info_circle"></i>
6175 </a>
6176 </label>
6177 </div>
6178 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6179 <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) ?>">
6180 </div>
6181 </div> <!-- Data Grouping Label -->
6182 <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">
6183 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6184 <label for="ays-chart-option-data-grouping-color">
6185 <?php echo esc_html(__( "Chart Data Grouping Color", "chart-builder" )); ?>
6186 <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") ); ?>">
6187 <i class="ays_fa ays_fa_info_circle"></i>
6188 </a>
6189 </label>
6190 </div>
6191 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6192 <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) ?>">
6193 </div>
6194 </div> <!-- Data Grouping Color -->
6195 <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">
6196 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6197 <label for="ays-chart-option-is-stacked">
6198 <?php echo esc_html(__( "Is stacked", "chart-builder" )); ?>
6199 <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") ); ?>">
6200 <i class="ays_fa ays_fa_info_circle"></i>
6201 </a>
6202 </label>
6203 </div>
6204 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6205 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6206 <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); ?> >
6207 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6208 </label>
6209 </div>
6210 </div> <!-- Is stacked -->
6211 <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">
6212 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6213 <label for="ays-chart-option-focus-target">
6214 <?php echo esc_html(__( "Focus target", "chart-builder" )); ?>
6215 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6216 echo htmlspecialchars( sprintf(
6217 "<p>" . __('There are two ways to focus the data table elements.', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6218 __('%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>" .
6219 __('%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>",
6220 '<em>',
6221 '</em>',
6222 '<em>',
6223 '</em>'
6224 ) );
6225 ?>">
6226 <i class="ays_fa ays_fa_info_circle"></i>
6227 </a>
6228 </label>
6229 </div>
6230 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6231 <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]">
6232 <?php
6233 foreach ( $focus_target_options as $option_slug => $option ):
6234 $selected = ( $focus_target == $option_slug ) ? 'selected' : '';
6235 ?>
6236 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6237 <?php
6238 endforeach;
6239 ?>
6240 </select>
6241 </div>
6242 </div> <!-- Focus target -->
6243 <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">
6244 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6245 <label for="ays-chart-option-opacity" class="form-label">
6246 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
6247 <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") ); ?>">
6248 <i class="ays_fa ays_fa_info_circle"></i>
6249 </a>
6250 </label>
6251 </div>
6252 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6253 <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">
6254 </div>
6255 </div> <!-- Data opacity -->
6256 <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">
6257 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6258 <label for="ays-chart-option-group-width">
6259 <?php echo esc_html(__( "Bar width", "chart-builder" )); ?>
6260 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6261 echo htmlspecialchars( sprintf(
6262 "<p>" . __('The width of the bars, specified in either of these formats:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6263 __('%sPixels:%s Set the width of the bars in pixels.', "chart-builder") . "</li><li>" .
6264 __('%sPercentage:%s Set the width of the bars in percentage.', "chart-builder") . "</li></ul>",
6265 '<em>',
6266 '</em>',
6267 '<em>',
6268 '</em>'
6269 ) );
6270 ?>">
6271 <i class="ays_fa ays_fa_info_circle"></i>
6272 </a>
6273 </label>
6274 </div>
6275 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6276 <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) ?>">
6277 <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]">
6278 <?php
6279 foreach ( $group_width_format_options as $option_slug => $option ):
6280 $selected = ( $group_width_format == $option_slug ) ? 'selected' : '';
6281 ?>
6282 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6283 <?php
6284 endforeach;
6285 ?>
6286 </select>
6287 </div>
6288 </div> <!-- Bars width -->
6289 <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">
6290 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6291 <label for="ays-chart-option-line-width" class="form-label">
6292 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
6293 <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") ); ?>">
6294 <i class="ays_fa ays_fa_info_circle"></i>
6295 </a>
6296 </label>
6297 </div>
6298 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6299 <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) ?>">
6300 </div>
6301 </div> <!-- Line width -->
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-multiple-selection">
6305 <?php echo esc_html(__( "Multiple data selection", "chart-builder" )); ?>
6306 <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") ); ?>">
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-multiple-selection" type="checkbox" name="<?php echo esc_attr($html_name_prefix); ?>settings[multiple_selection]" value="on" <?php echo esc_attr($multiple_selection); ?> >
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> <!-- Multiple data selection -->
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-multiple-data-format">
6321 <?php echo esc_html(__( "Multiple data format", "chart-builder" )); ?>
6322 <a class="ays_help" data-bs-toggle="tooltip" data-bs-html="true" title="<?php
6323 echo htmlspecialchars( sprintf(
6324 "<p>" . __('How multiple data selections are rolled up into tooltips:', "chart-builder") . "</p><ul class='ays_tooltop_ul'><li>" .
6325 __('%sCategory:%s Group selected data by row titles.', "chart-builder") . "</li><li>" .
6326 __('%sSeries:%s Group selected data by column titles.', "chart-builder") . "</li><li>" .
6327 __('%sAuto:%s Group selected data by row titles, if they have the same titles or by column titles', "chart-builder") . "</li><li>" .
6328 __('%sNone:%s Show only one tooltip per selection.', "chart-builder") . "</li></ul>",
6329 '<em>',
6330 '</em>',
6331 '<em>',
6332 '</em>',
6333 '<em>',
6334 '</em>',
6335 '<em>',
6336 '</em>'
6337 ) );
6338 ?>">
6339 <i class="ays_fa ays_fa_info_circle"></i>
6340 </a>
6341 </label>
6342 </div>
6343 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6344 <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]">
6345 <?php
6346 foreach ( $multiple_data_format_options as $option_slug => $option ):
6347 $selected = ( $multiple_data_format == $option_slug ) ? 'selected' : '';
6348 ?>
6349 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6350 <?php
6351 endforeach;
6352 ?>
6353 </select>
6354 </div>
6355 </div> <!-- Multiple data format -->
6356 <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">
6357 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6358 <label for="ays-chart-option-point-shape">
6359 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
6360 <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") ); ?>">
6361 <i class="ays_fa ays_fa_info_circle"></i>
6362 </a>
6363 </label>
6364 </div>
6365 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6366 <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]">
6367 <?php
6368 foreach ( $point_shape_options as $option_slug => $option ):
6369 $selected = ( $point_shape == $option_slug ) ? 'selected' : '';
6370 ?>
6371 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6372 <?php
6373 endforeach;
6374 ?>
6375 </select>
6376 </div>
6377 </div> <!-- Point shape -->
6378 <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">
6379 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6380 <label for="ays-chart-option-point-size" class="form-label">
6381 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
6382 <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") ); ?>">
6383 <i class="ays_fa ays_fa_info_circle"></i>
6384 </a>
6385 </label>
6386 </div>
6387 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6388 <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) ?>">
6389 </div>
6390 </div> <!-- Point size -->
6391 <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">
6392 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6393 <label for="ays-chart-option-orientation">
6394 <?php echo esc_html(__( "Rotate Vertical", "chart-builder" )); ?>
6395 <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") ); ?>">
6396 <i class="ays_fa ays_fa_info_circle"></i>
6397 </a>
6398 </label>
6399 </div>
6400 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6401 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6402 <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); ?> >
6403 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6404 </label>
6405 </div>
6406 </div> <!-- Orientation -->
6407 <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">
6408 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6409 <label for="ays-chart-option-fill-nulls">
6410 <?php echo esc_html(__( "Autofill nulls", "chart-builder" )); ?>
6411 <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") ); ?>">
6412 <i class="ays_fa ays_fa_info_circle"></i>
6413 </a>
6414 </label>
6415 </div>
6416 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6417 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6418 <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); ?> >
6419 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6420 </label>
6421 </div>
6422 </div> <!-- Autofill nulls -->
6423 <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">
6424 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6425 <label for="ays-chart-option-crosshair-trigger">
6426 <?php echo esc_html(__( "Crosshair trigger", "chart-builder" )); ?>
6427 <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") ); ?>">
6428 <i class="ays_fa ays_fa_info_circle"></i>
6429 </a>
6430 </label>
6431 </div>
6432 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6433 <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]">
6434 <?php
6435 foreach ( $crosshair_trigger_options as $option_slug => $option ):
6436 $selected = ( $crosshair_trigger == $option_slug ) ? 'selected' : '';
6437 ?>
6438 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6439 <?php
6440 endforeach;
6441 ?>
6442 </select>
6443 </div>
6444 </div> <!-- Crosshair trigger -->
6445 <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">
6446 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6447 <label for="ays-chart-option-crosshair-orientation">
6448 <?php echo esc_html(__( "Crosshair orientation", "chart-builder" )); ?>
6449 <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") ); ?>">
6450 <i class="ays_fa ays_fa_info_circle"></i>
6451 </a>
6452 </label>
6453 </div>
6454 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6455 <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]">
6456 <?php
6457 foreach ( $crosshair_orientation_options as $option_slug => $option ):
6458 $selected = ( $crosshair_orientation == $option_slug ) ? 'selected' : '';
6459 ?>
6460 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
6461 <?php
6462 endforeach;
6463 ?>
6464 </select>
6465 </div>
6466 </div> <!-- Crosshair orientation -->
6467 <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">
6468 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6469 <label for="ays-chart-option-crosshair-opacity" class="form-label">
6470 <?php echo esc_html(__( "Crosshair opacity", "chart-builder" )); ?>
6471 <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") ); ?>">
6472 <i class="ays_fa ays_fa_info_circle"></i>
6473 </a>
6474 </label>
6475 </div>
6476 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6477 <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">
6478 </div>
6479 </div> <!-- Crosshair opacity -->
6480 <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">
6481 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6482 <label for="ays-chart-option-dash-style" class="form-label">
6483 <?php echo esc_html(__( "Dash Pattern", "chart-builder" )); ?>
6484 <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") ); ?>">
6485 <i class="ays_fa ays_fa_info_circle"></i>
6486 </a>
6487 </label>
6488 </div>
6489 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6490 <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) ?>">
6491 </div>
6492 </div> <!-- Line dash pattern -->
6493 <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">
6494 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
6495 <label for="ays-chart-option-donut-hole-size">
6496 <?php echo __( "Hole size", $this->plugin_name ); ?>
6497 </label>
6498 </div>
6499 <div class="col-sm-7 <?= $html_class_prefix ?>input-align-right <?= $html_class_prefix ?>option-input">
6500 <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 ?>">
6501 </div>
6502 </div> <!-- Donut hole size -->
6503 <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">
6504 <div class="ays-pro-features-v2-small-buttons-box-middle ays-pro-features-v2-big-buttons-box">
6505 <div class="ays-pro-features-v2-video-button"></div>
6506 <a href="https://ays-pro.com/wordpress/chart-builder" target="_blank" class="ays-pro-features-v2-upgrade-button">
6507 <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>
6508 <div class="ays-pro-features-v2-upgrade-text">
6509 <?php echo __("Upgrade" , "chart-builder"); ?>
6510 </div>
6511 </a>
6512 </div>
6513 <div class="col-sm-5 d-flex align-items-center <?= $html_class_prefix ?>option-title">
6514 <label for="ays-chart-option-curve-type">
6515 <?php echo __( "Line curve type", "chart-builder" ); ?>
6516 </label>
6517 </div>
6518 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6519 <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]">
6520 <option><?php echo __( "Straight", "chart-builder" ); ?></option>
6521 </select>
6522 </div>
6523 </div> <!-- Line curve type -->
6524 <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">
6525 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6526 <label for="ays-chart-option-allow-collapse">
6527 <?php echo esc_html(__( "Allow collapse", "chart-builder" )); ?>
6528 <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") ); ?>">
6529 <i class="ays_fa ays_fa_info_circle"></i>
6530 </a>
6531 </label>
6532 </div>
6533 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6534 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6535 <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); ?> >
6536 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6537 </label>
6538 </div>
6539 </div> <!-- Allow collapse -->
6540 <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">
6541 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6542 <label for="ays-chart-option-org-node-description-font-color">
6543 <?php echo esc_html(__( "Description color", "chart-builder" )); ?>
6544 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description text color of the node.","chart-builder") ); ?>">
6545 <i class="ays_fa ays_fa_info_circle"></i>
6546 </a>
6547 </label>
6548 </div>
6549 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6550 <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) ?>">
6551 </div>
6552 </div> <!-- Org Node Description color -->
6553 <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">
6554 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6555 <label for="ays-chart-option-org-node-description-font-size" class="form-label">
6556 <?php echo esc_html(__( "Description font size", "chart-builder" )); ?>
6557 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Description font size of the node.","chart-builder") ); ?>">
6558 <i class="ays_fa ays_fa_info_circle"></i>
6559 </a>
6560 </label>
6561 </div>
6562 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6563 <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) ?>">
6564 </div>
6565 </div> <!-- Org Node Description font size -->
6566 <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">
6567 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6568 <label for="ays-chart-option-org-classname" class="form-label">
6569 <?php echo esc_html(__( "Custom CSS class", "chart-builder" )); ?>
6570 <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") ); ?>">
6571 <i class="ays_fa ays_fa_info_circle"></i>
6572 </a>
6573 </label>
6574 </div>
6575 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6576 <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) ?>">
6577 </div>
6578 </div> <!-- Org custom class -->
6579 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
6580 <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">
6581 <br>
6582 <blockquote>
6583 <?php echo sprintf(__( "%sNote:%s Custom CSS class must be set for the options below to take effect.", $this->plugin_name ), '<strong>', '</strong>'); ?>
6584 </blockquote>
6585 <br>
6586 </div>
6587 <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">
6588 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6589 <label for="ays-chart-option-org-node-background-color">
6590 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
6591 <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") ); ?>">
6592 <i class="ays_fa ays_fa_info_circle"></i>
6593 </a>
6594 </label>
6595 </div>
6596 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6597 <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) ?>">
6598 </div>
6599 </div> <!-- Org Node Background color -->
6600 <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">
6601 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6602 <label for="ays-chart-option-org-node-padding" class="form-label">
6603 <?php echo esc_html(__( "Padding", "chart-builder" )); ?>
6604 <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") ); ?>">
6605 <i class="ays_fa ays_fa_info_circle"></i>
6606 </a>
6607 </label>
6608 </div>
6609 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6610 <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) ?>">
6611 </div>
6612 </div> <!-- Org Node Padding -->
6613 <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">
6614 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6615 <label for="ays-chart-option-org-node-border-radius" class="form-label">
6616 <?php echo esc_html(__( "Border radius", "chart-builder" )); ?>
6617 <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") ); ?>">
6618 <i class="ays_fa ays_fa_info_circle"></i>
6619 </a>
6620 </label>
6621 </div>
6622 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6623 <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) ?>">
6624 </div>
6625 </div> <!-- Org Node Border radius -->
6626 <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">
6627 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6628 <label for="ays-chart-option-org-node-border-width" class="form-label">
6629 <?php echo esc_html(__( "Border width", "chart-builder" )); ?>
6630 <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") ); ?>">
6631 <i class="ays_fa ays_fa_info_circle"></i>
6632 </a>
6633 </label>
6634 </div>
6635 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6636 <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) ?>">
6637 </div>
6638 </div> <!-- Org Node Border width -->
6639 <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">
6640 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6641 <label for="ays-chart-option-org-node-border-color">
6642 <?php echo esc_html(__( "Border color", "chart-builder" )); ?>
6643 <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") ); ?>">
6644 <i class="ays_fa ays_fa_info_circle"></i>
6645 </a>
6646 </label>
6647 </div>
6648 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6649 <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) ?>">
6650 </div>
6651 </div> <!-- Org Node Background color -->
6652 <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">
6653 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6654 <label for="ays-chart-option-org-node-text-color">
6655 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6656 <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") ); ?>">
6657 <i class="ays_fa ays_fa_info_circle"></i>
6658 </a>
6659 </label>
6660 </div>
6661 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6662 <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) ?>">
6663 </div>
6664 </div> <!-- Org Node Text color -->
6665 <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">
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-org-node-text-font-size" class="form-label">
6668 <?php echo esc_html(__( "Text font size", "chart-builder" )); ?>
6669 <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") ); ?>">
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 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6675 <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) ?>">
6676 </div>
6677 </div> <!-- Org Node Text font size -->
6678 </div> <!-- Org custom class options -->
6679 <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">
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-org-selected-classname" class="form-label">
6682 <?php echo esc_html(__( "Selected node custom CSS class", "chart-builder" )); ?>
6683 <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") ); ?>">
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-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) ?>">
6690 </div>
6691 </div> <!-- Org custom selected class -->
6692 <div class="form-group mb-2 cb-changable-opt cb-org_chart-opt display_none">
6693 <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">
6694 <br>
6695 <blockquote>
6696 <?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>'); ?>
6697 </blockquote>
6698 <br>
6699 </div>
6700 <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">
6701 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6702 <label for="ays-chart-option-org-selected-node-background-color">
6703 <?php echo esc_html(__( "Background color", "chart-builder" )); ?>
6704 <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") ); ?>">
6705 <i class="ays_fa ays_fa_info_circle"></i>
6706 </a>
6707 </label>
6708 </div>
6709 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6710 <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) ?>">
6711 </div>
6712 </div> <!-- Org selected Node Background color -->
6713 <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">
6714 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6715 <label for="ays-chart-option-org-selected-node-text-color">
6716 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6717 <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") ); ?>">
6718 <i class="ays_fa ays_fa_info_circle"></i>
6719 </a>
6720 </label>
6721 </div>
6722 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6723 <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) ?>">
6724 </div>
6725 </div> <!-- Org selected Node text color -->
6726 </div> <!-- Org custom selected class options -->
6727 </div>
6728 </div>
6729 <?php
6730 $content = ob_get_clean();
6731
6732 $sources['advanced_settings'] = array(
6733 'content' => $content,
6734 'title' => $tab_title
6735 );
6736
6737 return $sources;
6738 }
6739
6740 public function settings_contents_advanced_settings_chartjs( $sources, $args ){
6741 $html_class_prefix = $args['html_class_prefix'];
6742 $html_name_prefix = $args['html_name_prefix'];
6743 $settings = $args['settings'];
6744 $tab_title = $args['tab_name'];
6745
6746 $outer_radius = $settings['outer_radius'];
6747 $slice_spacing = $settings['slice_spacing'];
6748 $circumference = $settings['circumference'];
6749 $start_angle = $settings['start_angle'];
6750 // $index_axis = $settings['index_axis'];
6751
6752 ob_start();
6753 ?>
6754 <div class="ays-accordion-data-main-wrap">
6755 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap <?php echo esc_attr($html_class_prefix) ?>advanced-settings-data-wrap">
6756 <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">
6757 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6758 <label for="ays-chart-option-outer-radius" class="form-label">
6759 <?php echo esc_html(__( "Outer Radius", "chart-builder" )); ?>
6760 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("The outer radius of the chart.","chart-builder") ); ?>">
6761 <i class="ays_fa ays_fa_info_circle"></i>
6762 </a>
6763 </label>
6764 </div>
6765 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6766 <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) ?>">
6767 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6768 </div>
6769 </div> <!-- Outer Radius -->
6770 <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">
6771 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6772 <label for="ays-chart-option-slice-spacing" class="form-label">
6773 <?php echo esc_html(__( "Slices Spacing", "chart-builder" )); ?>
6774 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Fixed arc offset (in pixels).","chart-builder") ); ?>">
6775 <i class="ays_fa ays_fa_info_circle"></i>
6776 </a>
6777 </label>
6778 </div>
6779 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6780 <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) ?>">
6781 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">px</div>
6782 </div>
6783 </div> <!-- Slice Spacing -->
6784 <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">
6785 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6786 <label for="ays-chart-option-circumference" class="form-label">
6787 <?php echo esc_html(__( "Arc Coverage", "chart-builder" )); ?>
6788 <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") ); ?>">
6789 <i class="ays_fa ays_fa_info_circle"></i>
6790 </a>
6791 </label>
6792 </div>
6793 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6794 <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) ?>">
6795 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
6796 </div>
6797 </div> <!-- Arc Coverage -->
6798 <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">
6799 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6800 <label for="ays-chart-option-start-angle" class="form-label">
6801 <?php echo esc_html(__( "Start Angle", "chart-builder" )); ?>
6802 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo esc_attr( __("Starting angle to draw arcs from.","chart-builder") ); ?>">
6803 <i class="ays_fa ays_fa_info_circle"></i>
6804 </a>
6805 </label>
6806 </div>
6807 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input">
6808 <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) ?>">
6809 <div class="<?php echo esc_attr($html_class_prefix) ?>option-desc-box">°</div>
6810 </div>
6811 </div> <!-- Start Angle -->
6812 <!-- <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">
6813 <div class="col-sm-5 d-flex align-items-center <?php // echo esc_attr($html_class_prefix) ?>option-title">
6814 <label for="ays-chart-option-index-axis">
6815 <?php // echo esc_html(__( "Horizontal ", "chart-builder" )); ?>
6816 <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") ); ?>">
6817 <i class="ays_fa ays_fa_info_circle"></i>
6818 </a>
6819 </label>
6820 </div>
6821 <div class="col-sm-7 py-1 <?php // echo esc_attr($html_class_prefix) ?>input-align-right">
6822 <label class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
6823 <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); ?> >
6824 <span class="<?php // echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php // echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
6825 </label>
6826 </div>
6827 </div> Reverse Categories -->
6828 </div>
6829 </div>
6830 <?php
6831 $content = ob_get_clean();
6832
6833 $sources['advanced_settings'] = array(
6834 'content' => $content,
6835 'title' => $tab_title
6836 );
6837
6838 return $sources;
6839 }
6840
6841 public function settings_contents_slices_settings( $sources, $args ){
6842 $html_class_prefix = $args['html_class_prefix'];
6843 $html_name_prefix = $args['html_name_prefix'];
6844 $settings = $args['settings'];
6845 $source = $args['source'];
6846 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
6847 $source_chart_type = $args['source_chart_type'];
6848 $settings = $args['settings'];
6849 $title_row = array_shift($source);
6850
6851 if (isset($source) && !empty($source)) {
6852 if ( !isset( $source[0] ) ) {
6853 if (count($source[1]) > 2) {
6854 $titles = array();
6855 for ($i = 0; $i < count($source[1]); $i++) {
6856 array_push($titles, __("Title", $this->plugin_name).$i);
6857 }
6858 $source[0] = $titles;
6859 } else {
6860 $source[0] = array(
6861 __("Country", $this->plugin_name),
6862 __("Population", $this->plugin_name),
6863 );
6864 }
6865
6866 ksort($source);
6867 }
6868 }
6869
6870 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6871 foreach ($source as $key => $row) {
6872 $source[$key] = array_slice($row, 0, 2);
6873 }
6874 }
6875
6876 ob_start();
6877 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
6878 $slice_color = $settings['slice_color'];
6879 $slice_colors_default = $settings['slice_colors_default'];
6880 $slice_offset = $settings['slice_offset'];
6881 $slice_text_color = $settings['slice_text_color'];
6882
6883 ?>
6884 <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">
6885 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6886 <div class="<?php echo esc_attr($html_class_prefix) ?>slices-settings">
6887 <?php
6888 foreach ( $source as $key => $val ):
6889 ?>
6890 <fieldset class="ays-slices-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-slices-<?php echo esc_attr($key); ?>" data-collapsed="true">
6891 <legend class="ays-slices-accordion-options-header">
6892 <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">
6893 <g>
6894 <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" />
6895 </g>
6896 </svg>
6897 <span><?php echo $val[0]; ?></span>
6898 </legend>
6899 <div class="ays-slices-accordion-options-content ays-slices-accordion-options-content">
6900 <div class="ays-slices-accordion-data-main-wrap">
6901 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
6902 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6903 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6904 <label for="ays-chart-option-slice-color">
6905 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
6906 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color to use for this slice.","chart-builder") ); ?>">
6907 <i class="ays_fa ays_fa_info_circle"></i>
6908 </a>
6909 </label>
6910 </div>
6911 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6912 <input type="color"
6913 id="ays-chart-option-slice-color-<?php echo $key; ?>"
6914 class="ays-chart-option-slice-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6915 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_color][<?php echo $key; ?>]"
6916 value="<?php echo isset($slice_color[$key]) ? esc_attr($slice_color[$key]) : $slice_colors_default[$key]; ?>"
6917 data-slice-id="<?php echo $key; ?>">
6918 </div>
6919 </div> <!-- Slice color -->
6920 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6921 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6922 <label for="ays-chart-option-slice-offset" class="form-label">
6923 <?php echo esc_html(__( "Offset", "chart-builder" )); ?>
6924 <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") ); ?>">
6925 <i class="ays_fa ays_fa_info_circle"></i>
6926 </a>
6927 </label>
6928 </div>
6929 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>option-input <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6930 <input type="number"
6931 id="ays-chart-option-slice-offset-<?php echo $key; ?>"
6932 class="ays-chart-option-slice-offset ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
6933 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_offset][<?php echo $key; ?>]"
6934 value="<?php echo isset($slice_offset[$key]) ? esc_attr($slice_offset[$key]) : 0 ; ?>"
6935 data-slice-id="<?php echo $key; ?>"
6936 step=".01" min="0.0" max="1.0">
6937 </div>
6938 </div> <!-- Slice offset -->
6939 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
6940 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
6941 <label for="ays-chart-option-slice-text-color">
6942 <?php echo esc_html(__( "Text color", "chart-builder" )); ?>
6943 <a class="ays_help" data-bs-toggle="tooltip" title="<?php echo htmlspecialchars( __("The color to use for the text of this slice.","chart-builder") ); ?>">
6944 <i class="ays_fa ays_fa_info_circle"></i>
6945 </a>
6946 </label>
6947 </div>
6948 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
6949 <input type="color"
6950 id="ays-chart-option-slice-text-color-<?php echo $key; ?>"
6951 class="ays-chart-option-slice-text-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
6952 name="<?php echo esc_attr($html_name_prefix); ?>settings[slice_text_color][<?php echo $key; ?>]"
6953 value="<?php echo isset($slice_text_color[$key]) ? esc_attr($slice_text_color[$key]) : '#ffffff'; ?>"
6954 data-slice-id="<?php echo $key; ?>">
6955 </div>
6956 </div> <!-- Slice color -->
6957 </div>
6958 </div>
6959 </div>
6960 </fieldset>
6961 <?php
6962 endforeach;
6963 ?>
6964 </div>
6965 </div>
6966 <br>
6967 <blockquote>
6968 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
6969 </blockquote>
6970 </div>
6971 <?php
6972
6973 } else {
6974 ?>
6975 <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>
6976 <?php
6977 }
6978
6979 $content = ob_get_clean();
6980
6981 $title = __( 'Slices settings', "chart-builder" );
6982
6983 $sources['slices_settings'] = array(
6984 'content' => $content,
6985 'title' => $title
6986 );
6987
6988 return $sources;
6989 }
6990
6991 public function settings_contents_series_settings( $sources, $args ){
6992 $html_class_prefix = $args['html_class_prefix'];
6993 $html_name_prefix = $args['html_name_prefix'];
6994 $settings = $args['settings'];
6995 $source = $args['source'];
6996 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
6997 $source_chart_type = $args['source_chart_type'];
6998
6999 $line_width = $settings['line_width'];
7000 $point_size = $settings['point_size'];
7001 $point_shape_options = $settings['point_shape_options'];
7002 $point_shape = $settings['point_shape'];
7003
7004 if (isset($source) && !empty($source)) {
7005 if ( !isset( $source[0] ) ) {
7006 if (count($source[1]) > 2) {
7007 $titles = array();
7008 for ($i = 0; $i < count($source[1]); $i++) {
7009 array_push($titles, __("Title", $this->plugin_name).$i);
7010 }
7011 $source[0] = $titles;
7012 } else {
7013 $source[0] = array(
7014 __("Country", $this->plugin_name),
7015 __("Population", $this->plugin_name),
7016 );
7017 }
7018
7019 ksort($source);
7020 }
7021 }
7022
7023 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'donut_chart') {
7024 foreach ($source as $key => $row) {
7025 $source[$key] = array_slice($row, 0, 2);
7026 }
7027 }
7028
7029 ob_start();
7030 if ($source_chart_type == 'pie_chart' || $source_chart_type == 'line_chart' || $source_chart_type == 'bar_chart' || $source_chart_type == 'column_chart') {
7031 $series_row = array_shift($source);
7032 $title = array_shift($series_row);
7033 $series_color = $settings['series_color'];
7034 $series_colors_default = $settings['series_colors_default'];
7035 $series_visible_in_legend = $settings['series_visible_in_legend'];
7036 $series_line_width = $settings['series_line_width'];
7037 $series_point_size = $settings['series_point_size'];
7038 $series_point_shape = $settings['series_point_shape'];
7039
7040 ?>
7041 <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">
7042 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7043 <div class="<?php echo esc_attr($html_class_prefix) ?>series-settings">
7044 <?php
7045 foreach ( $series_row as $key => $val ):
7046 ?>
7047 <fieldset class="ays-series-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-series-<?php echo esc_attr($key); ?>" data-collapsed="true">
7048 <legend class="ays-series-accordion-options-header">
7049 <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">
7050 <g>
7051 <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" />
7052 </g>
7053 </svg>
7054 <span><?php echo $val; ?></span>
7055 </legend>
7056 <div class="ays-series-accordion-options-content ays-series-accordion-options-content">
7057 <div class="ays-series-accordion-data-main-wrap">
7058 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7059 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7060 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7061 <label for="ays-chart-option-series-color">
7062 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7063 </label>
7064 </div>
7065 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7066 <input type="color"
7067 id="ays-chart-option-series-color-<?php echo $key; ?>"
7068 class="ays-chart-option-series-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7069 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_color][<?php echo $key; ?>]"
7070 value="<?php echo isset($series_color[$key]) ? esc_attr($series_color[$key]) : $series_colors_default[$key]; ?>"
7071 data-series-id="<?php echo $key; ?>">
7072 </div>
7073 </div> <!-- series color -->
7074 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7075 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7076 <label for="ays-chart-option-series-visible-in-legend">
7077 <?php echo esc_html(__( "Visible in legend", "chart-builder" )); ?>
7078 <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") ); ?>">
7079 <i class="ays_fa ays_fa_info_circle"></i>
7080 </a>
7081 </label>
7082 </div>
7083 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7084 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7085 <input type="checkbox"
7086 id="ays-chart-option-series-visible-in-legend-<?php echo $key; ?>"
7087 class="ays-chart-option-series-visible-in-legend <?php echo esc_attr($html_class_prefix) ?>toggle-switch"
7088 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_visible_in_legend][<?php echo $key; ?>]"
7089 value="on"
7090 data-series-id="<?php echo $key; ?>"
7091 <?php echo isset($series_visible_in_legend[$key]) && $series_visible_in_legend[$key] == 'on' ? 'checked' : (!isset($series_color[$key]) ? 'checked' : ''); ?> >
7092 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7093 </label>
7094 </div>
7095 </div> <!-- Series visible in legend -->
7096 <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">
7097 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7098 <label for="ays-chart-option-series-line-width">
7099 <?php echo esc_html(__( "Line width", "chart-builder" )); ?>
7100 <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") ); ?>">
7101 <i class="ays_fa ays_fa_info_circle"></i>
7102 </a>
7103 </label>
7104 </div>
7105 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7106 <input type="number"
7107 id="ays-chart-option-series-line-width-<?php echo $key; ?>"
7108 class="ays-chart-option-series-line-width ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7109 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_line_width][<?php echo $key; ?>]"
7110 value="<?php echo isset($series_line_width[$key]) ? esc_attr($series_line_width[$key]) : $line_width; ?>"
7111 data-series-id="<?php echo $key; ?>">
7112 </div>
7113 </div> <!-- Line width -->
7114 <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">
7115 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7116 <label for="ays-chart-option-series-point-size">
7117 <?php echo esc_html(__( "Point size", "chart-builder" )); ?>
7118 <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") ); ?>">
7119 <i class="ays_fa ays_fa_info_circle"></i>
7120 </a>
7121 </label>
7122 </div>
7123 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7124 <input type="number"
7125 id="ays-chart-option-series-point-size-<?php echo $key; ?>"
7126 class="ays-chart-option-series-point-size ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7127 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_size][<?php echo $key; ?>]"
7128 value="<?php echo isset($series_point_size[$key]) ? esc_attr($series_point_size[$key]) : $point_size; ?>"
7129 data-series-id="<?php echo $key; ?>">
7130 </div>
7131 </div> <!-- Point size -->
7132 <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">
7133 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7134 <label for="ays-chart-option-series-point-shape">
7135 <?php echo esc_html(__( "Point shape", "chart-builder" )); ?>
7136 <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") ); ?>">
7137 <i class="ays_fa ays_fa_info_circle"></i>
7138 </a>
7139 </label>
7140 </div>
7141 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7142 <select
7143 id="ays-chart-option-series-point-shape-<?php echo $key; ?>"
7144 class="ays-chart-option-series-point-shape <?php echo esc_attr($html_class_prefix) ?>option-select-input form-select"
7145 name="<?php echo esc_attr($html_name_prefix); ?>settings[series_point_shape][<?php echo $key; ?>]"
7146 data-series-id="<?php echo $key; ?>">
7147 >
7148 <?php
7149 $value = isset($series_point_shape[$key]) ? esc_attr($series_point_shape[$key]) : $point_shape;
7150 foreach ( $point_shape_options as $option_slug => $option ):
7151 $selected = ( $value === $option_slug ) ? 'selected' : '';
7152 ?>
7153 <option value="<?php echo esc_attr($option_slug); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($option); ?></option>
7154 <?php
7155 endforeach;
7156 ?>
7157 </select>
7158 </div>
7159 </div> <!-- Point shape -->
7160 </div>
7161 </div>
7162 </div>
7163 </fieldset>
7164 <?php
7165 endforeach;
7166 ?>
7167 </div>
7168 </div>
7169 <br>
7170 <blockquote>
7171 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
7172 <br>
7173 <?php echo sprintf(__( "%sNote:%s If you are not able to set the options, disable the row settings feature.", $this->plugin_name ), '<strong>', '</strong>'); ?>
7174 </blockquote>
7175 </div>
7176 <?php
7177
7178 } else {
7179 ?>
7180 <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>
7181 <?php
7182 }
7183
7184 $content = ob_get_clean();
7185
7186 $title = __( 'Series settings', "chart-builder" );
7187
7188 $sources['series_settings'] = array(
7189 'content' => $content,
7190 'title' => $title
7191 );
7192
7193 return $sources;
7194 }
7195
7196 public function settings_contents_row_settings( $sources, $args ){
7197 $html_class_prefix = $args['html_class_prefix'];
7198 $html_name_prefix = $args['html_name_prefix'];
7199 $settings = $args['settings'];
7200 $source = $args['source'];
7201 $source = isset($source["commonTypeCharts"]) ? $source["commonTypeCharts"] : $source;
7202 $source_chart_type = $args['source_chart_type'];
7203
7204 if (isset($source) && !empty($source)) {
7205 if ( !isset( $source[0] ) ) {
7206 if (count($source[1]) > 2) {
7207 $titles = array();
7208 for ($i = 0; $i < count($source[1]); $i++) {
7209 array_push($titles, __("Title", $this->plugin_name).$i);
7210 }
7211 $source[0] = $titles;
7212 } else {
7213 $source[0] = array(
7214 __("Country", $this->plugin_name),
7215 __("Population", $this->plugin_name),
7216 );
7217 }
7218
7219 ksort($source);
7220 }
7221 }
7222
7223 array_shift($source);
7224 $rows = array_column($source, 0);
7225
7226 $enable_row_settings = $settings['enable_row_settings'];
7227 $series_color = $settings['series_color'][0] ?? '#3366cc';
7228 $rows_color = $settings['rows_color'];
7229 $rows_opacity = $settings['rows_opacity'];
7230
7231 ob_start();
7232 ?>
7233 <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">
7234 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7235 <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">
7236 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7237 <label for="ays-chart-option-enable-row-settings">
7238 <?php echo esc_html(__( "Enable row settings", "chart-builder" )); ?>
7239 <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") ); ?>">
7240 <i class="ays_fa ays_fa_info_circle"></i>
7241 </a>
7242 </label>
7243 </div>
7244 <div class="col-sm-7 py-1 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7245 <label class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-switch">
7246 <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); ?> >
7247 <span class="<?php echo esc_attr($html_class_prefix) ?>toggle-switch-slider <?php echo esc_attr($html_class_prefix) ?>toggle-switch-round"></span>
7248 </label>
7249 </div>
7250 </div> <!-- Enable row settings -->
7251 <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'; ?>">
7252 <br>
7253 <?php
7254 foreach ( $rows as $key => $val ):
7255 ?>
7256 <fieldset class="ays-rows-accordion-options-container <?php echo esc_attr($html_class_prefix) ?>options-rows-<?php echo esc_attr($key); ?>" data-collapsed="true">
7257 <legend class="ays-rows-accordion-options-header">
7258 <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">
7259 <g>
7260 <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" />
7261 </g>
7262 </svg>
7263 <span><?php echo $val; ?></span>
7264 </legend>
7265 <div class="ays-rows-accordion-options-content ays-rows-accordion-options-content">
7266 <div class="ays-rows-accordion-data-main-wrap">
7267 <div class="<?php echo esc_attr($html_class_prefix) ?>settings-data-main-wrap">
7268 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7269 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7270 <label for="ays-chart-option-rows-color">
7271 <?php echo esc_html(__( "Color", "chart-builder" )); ?>
7272 </label>
7273 </div>
7274 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7275 <input type="color"
7276 id="ays-chart-option-rows-color-<?php echo $key; ?>"
7277 class="ays-chart-option-rows-color form-control-color <?php echo esc_attr($html_class_prefix) ?>option-color-picker"
7278 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_color][<?php echo $key; ?>]"
7279 value="<?php echo isset($rows_color[$key]) && '' !== $rows_color[$key] ? esc_attr($rows_color[$key]) : $series_color; ?>"
7280 data-rows-id="<?php echo $key; ?>">
7281 </div>
7282 </div> <!-- color -->
7283 <div class="form-group row mb-2 <?php echo esc_attr($html_class_prefix) ?>options-section">
7284 <div class="col-sm-5 d-flex align-items-center <?php echo esc_attr($html_class_prefix) ?>option-title">
7285 <label for="ays-chart-option-rows-color">
7286 <?php echo esc_html(__( "Opacity", "chart-builder" )); ?>
7287 </label>
7288 </div>
7289 <div class="col-sm-7 <?php echo esc_attr($html_class_prefix) ?>input-align-right">
7290 <input type="number"
7291 id="ays-chart-option-rows-opacity-<?php echo $key; ?>"
7292 class="ays-chart-option-rows-opacity ays-text-input form-control <?php echo esc_attr($html_class_prefix) ?>option-text-input"
7293 name="<?php echo esc_attr($html_name_prefix); ?>settings[rows_opacity][<?php echo $key; ?>]"
7294 value="<?php echo isset($rows_opacity[$key]) && '' !== $rows_opacity[$key] ? esc_attr($rows_opacity[$key]) : 1.0; ?>"
7295 data-rows-id="<?php echo $key; ?>"
7296 step=".1" min="0" max="1">
7297 </div>
7298 </div> <!-- opacity -->
7299 </div>
7300 </div>
7301 </div>
7302 </fieldset>
7303 <?php
7304 endforeach;
7305 ?>
7306 <br>
7307 <blockquote>
7308 <?php echo __( "Save the chart to update the data.", $this->plugin_name ); ?>
7309 <br>
7310 <?php echo sprintf(__( "%sNote:%s The applied styles will work only if the chart has one column.", $this->plugin_name ), '<strong>', '</strong>'); ?>
7311 </blockquote>
7312 </div>
7313 <div class="<?php echo esc_attr($html_class_prefix) ?>not-hidden-options-section <?php echo $enable_row_settings === 'checked' ? 'display_none' : ''; ?>">
7314 <br>
7315 <blockquote>
7316 <?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>'); ?>
7317 </blockquote>
7318 </div>
7319 </div>
7320 </div>
7321 <?php
7322 $content = ob_get_clean();
7323
7324 $title = __( 'Row settings', "chart-builder" );
7325
7326 $sources['row_settings'] = array(
7327 'content' => $content,
7328 'title' => $title
7329 );
7330
7331 return $sources;
7332 }
7333 }
7334