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