Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow form pulldown to pre-select multiple values if array is passed containing desired defaults #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions catalog/admin/includes/functions/general.php
Expand Up @@ -471,7 +471,7 @@ function tep_get_zone_code($country, $zone, $def_state) {
$state_prov_values = tep_db_fetch_array($state_prov_query);
$state_prov_code = $state_prov_values['zone_code'];
}

return $state_prov_code;
}

Expand Down Expand Up @@ -714,8 +714,8 @@ function tep_cfg_pull_down_tax_classes($tax_class_id, $key = '') {

////
// Function to read in text area in admin
function tep_cfg_textarea($text) {
return tep_draw_textarea_field('configuration_value', false, 35, 5, $text);
function tep_cfg_textarea($text, $key = '') {
return tep_draw_textarea_field('configuration['.$key.']', false, 35, 5, $text);
}

function tep_cfg_get_zone_name($zone_id) {
Expand Down
2 changes: 1 addition & 1 deletion catalog/admin/includes/functions/html_output.php
Expand Up @@ -327,7 +327,7 @@ function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = ''

for ($i=0, $n=sizeof($values); $i<$n; $i++) {
$field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
if ($default == $values[$i]['id']) {
if ($default == $values[$i]['id'] || (is_array($default) && in_array($values[$i]['id'], $default))) {
$field .= ' selected="selected"';
}

Expand Down
2 changes: 1 addition & 1 deletion catalog/includes/functions/html_output.php
Expand Up @@ -309,7 +309,7 @@ function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = ''

for ($i=0, $n=sizeof($values); $i<$n; $i++) {
$field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
if ($default == $values[$i]['id']) {
if ($default == $values[$i]['id'] || (is_array($default) && in_array($values[$i]['id'], $default))) {
$field .= ' selected="selected"';
}

Expand Down