| @@ -18,19 +18,19 @@ | ||
| 18 | 18 | <div class="cell medium-6"> |
| 19 | 19 | <label for="automation_name"><?php echo esc_html(acym_translation('ACYM_NAME')); ?></label> |
| 20 | 20 | <?php if (empty($data['automation']->admin)) { ?> |
| 21 | 21 | <input required |
| 22 | - type="text" | |
| 23 | - id="automation_name" | |
| 24 | - name="automation[name]" | |
| 25 | - value="<?php echo !empty($data['automation']->name) ? esc_attr($data['automation']->name) : ''; ?>"> | |
| 22 | + type="text" | |
| 23 | + id="automation_name" | |
| 24 | + name="automation[name]" | |
| 25 | + value="<?php echo !empty($data['automation']->name) ? esc_attr($data['automation']->name) : ''; ?>"> | |
| 26 | 26 | <?php } else { ?> |
| 27 | 27 | <input required |
| 28 | - type="text" | |
| 29 | - id="automation_name" | |
| 30 | - name="automation[name]" | |
| 31 | - disabled | |
| 32 | - value="<?php echo esc_attr(acym_translation($data['automation']->name)); ?>"> | |
| 28 | + type="text" | |
| 29 | + id="automation_name" | |
| 30 | + name="automation[name]" | |
| 31 | + disabled | |
| 32 | + value="<?php echo esc_attr(acym_translation($data['automation']->name)); ?>"> | |
| 33 | 33 | <?php } ?> |
| 34 | 34 | </div> |
| 35 | 35 | <div class="cell medium-shrink grid-x acym_vcenter margin-left-2" <?php echo empty($data['automation']->id) ? 'style="display: none"' : ''; ?>> |
| 36 | 36 | <?php acym_switch([ |
| @@ -45,10 +45,10 @@ | ||
| 45 | 45 | <i class="acymicon-keyboard-arrow-down"></i> |
| 46 | 46 | </h6> |
| 47 | 47 | <?php if (!empty($data['automation']->admin)) $data['automation']->description = esc_html(acym_translation($data['automation']->description)); ?> |
| 48 | 48 | <textarea style="display: none" |
| 49 | - name="automation[description]" <?php echo empty($data['automation']->admin) ? '' : 'disabled'; ?> rows="6" | |
| 50 | - class="margin-top-1"><?php echo !empty($data['automation']->description) ? esc_html( | |
| 49 | + name="automation[description]" <?php echo empty($data['automation']->admin) ? '' : 'disabled'; ?> rows="6" | |
| 50 | + class="margin-top-1"><?php echo !empty($data['automation']->description) ? esc_html( | |
| 51 | 51 | $data['automation']->description |
| 52 | 52 | ) : ''; ?></textarea> |
| 53 | 53 | </label> |
| 54 | 54 | </div> |
| @@ -54,11 +54,11 @@ | ||
| 54 | 54 | </div> |
| 55 | 55 | <div class="medium-12 cell grid-x acym__content acym__automation__info__trigger margin-top-2"> |
| 56 | 56 | <div class="cell grid-x margin-bottom-2" id="acym__automation__info__choose__trigger__type"> |
| 57 | 57 | <input type="hidden" |
| 58 | - name="type_trigger" | |
| 59 | - value="<?php echo !empty($data['type_trigger']) ? esc_attr($data['type_trigger']) : 'classic'; ?>" | |
| 60 | - id="acym__automation__trigger__type__input"> | |
| 58 | + name="type_trigger" | |
| 59 | + value="<?php echo !empty($data['type_trigger']) ? esc_attr($data['type_trigger']) : 'classic'; ?>" | |
| 60 | + id="acym__automation__trigger__type__input"> | |
| 61 | 61 | <div class="cell auto"></div> |
| 62 | 62 | <?php |
| 63 | 63 | $class = ''; |
| 64 | 64 | if (!empty($data['type_trigger']) && $data['type_trigger'] == 'classic') { |
| @@ -81,27 +81,28 @@ | ||
| 81 | 81 | ); ?></p> |
| 82 | 82 | <div class="cell auto"></div> |
| 83 | 83 | </div> |
| 84 | 84 | <div class="acym__automation__info__choose__trigger cell grid-x grid-margin-x grid-margin-y" |
| 85 | - id="acym__automation__info__choose__trigger__classic" <?php echo (!empty($data['type_trigger']) && $data['type_trigger'] == 'classic') ? '' | |
| 85 | + id="acym__automation__info__choose__trigger__classic" <?php echo (!empty($data['type_trigger']) && $data['type_trigger'] == 'classic') ? '' | |
| 86 | 86 | : (empty($data['type_trigger']) ? '' : 'style="display: none"'); ?>> |
| 87 | 87 | <div class="cell large-6 acym__content grid-x acym__automation__draggable"> |
| 88 | 88 | <h6 class="acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_ALL_TRIGGER')); ?></h6> |
| 89 | 89 | <div class="cell acym__automation__all-trigger__classic grid-x"> |
| 90 | - <!-- TODO : Handle the escape of ->option var in the addons themself --> | |
| 91 | 90 | <?php |
| 92 | - $allowedTriggerNameTags = [ | |
| 93 | - 'div' => ['class' => true], | |
| 94 | - 'span' => ['class' => true], | |
| 95 | - ]; | |
| 96 | 91 | foreach ($data['classic'] as $key => $classic) { |
| 97 | - echo '<div '.(in_array( | |
| 98 | - $key, | |
| 99 | - $data['defaultValues'] | |
| 100 | - ) ? 'style="display: none"' : '').' class="acym__automation__trigger__droppable__classic margin-top-1 cell" data-trigger="'.esc_attr( | |
| 101 | - $key | |
| 102 | - ).'"><span class="acym__automation__trigger__name">'.wp_kses($classic->name, $allowedTriggerNameTags).'</span><span class="acym__automation__trigger__action">'.$classic->option.'</span></div>'; | |
| 103 | - } ?> | |
| 92 | + ?> | |
| 93 | + <div | |
| 94 | + <?php echo in_array($key, $data['defaultValues']) ? 'style="display: none"' : ''; ?> | |
| 95 | + class="acym__automation__trigger__droppable__classic margin-top-1 cell" | |
| 96 | + data-trigger="<?php echo esc_attr($key); ?>"> | |
| 97 | + <span class="acym__automation__trigger__name"> | |
| 98 | + <?php echo esc_html($classic->name); ?> | |
| 99 | + </span> | |
| 100 | + <span class="acym__automation__trigger__action"> | |
| 101 | + <?php acym_displayAddonOption($classic); ?> | |
| 102 | + </span> | |
| 103 | + </div> | |
| 104 | + <?php } ?> | |
| 104 | 105 | </div> |
| 105 | 106 | </div> |
| 106 | 107 | |
| 107 | 108 | <div class="cell large-6 acym__content grid-x acym__automation__droppable__classic"> |
| @@ -115,10 +116,14 @@ | ||
| 115 | 116 | if (!in_array($key, $data['defaultValues'])) continue; |
| 116 | 117 | ?> |
| 117 | 118 | <div class="acym__automation__droppable__trigger margin-top-1"> |
| 118 | 119 | <div class="acym__automation__one__trigger"> |
| 119 | - <span class="acym__automation__trigger__name"><?php echo wp_kses($classic->name, $allowedTriggerNameTags); ?></span> | |
| 120 | - <span class="acym__automation__trigger__action"><?php echo $classic->option; ?></span> | |
| 120 | + <span class="acym__automation__trigger__name"> | |
| 121 | + <?php echo esc_html($classic->name); ?> | |
| 122 | + </span> | |
| 123 | + <span class="acym__automation__trigger__action"> | |
| 124 | + <?php acym_displayAddonOption($classic); ?> | |
| 125 | + </span> | |
| 121 | 126 | </div> |
| 122 | 127 | <i data-trigger-show="<?php echo esc_attr($key); ?>" |
| 123 | 128 | class="acymicon-close acym__color__red acym__automation__delete__trigger cursor-pointer"></i> |
| 124 | 129 | </div> |
| @@ -128,9 +133,9 @@ | ||
| 128 | 133 | </div> |
| 129 | 134 | </div> |
| 130 | 135 | </div> |
| 131 | 136 | <div class="acym__automation__info__choose__trigger cell grid-x grid-margin-x grid-margin-y" |
| 132 | - id="acym__automation__info__choose__trigger__user" <?php echo (!empty($data['type_trigger']) && $data['type_trigger'] == 'user') ? '' | |
| 137 | + id="acym__automation__info__choose__trigger__user" <?php echo (!empty($data['type_trigger']) && $data['type_trigger'] == 'user') ? '' | |
| 133 | 138 | : 'style="display: none"'; ?>> |
| 134 | 139 | <div class="cell large-6 acym__content grid-x acym__automation__draggable"> |
| 135 | 140 | <h6 class="acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_ALL_TRIGGER')); ?></h6> |
| 136 | 141 | <div class="cell acym__automation__all-trigger__action grid-x"> |
| @@ -135,16 +140,21 @@ | ||
| 135 | 140 | <h6 class="acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_ALL_TRIGGER')); ?></h6> |
| 136 | 141 | <div class="cell acym__automation__all-trigger__action grid-x"> |
| 137 | 142 | <?php |
| 138 | 143 | foreach ($data['user'] as $key => $triggerUser) { |
| 139 | - echo '<div '.(in_array( | |
| 140 | - $key, | |
| 141 | - $data['defaultValues'] | |
| 142 | - ) ? 'style="display: none"' : '').' class="acym__automation__trigger__droppable__action margin-top-1 cell" data-trigger="'.esc_attr( | |
| 143 | - $key | |
| 144 | - ).'"><span class="acym__automation__trigger__name">'.wp_kses($triggerUser->name, $allowedTriggerNameTags).'</span><span class="acym__automation__trigger__action">'.$triggerUser->option.'</span></div>'; | |
| 145 | - } | |
| 146 | - ?> | |
| 144 | + ?> | |
| 145 | + <div | |
| 146 | + <?php echo in_array($key, $data['defaultValues']) ? 'style="display: none"' : ''; ?> | |
| 147 | + class="acym__automation__trigger__droppable__action margin-top-1 cell" | |
| 148 | + data-trigger="<?php echo esc_attr($key); ?>"> | |
| 149 | + <span class="acym__automation__trigger__name"> | |
| 150 | + <?php echo esc_html($triggerUser->name); ?> | |
| 151 | + </span> | |
| 152 | + <span class="acym__automation__trigger__action"> | |
| 153 | + <?php acym_displayAddonOption($triggerUser); ?> | |
| 154 | + </span> | |
| 155 | + </div> | |
| 156 | + <?php } ?> | |
| 147 | 157 | </div> |
| 148 | 158 | </div> |
| 149 | 159 | |
| 150 | 160 | <div class="cell large-6 acym__content grid-x acym__automation__droppable__action"> |
| @@ -157,10 +167,15 @@ | ||
| 157 | 167 | foreach ($data['user'] as $key => $triggerUser) { |
| 158 | 168 | if (!in_array($key, $data['defaultValues'])) continue; |
| 159 | 169 | ?> |
| 160 | 170 | <div class="acym__automation__droppable__trigger margin-top-1"> |
| 161 | - <div class="acym__automation__one__trigger"><span class="acym__automation__trigger__name"><?php echo wp_kses($triggerUser->name, $allowedTriggerNameTags); ?></span></b> | |
| 162 | - <span class="acym__automation__trigger__action"><?php echo $triggerUser->option; ?></span> | |
| 171 | + <div class="acym__automation__one__trigger"> | |
| 172 | + <span class="acym__automation__trigger__name"> | |
| 173 | + <?php echo esc_html($triggerUser->name); ?> | |
| 174 | + </span> | |
| 175 | + <span class="acym__automation__trigger__action"> | |
| 176 | + <?php acym_displayAddonOption($triggerUser); ?> | |
| 177 | + </span> | |
| 163 | 178 | </div> |
| 164 | 179 | <i data-trigger-show="<?php echo esc_attr($key); ?>" |
| 165 | 180 | class="acymicon-close acym__color__red acym__automation__delete__trigger cursor-pointer"></i> |
| 166 | 181 | </div> |
| @@ -177,10 +192,10 @@ | ||
| 177 | 192 | </div> |
| 178 | 193 | <div class="cell medium-auto grid-x grid-margin-x text-right"> |
| 179 | 194 | <div class="cell auto"></div> |
| 180 | 195 | <button class="cell medium-shrink button medium-margin-bottom-0 margin-bottom-1 acy_button_submit button-secondary" |
| 181 | - type="button" | |
| 182 | - data-task="saveExitInfo"><?php echo esc_html(acym_translation('ACYM_SAVE_EXIT')); ?></button> | |
| 196 | + type="button" | |
| 197 | + data-task="saveExitInfo"><?php echo esc_html(acym_translation('ACYM_SAVE_EXIT')); ?></button> | |
| 183 | 198 | <button class="cell medium-shrink button margin-bottom-0 acy_button_submit" type="button" data-task="saveInfo"> |
| 184 | 199 | <?php echo esc_html(acym_translation('ACYM_SAVE_CONTINUE')); ?> |
| 185 | 200 | </button> |
| 186 | 201 | </div> |