<?php
$form = $this->beginWidget('ext.PlGrid.PlActiveForm', array(
    'id' => 'network-settings-form',
    'loadCoreScripts' => true,
    'action' => array("index")
));

echo '<h3 data-translation-id="WIZARD_APPLIANCE_NETWORK_HEADER_TEXT">' . __('WIZARD_APPLIANCE_NETWORK_HEADER_TEXT') . '</h3>';
echo '<div class="well well-small" data-translation-id="WIZARD_APPLIANCE_NETWORK_TEXT">'.__("WIZARD_APPLIANCE_NETWORK_TEXT").'</div>';

echo $form->textFieldRow($formModel, "ip");
echo $form->textFieldRow($formModel, "subnetMask");

echo $form->textFieldRow($formModel, "dns");
echo $form->textFieldRow($formModel, "gateway");

//echo $form->checkBoxRow($formModel, "enableDNSServer");
//echo $form->checkBoxRow($formModel, "enableDHCP");
//echo $form->textFieldRow($formModel, "dhcpRangeFrom");
//echo $form->textFieldRow($formModel, "dhcpRangeTo");

echo CHtml::submitButton("next", array(
                    'type' => 'htmlSubmit',
                    'value' => 'next',
                    'label' => __('WIZARD_NEXT_BTN'),
                    'name' => 'WizardForm[next]',
                    'class' => 'btn btn-primary',
                    'id' => 'originalNextBtn',
                    'data-translation-id' => 'WIZARD_SKIP_BTN',
                    'style' => 'display:none',
                ));

$this->endWidget();
$navigation = $this->beginWidget('ext.PlGrid.PlActiveForm', array(
    'id' => 'nav-form',
    'loadCoreScripts' => true,
    'clientOptions' => array('validateOnSubmit'=>false), // FIXME
    'action' => array("index")
));

                
echo CHtml::submitButton("prevButton", array(
                    'type' => 'htmlSubmit',
                    'value' => 'prev',
                    'label' => __('WIZARD_PREV_BTN'),
                    'name' => 'WizardForm[prev]',
                    'class' => 'btn',
                    'data-translation-id' => 'WIZARD_PREV_BTN',
                    'id' => 'originalPrevBtn',
                    'style' => 'display:none',
));

echo CHtml::submitButton("skip", array(
                    'type' => 'htmlSubmit',
                    'value' => 'skip',
                    'label' => __('WIZARD_NEXT_BTN'),
                    'name' => 'WizardForm[skip]',
                    'class' => 'btn btn-primary',
                    'id' => 'originalSkipBtn',
                    'data-translation-id' => 'WIZARD_SKIP_BTN',
                    'style' => 'display:none',
                    "disabled" => "disabled"
                ));
$this->endWidget();
?>


<script>
    $(function () {
        //onReady
        $('#nextBtn').attr('disabled', $('#originalNextBtn').attr('disabled'));
        $('#prevBtn').attr('disabled', $('#originalPrevBtn').attr('disabled'));
        $('#skipBtn').attr('disabled', $('#originalSkipBtn').attr('disabled'));

        $('#skipBtn').click(function () {
            $('#originalSkipBtn').click();
        });

        $('#nextBtn').click(function () {
            $('#originalNextBtn').click();
        });

        $('#prevBtn').click(function () {
            $('#originalPrevBtn').click();
        });
    });

</script>