| @@ -1,12 +1,16 @@ | ||
| 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 | +?> | |
| 1 | 5 | <div id="acym__wysid__right__toolbar__settings" style="display: none;" class="cell grid-padding-x acym__wysid__right__toolbar--menu"> |
| 2 | 6 | <p class="acym__wysid__right__toolbar__p__open acym__wysid__right__toolbar__p acym__title"> |
| 3 | - <?php echo acym_translation('ACYM_TEMPLATE_DESIGN'); ?><i class="acymicon-keyboard-arrow-up"></i> | |
| 7 | + <?php echo esc_html(acym_translation('ACYM_TEMPLATE_DESIGN')); ?><i class="acymicon-keyboard-arrow-up"></i> | |
| 4 | 8 | </p> |
| 5 | 9 | <div class="grid-y acym__wysid__right__toolbar__design--show acym__wysid__context__modal__container"> |
| 6 | 10 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 7 | 11 | <label for="acym__wysid__background-colorpicker" class="cell large-6 small-9" for="acym__wysid__background-colorpicker"> |
| 8 | - <?php echo acym_translation('ACYM_BACKGROUND_COLOR'); ?> | |
| 12 | + <?php echo esc_html(acym_translation('ACYM_BACKGROUND_COLOR')); ?> | |
| 9 | 13 | </label> |
| 10 | 14 | <i class="acymicon-insert-photo small-1 acym_vcenter text-center cell acym__color__light-blue cursor-pointer" id="acym__wysid__background-image__template"></i> |
| 11 | 15 | <i class="acymicon-close acym_vcenter acym__color__red" id="acym__wysid__background-image__template-delete"></i> |
| 12 | 16 | <div class="small-2 text-center cell" style="margin:auto 0;"> |
| @@ -13,9 +17,9 @@ | ||
| 13 | 17 | <input type="text" id="acym__wysid__background-colorpicker" class="cell medium-shrink small-4" /> |
| 14 | 18 | </div> |
| 15 | 19 | </div> |
| 16 | 20 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 17 | - <label class="middle large-6 cell" for="acym__wysid__background-size"><?php echo acym_translation('ACYM_BACKGROUND_SIZE'); ?></label> | |
| 21 | + <label class="middle large-6 cell" for="acym__wysid__background-size"><?php echo esc_html(acym_translation('ACYM_BACKGROUND_SIZE')); ?></label> | |
| 18 | 22 | <div class="cell large-6"> |
| 19 | 23 | <?php |
| 20 | 24 | $backgroundSize = [ |
| 21 | 25 | 'ACYM_DEFAULT' => [ |
| @@ -56,12 +60,12 @@ | ||
| 56 | 60 | |
| 57 | 61 | echo '<select name="acym__wysid__background-size" id="acym__wysid__background-size" class="acym__select">'; |
| 58 | 62 | |
| 59 | 63 | foreach ($backgroundSize as $groupName => $values) { |
| 60 | - echo '<optgroup label="'.acym_translation($groupName).'">'; | |
| 64 | + echo '<optgroup label="'.esc_attr(acym_translation($groupName)).'">'; | |
| 61 | 65 | foreach ($values as $value => $label) { |
| 62 | 66 | $selected = ($defaultBackgroundSize === $value) ? 'selected' : ''; |
| 63 | - echo '<option value="'.$value.'" '.$selected.'>'.$label.'</option>'; | |
| 67 | + echo '<option value="'.esc_attr($value).'" '.esc_attr($selected).'>'.esc_html($label).'</option>'; | |
| 64 | 68 | } |
| 65 | 69 | echo '</optgroup>'; |
| 66 | 70 | } |
| 67 | 71 | |
| @@ -69,9 +73,9 @@ | ||
| 69 | 73 | ?> |
| 70 | 74 | </div> |
| 71 | 75 | </div> |
| 72 | 76 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 73 | - <label class="middle large-6 cell" for="acym__wysid__background-repeat"><?php echo acym_translation('ACYM_BACKGROUND_REPEAT'); ?></label> | |
| 77 | + <label class="middle large-6 cell" for="acym__wysid__background-repeat"><?php echo esc_html(acym_translation('ACYM_BACKGROUND_REPEAT')); ?></label> | |
| 74 | 78 | <div class="cell large-6"> |
| 75 | 79 | <?php |
| 76 | 80 | $repeat = [ |
| 77 | 81 | 'no-repeat' => acym_translation('ACYM_DISABLE'), |
| @@ -85,19 +89,24 @@ | ||
| 85 | 89 | |
| 86 | 90 | if (!empty($data['mail']->settings['default']['background-repeat'])) $defaultSize = $data['mail']->settings['default']['background-repeat']; |
| 87 | 91 | } |
| 88 | 92 | |
| 89 | - echo acym_select( | |
| 93 | + acym_select( | |
| 90 | 94 | $repeat, |
| 91 | 95 | 'acym__wysid__background-repeat', |
| 92 | 96 | $defaultRepeat, |
| 93 | - ['class' => 'acym__select'] | |
| 97 | + ['class' => 'acym__select'], | |
| 98 | + 'value', | |
| 99 | + 'text', | |
| 100 | + null, | |
| 101 | + false, | |
| 102 | + true | |
| 94 | 103 | ); |
| 95 | 104 | ?> |
| 96 | 105 | </div> |
| 97 | 106 | </div> |
| 98 | 107 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 99 | - <label class="middle large-6 cell" for="acym__wysid__background-position"><?php echo acym_translation('ACYM_BACKGROUND_POSITION'); ?></label> | |
| 108 | + <label class="middle large-6 cell" for="acym__wysid__background-position"><?php echo esc_html(acym_translation('ACYM_BACKGROUND_POSITION')); ?></label> | |
| 100 | 109 | <div class="cell large-6"> |
| 101 | 110 | <?php |
| 102 | 111 | $position = [ |
| 103 | 112 | 'top' => acym_translation('ACYM_POSITION_TOP'), |
| @@ -114,13 +123,18 @@ | ||
| 114 | 123 | |
| 115 | 124 | if (!empty($data['mail']->settings['default']['background-position'])) $defaultPosition = $data['mail']->settings['default']['background-position']; |
| 116 | 125 | } |
| 117 | 126 | |
| 118 | - echo acym_select( | |
| 127 | + acym_select( | |
| 119 | 128 | $position, |
| 120 | 129 | 'acym__wysid__background-position', |
| 121 | 130 | $defaultPosition, |
| 122 | - ['class' => 'acym__select'] | |
| 131 | + ['class' => 'acym__select'], | |
| 132 | + 'value', | |
| 133 | + 'text', | |
| 134 | + null, | |
| 135 | + false, | |
| 136 | + true | |
| 123 | 137 | ); |
| 124 | 138 | ?> |
| 125 | 139 | </div> |
| 126 | 140 | </div> |
| @@ -125,9 +139,10 @@ | ||
| 125 | 139 | </div> |
| 126 | 140 | </div> |
| 127 | 141 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 128 | 142 | <label for="acym__wysid__maincolor-colorpicker1" class="cell large-6 small-9" for="acym__wysid__maincolor-colorpicker1"> |
| 129 | - <?php echo acym_translation('ACYM_MAIN_COLORS').acym_info(['textShownInTooltip' => 'ACYM_MAIN_COLORS_DESC']); ?> | |
| 143 | + <?php echo esc_html(acym_translation('ACYM_MAIN_COLORS')); | |
| 144 | + acym_info(['textShownInTooltip' => 'ACYM_MAIN_COLORS_DESC']); ?> | |
| 130 | 145 | </label> |
| 131 | 146 | <div class="small-1 cell" style="margin:auto 0;"> |
| 132 | 147 | <input type="text" id="acym__wysid__maincolor-colorpicker1" class="cell medium-shrink small-4" /> |
| 133 | 148 | </div> |
| @@ -138,21 +153,21 @@ | ||
| 138 | 153 | <input type="text" id="acym__wysid__maincolor-colorpicker3" class="cell medium-shrink small-4" /> |
| 139 | 154 | </div> |
| 140 | 155 | </div> |
| 141 | 156 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 142 | - <label class="middle large-6 cell" for="acym__wysid__padding__top__content"><?php echo acym_translation('ACYM_MARGIN_TOP_CONTENT'); ?></label> | |
| 157 | + <label class="middle large-6 cell" for="acym__wysid__padding__top__content"><?php echo esc_html(acym_translation('ACYM_MARGIN_TOP_CONTENT')); ?></label> | |
| 143 | 158 | <div class="cell large-6"> |
| 144 | 159 | <input type="number" min="0" value="20" id="acym__wysid__padding__top__content" class="cell small-4"> |
| 145 | 160 | </div> |
| 146 | 161 | </div> |
| 147 | 162 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 148 | - <label class="middle large-6 cell" for="acym__wysid__padding__bottom__content"><?php echo acym_translation('ACYM_MARGIN_BOTTOM_CONTENT'); ?></label> | |
| 163 | + <label class="middle large-6 cell" for="acym__wysid__padding__bottom__content"><?php echo esc_html(acym_translation('ACYM_MARGIN_BOTTOM_CONTENT')); ?></label> | |
| 149 | 164 | <div class="cell large-6"> |
| 150 | 165 | <input type="number" min="0" value="20" id="acym__wysid__padding__bottom__content" class="cell small-4"> |
| 151 | 166 | </div> |
| 152 | 167 | </div> |
| 153 | 168 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 154 | - <label class="middle large-6 cell" for="default_font"><?php echo acym_translation('ACYM_DEFAULT_FONT'); ?></label> | |
| 169 | + <label class="middle large-6 cell" for="default_font"><?php echo esc_html(acym_translation('ACYM_DEFAULT_FONT')); ?></label> | |
| 155 | 170 | <div class="cell large-6"> |
| 156 | 171 | <?php |
| 157 | 172 | $fonts = [ |
| 158 | 173 | 'Andale Mono' => 'Andale Mono', |
| @@ -175,13 +190,18 @@ | ||
| 175 | 190 | |
| 176 | 191 | if (!empty($data['mail']->settings['default']['font-family'])) $defaultFont = $data['mail']->settings['default']['font-family']; |
| 177 | 192 | } |
| 178 | 193 | |
| 179 | - echo acym_select( | |
| 194 | + acym_select( | |
| 180 | 195 | $fonts, |
| 181 | 196 | 'default_font', |
| 182 | 197 | $defaultFont, |
| 183 | - ['class' => 'acym__select'] | |
| 198 | + ['class' => 'acym__select'], | |
| 199 | + 'value', | |
| 200 | + 'text', | |
| 201 | + null, | |
| 202 | + false, | |
| 203 | + true | |
| 184 | 204 | ); |
| 185 | 205 | ?> |
| 186 | 206 | </div> |
| 187 | 207 | |
| @@ -187,21 +207,21 @@ | ||
| 187 | 207 | |
| 188 | 208 | </div> |
| 189 | 209 | </div> |
| 190 | 210 | <p class="acym__wysid__right__toolbar__p__open acym__wysid__right__toolbar__p acym__title"> |
| 191 | - <?php echo acym_translation('ACYM_DESIGN'); ?> | |
| 211 | + <?php echo esc_html(acym_translation('ACYM_DESIGN')); ?> | |
| 192 | 212 | <i class="acymicon-keyboard-arrow-up"></i> |
| 193 | - <?php echo acym_info(['textShownInTooltip' => 'ACYM_INTRO_CUSTOMIZE_FONT']); ?> | |
| 213 | + <?php acym_info(['textShownInTooltip' => 'ACYM_INTRO_CUSTOMIZE_FONT']); ?> | |
| 194 | 214 | </p> |
| 195 | 215 | <div class="grid-y acym__wysid__right__toolbar__design--show acym__wysid__right__toolbar__design acym__wysid__context__modal__container"> |
| 196 | 216 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 197 | - <label class="middle large-6 cell" for="acym__wysid__right__toolbar__settings__font--select"><?php echo acym_translation('ACYM_HTML_TAG'); ?></label> | |
| 217 | + <label class="middle large-6 cell" for="acym__wysid__right__toolbar__settings__font--select"><?php echo esc_html(acym_translation('ACYM_HTML_TAG')); ?></label> | |
| 198 | 218 | <div class="cell large-6"> |
| 199 | 219 | <select id="acym__wysid__right__toolbar__settings__font--select" class="small-8 large-4 cell acym__select"> |
| 200 | - <option value="p">p - <?php echo acym_translation('ACYM_PARAGRAPH'); ?></option> | |
| 201 | - <option value="a">a - <?php echo acym_translation('ACYM_LINKS'); ?></option> | |
| 202 | - <option value="span.acym_link"><?php echo acym_translation('ACYM_DYNAMIC_TEXTS_LINKS'); ?></option> | |
| 203 | - <option value="li">li - <?php echo acym_translation('ACYM_BULLET_LIST'); ?></option> | |
| 220 | + <option value="p">p - <?php echo esc_html(acym_translation('ACYM_PARAGRAPH')); ?></option> | |
| 221 | + <option value="a">a - <?php echo esc_html(acym_translation('ACYM_LINKS')); ?></option> | |
| 222 | + <option value="span.acym_link"><?php echo esc_html(acym_translation('ACYM_DYNAMIC_TEXTS_LINKS')); ?></option> | |
| 223 | + <option value="li">li - <?php echo esc_html(acym_translation('ACYM_BULLET_LIST')); ?></option> | |
| 204 | 224 | <option value="h1">h1</option> |
| 205 | 225 | <option value="h2">h2</option> |
| 206 | 226 | <option value="h3">h3</option> |
| 207 | 227 | <option value="h4">h4</option> |
| @@ -210,9 +230,9 @@ | ||
| 210 | 230 | </select> |
| 211 | 231 | </div> |
| 212 | 232 | </div> |
| 213 | 233 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 214 | - <label class="middle large-6 cell" for="acym__wysid__right__toolbar__settings__font-family"><?php echo acym_translation('ACYM_FAMILY'); ?></label> | |
| 234 | + <label class="middle large-6 cell" for="acym__wysid__right__toolbar__settings__font-family"><?php echo esc_html(acym_translation('ACYM_FAMILY')); ?></label> | |
| 215 | 235 | <div class="cell large-6"> |
| 216 | 236 | <select id="acym__wysid__right__toolbar__settings__font-family" class="auto cell acym__select"> |
| 217 | 237 | <option style="font-family: 'Andale Mono'">Andale Mono</option> |
| 218 | 238 | <option style="font-family: 'Arial'">Arial</option> |
| @@ -228,12 +248,12 @@ | ||
| 228 | 248 | </select> |
| 229 | 249 | </div> |
| 230 | 250 | </div> |
| 231 | 251 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 232 | - <label class="middle large-6 cell" for="acym__wysid__right__toolbar__settings__line-height"><?php echo acym_translation('ACYM_LINE_HEIGHT'); ?></label> | |
| 252 | + <label class="middle large-6 cell" for="acym__wysid__right__toolbar__settings__line-height"><?php echo esc_html(acym_translation('ACYM_LINE_HEIGHT')); ?></label> | |
| 233 | 253 | <div class="cell large-6"> |
| 234 | 254 | <select id="acym__wysid__right__toolbar__settings__line-height" class="auto cell acym__select"> |
| 235 | - <option value="inherit"><?php echo acym_translation('ACYM_DEFAULT'); ?></option> | |
| 255 | + <option value="inherit"><?php echo esc_html(acym_translation('ACYM_DEFAULT')); ?></option> | |
| 236 | 256 | <option value="100%">100%</option> |
| 237 | 257 | <option value="110%">110%</option> |
| 238 | 258 | <option value="120%">120%</option> |
| 239 | 259 | <option value="130%">130%</option> |
| @@ -251,9 +271,9 @@ | ||
| 251 | 271 | </select> |
| 252 | 272 | </div> |
| 253 | 273 | </div> |
| 254 | 274 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 255 | - <label class="middle large-6 cell" for="acym__wysid__right__toolbar__settings__font-size"><?php echo acym_translation('ACYM_SIZE'); ?></label> | |
| 275 | + <label class="middle large-6 cell" for="acym__wysid__right__toolbar__settings__font-size"><?php echo esc_html(acym_translation('ACYM_SIZE')); ?></label> | |
| 256 | 276 | <div class="cell large-6"> |
| 257 | 277 | <select id="acym__wysid__right__toolbar__settings__font-size" class="auto cell acym__select"> |
| 258 | 278 | <option>10px</option> |
| 259 | 279 | <option>12px</option> |
| @@ -272,9 +292,9 @@ | ||
| 272 | 292 | </select> |
| 273 | 293 | </div> |
| 274 | 294 | </div> |
| 275 | 295 | <div class="grid-x margin-bottom-1 small-12 cell"> |
| 276 | - <label class="middle large-6 cell"><?php echo acym_translation('ACYM_STYLE'); ?></label> | |
| 296 | + <label class="middle large-6 cell"><?php echo esc_html(acym_translation('ACYM_STYLE')); ?></label> | |
| 277 | 297 | <i id="acym__wysid__right__toolbar__settings__bold" class="acymicon-format-bold text-center small-3 large-auto cell" style="line-height: 39px"></i> |
| 278 | 298 | <i id="acym__wysid__right__toolbar__settings__italic" class="acymicon-format-italic text-center small-3 large-auto cell" style="line-height: 39px"></i> |
| 279 | 299 | <div class="small-2 text-center cell" style="margin:auto"><input type="text" id="acym__wysid__right__toolbar__settings__color" style="display: none;"></div> |
| 280 | 300 | </div> |
| @@ -287,9 +307,9 @@ | ||
| 287 | 307 | <button type="button" id="acym__wysid__right__toolbar__settings__stylesheet__cancel" class="button cell medium-4">'.acym_translation('ACYM_CANCEL').'</button> |
| 288 | 308 | <div class="medium-4 cell"></div> |
| 289 | 309 | <button type="button" id="acym__wysid__right__toolbar__settings__stylesheet__apply" class="button cell medium-4">'.acym_translation('ACYM_LOAD_STYLESHEET').'</button> |
| 290 | 310 | </div>'; |
| 291 | - echo acym_modal( | |
| 311 | + acym_modal( | |
| 292 | 312 | acym_translation('ACYM_CUSTOM_ADD_STYLESHEET'), |
| 293 | 313 | $dataStyleSheet, |
| 294 | 314 | 'acym__wysid__right__toolbar__settings__stylesheet__modal', |
| 295 | 315 | [], |
| @@ -300,9 +320,9 @@ | ||
| 300 | 320 | ); ?> |
| 301 | 321 | </div> |
| 302 | 322 | </div> |
| 303 | 323 | <p class="acym__wysid__right__toolbar__p__open acym__wysid__right__toolbar__p acym__title"> |
| 304 | - <?php echo acym_translation('ACYM_CUSTOM_SOCIAL_ICONS'); ?><i class="acymicon-keyboard-arrow-up"></i></p> | |
| 324 | + <?php echo esc_html(acym_translation('ACYM_CUSTOM_SOCIAL_ICONS')); ?><i class="acymicon-keyboard-arrow-up"></i></p> | |
| 305 | 325 | <div class="grid-y acym__wysid__right__toolbar__design--show acym__wysid__right__toolbar__design acym__wysid__right__toolbar__design__social__icons acym__wysid__context__modal__container"> |
| 306 | 326 | <?php |
| 307 | 327 | $config = acym_config(); |
| 308 | 328 | $socialIcons = json_decode($config->get('social_icons', '{}'), true); |
| @@ -307,14 +327,18 @@ | ||
| 307 | 327 | $config = acym_config(); |
| 308 | 328 | $socialIcons = json_decode($config->get('social_icons', '{}'), true); |
| 309 | 329 | foreach ($socialIcons as $social => $iconUrl) { |
| 310 | 330 | echo '<div class="cell grid-x margin-bottom-2 acym_vcenter acym__wysid__right__toolbar__design__social__icons__one"> |
| 311 | - <img class="cell shrink" src="'.acym_escape($iconUrl).'" alt="icon '.acym_escape($social).'"> | |
| 312 | - <input type="file" name="icon_'.acym_escape($social).'" class="auto cell" accept="image/png, image/jpeg"> | |
| 313 | - <div class="auto cell grid-x text-center align-center acym_vcenter"><span class="shrink cell acym__wysid__social__icons__import__text">'.acym_translation( | |
| 314 | - 'ACYM_SELECT_NEW_ICON' | |
| 331 | + <img class="cell shrink" src="'.esc_attr($iconUrl).'" alt="icon '.esc_attr($social).'"> | |
| 332 | + <input type="file" name="icon_'.esc_attr($social).'" class="auto cell" accept="image/png, image/jpeg"> | |
| 333 | + <div class="auto cell grid-x text-center align-center acym_vcenter"><span class="shrink cell acym__wysid__social__icons__import__text">'.esc_html( | |
| 334 | + acym_translation( | |
| 335 | + 'ACYM_SELECT_NEW_ICON' | |
| 336 | + ) | |
| 315 | 337 | ).'</span></div> |
| 316 | - <button disabled type="button" class="button cell shrink acym__wysid__social__icons__import">'.acym_translation('ACYM_IMPORT').'</button> | |
| 338 | + <button disabled type="button" class="button cell shrink acym__wysid__social__icons__import">'.esc_html( | |
| 339 | + acym_translation('ACYM_IMPORT') | |
| 340 | + ).'</button> | |
| 317 | 341 | </div>'; |
| 318 | 342 | } |
| 319 | 343 | ?> |
| 320 | 344 | </div> |