| @@ -1,41 +1,57 @@ | ||
| 1 | 1 | <?php |
| 2 | -if (!empty($data['mailInformation'])) $data['mail'] = $data['mailInformation']; | |
| 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 | +if (!empty($data['mailInformation'])) { | |
| 6 | + $data['mail'] = $data['mailInformation']; | |
| 7 | +} | |
| 3 | 8 | ?> |
| 4 | 9 | <div class="cell grid-x" id="acym__campaigns__edit_email__attachments"> |
| 5 | - <label class="cell"><?php echo acym_translation('ACYM_ATTACHMENTS'); ?></label> | |
| 10 | + <label class="cell"><?php echo esc_html(acym_translation('ACYM_ATTACHMENTS')); ?></label> | |
| 6 | 11 | <?php if (!empty($data['mail']->attachments)) { ?> |
| 7 | 12 | <?php |
| 8 | 13 | foreach ($data['mail']->attachments as $i => $oneAttach) { |
| 9 | 14 | $onlyFilename = explode('/', $oneAttach['filename']); |
| 10 | - | |
| 11 | 15 | $onlyFilename = end($onlyFilename); |
| 12 | 16 | |
| 13 | - echo '<div class="acym__listing__row cell grid-x" id="acym__campaigns__attach__del'.$i.'">'; | |
| 17 | + echo '<div class="acym__listing__row cell grid-x" id="acym__campaigns__attach__del'.esc_attr($i).'">'; | |
| 14 | 18 | |
| 15 | - echo acym_tooltip( | |
| 19 | + acym_tooltip( | |
| 16 | 20 | [ |
| 17 | - 'hoveredText' => '<span class="cell acym__campaigns__attachments__already">'.$onlyFilename.' ('.(round($oneAttach['size'] / 1000, 1)).' Ko)</span>', | |
| 21 | + 'hoveredText' => '<span class="cell acym__campaigns__attachments__already">'.esc_html( | |
| 22 | + $onlyFilename.' ('.(round($oneAttach['size'] / 1000, 1)).' Ko)' | |
| 23 | + ).'</span>', | |
| 18 | 24 | 'textShownInTooltip' => $oneAttach['filename'], |
| 19 | 25 | 'classContainer' => 'medium-11 cell', |
| 20 | 26 | ] |
| 21 | 27 | ); |
| 22 | 28 | $mailId = !empty($data['mail']->mail_id) ? $data['mail']->mail_id : $data['mail']->id; |
| 23 | - echo '<div class="cell medium-1 text-center"><a data-id="'.$i.'" data-mail="'.intval($mailId).'" class="acym__campaigns__attach__delete"><i class="acymicon-delete acym__color__red"></i></a></div>'; | |
| 24 | - echo '</div>'; | |
| 29 | + echo '<div class="cell medium-1 text-center"> | |
| 30 | + <a data-id="'.esc_attr($i).'" data-mail="'.intval($mailId).'" class="acym__campaigns__attach__delete"> | |
| 31 | + <i class="acymicon-delete acym__color__red"></i> | |
| 32 | + </a> | |
| 33 | + </div> | |
| 34 | + </div>'; | |
| 25 | 35 | } |
| 26 | 36 | } |
| 27 | 37 | |
| 28 | - $uploadfileType = $data['uploadFileType']; | |
| 29 | 38 | for ($i = 0; $i < 10; $i++) { |
| 30 | - $result = '<div '.($i >= 1 ? 'style="display:none"' : '').' class="cell grid-x grid-margin-x acym__campaigns__attach__elements" id="acym__campaigns__attach__'.$i.'">'; | |
| 31 | - $result .= $uploadfileType->display('attachments', $i); | |
| 32 | - $result .= '<div class="cell medium-auto"></div><div class="cell medium-1 text-center "><i style="display: none;" id="attachments'.$i.'suppr" data-id="'.$i.'" class="acymicon-delete acym__color__red acym__campaigns__attach__remove"></i></div>'; | |
| 33 | - $result .= '</div>'; | |
| 34 | - echo $result; | |
| 35 | - } | |
| 36 | - ?> | |
| 39 | + ?> | |
| 40 | + <div <?php echo $i >= 1 ? 'style="display:none"' : ''; ?> | |
| 41 | + class="cell grid-x grid-margin-x acym__campaigns__attach__elements" | |
| 42 | + id="acym__campaigns__attach__<?php echo intval($i); ?>"> | |
| 43 | + <?php $data['uploadFileType']->display('attachments', $i); ?> | |
| 44 | + <div class="cell medium-auto"></div> | |
| 45 | + <div class="cell medium-1 text-center "> | |
| 46 | + <i style="display: none;" | |
| 47 | + id="attachments<?php echo intval($i); ?>suppr" | |
| 48 | + data-id="<?php echo intval($i); ?>" | |
| 49 | + class="acymicon-delete acym__color__red acym__campaigns__attach__remove"></i> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + <?php } ?> | |
| 37 | 53 | </div> |
| 38 | 54 | <div class="cell"> |
| 39 | - <a href="javascript:void(0);" id="acym__campaigns__attach__add"><?php echo acym_translation('ACYM_ADD_ATTACHMENT'); ?></a> | |
| 40 | - <?php echo acym_translationSprintf('ACYM_MAX_UPLOAD', $data['maxupload']); ?> | |
| 55 | + <a href="javascript:void(0);" id="acym__campaigns__attach__add"><?php echo esc_html(acym_translation('ACYM_ADD_ATTACHMENT')); ?></a> | |
| 56 | + <?php echo esc_html(acym_translationSprintf('ACYM_MAX_UPLOAD', $data['maxupload'])); ?> | |
| 41 | 57 | </div> |