From f7c805f22be02df2579002fe17af648534b8fb97 Mon Sep 17 00:00:00 2001 From: asus Date: Tue, 19 Mar 2024 16:27:38 +0100 Subject: [PATCH] v 0.3.4 states are now handled with specific functions for setting, getting, and adding css --- plugins/cipf_plugin/cipf_plugin.php | 1 + .../php/paypal/update_user_payment.php | 6 +- plugins/cipf_plugin/php/profs_display_css.php | 101 ++++++++++++++++++ plugins/cipf_plugin/php/profs_profil.php | 7 +- plugins/cipf_plugin/php/profs_states.php | 16 +-- 5 files changed, 115 insertions(+), 16 deletions(-) create mode 100644 plugins/cipf_plugin/php/profs_display_css.php diff --git a/plugins/cipf_plugin/cipf_plugin.php b/plugins/cipf_plugin/cipf_plugin.php index ef0bae3..cdd745c 100644 --- a/plugins/cipf_plugin/cipf_plugin.php +++ b/plugins/cipf_plugin/cipf_plugin.php @@ -45,6 +45,7 @@ include_once(PLGNTLS_class::root_path() . 'php/profs_profil.php'); include_once(PLGNTLS_class::root_path() . 'php/profs_form.php'); include_once(PLGNTLS_class::root_path() . 'php/profs_dates.php'); include_once(PLGNTLS_class::root_path() . 'php/profs_states.php'); +include_once(PLGNTLS_class::root_path() . 'php/profs_display_css.php'); include_once(PLGNTLS_class::root_path() . 'php/partners_register.php'); include_once(PLGNTLS_class::root_path() . 'php/partners_page.php'); diff --git a/plugins/cipf_plugin/php/paypal/update_user_payment.php b/plugins/cipf_plugin/php/paypal/update_user_payment.php index f0160f1..8bc077c 100644 --- a/plugins/cipf_plugin/php/paypal/update_user_payment.php +++ b/plugins/cipf_plugin/php/paypal/update_user_payment.php @@ -60,7 +60,7 @@ function update_user_pre_order_CIPF($message) { * - 'nothing' -> output nothing on author page * */ - set_payment_started($user_id); + set_payment_started_CIPF($user_id); } @@ -139,7 +139,7 @@ function failure_payment_for_user_CIPF($user_id, $order_id, $status) { delete_user_meta($user_id, $meta_order_id, $order_id); - set_payment_failure($user_id); + set_payment_failure_CIPF($user_id); set_account_to_pay_CIPF($user_id); } @@ -172,7 +172,7 @@ function success_payment_for_user_CIPF($user_id, $order_id) { } set_card_renew_CIPF($user_id); - set_payment_success($user_id); + set_payment_success_CIPF($user_id); set_account_valid_CIPF($user_id); } diff --git a/plugins/cipf_plugin/php/profs_display_css.php b/plugins/cipf_plugin/php/profs_display_css.php new file mode 100644 index 0000000..7eb45cb --- /dev/null +++ b/plugins/cipf_plugin/php/profs_display_css.php @@ -0,0 +1,101 @@ + diff --git a/plugins/cipf_plugin/php/profs_profil.php b/plugins/cipf_plugin/php/profs_profil.php index 41d520a..7889b7d 100644 --- a/plugins/cipf_plugin/php/profs_profil.php +++ b/plugins/cipf_plugin/php/profs_profil.php @@ -177,11 +177,8 @@ function prof_profil_scripts_CIPF() { $author_id = get_queried_object_id(); $cipf_prof = new PLGNTLS_class(); - $cipf_prof->add_to_front( - array( - 'css/display_states/paiement_reussi.css', - ) - ); + $css_front_states = prof_display_css_CIPF(); + $cipf_prof->add_to_front($css_front_states); } add_action('wp_enqueue_scripts', 'prof_profil_scripts_CIPF', 11); diff --git a/plugins/cipf_plugin/php/profs_states.php b/plugins/cipf_plugin/php/profs_states.php index 46df539..8a3a44b 100644 --- a/plugins/cipf_plugin/php/profs_states.php +++ b/plugins/cipf_plugin/php/profs_states.php @@ -231,19 +231,19 @@ function is_payment_state_CIPF($user_id = null, $type) { $acf_card_payment_state = PLGNTLS_class::ACF_CARD_PAYMENT_STATE; return is_acf_state_CIPF($user_id, $acf_card_payment_state, $type); } -function is_payment_started($user_id = null) { +function is_payment_started_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); return is_payment_state_CIPF($user_id, 'started'); } -function is_payment_success($user_id = null) { +function is_payment_success_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); return is_payment_state_CIPF($user_id, 'success'); } -function is_payment_failure($user_id = null) { +function is_payment_failure_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); return is_payment_state_CIPF($user_id, 'failure'); } -function is_payment_nothing($user_id = null) { +function is_payment_nothing_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); return is_payment_state_CIPF($user_id, 'nothing'); } @@ -255,19 +255,19 @@ function set_payment_state_CIPF($user_id = null, $type) { $acf_card_payment_state = PLGNTLS_class::ACF_CARD_PAYMENT_STATE; set_acf_state_CIPF($user_id, $acf_card_payment_state, $type); } -function set_payment_started($user_id = null) { +function set_payment_started_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); set_payment_state_CIPF($user_id, 'started'); } -function set_payment_success($user_id = null) { +function set_payment_success_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); set_payment_state_CIPF($user_id, 'success'); } -function set_payment_failure($user_id = null) { +function set_payment_failure_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); set_payment_state_CIPF($user_id, 'failure'); } -function set_payment_nothing($user_id = null) { +function set_payment_nothing_CIPF($user_id = null) { PLGNTLS_class::debug_infos(); set_payment_state_CIPF($user_id, 'nothing'); }