src/UI/HTML/FormElements.php
public static function Options( $options, $selected = NULL )
	{
		$list		= array();
		foreach( $options as $key => $value)
		{
			if( (string) $key != "_selected" && is_array( $value ) )
			{
				foreach( $options as $groupLabel => $groupOptions )
				{
					if( !is_array( $groupOptions ) )
						continue;
					if( (string) $groupLabel == "_selected" )
						continue;
					$groupName	= isset( $groupOptions['_groupname'] ) ? $groupOptions['_groupname'] : $groupLabel;
					$select		= isset( $options['_selected'] ) ? $options['_selected'] : $selected;
					$list[]		= self::OptionGroup( $groupName, $groupOptions, $select );
				}
				return implode( "", $list );
			}
		}
		foreach( $options as $value => $label )
		{
			$value		= (string) $value;
			$isSelected	= is_array( $selected ) ? in_array( $value, $selected ) : (string) $selected == (string) $value;
			$list[]		= self::Option( $value, $label, $isSelected );
		}
		return implode( "", $list );
	}
public static function Options( $options, $selected = NULL )
	{
		$list		= array();
		foreach( $options as $key => $value)
		{
			if( (string) $key != "_selected" && is_array( $value ) )
			{
				foreach( $options as $groupLabel => $groupOptions )
				{
					if( !is_array( $groupOptions ) )
						continue;
					if( (string) $groupLabel == "_selected" )
						continue;
					$groupName	= isset( $groupOptions['_groupname'] ) ? $groupOptions['_groupname'] : $groupLabel;
					$select		= isset( $options['_selected'] ) ? $options['_selected'] : $selected;
					$list[]		= self::OptionGroup( $groupName, $groupOptions, $select );
				}
				return implode( "", $list );
			}
		}
		foreach( $options as $value => $label )
		{
			$value		= (string) $value;
			$isSelected	= is_array( $selected ) ? in_array( $value, $selected ) : (string) $selected == (string) $value;
			$list[]		= self::Option( $value, $label, $isSelected );
		}
		return implode( "", $list );
	}
public static function Options ( $ options , $ selected = NULL ) { $ list = array ( ) ; foreach ( $ options as $ key => $ value ) { if ( ( string ) $ key != "_selected" && is_array ( $ value ) ) { foreach ( $ options as $ groupLabel => $ groupOptions ) { if ( ! is_array ( $ groupOptions ) ) continue ; if ( ( string ) $ groupLabel == "_selected" ) continue ; $ groupName = isset ( $ groupOptions [ '_groupname' ] ) ? $ groupOptions [ '_groupname' ] : $ groupLabel ; $ select = isset ( $ options [ '_selected' ] ) ? $ options [ '_selected' ] : $ selected ; $ list [ ] = self :: OptionGroup ( $ groupName , $ groupOptions , $ select ) ; } return implode ( "" , $ list ) ; } } foreach ( $ options as $ value => $ label ) { $ value = ( string ) $ value ; $ isSelected = is_array ( $ selected ) ? in_array ( $ value , $ selected ) : ( string ) $ selected == ( string ) $ value ; $ list [ ] = self :: Option ( $ value , $ label , $ isSelected ) ; } return implode ( "" , $ list ) ; }
Builds HTML Code for Options for a Select.
@access		public
@static
@param		array		$options 			Array of Options
@param		string		$selected			Value of selected Option
@return		string
Builds HTML Code for Options for a Select .