Update UserController.php

This commit is contained in:
Julian Prieber 2022-11-10 19:55:46 +01:00
parent 9c535873dd
commit 4dd317b641
1 changed files with 36 additions and 5 deletions

View File

@ -215,11 +215,42 @@ class UserController extends Controller
if ($OrigLink) {
//EDITING EXISTING
$OrigLink->update([
'link' => $LinkURL,
'title' => $LinkTitle,
'button_id' => $button?->id,
]);
$isCustomWebsite = $customParams['GetSiteIcon'] ?? null;
$SpacerHeight = $customParams['height'] ?? null;
if($linkType->typename == "link" and $isCustomWebsite == "1"){
$OrigLink->update([
'link' => $LinkURL,
'title' => $LinkTitle,
'button_id' => "2",
]);
}elseif($linkType->typename == "link"){
$OrigLink->update([
'link' => $LinkURL,
'title' => $LinkTitle,
'button_id' => "1",
]);
}elseif($linkType->typename == "spacer"){
$OrigLink->update([
'link' => $LinkURL,
'title' => $LinkTitle,
'button_id' => "43",
]);
}elseif($linkType->typename == "heading"){
$OrigLink->update([
'link' => $LinkURL,
'title' => $LinkTitle,
'button_id' => "42",
]);
}else{
$OrigLink->update([
'link' => $LinkURL,
'title' => $LinkTitle,
'button_id' => $button?->id,
]);
}
$message .="updated";
} else {
// ADDING NEW