Revert "Refactor"

This reverts commit 32f7c5d867.
This commit is contained in:
Julian Prieber 2023-12-13 16:07:44 +01:00
parent 4b14e24a83
commit c684cdb0fa
1 changed files with 6 additions and 6 deletions

View File

@ -3,7 +3,7 @@
if (!function_exists('theme')) { if (!function_exists('theme')) {
function theme($key){ function theme($key){
$key = trim($key); $key = trim($key);
$file = base_path('themes/' . Auth::user()->theme . '/config.php'); $file = base_path('themes/' . $GLOBALS['themeName'] . '/config.php');
if (file_exists($file)) { if (file_exists($file)) {
$config = include $file; $config = include $file;
if (isset($config[$key])) { if (isset($config[$key])) {
@ -15,14 +15,14 @@ return null;}
// Theme Custom Asset // Theme Custom Asset
if (!function_exists('themeAsset')) { if (!function_exists('themeAsset')) {
function themeAsset($path){ function themeAsset($path){
$path = url('themes/' . Auth::user()->theme . '/extra/custom-assets/' . $path); $path = url('themes/' . $GLOBALS['themeName'] . '/extra/custom-assets/' . $path);
return $path;} return $path;}
} }
$customBackgroundExists = false; $customBackgroundExists = false;
@endphp @endphp
@foreach($information as $info) @php Auth::user()->theme = $info->theme; @endphp @endforeach @foreach($information as $info) @php $GLOBALS['themeName'] = $info->theme; @endphp @endforeach
@if(theme('allow_custom_background') != "false") @if(theme('allow_custom_background') != "false")
@php @php
@ -46,7 +46,7 @@ $customBackgroundExists = file_exists($customBackgroundPath)
@endif @endif
@push('linkstack-head-end') @push('linkstack-head-end')
@if(theme('enable_custom_code') == "true" and theme('enable_custom_head') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include(Auth::user()->theme . '.extra.custom-head')@endif @if(theme('enable_custom_code') == "true" and theme('enable_custom_head') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-head')@endif
@if($info->theme != '' and $info->theme != 'default') @if($info->theme != '' and $info->theme != 'default')
<!-- LinkStack Theme: "{{$info->theme}}" --> <!-- LinkStack Theme: "{{$info->theme}}" -->
@ -77,7 +77,7 @@ $customBackgroundExists = file_exists($customBackgroundPath)
@endpush @endpush
@push('linkstack-body-start') @push('linkstack-body-start')
@if(theme('enable_custom_code') == "true" and theme('enable_custom_body') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include(Auth::user()->theme . '.extra.custom-body')@endif @if(theme('enable_custom_code') == "true" and theme('enable_custom_body') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-body')@endif
@if($info->theme != '' and $info->theme != 'default') @if($info->theme != '' and $info->theme != 'default')
<!-- Enables parallax background animations --> <!-- Enables parallax background animations -->
@ -102,6 +102,6 @@ $customBackgroundExists = file_exists($customBackgroundPath)
@endpush @endpush
@push('linkstack-body-end') @push('linkstack-body-end')
@if(theme('enable_custom_code') == "true" and theme('enable_custom_body_end') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include(Auth::user()->theme . '.extra.custom-body-end')@endif @if(theme('enable_custom_code') == "true" and theme('enable_custom_body_end') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-body-end')@endif
@endpush @endpush
@include('linkstack.modules.dynamic-contrast') @include('linkstack.modules.dynamic-contrast')