<ul>
<?PHP
foreach($this->spout->params as $spoutParamName => $spoutParam) {
    $checked = '';
    
    $value = $spoutParam['default'];
    if(isset($this->params) && isset($this->params[$spoutParamName])) {
        $value = $this->params[$spoutParamName];
        if($spoutParam["type"]=="checkbox" && $value=='1')
            $checked = 'checked="checked"';
    }
    
    if( $spoutParam["type"]=="text" 
        || $spoutParam["type"]=="password"
        || $spoutParam["type"]=="checkbox")
        echo '<li>
                <label>'.$spoutParam['title'].':</label>
                <input type="'.$spoutParam["type"].'" 
                       name="'.$spoutParamName.'" 
                       value="'.$value.'" 
                       '.$checked.' />
              </li>';

    else if($spoutParam["type"]=="select") {
        $options = '';
        foreach($spoutParam["values"] as $optionName => $optionTitle) {
            $selected = ($optionName==$value) ? 'selected="selected"' : '';
            $options .= "\n".'<option value="'.$optionName.'" '.$selected.'>'.$optionTitle.'</option>';
        }

        echo '<li>
                <label>'.$spoutParam['title'].':</label>
                <select name="'.$spoutParamName.'" size="1">'.$options.'
                </select>
            </li>';
    }
}
?>
</ul>