Skip to content

Commit

Permalink
PAYONE-GmbH#80 Layout credit card companies
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Olbertz committed Sep 26, 2022
1 parent 8504698 commit cd3fa69
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Payone/Gateway/CreditCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ public function generate_cc_brands_html( $key, $data ) {
$out .= '</th><td class="forminp">';

$selected_brands = (array) $this->get_option( $key );
foreach ( $data['options'] as $brand_key => $brand_label ) {
$out .= '<div class="cc_brands_wrapper">';
$out .= '<div class="cc_brands_wrapper"><table class="table fixed">';

foreach ( $data['options'] as $brand_key => $brand_label ) {
if ( in_array( $brand_key, $selected_brands, true ) ) {
$checked = ' checked="checked"';
} else {
Expand All @@ -355,18 +355,18 @@ public function generate_cc_brands_html( $key, $data ) {

$checkbox_id = $this->get_field_key( $key );
$checkbox_name = $checkbox_id . '[]';
$out .= '<label for="' . $checkbox_id . '">';
$out .= '<tr><td><label for="' . $checkbox_id . '">';
$out .= '<input type="checkbox" name="' . $checkbox_name . '" id="' . $checkbox_id . '" value="' . esc_attr( $brand_key ) . '"' . $checked . '>';
$out .= $brand_label . '</label>';
$out .= $brand_label . '</label></td>';

$text_input_name = 'cc_brand_label_' . $brand_key;
$value = $this->get_option( $text_input_name );
$text_input_name = $this->plugin_id . $this->id . '_' . $text_input_name;
$out .= '<input class="input-text regular-input" type="text" name="' . $text_input_name . '" id="' . $text_input_name . '" value="' . esc_attr( $value ) . '">';
$out .= '<td><input class="input-text regular-input" type="text" name="' . $text_input_name . '" id="' . $text_input_name . '" value="' . esc_attr( $value ) . '"></td>';

$out .= '</div>';
$out .= '</tr>';
}
$out .= '</td></tr>';
$out .= '</table></div></td></tr>';

return $out;
}
Expand Down

0 comments on commit cd3fa69

Please sign in to comment.