<div class="ui-widget prefpanel simple-formblock clearfix padded-strong stream-config">
    <h2 style="float:left"><?php echo _("Stream Settings") ?></h2>
    <?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
    <form method="post" id="stream_form" enctype="application/x-www-form-urlencoded">
    <button name="stream_save" id="stream_save_top" type="button" class="btn right-floated"><?php echo _("Save") ?></button>
    <?php echo $this->form->getElement('csrf') ?>
    <div style="clear:both"></div>
  <?php echo $this->statusMsg;?>
  <div style="float: left; margin-right: 10px; width: 50%; overflow: auto;">

    <h3><?php echo _("Global") ?></h3>
    <fieldset class="padded stream-setting-global">
        <dl class="zend_form">
        <?php if($this->form->getElement('output_sound_device') != null){?>
            <dt id="hardwareOut-label">
                <label class="required">
                <?php echo $this->form->getElement('output_sound_device')->getLabel() ?> :
                </label>
            </dt>
            <dd id="hardwareOut-element">
                <?php echo $this->form->getElement('output_sound_device') ?>
            </dd>
            <dt id="hardwareOutType-label">
                <label class="required">
                <?php echo $this->form->getElement('output_sound_device_type')->getLabel() ?> :
                </label>
            </dt>
            <dd id="hardwareOutType-element">
                <?php echo $this->form->getElement('output_sound_device_type') ?>
            </dd>
        <?php } ?>
            <dt id="vorbisMetadata-label">
                <label class="required">
                    <?php echo $this->form->getElement('icecast_vorbis_metadata')->getLabel() ?> :
                    <span class='icecast_metadata_help_icon'></span>
                </label>
            </dt>
            <dd id="vorbisMetadata-element">
                <?php echo $this->form->getElement('icecast_vorbis_metadata') ?>
            </dd>

            <dt id="streamFormat-label">
                <label class="optional"><?php echo $this->form->getElement('streamFormat')->getLabel() ?></label>
            </dt>
            <br>
            <dd id="streamFormat-element" class="radio-inline-list">
                <?php $i=0;
                      $value = $this->form->getElement('streamFormat')->getValue();
                ?>
                <?php foreach ($this->form->getElement('streamFormat')->getMultiOptions() as $radio) : ?>
                    <label for="streamFormat-<?php echo $i ?>">
                        <input type="radio" value="<?php echo $i ?>" id="streamFormat-<?php echo $i ?>" name="streamFormat" <?php if($i == $value){echo 'checked="checked"';}?> >
                            <?php echo $radio ?> <br><br>
                        </input>
                    </label>
                    <?php $i = $i + 1; ?>
                <?php endforeach; ?>
                <?php if($this->form->getElement('streamFormat')->hasErrors()) : ?>
                    <ul class='errors'>
                        <?php foreach($this->form->getElement('streamFormat')->getMessages() as $error): ?>
                            <li><?php echo $error; ?></li>
                        <?php endforeach; ?>
                    </ul>
                <?php endif; ?>
            </dd>
            <dt id="offAirMeta-label">
                <label>
                    <?php echo $this->form->getElement('offAirMeta')->getLabel() ?> :
                </label>
            </dt>
            <dd id="offAirMeta-element">
                <?php echo $this->form->getElement('offAirMeta') ?>
            </dd>
            <dt id="enableReplayGain-label">
                <label>
                <?php echo $this->form->getElement('enableReplayGain')->getLabel() ?> :
                </label>
            </dt>
            <dd id="enableReplayGain-element">
                <?php echo $this->form->getElement('enableReplayGain') ?>
            </dd>
            <dt id="replayGainModifier-label" class="block-display">
                <label><?php echo $this->form->getElement('replayGainModifier')->getLabel() ?>:
                </label>
                <span id="rg_modifier_value" style="border: 0; color: #f6931f; font-weight: bold;">
                    <?php echo $this->form->getElement('replayGainModifier')->getValue() ?>
                </span>
                <?php echo _("dB")?>
            </dt>
            <dd id="replayGainModifier-element" class="block-display">
                <?php echo $this->form->getElement('replayGainModifier') ?>
                <?php if($this->form->getElement('replayGainModifier')->hasErrors()) : ?>
                    <ul class='errors'>
                        <?php foreach($this->form->getElement('replayGainModifier')->getMessages() as $error): ?>
                            <li><?php echo $error; ?></li>
                        <?php endforeach; ?>
                    </ul>
                <?php endif; ?>
                <div id="slider-range-max" style="width: 99%"></div>
            </dd>
        </dl>
    </fieldset>
    <?php echo $this->form->getSubform('live_stream_subform'); ?>
  </div>
  <div style="float: left; width: 48%;">
      <h3><?php echo _("Output Streams") ?></h3>
    <fieldset class="padded">
        <?php
            // TODO: replace this with something that looks good
            echo $this->form->getElement('customStreamSettings')->render();
            for($i=1;$i<=$this->num_stream;$i++){
                echo $this->form->getSubform("s".$i."_subform");
            }
        ?>
    </fieldset>
    <br />
      <div style="clear: both"></div>
    <button name="stream_save" id="stream_save_bottom" type="button" class="btn right-floated"><?php echo _("Save") ?></button>
  </div>
    </form>
</div>
