<?php

use \yii\helpers\Html;
use yii\widgets\ActiveForm;

?>

<div>
    <?php $form = ActiveForm::begin($form_options); ?>

    <div class="form-group">
        <?= Html::label('Form name', 'form_name') ?>
        <?= Html::textInput('form_name', $form_name ?? null, ['required' => true, 'class' => 'form-control', 'id' => 'form_name', 'style' => 'width: 50%;']) ?>
    </div>

    <div class="form-group">
        <?= Html::label('Form direction', 'form_direction') ?>
        <p class="text-info"><span class="glyphicon glyphicon-info-sign"></span> This option will determine the directionality of displaying form fields</p>
        <?= Html::radioList('form_direction', $form_direction ?? 'ltr', [
            'ltr' => 'LTR',
            'rtl' => 'RTL',
        ], [
            'required' => true,
            'id' => 'form_direction',
            'separator' => '&nbsp; &nbsp; &nbsp;',
        ]) ?>
    </div>

    <div class="form-group">
        <?= Html::label('Form Type', 'form_type') ?>
        <p class="text-danger"><span class="glyphicon glyphicon-warning-sign"></span> Global form's data will be accessible to all users regardless of their locations on the tree </p>
        <?= Html::radioList('form_type', $form_type ?? 'restricted', [
            'restricted' => 'Restricted',
            'global' => 'Global'
        ], [
            'required' => true,
            'id' => 'form_type',
            'separator' => '&nbsp; &nbsp; &nbsp;',
        ]) ?>
    </div>

    <div class="build-wrap"></div>

    <input type="hidden" name="formData" id="form-data" />

    <?= Html::submitButton('Save Form', ['class' => 'btn btn-primary']) ?>

    <?php ActiveForm::end() ?>
</div>