| 1 |
<?php |
| 2 |
/** |
| 3 |
* Cartflows Block Js. |
| 4 |
* |
| 5 |
* @package Cartflows |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
if ( ! class_exists( 'Cartflows_Block_JS' ) ) { |
| 13 |
|
| 14 |
/** |
| 15 |
* Class Cartflows_Block_JS. |
| 16 |
*/ |
| 17 |
class Cartflows_Block_JS { |
| 18 |
|
| 19 |
/** |
| 20 |
* Adds Google fonts for Next Step Button. |
| 21 |
* |
| 22 |
* @since 1.6.15 |
| 23 |
* @param array $attr the blocks attr. |
| 24 |
*/ |
| 25 |
public static function blocks_next_step_button_gfont( $attr ) { |
| 26 |
|
| 27 |
$title_load_google_font = isset( $attr['titleLoadGoogleFonts'] ) ? $attr['titleLoadGoogleFonts'] : ''; |
| 28 |
$title_font_family = isset( $attr['titleFontFamily'] ) ? $attr['titleFontFamily'] : ''; |
| 29 |
$title_font_weight = isset( $attr['titleFontWeight'] ) ? $attr['titleFontWeight'] : ''; |
| 30 |
$title_font_subset = isset( $attr['titleFontSubset'] ) ? $attr['titleFontSubset'] : ''; |
| 31 |
|
| 32 |
$sub_title_load_google_font = isset( $attr['subTitleLoadGoogleFonts'] ) ? $attr['subTitleLoadGoogleFonts'] : ''; |
| 33 |
$sub_title_font_family = isset( $attr['subTitleFontFamily'] ) ? $attr['subTitleFontFamily'] : ''; |
| 34 |
$sub_title_font_weight = isset( $attr['subTitleFontWeight'] ) ? $attr['subTitleFontWeight'] : ''; |
| 35 |
$sub_title_font_subset = isset( $attr['subTitleFontSubset'] ) ? $attr['subTitleFontSubset'] : ''; |
| 36 |
|
| 37 |
Cartflows_Gb_Helper::blocks_google_font( $title_load_google_font, $title_font_family, $title_font_weight, $title_font_subset ); |
| 38 |
Cartflows_Gb_Helper::blocks_google_font( $sub_title_load_google_font, $sub_title_font_family, $sub_title_font_weight, $sub_title_font_subset ); |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* Adds Google fonts for Order Detail Form block. |
| 43 |
* |
| 44 |
* @since 1.6.15 |
| 45 |
* @param array $attr the blocks attr. |
| 46 |
*/ |
| 47 |
public static function blocks_order_detail_form_gfont( $attr ) { |
| 48 |
|
| 49 |
$heading_load_google_font = isset( $attr['headingLoadGoogleFonts'] ) ? $attr['headingLoadGoogleFonts'] : ''; |
| 50 |
$heading_font_family = isset( $attr['headingFontFamily'] ) ? $attr['headingFontFamily'] : ''; |
| 51 |
$heading_font_weight = isset( $attr['headingFontWeight'] ) ? $attr['headingFontWeight'] : ''; |
| 52 |
$heading_font_subset = isset( $attr['headingFontSubset'] ) ? $attr['headingFontSubset'] : ''; |
| 53 |
|
| 54 |
$section_heading_load_google_font = isset( $attr['sectionHeadingLoadGoogleFonts'] ) ? $attr['sectionHeadingLoadGoogleFonts'] : ''; |
| 55 |
$section_heading_font_family = isset( $attr['sectionHeadingFontFamily'] ) ? $attr['sectionHeadingFontFamily'] : ''; |
| 56 |
$section_heading_font_weight = isset( $attr['sectionHeadingFontWeight'] ) ? $attr['sectionHeadingFontWeight'] : ''; |
| 57 |
$section_heading_font_subset = isset( $attr['sectionHeadingFontSubset'] ) ? $attr['sectionHeadingFontSubset'] : ''; |
| 58 |
|
| 59 |
$section_content_load_google_font = isset( $attr['sectionContentLoadGoogleFonts'] ) ? $attr['sectionContentLoadGoogleFonts'] : ''; |
| 60 |
$section_content_font_family = isset( $attr['sectionContentFontFamily'] ) ? $attr['sectionContentFontFamily'] : ''; |
| 61 |
$section_content_font_weight = isset( $attr['sectionContentFontWeight'] ) ? $attr['sectionContentFontWeight'] : ''; |
| 62 |
$section_content_font_subset = isset( $attr['sectionContentFontSubset'] ) ? $attr['sectionContentFontSubset'] : ''; |
| 63 |
|
| 64 |
$order_overview_load_google_font = isset( $attr['orderOverviewLoadGoogleFonts'] ) ? $attr['orderOverviewLoadGoogleFonts'] : ''; |
| 65 |
$order_overview_font_family = isset( $attr['orderOverviewFontFamily'] ) ? $attr['orderOverviewFontFamily'] : ''; |
| 66 |
$order_overview_font_weight = isset( $attr['orderOverviewFontWeight'] ) ? $attr['orderOverviewFontWeight'] : ''; |
| 67 |
$order_overview_font_subset = isset( $attr['orderOverviewFontSubset'] ) ? $attr['orderOverviewFontSubset'] : ''; |
| 68 |
|
| 69 |
$download_heading_load_google_font = isset( $attr['downloadHeadingLoadGoogleFonts'] ) ? $attr['downloadHeadingLoadGoogleFonts'] : ''; |
| 70 |
$download_heading_font_family = isset( $attr['downloadHeadingFontFamily'] ) ? $attr['downloadHeadingFontFamily'] : ''; |
| 71 |
$download_heading_font_weight = isset( $attr['downloadHeadingFontWeight'] ) ? $attr['downloadHeadingFontWeight'] : ''; |
| 72 |
$download_heading_font_subset = isset( $attr['downloadHeadingFontSubset'] ) ? $attr['downloadHeadingFontSubset'] : ''; |
| 73 |
|
| 74 |
$download_content_load_google_font = isset( $attr['downloadContentLoadGoogleFonts'] ) ? $attr['downloadContentLoadGoogleFonts'] : ''; |
| 75 |
$download_content_font_family = isset( $attr['downloadContentFontFamily'] ) ? $attr['downloadContentFontFamily'] : ''; |
| 76 |
$download_content_font_weight = isset( $attr['downloadContentFontWeight'] ) ? $attr['downloadContentFontWeight'] : ''; |
| 77 |
$download_content_font_subset = isset( $attr['downloadContentFontSubset'] ) ? $attr['downloadContentFontSubset'] : ''; |
| 78 |
|
| 79 |
$order_detail_heading_load_google_font = isset( $attr['orderDetailHeadingLoadGoogleFonts'] ) ? $attr['orderDetailHeadingLoadGoogleFonts'] : ''; |
| 80 |
$order_detail_heading_font_family = isset( $attr['orderDetailHeadingFontFamily'] ) ? $attr['orderDetailHeadingFontFamily'] : ''; |
| 81 |
$order_detail_heading_font_weight = isset( $attr['orderDetailHeadingFontWeight'] ) ? $attr['orderDetailHeadingFontWeight'] : ''; |
| 82 |
$order_detail_heading_font_subset = isset( $attr['orderDetailHeadingFontSubset'] ) ? $attr['orderDetailHeadingFontSubset'] : ''; |
| 83 |
|
| 84 |
$order_detail_content_load_google_font = isset( $attr['orderDetailContentLoadGoogleFonts'] ) ? $attr['orderDetailContentLoadGoogleFonts'] : ''; |
| 85 |
$order_detail_content_font_family = isset( $attr['orderDetailContentFontFamily'] ) ? $attr['orderDetailContentFontFamily'] : ''; |
| 86 |
$order_detail_content_font_weight = isset( $attr['orderDetailContentFontWeight'] ) ? $attr['orderDetailContentFontWeight'] : ''; |
| 87 |
$order_detail_content_font_subset = isset( $attr['orderDetailContentFontSubset'] ) ? $attr['orderDetailContentFontSubset'] : ''; |
| 88 |
|
| 89 |
$customer_detail_heading_load_google_font = isset( $attr['customerDetailHeadingLoadGoogleFonts'] ) ? $attr['customerDetailHeadingLoadGoogleFonts'] : ''; |
| 90 |
$customer_detail_heading_font_family = isset( $attr['customerDetailHeadingFontFamily'] ) ? $attr['customerDetailHeadingFontFamily'] : ''; |
| 91 |
$customer_detail_heading_font_weight = isset( $attr['customerDetailHeadingFontWeight'] ) ? $attr['customerDetailHeadingFontWeight'] : ''; |
| 92 |
$customer_detail_heading_font_subset = isset( $attr['customerDetailHeadingFontSubset'] ) ? $attr['customerDetailHeadingFontSubset'] : ''; |
| 93 |
|
| 94 |
$customer_detail_content_load_google_font = isset( $attr['customerDetailContentLoadGoogleFonts'] ) ? $attr['customerDetailContentLoadGoogleFonts'] : ''; |
| 95 |
$customer_detail_content_font_family = isset( $attr['customerDetailContentFontFamily'] ) ? $attr['customerDetailContentFontFamily'] : ''; |
| 96 |
$customer_detail_content_font_weight = isset( $attr['customerDetailContentFontWeight'] ) ? $attr['customerDetailContentFontWeight'] : ''; |
| 97 |
$customer_detail_content_font_subset = isset( $attr['customerDetailContentFontSubset'] ) ? $attr['customerDetailContentFontSubset'] : ''; |
| 98 |
|
| 99 |
Cartflows_Gb_Helper::blocks_google_font( $heading_load_google_font, $heading_font_family, $heading_font_weight, $heading_font_subset ); |
| 100 |
Cartflows_Gb_Helper::blocks_google_font( $section_heading_load_google_font, $section_heading_font_family, $section_heading_font_weight, $section_heading_font_subset ); |
| 101 |
Cartflows_Gb_Helper::blocks_google_font( $section_content_load_google_font, $section_content_font_family, $section_content_font_weight, $section_content_font_subset ); |
| 102 |
Cartflows_Gb_Helper::blocks_google_font( $order_overview_load_google_font, $order_overview_font_family, $order_overview_font_weight, $order_overview_font_subset ); |
| 103 |
Cartflows_Gb_Helper::blocks_google_font( $download_heading_load_google_font, $download_heading_font_family, $download_heading_font_weight, $download_heading_font_subset ); |
| 104 |
Cartflows_Gb_Helper::blocks_google_font( $download_content_load_google_font, $download_content_font_family, $download_content_font_weight, $download_content_font_subset ); |
| 105 |
Cartflows_Gb_Helper::blocks_google_font( $order_detail_heading_load_google_font, $order_detail_heading_font_family, $order_detail_heading_font_weight, $order_detail_heading_font_subset ); |
| 106 |
Cartflows_Gb_Helper::blocks_google_font( $order_detail_content_load_google_font, $order_detail_content_font_family, $order_detail_content_font_weight, $order_detail_content_font_subset ); |
| 107 |
Cartflows_Gb_Helper::blocks_google_font( $customer_detail_heading_load_google_font, $customer_detail_heading_font_family, $customer_detail_heading_font_weight, $customer_detail_heading_font_subset ); |
| 108 |
Cartflows_Gb_Helper::blocks_google_font( $customer_detail_content_load_google_font, $customer_detail_content_font_family, $customer_detail_content_font_weight, $customer_detail_content_font_subset ); |
| 109 |
|
| 110 |
} |
| 111 |
|
| 112 |
/** |
| 113 |
* Adds Google fonts for checkout form. |
| 114 |
* |
| 115 |
* @since 1.6.15 |
| 116 |
* @param array $attr the blocks attr. |
| 117 |
*/ |
| 118 |
public static function blocks_checkout_form_gfont( $attr ) { |
| 119 |
|
| 120 |
$head_load_google_font = isset( $attr['headLoadGoogleFonts'] ) ? $attr['headLoadGoogleFonts'] : ''; |
| 121 |
$head_font_family = isset( $attr['headFontFamily'] ) ? $attr['headFontFamily'] : ''; |
| 122 |
$head_font_weight = isset( $attr['headFontWeight'] ) ? $attr['headFontWeight'] : ''; |
| 123 |
$head_font_subset = isset( $attr['headFontSubset'] ) ? $attr['headFontSubset'] : ''; |
| 124 |
|
| 125 |
$input_load_google_font = isset( $attr['inputLoadGoogleFonts'] ) ? $attr['inputLoadGoogleFonts'] : ''; |
| 126 |
$input_font_family = isset( $attr['inputFontFamily'] ) ? $attr['inputFontFamily'] : ''; |
| 127 |
$input_font_weight = isset( $attr['inputFontWeight'] ) ? $attr['inputFontWeight'] : ''; |
| 128 |
$input_font_subset = isset( $attr['inputFontSubset'] ) ? $attr['inputFontSubset'] : ''; |
| 129 |
|
| 130 |
$button_load_google_font = isset( $attr['buttonLoadGoogleFonts'] ) ? $attr['buttonLoadGoogleFonts'] : ''; |
| 131 |
$button_font_family = isset( $attr['buttonFontFamily'] ) ? $attr['buttonFontFamily'] : ''; |
| 132 |
$button_font_weight = isset( $attr['buttonFontWeight'] ) ? $attr['buttonFontWeight'] : ''; |
| 133 |
$button_font_subset = isset( $attr['buttonFontSubset'] ) ? $attr['buttonFontSubset'] : ''; |
| 134 |
|
| 135 |
$global_load_google_font = isset( $attr['globalLoadGoogleFonts'] ) ? $attr['globalLoadGoogleFonts'] : ''; |
| 136 |
$global_font_family = isset( $attr['globalFontFamily'] ) ? $attr['globalFontFamily'] : ''; |
| 137 |
$global_font_weight = isset( $attr['globalFontWeight'] ) ? $attr['globalFontWeight'] : ''; |
| 138 |
$global_font_subset = isset( $attr['globalFontSubset'] ) ? $attr['globalFontSubset'] : ''; |
| 139 |
|
| 140 |
Cartflows_Gb_Helper::blocks_google_font( $global_load_google_font, $global_font_family, $global_font_weight, $global_font_subset ); |
| 141 |
Cartflows_Gb_Helper::blocks_google_font( $head_load_google_font, $head_font_family, $head_font_weight, $head_font_subset ); |
| 142 |
Cartflows_Gb_Helper::blocks_google_font( $button_load_google_font, $button_font_family, $button_font_weight, $button_font_subset ); |
| 143 |
Cartflows_Gb_Helper::blocks_google_font( $input_load_google_font, $input_font_family, $input_font_weight, $input_font_subset ); |
| 144 |
|
| 145 |
} |
| 146 |
|
| 147 |
/** |
| 148 |
* Adds Google fonts for Optin Form block. |
| 149 |
* |
| 150 |
* @since 1.6.15 |
| 151 |
* @param array $attr the blocks attr. |
| 152 |
*/ |
| 153 |
public static function blocks_optin_form_gfont( $attr ) { |
| 154 |
|
| 155 |
$general_load_google_font = isset( $attr['generalLoadGoogleFonts'] ) ? $attr['generalLoadGoogleFonts'] : ''; |
| 156 |
$general_font_family = isset( $attr['generalFontFamily'] ) ? $attr['generalFontFamily'] : ''; |
| 157 |
$general_font_weight = isset( $attr['generalFontWeight'] ) ? $attr['generalFontWeight'] : ''; |
| 158 |
$general_font_subset = isset( $attr['generalFontSubset'] ) ? $attr['generalFontSubset'] : ''; |
| 159 |
|
| 160 |
$submit_button_load_google_font = isset( $attr['submitButtonLoadGoogleFonts'] ) ? $attr['submitButtonLoadGoogleFonts'] : ''; |
| 161 |
$submit_button_font_family = isset( $attr['submitButtonFontFamily'] ) ? $attr['submitButtonFontFamily'] : ''; |
| 162 |
$submit_button_font_weight = isset( $attr['submitButtonFontWeight'] ) ? $attr['submitButtonFontWeight'] : ''; |
| 163 |
$submit_button_font_subset = isset( $attr['submitButtonFontSubset'] ) ? $attr['submitButtonFontSubset'] : ''; |
| 164 |
|
| 165 |
Cartflows_Gb_Helper::blocks_google_font( $general_load_google_font, $general_font_family, $general_font_weight, $general_font_subset ); |
| 166 |
Cartflows_Gb_Helper::blocks_google_font( $submit_button_load_google_font, $submit_button_font_family, $submit_button_font_weight, $submit_button_font_subset ); |
| 167 |
|
| 168 |
} |
| 169 |
} |
| 170 |
} |
| 171 |
|