| @@ -1,5 +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 | +// 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 | +<form id="acym_form" action="<?php echo esc_url(acym_completeLink(acym_getVar('cmd', 'ctrl'))); ?>" method="post" name="acyForm" data-abide novalidate> | |
| 2 | 6 | <input type="hidden" name="id" value="<?php echo !empty($data['automation']->id) ? intval($data['automation']->id) : ''; ?>"> |
| 3 | 7 | <input type="hidden" name="stepAutomationId" value="<?php echo empty($data['step']->id) ? '' : intval($data['step']->id); ?>"> |
| 4 | 8 | <input type="hidden" name="automation[admin]" value="<?php echo empty($data['automation']->admin) ? '' : intval($data['automation']->admin); ?>"> |
| 5 | 9 | <div class="acym__content cell grid-x" id="acym__automation__info"> |
| @@ -6,20 +10,20 @@ | ||
| 6 | 10 | <?php |
| 7 | 11 | if (empty($data['automation']->id)) { |
| 8 | 12 | $data['workflowHelper']->disabledAfter = 'info'; |
| 9 | 13 | } |
| 10 | - echo $data['workflowHelper']->display($this->steps, $this->step); | |
| 14 | + $data['workflowHelper']->display($this->steps, $this->step); | |
| 11 | 15 | ?> |
| 12 | 16 | <div class="cell grid-x grid-margin-x"> |
| 13 | 17 | <div class="medium-12 small-12 cell grid-x acym__content acym__automation__info__first margin-top-2 margin-y"> |
| 14 | 18 | <div class="cell medium-6"> |
| 15 | - <label for="automation_name"><?php echo acym_translation('ACYM_NAME'); ?></label> | |
| 19 | + <label for="automation_name"><?php echo esc_html(acym_translation('ACYM_NAME')); ?></label> | |
| 16 | 20 | <?php if (empty($data['automation']->admin)) { ?> |
| 17 | 21 | <input required |
| 18 | 22 | type="text" |
| 19 | 23 | id="automation_name" |
| 20 | 24 | name="automation[name]" |
| 21 | - value="<?php echo !empty($data['automation']->name) ? acym_escape($data['automation']->name) : ''; ?>"> | |
| 25 | + value="<?php echo !empty($data['automation']->name) ? esc_attr($data['automation']->name) : ''; ?>"> | |
| 22 | 26 | <?php } else { ?> |
| 23 | 27 | <input required |
| 24 | 28 | type="text" |
| 25 | 29 | id="automation_name" |
| @@ -24,23 +28,27 @@ | ||
| 24 | 28 | type="text" |
| 25 | 29 | id="automation_name" |
| 26 | 30 | name="automation[name]" |
| 27 | 31 | disabled |
| 28 | - value="<?php echo acym_escape(acym_translation($data['automation']->name)); ?>"> | |
| 32 | + value="<?php echo esc_attr(acym_translation($data['automation']->name)); ?>"> | |
| 29 | 33 | <?php } ?> |
| 30 | 34 | </div> |
| 31 | 35 | <div class="cell medium-shrink grid-x acym_vcenter margin-left-2" <?php echo empty($data['automation']->id) ? 'style="display: none"' : ''; ?>> |
| 32 | - <?php echo acym_switch('automation[active]', $data['automation']->active, acym_translation('ACYM_ACTIVE')); ?> | |
| 36 | + <?php acym_switch([ | |
| 37 | + 'name' => 'automation[active]', | |
| 38 | + 'value' => $data['automation']->active, | |
| 39 | + 'label' => acym_translation('ACYM_ACTIVE'), | |
| 40 | + ]); ?> | |
| 33 | 41 | </div> |
| 34 | 42 | <label class="cell"> |
| 35 | 43 | <h6 id="acym__automation__info__desc__button" class="cursor-pointer"> |
| 36 | - <?php echo acym_translation('ACYM_DESCRIPTION'); ?> | |
| 44 | + <?php echo esc_html(acym_translation('ACYM_DESCRIPTION')); ?> | |
| 37 | 45 | <i class="acymicon-keyboard-arrow-down"></i> |
| 38 | 46 | </h6> |
| 39 | - <?php if (!empty($data['automation']->admin)) $data['automation']->description = acym_escape(acym_translation($data['automation']->description)); ?> | |
| 47 | + <?php if (!empty($data['automation']->admin)) $data['automation']->description = esc_html(acym_translation($data['automation']->description)); ?> | |
| 40 | 48 | <textarea style="display: none" |
| 41 | 49 | name="automation[description]" <?php echo empty($data['automation']->admin) ? '' : 'disabled'; ?> rows="6" |
| 42 | - class="margin-top-1"><?php echo !empty($data['automation']->description) ? acym_escape( | |
| 50 | + class="margin-top-1"><?php echo !empty($data['automation']->description) ? esc_html( | |
| 43 | 51 | $data['automation']->description |
| 44 | 52 | ) : ''; ?></textarea> |
| 45 | 53 | </label> |
| 46 | 54 | </div> |
| @@ -47,9 +55,9 @@ | ||
| 47 | 55 | <div class="medium-12 cell grid-x acym__content acym__automation__info__trigger margin-top-2"> |
| 48 | 56 | <div class="cell grid-x margin-bottom-2" id="acym__automation__info__choose__trigger__type"> |
| 49 | 57 | <input type="hidden" |
| 50 | 58 | name="type_trigger" |
| 51 | - value="<?php echo !empty($data['type_trigger']) ? $data['type_trigger'] : 'classic'; ?>" | |
| 59 | + value="<?php echo !empty($data['type_trigger']) ? esc_attr($data['type_trigger']) : 'classic'; ?>" | |
| 52 | 60 | id="acym__automation__trigger__type__input"> |
| 53 | 61 | <div class="cell auto"></div> |
| 54 | 62 | <?php |
| 55 | 63 | $class = ''; |
| @@ -60,15 +68,17 @@ | ||
| 60 | 68 | } |
| 61 | 69 | ?> |
| 62 | 70 | <p id="acym__automation__info__group" |
| 63 | 71 | data-trigger-type="classic" |
| 64 | - class="shrink cell <?php echo $class; ?> margin-right-2"> | |
| 65 | - <?php echo acym_translation('ACYM_CLASSIC_TRIGGER'); ?> | |
| 72 | + class="shrink cell <?php echo esc_attr($class); ?> margin-right-2"> | |
| 73 | + <?php echo esc_html(acym_translation('ACYM_CLASSIC_TRIGGER')); ?> | |
| 66 | 74 | </p> |
| 67 | 75 | <p id="acym__automation__info__one-user" |
| 68 | 76 | data-trigger-type="user" |
| 69 | - class="shrink cell <?php echo (!empty($data['type_trigger']) && $data['type_trigger'] == 'user') ? 'selected-trigger' : ''; ?>"><?php echo acym_translation( | |
| 70 | - 'ACYM_TRIGGER_BASED_ON_USER_ACTIONS' | |
| 77 | + class="shrink cell <?php echo (!empty($data['type_trigger']) && $data['type_trigger'] == 'user') ? 'selected-trigger' : ''; ?>"><?php echo esc_html( | |
| 78 | + acym_translation( | |
| 79 | + 'ACYM_TRIGGER_BASED_ON_USER_ACTIONS' | |
| 80 | + ) | |
| 71 | 81 | ); ?></p> |
| 72 | 82 | <div class="cell auto"></div> |
| 73 | 83 | </div> |
| 74 | 84 | <div class="acym__automation__info__choose__trigger cell grid-x grid-margin-x grid-margin-y" |
| @@ -74,27 +84,34 @@ | ||
| 74 | 84 | <div class="acym__automation__info__choose__trigger cell grid-x grid-margin-x grid-margin-y" |
| 75 | 85 | id="acym__automation__info__choose__trigger__classic" <?php echo (!empty($data['type_trigger']) && $data['type_trigger'] == 'classic') ? '' |
| 76 | 86 | : (empty($data['type_trigger']) ? '' : 'style="display: none"'); ?>> |
| 77 | 87 | <div class="cell large-6 acym__content grid-x acym__automation__draggable"> |
| 78 | - <h6 class="acym__title acym__title__secondary"><?php echo acym_translation('ACYM_ALL_TRIGGER'); ?></h6> | |
| 88 | + <h6 class="acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_ALL_TRIGGER')); ?></h6> | |
| 79 | 89 | <div class="cell acym__automation__all-trigger__classic grid-x"> |
| 80 | - <?php foreach ($data['classic'] as $key => $classic) { | |
| 81 | - echo '<div '.(in_array( | |
| 82 | - $key, | |
| 83 | - $data['defaultValues'] | |
| 84 | - ) ? 'style="display: none"' : '').' class="acym__automation__trigger__droppable__classic margin-top-1 cell" data-trigger="'.acym_escape( | |
| 85 | - $key | |
| 86 | - ).'"><span class="acym__automation__trigger__name">'.$classic->name.'</span><span class="acym__automation__trigger__action">'.$classic->option.'</span></div>'; | |
| 87 | - } ?> | |
| 90 | + <?php | |
| 91 | + foreach ($data['classic'] as $key => $classic) { | |
| 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 } ?> | |
| 88 | 105 | </div> |
| 89 | 106 | </div> |
| 90 | 107 | |
| 91 | 108 | <div class="cell large-6 acym__content grid-x acym__automation__droppable__classic"> |
| 92 | - <h6 class="acym__title acym__title__secondary cell"><?php echo acym_translation('ACYM_EXECUTE_AUTOMATION'); ?></h6> | |
| 109 | + <h6 class="acym__title acym__title__secondary cell"><?php echo esc_html(acym_translation('ACYM_EXECUTE_AUTOMATION')); ?></h6> | |
| 93 | 110 | <div class="cell acym__automation__user-trigger__classic acym__automation__trigger__sortable"> |
| 94 | 111 | <?php |
| 95 | 112 | if (count($data['defaultValues']) < 2) { |
| 96 | - echo '<div class="cell margin-top-1 acym__automation__drag-here-text">'.acym_translation('ACYM_DRAG_YOUR_TRIGGERS').'</div>'; | |
| 113 | + echo '<div class="cell margin-top-1 acym__automation__drag-here-text">'.esc_html(acym_translation('ACYM_DRAG_YOUR_TRIGGERS')).'</div>'; | |
| 97 | 114 | } |
| 98 | 115 | foreach ($data['classic'] as $key => $classic) { |
| 99 | 116 | if (!in_array($key, $data['defaultValues'])) continue; |
| 100 | 117 | ?> |
| @@ -99,12 +116,16 @@ | ||
| 99 | 116 | if (!in_array($key, $data['defaultValues'])) continue; |
| 100 | 117 | ?> |
| 101 | 118 | <div class="acym__automation__droppable__trigger margin-top-1"> |
| 102 | 119 | <div class="acym__automation__one__trigger"> |
| 103 | - <span class="acym__automation__trigger__name"><?php echo $classic->name; ?></span> | |
| 104 | - <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> | |
| 105 | 126 | </div> |
| 106 | - <i data-trigger-show="<?php echo acym_escape($key); ?>" | |
| 127 | + <i data-trigger-show="<?php echo esc_attr($key); ?>" | |
| 107 | 128 | class="acymicon-close acym__color__red acym__automation__delete__trigger cursor-pointer"></i> |
| 108 | 129 | </div> |
| 109 | 130 | <?php |
| 110 | 131 | } |
| @@ -115,38 +136,48 @@ | ||
| 115 | 136 | <div class="acym__automation__info__choose__trigger cell grid-x grid-margin-x grid-margin-y" |
| 116 | 137 | id="acym__automation__info__choose__trigger__user" <?php echo (!empty($data['type_trigger']) && $data['type_trigger'] == 'user') ? '' |
| 117 | 138 | : 'style="display: none"'; ?>> |
| 118 | 139 | <div class="cell large-6 acym__content grid-x acym__automation__draggable"> |
| 119 | - <h6 class="acym__title acym__title__secondary"><?php echo acym_translation('ACYM_ALL_TRIGGER'); ?></h6> | |
| 140 | + <h6 class="acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_ALL_TRIGGER')); ?></h6> | |
| 120 | 141 | <div class="cell acym__automation__all-trigger__action grid-x"> |
| 121 | 142 | <?php |
| 122 | 143 | foreach ($data['user'] as $key => $triggerUser) { |
| 123 | - echo '<div '.(in_array( | |
| 124 | - $key, | |
| 125 | - $data['defaultValues'] | |
| 126 | - ) ? 'style="display: none"' : '').' class="acym__automation__trigger__droppable__action margin-top-1 cell" data-trigger="'.acym_escape( | |
| 127 | - $key | |
| 128 | - ).'"><span class="acym__automation__trigger__name">'.$triggerUser->name.'</span><span class="acym__automation__trigger__action">'.$triggerUser->option.'</span></div>'; | |
| 129 | - } | |
| 130 | - ?> | |
| 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 } ?> | |
| 131 | 157 | </div> |
| 132 | 158 | </div> |
| 133 | 159 | |
| 134 | 160 | <div class="cell large-6 acym__content grid-x acym__automation__droppable__action"> |
| 135 | - <h6 class="acym__title acym__title__secondary cell"><?php echo acym_translation('ACYM_EXECUTE_AUTOMATION'); ?></h6> | |
| 161 | + <h6 class="acym__title acym__title__secondary cell"><?php echo esc_html(acym_translation('ACYM_EXECUTE_AUTOMATION')); ?></h6> | |
| 136 | 162 | <div class="cell acym__automation__user-trigger__action acym__automation__trigger__sortable"> |
| 137 | 163 | <?php |
| 138 | 164 | if (count($data['defaultValues']) < 2) { |
| 139 | - echo '<div class="cell margin-top-1 acym__automation__drag-here-text">'.acym_translation('ACYM_DRAG_YOUR_TRIGGERS').'</div>'; | |
| 165 | + echo '<div class="cell margin-top-1 acym__automation__drag-here-text">'.esc_html(acym_translation('ACYM_DRAG_YOUR_TRIGGERS')).'</div>'; | |
| 140 | 166 | } |
| 141 | 167 | foreach ($data['user'] as $key => $triggerUser) { |
| 142 | 168 | if (!in_array($key, $data['defaultValues'])) continue; |
| 143 | 169 | ?> |
| 144 | 170 | <div class="acym__automation__droppable__trigger margin-top-1"> |
| 145 | - <div class="acym__automation__one__trigger"><span class="acym__automation__trigger__name"><?php echo $triggerUser->name; ?></span></b> | |
| 146 | - <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> | |
| 147 | 178 | </div> |
| 148 | - <i data-trigger-show="<?php echo acym_escape($key); ?>" | |
| 179 | + <i data-trigger-show="<?php echo esc_attr($key); ?>" | |
| 149 | 180 | class="acymicon-close acym__color__red acym__automation__delete__trigger cursor-pointer"></i> |
| 150 | 181 | </div> |
| 151 | 182 | <?php |
| 152 | 183 | } |
| @@ -156,17 +187,17 @@ | ||
| 156 | 187 | </div> |
| 157 | 188 | </div> |
| 158 | 189 | <div class="cell grid-x margin-top-2"> |
| 159 | 190 | <div class="cell medium-shrink medium-margin-bottom-0 margin-bottom-1 text-left"> |
| 160 | - <?php echo acym_backToListing('automation'); ?> | |
| 191 | + <?php acym_backToListing('automation'); ?> | |
| 161 | 192 | </div> |
| 162 | 193 | <div class="cell medium-auto grid-x grid-margin-x text-right"> |
| 163 | 194 | <div class="cell auto"></div> |
| 164 | 195 | <button class="cell medium-shrink button medium-margin-bottom-0 margin-bottom-1 acy_button_submit button-secondary" |
| 165 | 196 | type="button" |
| 166 | - data-task="saveExitInfo"><?php echo acym_translation('ACYM_SAVE_EXIT'); ?></button> | |
| 197 | + data-task="saveExitInfo"><?php echo esc_html(acym_translation('ACYM_SAVE_EXIT')); ?></button> | |
| 167 | 198 | <button class="cell medium-shrink button margin-bottom-0 acy_button_submit" type="button" data-task="saveInfo"> |
| 168 | - <?php echo acym_translation('ACYM_SAVE_CONTINUE'); ?> | |
| 199 | + <?php echo esc_html(acym_translation('ACYM_SAVE_CONTINUE')); ?> | |
| 169 | 200 | </button> |
| 170 | 201 | </div> |
| 171 | 202 | </div> |
| 172 | 203 | </div> |