| @@ -1,102 +1,115 @@ | ||
| 1 | -<div id="acym__editor__content" class="grid-x acym__content acym__editor__area <?php echo !empty($data['menuClass']) ? acym_escape($data['menuClass']) : ''; ?>"> | |
| 2 | - <div class="cell grid-x grid-margin-x align-right margin-bottom-1"> | |
| 3 | - <input type="hidden" id="acym__mail__edit__editor" value="<?php echo acym_escape($data['mail']->editor); ?>"> | |
| 4 | - <input type="hidden" | |
| 5 | - class="acym__wysid__hidden__save__thumbnail" | |
| 6 | - id="editor_thumbnail" | |
| 7 | - name="editor_thumbnail" | |
| 8 | - value="<?php echo acym_escape($data['mail']->thumbnail); ?>" /> | |
| 9 | - <input type="hidden" id="acym__mail__edit__editor__social__icons" value="<?php echo empty($data['social_icons']) ? '{}' : acym_escape($data['social_icons']); ?>"> | |
| 10 | - <input type="hidden" id="acym__mail__type" name="mail[type]" value="<?php echo empty($data['mail']->type) ? $data['mailClass']::TYPE_STANDARD : $data['mail']->type; ?>"> | |
| 11 | - <input type="hidden" name="list_ids" value="<?php echo empty($data['list_id'][0]) ? 0 : $data['list_id'][0]; ?>"> | |
| 12 | - <?php | |
| 13 | - include acym_getView('mails', 'edit_actions', true); | |
| 14 | - ?> | |
| 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 id="acym__editor__content" class="grid-x acym__content acym__editor__area <?php echo !empty($data['menuClass']) ? esc_attr($data['menuClass']) : ''; ?>"> | |
| 6 | + <div class="cell grid-x grid-margin-x align-right margin-bottom-1"> | |
| 7 | + <input type="hidden" id="acym__mail__edit__editor" value="<?php echo esc_attr($data['mail']->editor); ?>"> | |
| 8 | + <input type="hidden" | |
| 9 | + class="acym__wysid__hidden__save__thumbnail" | |
| 10 | + id="editor_thumbnail" | |
| 11 | + name="editor_thumbnail" | |
| 12 | + value="<?php echo esc_attr($data['mail']->thumbnail); ?>" /> | |
| 13 | + <input type="hidden" id="acym__mail__edit__editor__social__icons" value="<?php echo empty($data['social_icons']) ? '{}' : esc_attr($data['social_icons']); ?>"> | |
| 14 | + <input type="hidden" | |
| 15 | + id="acym__mail__type" | |
| 16 | + name="mail[type]" | |
| 17 | + value="<?php echo empty($data['mail']->type) ? esc_attr($data['mailClass']::TYPE_STANDARD) : esc_attr($data['mail']->type); ?>"> | |
| 18 | + <input type="hidden" name="list_ids" value="<?php echo empty($data['list_id'][0]) ? 0 : esc_attr($data['list_id'][0]); ?>"> | |
| 19 | + <?php | |
| 20 | + include acym_getView('mails', 'edit_actions', true); | |
| 21 | + ?> | |
| 15 | 22 | |
| 16 | - </div> | |
| 17 | - <div class="cell grid-x grid-padding-x acym__editor__content__options"> | |
| 18 | - <?php | |
| 19 | - echo !empty($data['return']) ? '<input type="hidden" name="return" value="'.acym_escape($data['return']).'"/>' : ''; | |
| 20 | - echo !empty($data['fromId']) ? '<input type="hidden" name="fromId" value="'.acym_escape($data['fromId']).'"/>' : ''; | |
| 21 | - ?> | |
| 22 | - <div class="cell medium-auto"> | |
| 23 | - <label> | |
| 24 | - <?php echo acym_translation('ACYM_NAME'); ?> | |
| 25 | - <input name="mail[name]" type="text" class="acy_required_field" value="<?php echo acym_escape($data['mail']->name); ?>" required> | |
| 26 | - </label> | |
| 27 | 23 | </div> |
| 28 | - <div class="cell medium-auto"> | |
| 29 | - <label> | |
| 30 | - <?php echo acym_translation('ACYM_EMAIL_SUBJECT'); ?> | |
| 31 | - <input name="mail[subject]" type="text" value="<?php echo acym_escape($data['mail']->subject); ?>" <?php echo in_array( | |
| 32 | - $data['mail']->type, | |
| 33 | - [$data['mailClass']::TYPE_WELCOME, $data['mailClass']::TYPE_UNSUBSCRIBE, $data['mailClass']::TYPE_AUTOMATION] | |
| 34 | - ) ? 'required' : ''; ?>> | |
| 35 | - </label> | |
| 36 | - </div> | |
| 37 | - <?php if (!empty($data['lists'])) { ?> | |
| 24 | + <div class="cell grid-x grid-padding-x acym__editor__content__options"> | |
| 25 | + <?php | |
| 26 | + echo !empty($data['return']) ? '<input type="hidden" name="return" value="'.esc_attr($data['return']).'"/>' : ''; | |
| 27 | + echo !empty($data['fromId']) ? '<input type="hidden" name="fromId" value="'.esc_attr($data['fromId']).'"/>' : ''; | |
| 28 | + ?> | |
| 38 | 29 | <div class="cell medium-auto"> |
| 39 | 30 | <label> |
| 40 | - <?php | |
| 41 | - echo acym_translation('ACYM_SELECT_ONE_OR_MORE_LIST'); | |
| 42 | - echo acym_selectMultiple($data['lists'], 'list_ids', empty($data['list_id']) ? [] : $data['list_id'], ['class' => 'acym__select']); | |
| 43 | - ?> | |
| 31 | + <?php echo esc_html(acym_translation('ACYM_NAME')); ?> | |
| 32 | + <input name="mail[name]" type="text" class="acy_required_field" value="<?php echo esc_attr($data['mail']->name); ?>" required> | |
| 44 | 33 | </label> |
| 45 | 34 | </div> |
| 46 | - <?php } ?> | |
| 47 | - <div class="cell grid-x acym__toggle__arrow"> | |
| 48 | - <p class="cell medium-shrink acym__toggle__arrow__trigger"><?php echo acym_translation('ACYM_ADVANCED_OPTIONS'); ?> <i class="acymicon-keyboard-arrow-down"></i></p> | |
| 49 | - <div class="cell acym__toggle__arrow__contain"> | |
| 50 | - <div class="grid-x grid-padding-x"> | |
| 51 | - <?php if (empty($data['multilingual']) && empty($data['abtest'])) { ?> | |
| 52 | - <div class="cell grid-x"> | |
| 35 | + <div class="cell medium-auto"> | |
| 36 | + <label> | |
| 37 | + <?php echo esc_html(acym_translation('ACYM_EMAIL_SUBJECT')); ?> | |
| 38 | + <input name="mail[subject]" type="text" value="<?php echo esc_attr($data['mail']->subject); ?>" <?php echo in_array( | |
| 39 | + $data['mail']->type, | |
| 40 | + [$data['mailClass']::TYPE_WELCOME, $data['mailClass']::TYPE_UNSUBSCRIBE, $data['mailClass']::TYPE_AUTOMATION] | |
| 41 | + ) ? 'required' : ''; ?>> | |
| 42 | + </label> | |
| 43 | + </div> | |
| 44 | + <?php if (!empty($data['lists'])) { ?> | |
| 45 | + <div class="cell medium-auto"> | |
| 46 | + <label> | |
| 47 | + <?php | |
| 48 | + echo esc_html(acym_translation('ACYM_SELECT_ONE_OR_MORE_LIST')); | |
| 49 | + acym_selectMultiple($data['lists'], 'list_ids', empty($data['list_id']) ? [] : $data['list_id'], ['class' => 'acym__select'], 'value', 'text', true); | |
| 50 | + ?> | |
| 51 | + </label> | |
| 52 | + </div> | |
| 53 | + <?php } ?> | |
| 54 | + <div class="cell grid-x acym__toggle__arrow"> | |
| 55 | + <p class="cell medium-shrink acym__toggle__arrow__trigger"> | |
| 56 | + <?php echo esc_html(acym_translation('ACYM_ADVANCED_OPTIONS')); ?> <i class="acymicon-keyboard-arrow-down"></i> | |
| 57 | + </p> | |
| 58 | + <div class="cell acym__toggle__arrow__contain"> | |
| 59 | + <div class="grid-x grid-padding-x"> | |
| 60 | + <?php if (empty($data['multilingual']) && empty($data['abtest'])) { ?> | |
| 61 | + <div class="cell grid-x"> | |
| 62 | + <div class="cell medium-shrink"> | |
| 63 | + <label for="acym__mail__edit__preheader"> | |
| 64 | + <?php | |
| 65 | + echo esc_html(acym_translation('ACYM_EMAIL_PREHEADER')); | |
| 66 | + acym_info(['textShownInTooltip' => 'ACYM_EMAIL_PREHEADER_DESC']); | |
| 67 | + ?> | |
| 68 | + </label> | |
| 69 | + </div> | |
| 70 | + <input id="acym__mail__edit__preheader" | |
| 71 | + name="mail[preheader]" | |
| 72 | + type="text" | |
| 73 | + maxlength="255" | |
| 74 | + value="<?php echo esc_attr($data['mail']->preheader); ?>"> | |
| 75 | + </div> | |
| 76 | + <?php } ?> | |
| 77 | + <div class="cell grid-x medium-6" id="acym__mail__edit__html__stylesheet__container"> | |
| 53 | 78 | <div class="cell medium-shrink"> |
| 54 | - <label for="acym__mail__edit__preheader"> | |
| 79 | + <label for="acym__mail__edit__html__stylesheet"> | |
| 55 | 80 | <?php |
| 56 | - echo acym_translation('ACYM_EMAIL_PREHEADER'); | |
| 57 | - echo acym_info('ACYM_EMAIL_PREHEADER_DESC'); | |
| 81 | + acym_tooltip( | |
| 82 | + [ | |
| 83 | + 'hoveredText' => acym_translation('ACYM_CUSTOM_ADD_STYLESHEET'), | |
| 84 | + 'textShownInTooltip' => acym_translation('ACYM_STYLESHEET_HTML_DESC'), | |
| 85 | + ] | |
| 86 | + ); | |
| 87 | + $stylesheet = empty($data['mail']->stylesheet) ? '' : $data['mail']->stylesheet; | |
| 58 | 88 | ?> |
| 59 | 89 | </label> |
| 60 | 90 | </div> |
| 61 | - <input id="acym__mail__edit__preheader" name="mail[preheader]" type="text" maxlength="255" value="<?php echo acym_escape($data['mail']->preheader); ?>"> | |
| 91 | + <textarea | |
| 92 | + name="editor_stylesheet" | |
| 93 | + id="acym__mail__edit__html__stylesheet" | |
| 94 | + cols="30" | |
| 95 | + rows="15" | |
| 96 | + type="text"><?php echo esc_html($stylesheet); ?></textarea> | |
| 62 | 97 | </div> |
| 63 | - <?php } ?> | |
| 64 | - <div class="cell grid-x medium-6" id="acym__mail__edit__html__stylesheet__container"> | |
| 65 | - <div class="cell medium-shrink"> | |
| 66 | - <label for="acym__mail__edit__html__stylesheet"> | |
| 67 | - <?php | |
| 68 | - echo acym_tooltip( | |
| 69 | - [ | |
| 70 | - 'hoveredText' => acym_translation('ACYM_CUSTOM_ADD_STYLESHEET'), | |
| 71 | - 'textShownInTooltip' => acym_translation('ACYM_STYLESHEET_HTML_DESC'), | |
| 72 | - ] | |
| 73 | - ); | |
| 74 | - $stylesheet = empty($data['mail']->stylesheet) ? '' : $data['mail']->stylesheet; | |
| 75 | - ?> | |
| 76 | - </label> | |
| 98 | + <div class="cell medium-auto"> | |
| 99 | + <label for="acym__mail__edit__custom__header"><?php echo esc_html(acym_translation('ACYM_CUSTOM_HEADERS')); ?></label> | |
| 100 | + <textarea id="acym__mail__edit__custom__header" name="editor_headers" cols="30" rows="15" type="text"> | |
| 101 | + <?php echo esc_html($data['mail']->headers); ?> | |
| 102 | + </textarea> | |
| 77 | 103 | </div> |
| 78 | - <textarea | |
| 79 | - name="editor_stylesheet" | |
| 80 | - id="acym__mail__edit__html__stylesheet" | |
| 81 | - cols="30" | |
| 82 | - rows="15" | |
| 83 | - type="text"><?php echo $stylesheet; ?></textarea> | |
| 84 | 104 | </div> |
| 85 | - <div class="cell medium-auto"> | |
| 86 | - <label for="acym__mail__edit__custom__header"><?php echo acym_translation('ACYM_CUSTOM_HEADERS'); ?></label> | |
| 87 | - <textarea id="acym__mail__edit__custom__header" name="editor_headers" cols="30" rows="15" type="text"><?php echo acym_escape( | |
| 88 | - $data['mail']->headers | |
| 89 | - ); ?></textarea> | |
| 90 | - </div> | |
| 91 | 105 | </div> |
| 92 | 106 | </div> |
| 93 | 107 | </div> |
| 94 | 108 | </div> |
| 95 | -</div> | |
| 96 | -<input type="hidden" name="mail[id]" value="<?php echo acym_escape($data['mail']->id); ?>" /> | |
| 97 | -<input type="hidden" name="id" value="<?php echo acym_escape($data['mail']->id); ?>" /> | |
| 98 | -<input type="hidden" name="thumbnail" value="<?php echo empty($data['mail']->thumbnail) ? '' : acym_escape($data['mail']->thumbnail); ?>" /> | |
| 109 | + <input type="hidden" name="mail[id]" value="<?php echo esc_attr($data['mail']->id); ?>" /> | |
| 110 | + <input type="hidden" name="id" value="<?php echo esc_attr($data['mail']->id); ?>" /> | |
| 111 | + <input type="hidden" name="thumbnail" value="<?php echo empty($data['mail']->thumbnail) ? '' : esc_attr($data['mail']->thumbnail); ?>" /> | |
| 99 | 112 | <?php |
| 100 | 113 | acym_formOptions(); |
| 101 | 114 | |
| 102 | 115 | $data['editor']->content = $data['mail']->body; |
| @@ -105,5 +118,5 @@ | ||
| 105 | 118 | if (!empty($data['mail']->id)) $data['editor']->mailId = $data['mail']->id; |
| 106 | 119 | if (!empty($data['mail']->type)) $data['editor']->automation = $data['isAutomationAdmin']; |
| 107 | 120 | if (!empty($data['mail']->settings)) $data['editor']->settings = $data['mail']->settings; |
| 108 | 121 | if (!empty($data['mail']->stylesheet)) $data['editor']->stylesheet = $data['mail']->stylesheet; |
| 109 | -echo $data['editor']->display(); | |
| 122 | +$data['editor']->display(); | |