File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ function findBackground($name)
4646}
4747
4848function analyzeImageBrightness ($ file ) {
49-
49+ try {
5050 $ file = base_path ('assets/img/background-img/ ' .$ file );
5151
5252 // Get image information using getimagesize
@@ -95,6 +95,9 @@ function analyzeImageBrightness($file) {
9595 } else {
9696 return 'light ' ;
9797 }
98+ } catch (\Throwable $ th ) {
99+ return null ;
100+ }
98101 }
99102
100103 function infoIcon ($ tip ) {
Original file line number Diff line number Diff line change 1212 @endif
1313@endforeach
1414
15- @foreach ($information as $info ) @php $GLOBALS [' themeName' ] = $info -> theme ; @endphp @endforeach
16-
1715<?php
1816// Theme Config
19- function theme ($key ){
17+ if (! function_exists (' theme' )) {
18+ function theme ($key ){
2019$key = trim ($key );
2120$file = base_path (' themes/' . $GLOBALS [' themeName' ] . ' /config.php' );
2221 if (file_exists ($file )) {
@@ -25,13 +24,18 @@ function theme($key){
2524 return $config [$key ];
2625}}
2726return null ;}
27+ }
2828
2929// Theme Custom Asset
30+ if (! function_exists (' themeAsset' )) {
3031function themeAsset ($path ){
3132$path = url (' themes/' . $GLOBALS [' themeName' ] . ' /extra/custom-assets/' . $path );
3233return $path ;}
34+ }
3335? >
3436
37+ @foreach ($information as $info ) @php $GLOBALS [' themeName' ] = $info -> theme ; @endphp @endforeach
38+
3539@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
3640
3741@include (' layouts.analytics' )
You can’t perform that action at this time.
0 commit comments