| @@ -3,8 +3,9 @@ | ||
| 3 | 3 | namespace YayMail\Utils; |
| 4 | 4 | |
| 5 | 5 | defined( 'ABSPATH' ) || exit; |
| 6 | 6 | |
| 7 | +use YayMail\Integrations\TranslationModule; | |
| 7 | 8 | use YayMail\Models\TemplateModel; |
| 8 | 9 | |
| 9 | 10 | /** |
| 10 | 11 | * Localize Classes |
| @@ -10,8 +11,16 @@ | ||
| 10 | 11 | * Localize Classes |
| 11 | 12 | */ |
| 12 | 13 | class Localize { |
| 13 | 14 | |
| 15 | + public static function get_translate_integrations() { | |
| 16 | + $current_integration = TranslationModule::get_instance()->current_integration; | |
| 17 | + return [ | |
| 18 | + 'available' => [], | |
| 19 | + 'current_translation' => is_null( $current_integration ) ? null : $current_integration->get_data(), | |
| 20 | + ]; | |
| 21 | + } | |
| 22 | + | |
| 14 | 23 | public static function get_list_orders() { |
| 15 | 24 | if ( yaymail_is_wc_installed() ) { |
| 16 | 25 | $data_orders [] = [ |
| 17 | 26 | 'id' => 'sample_order', |
| @@ -82,9 +91,9 @@ | ||
| 82 | 91 | 'youtube', |
| 83 | 92 | 'zillow', |
| 84 | 93 | ]; |
| 85 | 94 | $resource_prefix_url = YAYMAIL_PLUGIN_URL . 'assets/images/social-icons/'; |
| 86 | - $themes = [ 'colorful', 'line-dark', 'line-light', 'solid-dark', 'solid-light' ]; | |
| 95 | + $themes = [ 'colorful', 'line-dark', 'line-light', 'solid-dark', 'solid-light', 'custom' ]; | |
| 87 | 96 | $themes_pascal = array_map( [ self::class, 'kebab_to_pascal' ], $themes ); |
| 88 | 97 | $images = []; |
| 89 | 98 | foreach ( $socials as $social ) { |
| 90 | 99 | $pngs = []; |
| @@ -108,11 +117,11 @@ | ||
| 108 | 117 | 'images' => $images, |
| 109 | 118 | ]; |
| 110 | 119 | } |
| 111 | 120 | |
| 112 | - public static function get_global_headers_footers() { | |
| 121 | + public static function get_global_headers_footers( $template_name = 'yaymail_global_header_footer' ) { | |
| 113 | 122 | $template_model = TemplateModel::get_instance(); |
| 114 | - $global_headers_footers = $template_model->get_global_header_and_footer(); | |
| 123 | + $global_headers_footers = $template_model->get_global_headers_and_footers_for_all_available_languages( $template_name ); | |
| 115 | 124 | return $global_headers_footers; |
| 116 | 125 | } |
| 117 | 126 | |
| 118 | 127 | public static function get_activated_addons() { |