<?php
 
function expose_plugin_html_selectbox( & $expose, $params )
 
{
 
    $params = exposeMergeParameters( $params, array(
 
        'name'      => '',
 
        'options'   => array(),
 
        'selected'  => '',
 
        'attr'      => ''
 
    ) );
 
 
    $params['options'] = exposeReadArray( $params['options'] );
 
   
 
    echo( "<select name=\"{$params['name']}\" {$params['attr']}>\n" );
 
    foreach( $params['options'] as $key => $text )
 
    {
 
        if( is_array( $text ) ) {
 
            $key = $text[0];
 
            $text = $text[1];
 
        }
 
        
 
        $selectState = ( (string) $params['selected'] == (string) $key ) ? 'selected="selected"' : '';
 
        echo( "<option value=\"".htmlentities($key)."\" $selectState>".htmlentities($text)."</option>\n" );
 
    }
 
    echo( "</select>\n" );
 
}
 
?>
 
 
 |