@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | function analyzeImageBrightness($file) { |
| 49 | 49 | try { |
| 50 | - $file = base_path('assets/img/background-img/'.$file); |
|
| 50 | + $file = base_path('assets/img/background-img/' . $file); |
|
| 51 | 51 | |
| 52 | 52 | // Get image information using getimagesize |
| 53 | 53 | $imageInfo = getimagesize($file); |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // Calculate the average brightness of the image |
| 79 | 79 | $total_brightness = 0; |
| 80 | - for ($x=0; $x<$width; $x++) { |
|
| 81 | - for ($y=0; $y<$height; $y++) { |
|
| 80 | + for ($x = 0; $x < $width; $x++) { |
|
| 81 | + for ($y = 0; $y < $height; $y++) { |
|
| 82 | 82 | $rgb = imagecolorat($img, $x, $y); |
| 83 | 83 | $r = ($rgb >> 16) & 0xFF; |
| 84 | 84 | $g = ($rgb >> 8) & 0xFF; |
@@ -132,10 +132,10 @@ discard block |
||
| 132 | 132 | function footer($key) |
| 133 | 133 | { |
| 134 | 134 | $upperStr = strtoupper($key); |
| 135 | - if (env('TITLE_FOOTER_'.$upperStr) == "") { |
|
| 136 | - $title = __('messages.footer.'.$key); |
|
| 135 | + if (env('TITLE_FOOTER_' . $upperStr) == "") { |
|
| 136 | + $title = __('messages.footer.' . $key); |
|
| 137 | 137 | } else { |
| 138 | - $title = env('TITLE_FOOTER_'.$upperStr); |
|
| 138 | + $title = env('TITLE_FOOTER_' . $upperStr); |
|
| 139 | 139 | } |
| 140 | 140 | return $title; |
| 141 | 141 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | return $str; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | -if(!function_exists('setBlockAssetContext')) { |
|
| 155 | +if (!function_exists('setBlockAssetContext')) { |
|
| 156 | 156 | function setBlockAssetContext($type = null) { |
| 157 | 157 | static $currentType = null; |
| 158 | 158 | if ($type !== null) { |
@@ -163,14 +163,14 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | // Get custom block assets |
| 166 | -if(!function_exists('block_asset')) { |
|
| 166 | +if (!function_exists('block_asset')) { |
|
| 167 | 167 | function block_asset($file) { |
| 168 | 168 | $type = setBlockAssetContext(); // Retrieve the current type context |
| 169 | 169 | return url("block-asset/$type?asset=$file"); |
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | -if(!function_exists('get_block_file_contents')) { |
|
| 173 | +if (!function_exists('get_block_file_contents')) { |
|
| 174 | 174 | function get_block_file_contents($file) { |
| 175 | 175 | $type = setBlockAssetContext(); // Retrieve the current type context |
| 176 | 176 | return file_get_contents(base_path("blocks/$type/$file")); |