Ejemplo n.º 1
0
function etheme_widget_select_single($label, $id, $name, $value, $options, $blank_option, $class = '')
{
    $class = $class ? $class : 'widefat;';
    if ($blank_option) {
        $options = array_merge(array(''), $options);
    }
    echo "\n\t\t\t<p>";
    etheme_widget_label($label, $id);
    echo "<select id='{$id}' name='{$name}' class='{$class}'>";
    foreach ($options as $option_value => $option_label) {
        $option_value = (string) $option_value;
        $option_label = (string) $option_label;
        echo "<option value='" . ($option_value ? $option_value : $option_label) . "'" . ($value == $option_value || $value == $option_label ? " selected='selected'" : '') . ">{$option_label}</option>";
    }
    echo '</select>';
    echo '</p>';
}
Ejemplo n.º 2
0
function etheme_widget_input_text($label, $id, $name, $value)
{
    echo "\n\t\t\t<p>";
    etheme_widget_label($label, $id);
    echo "<input type='text' id='{$id}' name='{$name}' value='" . strip_tags($value) . "' class='widefat' />";
    echo '</p>';
}