diff --git a/web/includes/functions.php b/web/includes/functions.php index 319ff1774..09a86c03c 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -432,20 +432,38 @@ function htmlSelect( $name, $contents, $values, $behaviours=false ) { } } - return "'; + return "'; } -function htmlOptions( $contents, $values ) { - $html = ''; - foreach ( $contents as $value=>$text ) { - if ( is_array( $text ) ) - $text = $text['Name']; - else if ( is_object( $text ) ) - $text = $text->Name(); - $selected = is_array( $values ) ? in_array( $value, $values ) : !strcmp($value, $values); - $html .= ""; +function htmlOptions($contents, $values) { + $options_html = ''; + + foreach ( $contents as $value=>$option ) { + $disabled = 0; + $text = ''; + if ( is_array($option) ) { + + if ( isset($option['Name']) ) + $text = $option['Name']; + else if ( isset($option['text']) ) + $text = $option['text']; + + if ( isset($option['disabled']) ) { + $disabled = $option['disabled']; + Error("Setting to disabled"); + } + } else if ( is_object($option) ) { + $text = $option->Name(); + } else { + $text = $option; + } + $selected = is_array($values) ? in_array($value, $values) : !strcmp($value, $values); + $options_html .= ""; } - return $html; + return $options_html; } function truncText( $text, $length, $deslash=1 ) { diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index 9867298d5..92d6325bd 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -924,7 +924,9 @@ if ( $monitor->Type() == 'Local' ) { 1 => 'X264 Encode', ); if ($monitor->Type() == 'Ffmpeg' ) - $videowriteropts[2]='H264 Camera Passthrough'; + $videowriteropts[2] = 'H264 Camera Passthrough'; + else + $videowriteropts[2] = array('text'=>'H264 Camera Passthrough - only for FFMPEG','disabled'=>1); echo htmlselect( 'newMonitor[VideoWriter]', $videowriteropts, $monitor->VideoWriter() ); ?>