| @@ -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__users__import__from_database" class="grid-x padding-vertical-2 padding-horizontal-2"> |
| 2 | 6 | <div class="cell large-3"></div> |
| 3 | 7 | <div class="cell large-6 grid-x margin-y"> |
| 4 | - <label class="cell medium-4" for="acym__users__import__from_database__field--tablename"><?php echo acym_translation('ACYM_TABLE_NAME'); ?></label> | |
| 8 | + <label class="cell medium-4" for="acym__users__import__from_database__field--tablename"><?php echo esc_html(acym_translation('ACYM_TABLE_NAME')); ?></label> | |
| 5 | 9 | <?php |
| 6 | - echo '<div class="cell medium-8">'; | |
| 10 | + echo '<div class="cell medium-8">'; | |
| 7 | 11 | array_unshift($data['tables'], acym_translation('ACYM_SELECT_TABLE')); |
| 8 | - echo acym_select( | |
| 12 | + acym_select( | |
| 9 | 13 | $data['tables'], |
| 10 | 14 | 'tablename', |
| 11 | 15 | null, |
| 12 | 16 | [ |
| @@ -13,9 +17,11 @@ | ||
| 13 | 17 | 'class' => 'acym__select', |
| 14 | 18 | ], |
| 15 | 19 | 'value', |
| 16 | 20 | 'name', |
| 17 | - 'acym__users__import__from_database__field--tablename' | |
| 21 | + 'acym__users__import__from_database__field--tablename', | |
| 22 | + false, | |
| 23 | + true | |
| 18 | 24 | ); |
| 19 | 25 | echo '</div>'; |
| 20 | 26 | |
| 21 | 27 | $userFields = acym_getColumns('user'); |
| @@ -21,11 +27,13 @@ | ||
| 21 | 27 | $userFields = acym_getColumns('user'); |
| 22 | 28 | if (!empty($userFields)) { |
| 23 | 29 | foreach ($userFields as $oneUserField) { |
| 24 | 30 | if (!in_array($oneUserField, ['id', 'key', 'automation'])) { |
| 25 | - echo '<label class="cell medium-4" for="acym__users__import__from_database__field--'.$oneUserField.'">'.$oneUserField.'</label>'; | |
| 31 | + echo '<label class="cell medium-4" for="acym__users__import__from_database__field--'.esc_attr($oneUserField).'">'.esc_html($oneUserField).'</label>'; | |
| 26 | 32 | echo '<div class="cell medium-8">'; |
| 27 | - echo '<select acym-data-infinite class="acym__users__import__from_database__fields acym__select" name="fields['.$oneUserField.']" id="acym__users__import__from_database__field--'.$oneUserField.'"></select>'; | |
| 33 | + echo '<select acym-data-infinite class="acym__users__import__from_database__fields acym__select" name="fields['.esc_attr( | |
| 34 | + $oneUserField | |
| 35 | + ).']" id="acym__users__import__from_database__field--'.esc_attr($oneUserField).'"></select>'; | |
| 28 | 36 | echo '</div>'; |
| 29 | 37 | } |
| 30 | 38 | } |
| 31 | 39 | } |
| @@ -30,17 +38,17 @@ | ||
| 30 | 38 | } |
| 31 | 39 | } |
| 32 | 40 | if ($this->config->get('require_confirmation')) { ?> |
| 33 | 41 | <div class="cell grid-x"> |
| 34 | - <?php echo acym_switch('import_confirmed_database', 1, acym_translation('ACYM_IMPORT_USERS_AS_CONFIRMED')); ?> | |
| 42 | + <?php acym_switch(['name' => 'import_confirmed_database', 'value' => 1, 'label' => acym_translation('ACYM_IMPORT_USERS_AS_CONFIRMED')]); ?> | |
| 35 | 43 | </div> |
| 36 | 44 | <?php } ?> |
| 37 | 45 | |
| 38 | 46 | <div class="cell grid-x grid-margin-x"> |
| 39 | 47 | <div class="cell hide-for-small-only medium-auto"></div> |
| 40 | - <?php echo acym_cancelButton('ACYM_CANCEL', '', 'button medium-6 large-shrink margin-bottom-0'); ?> | |
| 48 | + <?php acym_cancelButton('ACYM_CANCEL', '', 'button medium-6 large-shrink margin-bottom-0'); ?> | |
| 41 | 49 | <button type="button" class="button cell medium-shrink margin-bottom-0" data-open="acym__user__import__add-subscription__modal" data-from="database"> |
| 42 | - <?php echo acym_translation('ACYM_IMPORT'); ?> | |
| 50 | + <?php echo esc_html(acym_translation('ACYM_IMPORT')); ?> | |
| 43 | 51 | </button> |
| 44 | 52 | <button id="submit_import_database" class="acym__import__submit is-hidden" data-from="database"></button> |
| 45 | 53 | <div class="cell hide-for-small-only medium-auto"></div> |
| 46 | 54 | </div> |