| @@ -1,200 +1,0 @@ | ||
| 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 | -$summaryAllowedTags = [ | |
| 6 | - 'br' => [], | |
| 7 | - 'b' => [], | |
| 8 | - 'strong' => [], | |
| 9 | - 'i' => [], | |
| 10 | - 'em' => [], | |
| 11 | - 'p' => [], | |
| 12 | - 'span' => ['class' => true], | |
| 13 | -]; | |
| 14 | -?> | |
| 15 | -<form id="acym_form" action="<?php echo esc_url(acym_completeLink(acym_getVar('cmd', 'ctrl'))); ?>" method="post" name="acyForm" data-abide novalidate> | |
| 16 | - <input type="hidden" name="id" value="<?php echo empty($data['id']) ? '' : intval($data['id']); ?>"> | |
| 17 | - <div class="cell grid-x"> | |
| 18 | - <div class="cell auto"></div> | |
| 19 | - <div class="acym__content grid-x cell xxlarge-7 xlarge-9" id="acym__automation__summary"> | |
| 20 | - <?php | |
| 21 | - $data['workflowHelper']->display($this->steps, 'summary'); | |
| 22 | - if (!empty($data['id'])) { | |
| 23 | - ?> | |
| 24 | - <div class="acym__automation__summary__info cell grid-x acym__content margin-top-2"> | |
| 25 | - <h6 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_INFORMATION')); ?></h6> | |
| 26 | - <?php if (!empty($data['automation']->admin)) { | |
| 27 | - $data['automation']->name = acym_translation($data['automation']->name); | |
| 28 | - $data['automation']->description = acym_translation($data['automation']->description); | |
| 29 | - } ?> | |
| 30 | - <div class="cell acym__automation__summary__information__one"><span class="acym__automation__summary__information__one__title"><?php echo esc_html( | |
| 31 | - acym_translation( | |
| 32 | - 'ACYM_NAME_SUMMARY' | |
| 33 | - ) | |
| 34 | - ); ?></span> : <?php echo esc_html($data['automation']->name); ?></div> | |
| 35 | - <div class="cell acym__automation__summary__information__one"><span class="acym__automation__summary__information__one__title"><?php echo esc_html( | |
| 36 | - acym_translation( | |
| 37 | - 'ACYM_DESCRIPTION' | |
| 38 | - ) | |
| 39 | - ); ?></span> : <?php echo esc_html($data['automation']->description); ?></div> | |
| 40 | - </div> | |
| 41 | - <div class="acym__automation__summary__filters cell grid-x margin-top-2 acym__content"> | |
| 42 | - <h6 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_TRIGGERS')); ?></h6> | |
| 43 | - <div class="cell acym__automation__summary__information__one"><span class="acym__automation__summary__information__one__title"><?php echo esc_html( | |
| 44 | - acym_translation( | |
| 45 | - 'ACYM_AUTOMATION_TRIGGER' | |
| 46 | - ) | |
| 47 | - ); ?></span></div> | |
| 48 | - <br /> | |
| 49 | - <div class="cell acym__automation__summary__information__one"> | |
| 50 | - <?php | |
| 51 | - foreach ($data['step']->triggers as $name => $oneTrigger) { | |
| 52 | - if (!is_string($oneTrigger)) { | |
| 53 | - $data['step']->triggers[$name] = acym_translation('ACYM_UNKNOWN'); | |
| 54 | - } | |
| 55 | - } | |
| 56 | - | |
| 57 | - echo implode( | |
| 58 | - '<br /><span class="acym__automation__summary__information__one__title">'.esc_html(acym_translation('ACYM_OR')).'</span><br />', | |
| 59 | - $data['step']->triggers | |
| 60 | - ); | |
| 61 | - ?> | |
| 62 | - </div> | |
| 63 | - </div> | |
| 64 | - <div class="acym__automation__summary__actions cell grid-x margin-top-2 acym__content"> | |
| 65 | - <h6 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_CONDITIONS')); ?></h6> | |
| 66 | - <div class="cell acym__automation__summary__information__one grid-x"> | |
| 67 | - <?php | |
| 68 | - if (!empty($data['condition']->conditions)) { | |
| 69 | - $orNum = 0; | |
| 70 | - $andNum = 0; | |
| 71 | - $typeTrigger = $data['condition']->conditions['type_condition']; | |
| 72 | - unset($data['condition']->conditions['type_condition']); | |
| 73 | - if (empty($data['condition']->conditions)) { | |
| 74 | - echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 75 | - acym_translation( | |
| 76 | - 'ACYM_YOU_DID_NOT_SET_CONDITION' | |
| 77 | - ) | |
| 78 | - ).'</span></div><div class="acym__automation__summary__information__one">'; | |
| 79 | - } else { | |
| 80 | - echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 81 | - acym_translationSprintf( | |
| 82 | - 'ACYM_CONDITIONS_APPLY_TO', | |
| 83 | - acym_translation($typeTrigger == 'classic' ? '' : 'ACYM_ONE_ACYMAILING_SUBSCRIBER_CONDITION') | |
| 84 | - ) | |
| 85 | - ).'</span></div><div class="acym__automation__summary__information__one">'; | |
| 86 | - foreach ($data['condition']->conditions as $or => $orValues) { | |
| 87 | - if ($or === 'type_condition') continue; | |
| 88 | - $andNum = 0; | |
| 89 | - if ($orNum > 0) { | |
| 90 | - echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 91 | - acym_translation('ACYM_OR') | |
| 92 | - ).'</span><br />'; | |
| 93 | - } | |
| 94 | - foreach ($orValues as $and => $andValue) { | |
| 95 | - if (is_array($andValue)) continue; | |
| 96 | - if ($andNum > 0) { | |
| 97 | - echo '<span class="acym__automation__summary__information__one__title">'.esc_html(acym_translation('ACYM_AND')).'</span><br />'; | |
| 98 | - } | |
| 99 | - echo wp_kses((string)$andValue, $summaryAllowedTags).'<br />'; | |
| 100 | - $andNum++; | |
| 101 | - } | |
| 102 | - $orNum++; | |
| 103 | - } | |
| 104 | - } | |
| 105 | - } else { | |
| 106 | - echo '<strong class="acym__color__red cell text-center">'.esc_html(acym_translation('ACYM_SELECT_CONDITIONS')).'</strong>'; | |
| 107 | - } | |
| 108 | - ?> | |
| 109 | - </div> | |
| 110 | - </div> | |
| 111 | - <?php } ?> | |
| 112 | - <div class="acym__automation__summary__actions cell grid-x margin-top-2 margin-bottom-2 acym__content"> | |
| 113 | - <h6 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_ACTIONS')); ?></h6> | |
| 114 | - <div class="cell acym__automation__summary__information__one grid-x"> | |
| 115 | - <?php | |
| 116 | - if (!empty($data['action']->actions)) { | |
| 117 | - echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 118 | - acym_translationSprintf( | |
| 119 | - 'ACYM_ACTIONS_SUBSCRIBER_WILL', | |
| 120 | - acym_strtolower(acym_translation(empty($data['id']) ? 'ACYM_MASS_ACTION' : 'ACYM_AUTOMATION')) | |
| 121 | - ) | |
| 122 | - ).'</span></div><div class="acym__automation__summary__information__one">'; | |
| 123 | - $andNum = 0; | |
| 124 | - foreach ($data['action']->actions as $and => $andValue) { | |
| 125 | - if (is_array($andValue)) continue; | |
| 126 | - if ($andNum > 0) echo '<span class="acym__automation__summary__information__one__title">'.esc_html(acym_translation('ACYM_AND')).'</span><br />'; | |
| 127 | - echo wp_kses((string)$andValue, $summaryAllowedTags).'<br />'; | |
| 128 | - $andNum++; | |
| 129 | - } | |
| 130 | - } else { | |
| 131 | - echo '<strong class="acym__color__red cell text-center">'.esc_html(acym_translation('ACYM_SELECT_ACTIONS')).'</strong>'; | |
| 132 | - } | |
| 133 | - ?> | |
| 134 | - </div> | |
| 135 | - </div> | |
| 136 | - <div class="acym__automation__summary__actions cell grid-x margin-top-1 margin-bottom-2 acym__content"> | |
| 137 | - <h6 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_ACTIONS_TARGETS')); ?></h6> | |
| 138 | - <div class="cell acym__automation__summary__information__one grid-x"> | |
| 139 | - <?php | |
| 140 | - if (!empty($data['action']->filters)) { | |
| 141 | - $orNum = 0; | |
| 142 | - $andNum = 0; | |
| 143 | - echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 144 | - acym_translationSprintf( | |
| 145 | - 'ACYM_FILTERS_APPLY_TO', | |
| 146 | - acym_strtolower(acym_translation(empty($data['id']) ? 'ACYM_MASS_ACTION' : 'ACYM_AUTOMATION')), | |
| 147 | - acym_translation($data['action']->filters['type_filter'] == 'classic' ? 'ACYM_ALL_ACYMAILING_USERS' : 'ACYM_ONE_ACYMAILING_USER') | |
| 148 | - ) | |
| 149 | - ).'</span></div><div class="acym__automation__summary__information__one">'; | |
| 150 | - foreach ($data['action']->filters as $or => $orValues) { | |
| 151 | - if ($or === 'type_filter') continue; | |
| 152 | - $andNum = 0; | |
| 153 | - if ($orNum > 0) echo '<span class="acym__automation__summary__information__one__title">'.esc_html(acym_translation('ACYM_OR')).'</span><br />'; | |
| 154 | - foreach ($orValues as $and => $andValue) { | |
| 155 | - if (is_array($andValue)) continue; | |
| 156 | - if ($andNum > 0) { | |
| 157 | - echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 158 | - acym_translation('ACYM_AND') | |
| 159 | - ).'</span><br />'; | |
| 160 | - } | |
| 161 | - echo wp_kses((string)$andValue, $summaryAllowedTags).'<br />'; | |
| 162 | - $andNum++; | |
| 163 | - } | |
| 164 | - $orNum++; | |
| 165 | - } | |
| 166 | - } else { | |
| 167 | - echo '<strong class="acym__color__red cell text-center">'.esc_html(acym_translation('ACYM_SELECT_FILTERS')).'</strong>'; | |
| 168 | - } | |
| 169 | - ?> | |
| 170 | - </div> | |
| 171 | - </div> | |
| 172 | - <div class="cell grid-x grid-margin-x"> | |
| 173 | - <div class="auto cell"></div> | |
| 174 | - <?php if (empty($data['id'])) { ?> | |
| 175 | - <button type="button" data-task="listing" class="cell shrink button-secondary button acy_button_submit"><?php echo esc_html( | |
| 176 | - acym_translation('ACYM_CANCEL') | |
| 177 | - ); ?></button> | |
| 178 | - <button type="button" data-task="processMassAction" class="cell shrink button acy_button_submit"><?php echo esc_html( | |
| 179 | - acym_translation( | |
| 180 | - 'ACYM_PROCESS_MASS_ACTION' | |
| 181 | - ) | |
| 182 | - ); ?></button> | |
| 183 | - <?php } else { ?> | |
| 184 | - <button type="button" data-task="listing" class="cell shrink button button-secondary acy_button_submit"><?php echo esc_html( | |
| 185 | - acym_translation( | |
| 186 | - 'ACYM_SAVE_EXIT' | |
| 187 | - ) | |
| 188 | - ); ?></button> | |
| 189 | - <button type="button" data-task="activeAutomation" class="cell shrink button acy_button_submit"><?php echo esc_html( | |
| 190 | - acym_translation( | |
| 191 | - 'ACYM_ACTIVE_AUTOMATION' | |
| 192 | - ) | |
| 193 | - ); ?></button> | |
| 194 | - <?php } ?> | |
| 195 | - </div> | |
| 196 | - </div> | |
| 197 | - <div class="cell auto"></div> | |
| 198 | - </div> | |
| 199 | - <?php acym_formOptions(); ?> | |
| 200 | -</form> | |