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>&nbsp;</td>';
         }
         echo '</tr></table>';
     } else {
         // single select field
         $epf_values = array_merge(array(array('id' => '', 'text' => TEXT_ANY_VALUE)), $epf_values);
         if ($e['use_checkbox']) {
             $col = 0;
             echo '<table><tr>';
             foreach ($epf_values as $value) {
                 $col++;
                 if ($col > $e['columns']) {
                     echo '</tr><tr>';
                     $col = 1;
                 }
                 echo '<td>' . tep_draw_radio_field($e['field'], $value['id'], $value['id'] == '', 'id="' . $e['field'] . '_' . $value['id'] . '"') . '</td><td>' . ($value['id'] == '' ? TEXT_ANY_VALUE : tep_get_extra_field_list_value($value['id'], false, $e['display_type'])) . '<td><td>&nbsp;</td>';
             }
             echo '</tr></table>';
         } else {
             echo tep_draw_pull_down_menu($e['field'], $epf_values);
         }
     }
 } else {
     // text field
     echo tep_draw_input_field($e['field'], '', 'style="width: 300px"');
 }
 ?>
             </td>
           </tr>
           <tr>
             <td colspan="2"><?php 
Example #2
0
function tep_get_extra_field_list_value($value_id, $show_chain = false, $display_type = 0)
{
    $sql = tep_db_query("select epf_value, value_image, parent_id from " . TABLE_EPF_VALUES . " where value_id = " . (int) $value_id);
    $value = tep_db_fetch_array($sql);
    $display = $value['epf_value'];
    if (tep_not_null($value['value_image'])) {
        if ($display_type == 2) {
            $browser = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
            $pos = strpos($browser, 'msie');
            if ($pos !== false) {
                // using Internet Explorer requires different display type for inline tables
                $vpos = strpos($browser, ';', $pos);
                $version = substr($browser, $pos + 5, $vpos - $pos - 5);
                if ($version < 9) {
                    $tt = 'inline';
                } else {
                    $tt = 'inline-table';
                }
            } else {
                $tt = 'inline-table';
            }
            $display = '<table style="display: ' . $tt . '; vertical-align: middle; text-align: center"><tr><td>' . tep_image(DIR_WS_IMAGES . 'epf/' . $value['value_image'], $value['epf_value']) . '<br />' . $value['epf_value'] . '</td></tr></table>';
        } elseif ($display_type == 1) {
            $display = tep_image(DIR_WS_IMAGES . 'epf/' . $value['value_image'], $value['epf_value']);
        }
    }
    if ($show_chain && $value['parent_id'] > 0) {
        return tep_get_extra_field_list_value($value['parent_id'], true, $display_type) . ' | ' . $display;
    } else {
        return $display;
    }
}
Example #3
0
 foreach ($epf as $e) {
     if ($e['listing']) {
         $mt = $e['uses_list'] && !$e['multi_select'] ? $listing[$e['field']] == 0 : !tep_not_null($listing[$e['field']]);
         if (!$mt) {
             // only list fields that aren't empty
             $extra .= '<br><b>' . $e['label'] . ': </b>';
             if ($e['uses_list']) {
                 if ($e['multi_select']) {
                     $epf_values = explode('|', trim($listing[$e['field']], '|'));
                     $epf_string = '';
                     foreach ($epf_values as $v) {
                         $epf_string .= tep_get_extra_field_list_value($v) . ', ';
                     }
                     $extra .= trim($epf_string, ', ');
                 } else {
                     $extra .= tep_get_extra_field_list_value($listing[$e['field']], $e['show_chain'] == 1);
                 }
             } else {
                 $extra .= $listing[$e['field']];
             }
         }
     }
 }
 if ($gridlist == 'list') {
     // add short description
     if (PRODUCT_SHORT_DESCRIPTION == 'true') {
         $short = $listing[$x]['products_short'];
     }
 }
 // end extra product fields
 $lc_align = '';
