Procházet zdrojové kódy

去除多余代码

jqh před 5 roky
rodič
revize
70c4df314f

+ 0 - 20
resources/views/form/step-form.blade.php

@@ -7,24 +7,4 @@
 
 </div>
 
-<!-- /.box-body -->
-@if(count($buttons) > 0)
-    <div class="box-footer">
-        <div class="col-md-2"></div>
-
-        <div class="col-md-8">
-            @if(in_array('previous', $buttons))
-                <div class="btn-group pull-left">
-                    <span class="btn btn-warning pull-right previous-step">{!! trans('admin.') !!}</span>
-                </div>
-            @endif
-
-            @if(in_array('next', $buttons))
-                <div class="btn-group pull-right">
-                    <span class="btn btn-primary pull-right next-step">{!! trans('admin.next') !!}</span>
-                </div>
-            @endif
-        </div>
-    </div>
-@endif
 {!! $end !!}

+ 2 - 2
resources/views/form/steps.blade.php

@@ -117,8 +117,8 @@ LA.ready(function () {
         showStepURLhash: false,
         autoAdjustHeight: false,
         lang: {
-            next: '{{ trans('admin.next_step') }}',
-            previous: '{{ trans('admin.prev_step') }}'
+            next: '{!! trans('admin.next_step') !!}',
+            previous: '{!! trans('admin.prev_step') !!}'
         },
         toolbarSettings: {
             toolbarPosition: 'bottom',

+ 9 - 7
src/Form/Concerns/HasFiles.php

@@ -103,15 +103,17 @@ trait HasFiles
      */
     protected function handleFileDelete(array $input = [])
     {
-        if (array_key_exists(Field::FILE_DELETE_FLAG, $input)) {
-            $input[Field::FILE_DELETE_FLAG] = $input['key'];
-            unset($input['key']);
+        if (! array_key_exists(Field::FILE_DELETE_FLAG, $input)) {
+            return $input;
+        }
+
+        $input[Field::FILE_DELETE_FLAG] = $input['key'];
+        unset($input['key']);
 
-            if (! empty($input['_column'])) {
-                $input[$input['_column']] = '';
+        if (! empty($input['_column'])) {
+            $input[$input['_column']] = '';
 
-                unset($input['_column']);
-            }
+            unset($input['_column']);
         }
 
         $this->request->replace($input);