示例#1
0
function pawusers_input_text_print($attributes)
{
    $attr = paw_format_attributes($attributes);
    ?>
<input type="text" <?php 
    echo $attr;
    ?>
 /><?php 
    return;
}
示例#2
0
function pawusers_input_select_print($attributes)
{
    $items = $attributes["items"];
    $items = explode("\n", $items);
    unset($attributes["items"]);
    $select = $attributes["selected"];
    unset($attributes["selected"]);
    if (!empty($attributes["value"])) {
        $select = $attributes["value"];
    }
    unset($attributes["value"]);
    if (!is_array($select)) {
        $select = explode(",", $select);
    }
    if ($attributes["multiple"] == "true") {
        $attributes["name"] = $attributes["name"] . "[]";
    }
    $attr = paw_format_attributes($attributes);
    ?>
<select <?php 
    echo $attr;
    ?>
>
			<?php 
    foreach ($items as $item) {
        $item = explode("#", $item);
        if (count($item) >= 2) {
            $key = $item[0];
            unset($item[0]);
            $item = implode("#", $item);
        } else {
            $key = $item[0];
            $item = $item[0];
        }
        ?>
<option value="<?php 
        echo $key;
        ?>
" <?php 
        paw_select($key, $select);
        ?>
><?php 
        echo $item;
        ?>
</option>
			<?php 
    }
    ?>
		</select><?php 
    return;
}
示例#3
0
function pawusers_input_textarea_print($attributes)
{
    $value = $attributes["value"];
    unset($attributes["value"]);
    $attr = paw_format_attributes($attributes);
    ?>
<textarea <?php 
    echo $attr;
    ?>
 /><?php 
    echo $value;
    ?>
</textarea><?php 
    return;
}