Add new block config option

This commit is contained in:
Julian Prieber 2024-09-19 12:53:21 +02:00
parent 5a45e412b3
commit c428bb2ef7
2 changed files with 10 additions and 2 deletions

View File

@ -244,6 +244,12 @@ class UserController extends Controller
$customParams['custom_html'] = $linkType->custom_html; $customParams['custom_html'] = $linkType->custom_html;
} }
// Check if $linkType->ignore_container is defined and not null
if (isset($linkType->ignore_container)) {
// Add $linkType->ignore_container to the $customParams array
$customParams['ignore_container'] = $linkType->ignore_container;
}
$filteredLinkData['type_params'] = json_encode($customParams); $filteredLinkData['type_params'] = json_encode($customParams);
if ($OrigLink) { if ($OrigLink) {

View File

@ -8,7 +8,7 @@ use Illuminate\Filesystem\Filesystem;
class LinkType extends Model class LinkType extends Model
{ {
protected $fillable = ['id', 'typename', 'title', 'description', 'icon', 'custom_html']; protected $fillable = ['id', 'typename', 'title', 'description', 'icon', 'custom_html', 'ignore_container'];
// Assuming no database interaction, we can disable timestamps // Assuming no database interaction, we can disable timestamps
public $timestamps = false; public $timestamps = false;
@ -32,6 +32,7 @@ class LinkType extends Model
'description' => null, 'description' => null,
'icon' => 'bi bi-boxes', 'icon' => 'bi bi-boxes',
'custom_html' => false, 'custom_html' => false,
'ignore_container' => false,
]); ]);
$linkTypes->prepend($predefinedLinkType); $linkTypes->prepend($predefinedLinkType);
@ -48,7 +49,8 @@ class LinkType extends Model
'title' => $configData['title'] ?? null, 'title' => $configData['title'] ?? null,
'description' => $configData['description'] ?? null, 'description' => $configData['description'] ?? null,
'icon' => $configData['icon'] ?? null, 'icon' => $configData['icon'] ?? null,
'custom_html' => $configData['custom_html'] ?? [], 'custom_html' => $configData['custom_html'] ?? false,
'ignore_container' => $configData['ignore_container'] ?? false,
]); ]);
$linkTypes->push($linkType); $linkTypes->push($linkType);
} }