?> </td> </tr> <?php // begin Extra Product Fields foreach ($epf as $e) { ?> <tr> <td class="fieldKey"><?php echo $e['label']; ?> </td> <td class="fieldValue"> <?php if ($e['uses_list']) { $epf_values = tep_build_epf_pulldown($e['id'], $languages_id); if ($e['multi_select']) { // multi-select field echo TEXT_FOR_FIELD . tep_draw_radio_field('match' . $e['id'], 'any', true) . TEXT_MATCH_ANY . tep_draw_radio_field('match' . $e['id'], 'all') . TEXT_MATCH_ALL . '</td></tr><tr><td class="fieldKey">' . $e['label'] . '</td><td class="fieldValue">'; $col = 0; echo '<table><tr>'; foreach ($epf_values as $value) { $col++; if ($col > $e['columns']) { echo '</tr><tr>'; $col = 1; } echo '<td>' . tep_draw_checkbox_field($e['field'] . '[]', $value['id'], false, 'id="' . $value['id'] . '"') . '</td><td>' . tep_get_extra_field_list_value($value['id'], false, $e['display_type']) . '<td><td> </td>'; } echo '</tr></table>'; } else {
function tep_build_epf_pulldown($epf_id, $languages_id, $value_array = '', $parent_id = 0, $indent = '') { if (!is_array($value_array)) { $value_array = array(); } $sql = tep_db_query("select epf_value, value_id from " . TABLE_EPF_VALUES . " where epf_id = " . (int) $epf_id . " and languages_id = " . (int) $languages_id . " and parent_id = " . (int) $parent_id . " order by sort_order, epf_value"); while ($v = tep_db_fetch_array($sql)) { $value_array[] = array('id' => $v['value_id'], 'text' => $indent . $v['epf_value']); $value_array = tep_build_epf_pulldown($epf_id, $languages_id, $value_array, $v['value_id'], $indent . '·'); } return $value_array; }
} else { $tparms = ''; } $inp .= '<table' . $tparms . '><tr>'; foreach ($vallist as $value) { $col++; if ($col > $e['columns']) { $inp .= '</tr><tr>'; $col = 1; } $inp .= '<td>' . tep_draw_checkbox_field($e['field'] . "[" . $languages[$i]['id'] . "][]", $value, in_array($value, $currentval), '', 'onClick="process_' . $e['field'] . '_' . $e['language'] . '(' . $value . ')" id="ms' . $value . '"') . '</td><td>' . ($value == '0' ? TEXT_NOT_APPLY : tep_get_extra_field_list_value($value, false, $e['display_type'])) . '<td><td> </td>'; } $inp .= '</tr></table>'; } } else { $epfvals = tep_build_epf_pulldown($e['id'], $languages[$i]['id'], array(array('id' => 0, 'text' => TEXT_NOT_APPLY))); if ($e['checkbox']) { $col = 0; $inp = '<table><tr>'; foreach ($epfvals as $value) { $col++; if ($col > $e['columns']) { $inp .= '</tr><tr>'; $col = 1; } $inp .= '<td>' . tep_draw_radio_field($e['field'] . "[" . $languages[$i]['id'] . "]", $value['id'], false, $currentval, $e['linked'] ? 'onClick="process_' . $e['field'] . '_' . $e['language'] . '(' . $value['id'] . ')"' : '') . '</td><td>' . ($value['id'] == '0' ? TEXT_NOT_APPLY : tep_get_extra_field_list_value($value['id'], false, $e['display_type'])) . '<td><td> </td>'; } $inp .= '</tr></table>'; } else { $inp = tep_draw_pull_down_menu($e['field'] . "[" . $languages[$i]['id'] . "]", $epfvals, $currentval, $e['linked'] ? 'onChange="process_' . $e['field'] . '_' . $e['language'] . '()" id="lv' . $e['id'] . '_' . $languages[$i]['id'] . '"' : ''); }
<table border="0" width="100%" cellspacing="0" cellpadding="2" class="filterbox"> <tr> <td class="main" align="right" colspan="2"> <?php echo tep_draw_form('epf_restrict', FILENAME_DEFAULT, 'get'); if (is_array($_GET) && sizeof($_GET) > 0) { reset($_GET); while (list($key, $value) = each($_GET)) { if (strlen($value) > 0 && $key != tep_session_name() && !in_array($key, $epf_list)) { echo tep_draw_hidden_field($key, $value); } } } foreach ($epf as $e) { if ($e['restrict']) { echo sprintf(TEXT_RESTRICT_TO, $e['label'], tep_draw_pull_down_menu($e['field'], tep_build_epf_pulldown($e['id'], $languages_id, array(array('id' => '', 'text' => TEXT_ANY_VALUE))), '', 'onchange="this.form.submit()"')) . '<br>'; } } ?> </form> </td> </tr> </table> <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); } // end if to hide epf ?> <!-- end extra product fields --> <?php }
echo '</tr></table>'; } } elseif ($field_info['epf_checked_entry'] || $field_info['epf_multi_select']) { $col = 0; echo '<table><tr>'; foreach ($query as $val) { $col++; if ($col > $field_info['epf_num_columns']) { echo '</tr><tr>'; $col = 1; } echo '<td>' . ($field_info['epf_multi_select'] ? tep_draw_checkbox_field('example', $val['value_id']) : tep_draw_radio_field('example', $val['value_id'])) . '</td><td>' . tep_get_extra_field_list_value($val['value_id'], false, $field_info['epf_value_display_type']) . '</td><td> </td>'; } echo '</tr></table>'; } else { echo tep_draw_pull_down_menu('preview', tep_build_epf_pulldown($eid, $lid)); } ?> </td></tr> </table> </td> <?php // build information box contents $heading = array(); $contents = array(); if (!empty($selected)) { $heading[] = array('text' => $lang[$lid]['name'] . ': ' . $current_label); $heading[] = array('text' => TABLE_HEADING_ID . $selected['value_id']); $heading[] = array('text' => ENTRY_VALUE . $selected['epf_value']); $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_EXTRA_VALUES, 'vid=' . $vid . '&action=edit&list_id=' . $list_id) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_EXTRA_VALUES, 'vid=' . $vid . '&action=delete&list_id=' . $list_id) . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>'); if (!$field_info['epf_multi_select']) {