| @@ -1,0 +1,72 @@ | ||
| 1 | +<?php | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals. | |
| 3 | +defined('ABSPATH') || die('Restricted Access'); | |
| 4 | +?> | |
| 5 | +<div class="cell grid-x acym__sending__methods__choose acym__selection"> | |
| 6 | + <?php | |
| 7 | + $services = $data['sendingMethods']; | |
| 8 | + uksort($services, function ($first, $next) { | |
| 9 | + if ($first === 'phpmail' || $first === 'acymailer') return -1; | |
| 10 | + if ($next === 'sendinblue') return -1; | |
| 11 | + | |
| 12 | + return $first !== 'smtp' || $next === 'phpmail' ? 1 : -1; | |
| 13 | + }); | |
| 14 | + ?> | |
| 15 | + <?php if (empty($data['isSml'])) { ?> | |
| 16 | + <div class="acym__title acym__title__secondary margin-top-1 medium-12 <?php echo !empty($data['step']) && $data['step'] == 'phpmail' ? 'text-center' | |
| 17 | + : ''; ?>"><?php echo esc_html(acym_translation('ACYM_SENDING_MEHTODS')); ?></div> | |
| 18 | + <?php } ?> | |
| 19 | + <div class="cell grid-x grid-margin-x grid-margin-y acym__sending__methods__choose__selection text-center <?php echo !empty($data['step']) && $data['step'] == 'phpmail' | |
| 20 | + ? 'align-center' | |
| 21 | + : ''; ?>"> | |
| 22 | + <?php | |
| 23 | + foreach ($services as $key => $sendingMethod) { | |
| 24 | + if (!empty($data['isSml']) && $key === 'acymailer') { | |
| 25 | + continue; | |
| 26 | + } | |
| 27 | + | |
| 28 | + $selected = isset($sendingMethod['selected']) && $sendingMethod['selected']; | |
| 29 | + $class = !empty($sendingMethod['recommended']) ? 'acym__sending__methods__one__premium' : ''; | |
| 30 | + $class .= empty($data['step']) ? ' acym__sending__methods__one__config' : ''; | |
| 31 | + $idCheckbox = 'acym__sending__methods-'.(empty($data['isSml']) ? 'default' : 'sml').'-'.$key; | |
| 32 | + ?> | |
| 33 | + <div class="cell large-3 medium-6 grid-x align-center acym_vcenter acym__sending__methods__one <?php echo esc_attr($class); ?>"> | |
| 34 | + <label for="<?php echo esc_attr($idCheckbox); ?>" data-acym-method="<?php echo esc_attr($key); ?>" | |
| 35 | + class="acym__selection__card cell acym_vcenter align-center <?php echo $selected ? 'acym__selection__card-selected' : ''; ?>"> | |
| 36 | + <?php | |
| 37 | + if (!empty($sendingMethod['icon'])) { ?> | |
| 38 | + <i class="cell <?php echo esc_attr($sendingMethod['icon']); ?> text-center"></i> | |
| 39 | + <?php } else { ?> | |
| 40 | + <img src="<?php echo esc_url($sendingMethod['image']); ?>" | |
| 41 | + alt="" | |
| 42 | + class="cell <?php echo !empty($sendingMethod['image_class']) ? esc_attr($sendingMethod['image_class']) : ''; ?>"> | |
| 43 | + <?php } ?> | |
| 44 | + </label> | |
| 45 | + <span class="cell acym__sending__methods__name"> | |
| 46 | + <?php | |
| 47 | + echo esc_html($sendingMethod['name']); | |
| 48 | + if (!empty($sendingMethod['recommended'])) { | |
| 49 | + echo ' <br>('.esc_html(acym_translation('ACYM_RECOMMENDED')).')'; | |
| 50 | + } | |
| 51 | + ?> | |
| 52 | + </span> | |
| 53 | + <input type="radio" | |
| 54 | + name="<?php echo !empty($data['isSml']) ? 'sml' : 'config'; ?>[mailer_method]" | |
| 55 | + <?php checked($selected); ?> | |
| 56 | + id="<?php echo esc_attr($idCheckbox); ?>" | |
| 57 | + value="<?php echo esc_attr($key); ?>" | |
| 58 | + style="display: none"> | |
| 59 | + </div> | |
| 60 | + <?php } ?> | |
| 61 | + </div> | |
| 62 | + <?php | |
| 63 | + $class = ''; | |
| 64 | + if (!empty($data['step'])) { | |
| 65 | + $class = 'medium-10'; | |
| 66 | + echo '<div class="cell medium-1 hide-for-small-only"></div>'; | |
| 67 | + } | |
| 68 | + ?> | |
| 69 | + <div class="cell <?php echo esc_attr($class); ?> grid-x"> | |
| 70 | + <?php acym_trigger('onAcymGetSendingMethodsHtmlSetting', [&$data]); ?> | |
| 71 | + </div> | |
| 72 | +</div> | |