Exemple #1
0
function light_form_field($name, $value = null, $width = null, $maxchars = null, $type = 'text', $custom_html = null, $placeholder = null)
{
    $id = form_unique_id($name);
    $html = "<input type=\"{$type}\" name=\"{$name}\" id=\"{$id}\" class=\"{$type}\" value=\"{$value}\"";
    if (isset($custom_html) && is_string($custom_html)) {
        $html .= sprintf(" %s", trim($custom_html));
    }
    if (is_numeric($width)) {
        $html .= " size=\"{$width}\"";
    }
    if (is_numeric($maxchars)) {
        $html .= " maxlength=\"{$maxchars}\"";
    }
    if (isset($placeholder) && is_string($placeholder)) {
        $html .= " placeholder=\"{$placeholder}\"";
    }
    return $html . " />";
}
Exemple #2
0
function form_quick_button($href, $label, $var_array = false, $target = "_self")
{
    $webtag = get_webtag();
    $html = "<form accept-charset=\"utf-8\" method=\"get\" action=\"{$href}\" target=\"{$target}\">";
    $html .= form_input_hidden("webtag", htmlentities_array($webtag));
    if (is_array($var_array)) {
        foreach ($var_array as $var_name => $var_value) {
            if (!is_array($var_value)) {
                $html .= form_input_hidden($var_name, htmlentities_array($var_value));
            }
        }
    }
    $html .= form_submit(form_unique_id('submit'), $label);
    $html .= "</form>";
    return $html;
}
Exemple #3
0
function form_quick_button($href, $button_label, $var_array = null, $target = '_self', $button_custom_html = null, $button_class = 'button', $button_id = null)
{
    $webtag = get_webtag();
    forum_check_webtag_available($webtag);
    $html = "<form accept-charset=\"utf-8\" method=\"get\" action=\"{$href}\" target=\"{$target}\">";
    $html .= form_input_hidden("webtag", htmlentities_array($webtag));
    if (is_array($var_array)) {
        foreach ($var_array as $var_name => $var_value) {
            if (!is_array($var_value)) {
                $html .= form_input_hidden($var_name, htmlentities_array($var_value));
            }
        }
    }
    $html .= form_submit(form_unique_id('submit'), $button_label, $button_custom_html, $button_class, $button_id);
    return $html . "</form>";
}