| @@ -1,0 +1,213 @@ | ||
| 1 | +<?php | |
| 2 | +defined('ABSPATH') || die('Restricted Access'); | |
| 3 | +?> | |
| 4 | +<form id="acym_form" action="<?php echo esc_url(acym_completeLink(acym_getVar('cmd', 'ctrl'))); ?>" method="post" name="acyForm" data-abide novalidate> | |
| 5 | + <input type="hidden" name="id" value="<?php echo empty($data['id']) ? '' : intval($data['id']); ?>"> | |
| 6 | + <input type="hidden" name="stepAutomationId" value="<?php echo empty($data['step_automation_id']) ? '' : intval($data['step_automation_id']); ?>"> | |
| 7 | + <input type="hidden" name="conditionId" value="<?php echo empty($data['condition']->id) ? '' : intval($data['condition']->id); ?>"> | |
| 8 | + <input type="hidden" id="acym__automation__conditions__count__and" value="0"> | |
| 9 | + <input type="hidden" id="acym__automation__conditions__count__or" value="0"> | |
| 10 | + | |
| 11 | + <div class="acym__content grid-x cell" id="acym__automation__conditions"> | |
| 12 | + <?php | |
| 13 | + if (empty($data['condition']->conditions)) { | |
| 14 | + $data['workflowHelper']->disabledAfter = 'condition'; | |
| 15 | + } | |
| 16 | + $data['workflowHelper']->display($this->steps, 'condition'); | |
| 17 | + ?> | |
| 18 | + <div id="acym__automation__or__example" style="display: none;"> | |
| 19 | + <h6 class="cell acym__title acym__title__secondary margin-top-1"><?php echo esc_html(acym_translation('ACYM_OR')); ?></h6> | |
| 20 | + <div class="cell grid-x acym__content acym__automation__group__condition" data-condition-number="0"> | |
| 21 | + <div class="acym__automation__new__or cell grid-x"> | |
| 22 | + <div class="cell auto"></div> | |
| 23 | + <i class="acymicon-close acym__color__red acym__automation__delete__group__condition shrink cell cursor-pointer"></i> | |
| 24 | + </div> | |
| 25 | + <div class="cell grid-x margin-top-2"> | |
| 26 | + <button data-condition-type="" type="button" class="button-secondary button medium-shrink acym__automation__add-condition"> | |
| 27 | + <?php echo esc_html(acym_translation('ACYM_ADD_CONDITION')); ?> | |
| 28 | + </button> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + <div class="cell grid-x acym__automation__one__condition" id="acym__automation__and__example" style="display: none;"> | |
| 33 | + <div class="acym__automation__and cell grid-x margin-top-2"> | |
| 34 | + <h6 class="cell medium-shrink small-11 acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_AND')); ?></h6> | |
| 35 | + <div class="cell medium-4 hide-for-small-only"></div> | |
| 36 | + <i class="cell medium-shrink small-1 cursor-pointer acymicon-close acym__color__red acym__automation__delete__one__condition"></i> | |
| 37 | + </div> | |
| 38 | + <div class="medium-5 cell acym__automation__and__example__classic__select" style="display: none;"> | |
| 39 | + <?php | |
| 40 | + acym_select( | |
| 41 | + $data['classic_name'], | |
| 42 | + 'conditions_name', | |
| 43 | + null, | |
| 44 | + [ | |
| 45 | + 'class' => 'acym__automation__select__classic__condition', | |
| 46 | + 'data-class' => 'acym__select', | |
| 47 | + ], | |
| 48 | + 'value', | |
| 49 | + 'text', | |
| 50 | + null, | |
| 51 | + false, | |
| 52 | + true | |
| 53 | + ); | |
| 54 | + ?> | |
| 55 | + </div> | |
| 56 | + <div class="medium-5 cell acym__automation__and__example__user__select" style="display: none;"> | |
| 57 | + <?php | |
| 58 | + acym_select( | |
| 59 | + $data['user_name'], | |
| 60 | + 'conditions_name', | |
| 61 | + null, | |
| 62 | + [ | |
| 63 | + 'class' => 'acym__automation__select__user__condition', | |
| 64 | + 'data-class' => 'acym__select', | |
| 65 | + ], | |
| 66 | + 'value', | |
| 67 | + 'text', | |
| 68 | + null, | |
| 69 | + false, | |
| 70 | + true | |
| 71 | + ); | |
| 72 | + ?> | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | + | |
| 76 | + <h6 class="acym__title acym__title__secondary cell"> | |
| 77 | + <?php echo esc_html(acym_translation('ACYM_SELECT_YOUR_CONDITIONS')); | |
| 78 | + acym_info(['textShownInTooltip' => 'ACYM_CONDITIONS_DESC']); ?> | |
| 79 | + </h6> | |
| 80 | + <div class="cell grid-x grid-margin-x margin-bottom-2" <?php echo $data['type_trigger'] == 'classic' ? 'style="display: none;"' : ''; ?>> | |
| 81 | + <div class="cell auto"></div> | |
| 82 | + <input type="hidden" name="type_condition" id="acym__automation__type-condition__input" value="<?php echo esc_attr($data['type_condition']); ?>"> | |
| 83 | + <p data-condition="user" class="acym__automation__choose__condition medium-shrink cell <?php echo $data['type_condition'] == 'classic' ? '' : 'selected-condition'; ?>"> | |
| 84 | + <?php echo esc_html(acym_translation('ACYM_EXECUTE_CONDITIONS_ON_ONE_SUBSCRIBER')); ?> | |
| 85 | + </p> | |
| 86 | + <p data-condition="classic" | |
| 87 | + class="acym__automation__choose__condition medium-shrink cell <?php echo $data['type_condition'] == 'classic' ? 'selected-condition' : ''; ?>"> | |
| 88 | + <?php echo esc_html(acym_translation('ACYM_EXECUTE_CONDITIONS_ON_ALL_SUBSCRIBERS')); ?> | |
| 89 | + </p> | |
| 90 | + <div class="cell auto"></div> | |
| 91 | + </div> | |
| 92 | + | |
| 93 | + <div class="cell grid-x acym__automation__condition__container" | |
| 94 | + id="acym__automation__conditions__type__classic" <?php echo $data['type_condition'] == 'classic' ? '' : 'style="display:none;"'; ?>> | |
| 95 | + <div class="cell grid-x acym__content acym__automation__group__condition" data-condition-number="0"> | |
| 96 | + <div class="cell grid-x acym__automation__one__condition acym__automation__one__condition__classic"> | |
| 97 | + <div class="medium-5 cell"> | |
| 98 | + <?php | |
| 99 | + acym_select( | |
| 100 | + $data['classic_name'], | |
| 101 | + 'conditions_name', | |
| 102 | + null, | |
| 103 | + ['class' => 'acym__select acym__automation__select__classic__condition'], | |
| 104 | + 'value', | |
| 105 | + 'text', | |
| 106 | + null, | |
| 107 | + false, | |
| 108 | + true | |
| 109 | + ); | |
| 110 | + ?> | |
| 111 | + </div> | |
| 112 | + </div> | |
| 113 | + <div class="cell grid-x margin-top-2"> | |
| 114 | + <button data-condition-type="classic" | |
| 115 | + data-block="0" | |
| 116 | + type="button" | |
| 117 | + class="button-secondary button medium-shrink acym__automation__add-condition"><?php echo esc_html( | |
| 118 | + acym_translation('ACYM_ADD_CONDITION') | |
| 119 | + ); ?></button> | |
| 120 | + </div> | |
| 121 | + </div> | |
| 122 | + <button data-condition-type="classic" type="button" class="acym__automation__conditions__or margin-top-1 button button-secondary"><?php echo esc_html( | |
| 123 | + acym_translation( | |
| 124 | + 'ACYM_OR' | |
| 125 | + ) | |
| 126 | + ); ?></button> | |
| 127 | + </div> | |
| 128 | + | |
| 129 | + <div class="cell grid-x acym__automation__condition__container" | |
| 130 | + id="acym__automation__conditions__type__user" <?php echo $data['type_condition'] === 'classic' ? 'style="display:none;"' : ''; ?>> | |
| 131 | + <div class="cell grid-x acym__content acym__automation__group__condition" data-condition-number="0"> | |
| 132 | + <div class="cell grid-x acym__automation__one__condition acym__automation__one__condition__user"> | |
| 133 | + <div class="medium-5 cell"> | |
| 134 | + <?php | |
| 135 | + acym_select( | |
| 136 | + $data['user_name'], | |
| 137 | + 'conditions_name', | |
| 138 | + null, | |
| 139 | + ['class' => 'acym__select acym__automation__select__user__condition'], | |
| 140 | + 'value', | |
| 141 | + 'text', | |
| 142 | + null, | |
| 143 | + false, | |
| 144 | + true | |
| 145 | + ); | |
| 146 | + ?> | |
| 147 | + </div> | |
| 148 | + </div> | |
| 149 | + <div class="cell grid-x margin-top-2"> | |
| 150 | + <button data-condition-type="user" | |
| 151 | + data-block="0" | |
| 152 | + type="button" | |
| 153 | + class="button-secondary button medium-shrink acym__automation__add-condition"><?php echo esc_html( | |
| 154 | + acym_translation('ACYM_ADD_CONDITION') | |
| 155 | + ); ?></button> | |
| 156 | + </div> | |
| 157 | + </div> | |
| 158 | + <button data-condition-type="user" type="button" class="acym__automation__conditions__or margin-top-1 button button-secondary"><?php echo esc_html( | |
| 159 | + acym_translation( | |
| 160 | + 'ACYM_OR' | |
| 161 | + ) | |
| 162 | + ); ?></button> | |
| 163 | + </div> | |
| 164 | + | |
| 165 | + <div class="cell grid-x grid-margin-x margin-top-2"> | |
| 166 | + <?php if (empty($data['id'])) { ?> | |
| 167 | + <div class="cell medium-auto grid-x grid-margin-x text-right"> | |
| 168 | + <div class="cell auto"></div> | |
| 169 | + <button | |
| 170 | + type="button" | |
| 171 | + class="button button-secondary acy_button_submit medium-shrink cell" | |
| 172 | + data-task="listing" | |
| 173 | + data-condition="cleanCondition" | |
| 174 | + > | |
| 175 | + <?php echo esc_html(acym_translation('ACYM_CANCEL')); ?> | |
| 176 | + </button> | |
| 177 | + <button type="button" | |
| 178 | + class="button acy_button_submit medium-shrink cell" | |
| 179 | + data-task="edit" | |
| 180 | + data-step="setConditionMassAction" | |
| 181 | + data-condition="cleanCondition"> | |
| 182 | + <?php echo esc_html(acym_translation('ACYM_SET_FILTERS')); ?> | |
| 183 | + </button> | |
| 184 | + </div> | |
| 185 | + <?php } else { ?> | |
| 186 | + <div class="cell medium-shrink medium-margin-bottom-0 margin-bottom-1 text-left"> | |
| 187 | + <?php acym_backToListing('automation'); ?> | |
| 188 | + </div> | |
| 189 | + <div class="cell medium-auto grid-x grid-margin-x text-right"> | |
| 190 | + <div class="cell auto"></div> | |
| 191 | + <button type="button" | |
| 192 | + class="button button-secondary acy_button_submit medium-shrink medium-margin-bottom-0 margin-bottom-1 cell" | |
| 193 | + data-task="edit" | |
| 194 | + data-step="saveExitConditions" | |
| 195 | + data-condition="cleanCondition" | |
| 196 | + > | |
| 197 | + <?php echo esc_html(acym_translation('ACYM_SAVE_EXIT')); ?> | |
| 198 | + </button> | |
| 199 | + <button | |
| 200 | + type="button" | |
| 201 | + class="button acy_button_submit medium-shrink medium-margin-bottom-0 cell" | |
| 202 | + data-task="edit" | |
| 203 | + data-step="saveConditions" | |
| 204 | + data-condition="cleanCondition" | |
| 205 | + > | |
| 206 | + <?php echo esc_html(acym_translation('ACYM_SAVE_CONTINUE')); ?> | |
| 207 | + </button> | |
| 208 | + </div> | |
| 209 | + <?php } ?> | |
| 210 | + </div> | |
| 211 | + </div> | |
| 212 | + <?php acym_formOptions(); ?> | |
| 213 | +</form> | |