public function update(Page $page, Request $request, array &$fields)
{
$rules = $this->rules(false);
+ if ($fields['order'] == null){
+ $fields['order'] = 0;
+ }
if ($fields['reference_id'] != null){
$rules['reference_id'] = 'exists:pages,id';
}
} else {
$validated = $validator->validated();
$validated['info'] = strip_tags($validated['info']);
- if (empty($page->audio_id) && $request->file('file') != null) {
+ $audioId = $page->audio_id;
+ $x = $request->file('file');
+ if ($audioId == null && $request->file('file') != null) {
$filename = FileHelper::textToFilename($page->title);
$moduleId = Module::idOfModule('Page');
$fileId = File::storeFile($request, $page->title, 1103, 1091, 'audio file of page', $filename, $moduleId, $page->id);
@extends('layouts.backend')
@section('content')
- <form id="page-edit" action="/page-edit/{{ $context->model->id }}" method="POST">
+ <form id="page-edit" enctype="multipart/form-data" action="/page-edit/{{ $context->model->id }}" method="POST">
@csrf
<x-laraknife.panels.edit title="{{ __('Change of a Page') }}">
<x-laraknife.forms.combobox position="first" name="pagetype_scope" label="Pagetype" :options="$optionsPagetype" width2="4"
@csrf
<x-laraknife.panels.text-area title="{{ $context->valueof('title') }}">
<div class="lkn-text">
- {!! $context->valueOf('text') !!}
+ {!! $context->valueOf('text1') !!}
</div>
</x-laraknife.panels.text-area>
- @if ($context->valueof('link') != null)
+ @if ($context->valueof('audio') != null)
<div class="row">
- <x-laraknife.forms.audio width1="5" width2="2" fileLink="{{ $context->valueof('link') }}" />
+ <x-laraknife.forms.audio width1="5" width2="2" fileLink="{{ $context->valueof('audio') }}" />
</div>
@endif
</form>
</div>
</x-laraknife.panels.text-area>
@if ($context->valueof('audio') != null)
- <div class="row">
- <x-laraknife.forms.audio width1="5" width2="2" fileLink="{{ $context->valueof('audio') }}" />
- </div>
+ <x-laraknife.forms.audio-norow fileLink="{{ $context->valueof('audio') }}" />
@endif
</form>
@endsection