@extends('layouts/default', [ 'helpText' => trans('admin/custom_fields/general.about_fieldsets_text'), 'helpPosition' => 'right', ]) {{-- Page title --}} @section('title') {{ trans('admin/custom_fields/general.custom_fields') }} @parent @stop @section('content') @section('header_right') {{ trans('general.back') }} @stop {{-- Page content --}} @section('content') @if ($field->id) {{ Form::open(['route' => ['fields.update', $field->id], 'class'=>'form-horizontal']) }} {{ method_field('PUT') }} @else {{ Form::open(['route' => 'fields.store', 'class'=>'form-horizontal']) }} @endif @csrf
{{ Form::text('name', old('name', $field->name), array('class' => 'form-control', 'aria-label'=>'name')) }} {!! $errors->first('name', '') !!}
{!! Form::customfield_elements('element', old('element', $field->element), 'field_element select2 form-control') !!} {!! $errors->first('element', '') !!}
@php $field_format = ''; if (stripos($field->format, 'regex') === 0){ $field_format = 'CUSTOM REGEX'; } @endphp
{{ Form::select("format",Helper::predefined_formats(), ($field_format == '') ? $field->format : $field_format, array('class'=>'format select2 form-control', 'aria-label'=>'format', 'style' => 'width:100%;')) }} {!! $errors->first('format', '') !!}
{{ Form::text('help_text', old('help_text', $field->help_text), array('class' => 'form-control', 'aria-label'=>'help_text')) }}

{{ trans('admin/custom_fields/general.help_text_description') }}

{!! $errors->first('help_text', '') !!}
@if (($field->id) && ($field->field_encrypted=='1'))
{{ trans('general.notification_warning') }}: {{ trans('admin/custom_fields/general.encrypted_options') }}
@endif @if (!$field->id)
@endif
@if ((!$field->id) || ($field->field_encrypted=='0'))
@endif
@if ($fieldsets->count() > 0)

{{ trans('admin/custom_fields/general.fieldsets') }}

{!! $errors->first('associate_fieldsets', '') !!} @foreach ($fieldsets as $fieldset) @php $array_fieldname = 'associate_fieldsets.'.$fieldset->id; // Consider the form data first if (old($array_fieldname) == $fieldset->id) { $checked = 'checked'; // Otherwise check DB } elseif (isset($field->fieldset) && ($field->fieldset->contains($fieldset->id))) { $checked = 'checked'; } else { $checked = ''; } @endphp @endforeach
@endif
{{ Form::close() }} @stop @section('moar_scripts') @stop