Example #4
0
                       if ($e['uses_list'] && $value == 0) {
                           $value = '';
                       }
                   }
               }
               if (tep_not_null($value)) {
                   echo '<tr><td class="main"><b>' . $e['label'] . ': </b>';
                   if ($e['uses_list']) {
                       if ($e['multi_select']) {
                           $output = array();
                           foreach ($value as $val) {
                               $output[] = tep_get_extra_field_list_value($val, $e['show_chain'], $e['display_type']);
                           }
                           echo implode(', ', $output);
                       } else {
                           echo tep_get_extra_field_list_value($value, $e['show_chain'], $e['display_type']);
                       }
                   } else {
                       echo $value;
                   }
                   echo "</td></tr>\n";
               }
           }
       }
   }
   // EOF: Extra Product Fields
   if ($pInfo->products_url) {
       ?>
 <tr>
   <td width="100%"><?php 
       echo tep_draw_separator('pixel_trans.gif', '1', '10');
Example #5
0
    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 . '&amp;action=edit&amp;list_id=' . $list_id) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_EXTRA_VALUES, 'vid=' . $vid . '&amp;action=delete&amp;list_id=' . $list_id) . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
        if (!$field_info['epf_multi_select']) {
            $contents[] = array('align' => 'center', 'text' => tep_draw_form('subvalue', FILENAME_EXTRA_VALUES, 'list_id=' . $selected['epf_id'] . '_' . $selected['languages_id'] . '&amp;parent=' . $selected['value_id'] . "&amp;action=new") . tep_draw_input_field('subvalues', BUTTON_SUBVALUE, 'alt="' . BUTTON_SUBVALUES . '"', false, 'submit') . '</form>');
        }
        $contents[] = array('text' => ENTRY_VALUE . $selected['epf_value']);
        $contents[] = array('text' => TABLE_HEADING_PARENT . ': ' . $selected['parent_id']);
        $contents[] = array('text' => TABLE_HEADING_ORDER . ': ' . $selected['sort_order']);
        $contents[] = array('text' => TEXT_FIELD_ID . $selected['epf_id']);
        $contents[] = array('text' => TEXT_LANGAUGE . $lang[$selected['languages_id']]['name']);
        $contents[] = array('text' => TEXT_CHAIN . tep_get_extra_field_list_value($selected['value_id'], true));
        if ($selected['value_depends_on'] != 0) {
            $contents[] = array('text' => TEXT_REQUIRES . '<br>' . tep_get_extra_field_list_value($selected['value_depends_on']));
        }
    }
    // display information box if it exists
    if (tep_not_null($heading) && tep_not_null($contents)) {
        echo '            <td width="25%" valign="top">' . "\n";
        $box = new box();
        echo $box->infoBox($heading, $contents);
        echo '            </td>' . "\n";
    }
    ?>
          </tr>
        </table></td>
      </tr>
      <?php 
}
Example #6
0
            echo '<tr>';
            echo '  <td colspan="3">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td>';
            echo '</tr>';
            echo '<tr>';
            echo '  <td class="productinfo_epf">';
            echo '<b>' . $e['label'] . ': </b>';
            if ($e['uses_list']) {
                if ($e['multi_select']) {
                    $values = explode('|', trim($product_info[$e['field']], '|'));
                    $listing = array();
                    foreach ($values as $val) {
                        $listing[] = tep_get_extra_field_list_value($val, $e['show_chain'], $e['display_type']);
                    }
                    echo implode(', ', $listing);
                } else {
                    echo tep_get_extra_field_list_value($product_info[$e['field']], $e['show_chain'], $e['display_type']);
                }
            } else {
                echo $product_info[$e['field']];
            }
            echo '<br>';
            echo '  </td>';
            echo '</tr>';
        }
    }
    // end Extra Product Field
    ?>
              <!-- Product Extra Fields Ends -->
            
			<!-- Conditional Atrributes Starts -->              
            <?php