File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -402,6 +402,23 @@ public function deleteLink(request $request)
402
402
return redirect ('/studio/links ' );
403
403
}
404
404
405
+ //Delete icon
406
+ public function clearIcon (request $ request )
407
+ {
408
+ $ linkId = $ request ->id ;
409
+
410
+ $ directory = base_path ("studio/favicon/icons " );
411
+ $ files = scandir ($ directory );
412
+ foreach ($ files as $ file ) {
413
+ if (strpos ($ file , $ linkId .". " ) !== false ) {
414
+ $ pathinfo = pathinfo ($ file , PATHINFO_EXTENSION );}}
415
+ if (isset ($ pathinfo )) {
416
+ try {File::delete (base_path ("studio/favicon/icons " )."/ " .$ linkId .". " .$ pathinfo );} catch (exception $ e ) {}
417
+ }
418
+
419
+ return redirect ('/studio/links ' );
420
+ }
421
+
405
422
//Raise link on the littlelink page
406
423
public function upLink (request $ request )
407
424
{
Original file line number Diff line number Diff line change 122
122
123
123
@endif
124
124
125
- <a href =" {{ route (' deleteLink' , $link -> id ) } }" onclick =" return confirm('Are you sure you want to delete `{{ $link -> title } } ` ?')" class =" float-right hvr-grow p-1 text-danger" ><i class =' bi bi-trash' ></i ></a >
125
+ <a href =" {{ route (' deleteLink' , $link -> id ) } }" title =" Delete" onclick =" return confirm('Are you sure you want to delete `{{ $link -> title } } ` ?')" class =" float-right hvr-grow p-1 text-danger" ><i class =' bi bi-trash' ></i ></a >
126
+
127
+ <a href =" {{ route (' clearIcon' , $link -> id ) } }" title =" Clear icon cache" class =" float-right hvr-grow p-1 text-primary" ><i style =" -webkit-text-stroke :1px ;padding-right :5px ;" class =" bi bi-arrow-repeat" ></i ></a >
126
128
127
129
128
130
Original file line number Diff line number Diff line change 101
101
Route::get ('/studio/theme ' , [UserController::class, 'showTheme ' ])->name ('showTheme ' );
102
102
Route::post ('/studio/theme ' , [UserController::class, 'editTheme ' ])->name ('editTheme ' );
103
103
Route::get ('/deleteLink/{id} ' , [UserController::class, 'deleteLink ' ])->name ('deleteLink ' );
104
+ Route::get ('/clearIcon/{id} ' , [UserController::class, 'clearIcon ' ])->name ('clearIcon ' );
104
105
Route::get ('/upLink/{up}/{id} ' , [UserController::class, 'upLink ' ])->name ('upLink ' );
105
106
Route::post ('/studio/edit-link/{id} ' , [UserController::class, 'editLink ' ])->name ('editLink ' );
106
107
Route::get ('/studio/button-editor/{id} ' , [UserController::class, 'showCSS ' ])->name ('showCSS ' );
You can’t perform that action at this time.
0 commit comments