function vam_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false)
{
    $field = '<select name="' . vam_parse_input_field_data($name, array('"' => '&quot;')) . '"';
    if (vam_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= '>';
    if (empty($default) && isset($GLOBALS[$name])) {
        $default = $GLOBALS[$name];
    }
    // Start Products Specifications
    foreach ($values as $link_data) {
        switch (true) {
            case $link_data['count'] != '' && $link_data['count'] < 1 && SPECIFICATIONS_FILTER_NO_RESULT == 'none':
                break;
            case $link_data['count'] != '' && $link_data['count'] < 1 && SPECIFICATIONS_FILTER_NO_RESULT == 'grey':
                $field .= '<optgroup class="no_results" label="';
                $field .= vam_output_string($link_data['text']);
                if (SPECIFICATIONS_FILTER_SHOW_COUNT == 'True' && $link_data['count'] != '') {
                    $field .= ' (' . $link_data['count'] . ')';
                }
                $field .= '"></optgroup>';
                break;
            default:
                $field .= '<option value="' . vam_output_string($link_data['id']) . '"';
                if (in_array($link_data['id'], (array) $default)) {
                    $field .= ' SELECTED';
                }
                $field .= '>' . vam_output_string($link_data['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;'));
                if (SPECIFICATIONS_FILTER_SHOW_COUNT == 'True' && $link_data['count'] != '') {
                    $field .= '<span class="filter_count"> (' . $link_data['count'] . ')</span>';
                }
                $field .= '</option>';
                break;
        }
        // switch (true)
    }
    // foreach ($values
    // End Products Specifications
    $field .= '</select>';
    if ($required == true) {
        $field .= TEXT_FIELD_REQUIRED;
    }
    return $field;
}
Ejemplo n.º 2
0
function vam_output_string_protected($string)
{
    return vam_output_string($string, false, true);
}
function vam_draw_multi_pull_down_menu($name, $values, $default = array(), $parameters = '', $required = false)
{
    $field = '<select name="' . vam_output_string($name) . '"';
    if (vam_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= 'multiple="' . $name . '">';
    if (empty($default) && (isset($_GET[$name]) && is_string($_GET[$name]) || isset($_POST[$name]) && is_string($_POST[$name]))) {
        if (isset($_GET[$name]) && is_string($_GET[$name])) {
            $default = stripslashes($_GET[$name]);
        } elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
            $default = stripslashes($_POST[$name]);
        }
    }
    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
        $field .= '<option value="' . vam_output_string($values[$i]['id']) . '"';
        if (in_array($values[$i]['id'], (array) $default)) {
            $field .= ' SELECTED';
        }
        $field .= '>' . vam_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>';
    }
    $field .= '</select>';
    if ($required == true) {
        $field .= TEXT_FIELD_REQUIRED;
    }
    $field .= '<br clear=all>';
    return $field;
}
Ejemplo n.º 4
0
function oe_draw_selection_field($name, $type, $value = '', $checked = false, $compare = '', $parameters = '')
{
    $selection = '<input type="' . vam_output_string($type) . '" name="' . vam_output_string($name) . '"';
    if (vam_not_null($value)) {
        $selection .= ' value="' . vam_output_string($value) . '"';
    }
    if (vam_not_null($parameters)) {
        $selection .= ' ' . $parameters;
    }
    if ($checked == true || isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) && $GLOBALS[$name] == 'on' || isset($value) && isset($GLOBALS[$name]) && stripslashes($GLOBALS[$name]) == $value || vam_not_null($value) && vam_not_null($compare) && $value == $compare) {
        $selection .= ' CHECKED';
    }
    $selection .= '>';
    return $selection;
}
function vam_draw_multi_pull_down_menu($name, $values, $default = array(), $parameters = '', $required = false)
{
    $field = '<select name="' . vam_output_string($name) . '"';
    if (vam_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= 'multiple="' . $name . '">';
    if (empty($default) && (isset($_GET[$name]) && is_string($_GET[$name]) || isset($_POST[$name]) && is_string($_POST[$name]))) {
        if (isset($_GET[$name]) && is_string($_GET[$name])) {
            $default = stripslashes($_GET[$name]);
        } elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
            $default = stripslashes($_POST[$name]);
        }
    }
    foreach ($values as $link_data) {
        switch (true) {
            case $link_data['count'] != '' && $link_data['count'] < 1 && SPECIFICATIONS_FILTER_NO_RESULT == 'none':
                break;
            case $link_data['count'] != '' && $link_data['count'] < 1 && SPECIFICATIONS_FILTER_NO_RESULT == 'grey':
                $field .= '<optgroup class="no_results" label="';
                $field .= vam_output_string($link_data['text']);
                if ($link_data['count'] != '' && SPECIFICATIONS_FILTER_SHOW_COUNT == 'True') {
                    $field .= ' (' . $link_data['count'] . ')';
                }
                $field .= '"></optgroup>';
                break;
            default:
                $field .= '<option value="' . vam_output_string($link_data['id']) . '"';
                if (in_array($link_data['id'], (array) $default)) {
                    $field .= ' SELECTED';
                }
                $field .= '>' . vam_output_string($link_data['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;'));
                if ($link_data['count'] != '' && SPECIFICATIONS_FILTER_SHOW_COUNT == 'True') {
                    $field .= '<span class="filter_count"> (' . $link_data['count'] . ')</span>';
                }
                $field .= '</option>';
                break;
        }
        // switch (true)
    }
    // foreach ($values
    $field .= '</select>';
    if ($required == true) {
        $field .= TEXT_FIELD_REQUIRED;
    }
    $field .= '<br clear=all>';
    return $field;
}