|
3 | 3 | @section('content') |
4 | 4 |
|
5 | 5 | <script src="{{ asset('resources/ckeditor/ckeditor.js') }}"></script> |
6 | | -@php |
7 | | -function findFileSite($name){ |
8 | | - $directory = base_path('/littlelink/images/'); |
9 | | - $files = scandir($directory); |
10 | | - $pathinfo = "error.error"; |
11 | | - foreach($files as $file) { |
12 | | - if (strpos($file, $name.'.') !== false) { |
13 | | - $pathinfo = $name. "." . pathinfo($file, PATHINFO_EXTENSION); |
14 | | - }} |
15 | | - return $pathinfo; |
16 | | - } |
17 | | -@endphp |
| 6 | + |
18 | 7 | <section class="shadow text-gray-400"> |
19 | 8 | <h2 class="mb-4 card-header"><i class="bi bi-person"> Site</i></h2> |
20 | 9 | <div class="card-body p-0 p-md-3"> |
21 | 10 |
|
22 | 11 | <form action="{{ route('editSite') }}" enctype="multipart/form-data" method="post"> |
23 | 12 | @csrf |
24 | 13 | <div class="form-group col-lg-8"> |
25 | | - <label>Site logo</label>@if(file_exists(base_path("littlelink/images/").findFileSite('avatar')))<a title="Remove icon" class="hvr-grow p-1 text-danger" style="padding-left:5px;" href="{{ route('delAvatar') }}"><i class="bi bi-trash-fill"></i></a>@endif |
| 14 | + <label>Site logo</label>@if(file_exists(base_path("littlelink/images/").findFile('avatar')))<a title="Remove icon" class="hvr-grow p-1 text-danger" style="padding-left:5px;" href="{{ route('delAvatar') }}"><i class="bi bi-trash-fill"></i></a>@endif |
26 | 15 | <input type="file" class="form-control-file" name="image"> |
27 | 16 | </div> |
28 | 17 | <div class="form-group col-lg-8"> |
29 | | - <label>Favicon</label>@if(file_exists(base_path("littlelink/images/").findFileSite('favicon')))<a title="Remove icon" class="hvr-grow p-1 text-danger" style="padding-left:5px;" href="{{ route('delFavicon') }}"><i class="bi bi-trash-fill"></i></a>@endif |
| 18 | + <label>Favicon</label>@if(file_exists(base_path("littlelink/images/").findFile('favicon')))<a title="Remove icon" class="hvr-grow p-1 text-danger" style="padding-left:5px;" href="{{ route('delFavicon') }}"><i class="bi bi-trash-fill"></i></a>@endif |
30 | 19 | <input type="file" class="form-control-file" name="icon"> |
31 | 20 | </div> |
32 | 21 | <div class="form-group col-lg-8"> |
|
0 commit comments