Skip to content

Commit dd68dee

Browse files
committed
Added option to rename footer pages
Users can now edit the names of footer pages. This new category on the config page replaces the previous section in the Advanced Config.
1 parent fcd0fd4 commit dd68dee

File tree

9 files changed

+233
-146
lines changed

9 files changed

+233
-146
lines changed

.env

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,15 @@ ENABLE_SOCIAL_LOGIN=false
9797
USE_THEME_PREVIEW_IFRAME=true
9898

9999
#Redirects all pages to https
100-
FORCE_ROUTE_HTTPS=false
100+
FORCE_ROUTE_HTTPS=false#Redirects all pages to https=
101+
DISPLAY_FOOTER_HOME=true
102+
DISPLAY_FOOTER_TERMS=true
103+
DISPLAY_FOOTER_PRIVACY=true
104+
DISPLAY_FOOTER_CONTACT=true
105+
106+
TITLE_FOOTER_HOME="Home"
107+
TITLE_FOOTER_TERMS="Terms"
108+
TITLE_FOOTER_PRIVACY="Privacy"
109+
TITLE_FOOTER_CONTACT="Contact"
110+
111+
HOME_FOOTER_LINK=""

composer.lock

Lines changed: 126 additions & 132 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/config-legends.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,51 @@
166166
{"value": "FORCE_ROUTE_HTTPS",
167167
"title": "Redirect all pages to HTTPS",
168168
"description": "This option will break your setup when using a reverse proxy."
169+
},
170+
171+
172+
{"value": "DISPLAY_FOOTER_HOME",
173+
"title": "Home footer link",
174+
"description": "Enable Home footer link."
175+
},
176+
177+
{"value": "DISPLAY_FOOTER_TERMS",
178+
"title": "Terms footer link",
179+
"description": "Enable Terms footer link."
180+
},
181+
182+
{"value": "DISPLAY_FOOTER_PRIVACY",
183+
"title": "Privacy footer link",
184+
"description": "Enable Privacy link."
185+
},
186+
187+
{"value": "DISPLAY_FOOTER_CONTACT",
188+
"title": "Contact footer link",
189+
"description": "Enable Contact link."
190+
},
191+
192+
{"value": "TITLE_FOOTER_HOME",
193+
"title": "<div style=\"margin-top:-40px\"></div>",
194+
"description": "Title of home footer link."
195+
},
196+
197+
{"value": "TITLE_FOOTER_TERMS",
198+
"title": "<div style=\"margin-top:-40px\"></div>",
199+
"description": "Title of terms footer link."
200+
},
201+
202+
{"value": "TITLE_FOOTER_PRIVACY",
203+
"title": "<div style=\"margin-top:-40px\"></div>",
204+
"description": "Title of privacy link."
205+
},
206+
207+
{"value": "TITLE_FOOTER_CONTACT",
208+
"title": "<div style=\"margin-top:-40px\"></div>",
209+
"description": "Title of contact link."
210+
},
211+
212+
{"value": "HOME_FOOTER_LINK",
213+
"title": "<div style=\"margin-top:-40px\">Home footer link URL</div>",
214+
"description": "Enter any URL to redirect your home link URL.<br>Leave empty to use the default link."
169215
}
170216
]

resources/views/components/config/config.blade.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,40 @@ function text($key){
378378
{{-- end SMTP settings --}}
379379

380380

381+
{{-- start footer settings --}}
382+
<a name="Footer"><h2 class="ch2">Footer links</h2></a>
383+
384+
{{toggle('DISPLAY_FOOTER_HOME')}}
385+
{{text('TITLE_FOOTER_HOME')}}
386+
387+
@php
388+
$configNames = json_decode(file_get_contents(base_path('config/config-legends.json')));
389+
$configValue = str_replace('"', "", EnvEditor::getKey('HOME_FOOTER_LINK'));
390+
@endphp
391+
<form id="HOME_FOOTER_LINK-form" action="{{route('editConfig')}}" enctype="multipart/form-data" method="post">
392+
<div class="form-group col-lg-8">
393+
<input value="text" name="type" style="display:none;" type="text" required>
394+
<input value="HOME_FOOTER_LINK" name="entry" style="display:none;" type="text" required>
395+
<h5 style="margin-top:50px">@php foreach($configNames as $obj){if($obj->value == 'HOME_FOOTER_LINK'){echo $obj->title;}}; @endphp</h5>
396+
<p class="text-muted">@php foreach($configNames as $obj){if($obj->value == 'HOME_FOOTER_LINK'){echo $obj->description;}}; @endphp</p>
397+
<div class="input-group">
398+
<input type="url" style="border-radius:.25rem;max-width:600px" class="form-control" name="value" value="{{$configValue}}">
399+
<input type="hidden" name="_token" value="{{csrf_token()}}">
400+
<button style="position:relative;bottom:17px;" type="submit" class="mt-3 ml-3 btn btn-info">Apply</button>
401+
</div></div>
402+
</form>
403+
404+
{{toggle('DISPLAY_FOOTER_TERMS')}}
405+
{{text('TITLE_FOOTER_TERMS')}}
406+
407+
{{toggle('DISPLAY_FOOTER_PRIVACY')}}
408+
{{text('TITLE_FOOTER_PRIVACY')}}
409+
410+
{{toggle('DISPLAY_FOOTER_CONTACT')}}
411+
{{text('TITLE_FOOTER_CONTACT')}}
412+
{{-- end footer settings --}}
413+
414+
381415
{{-- start debug settings --}}
382416
<a name="Debug"><h2 class="ch2">Debug</h2></a>
383417
<form id="debug-form" action="{{route('editConfig')}}" enctype="multipart/form-data" method="post">

resources/views/layouts/footer.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div class="container">
22
<div class="footer fadein" style="margin:5% 0px 35px 0px;">
33
@if(env('DISPLAY_FOOTER') === true)
4-
@if(config('advanced-config.display_link_home') != 'false')<a class="footer-hover spacing" @if(config('advanced-config.custom_link_home') != '')href="{{ config('advanced-config.custom_link_home') }}"@else href="{{ url('') }}/"@endif> @if(config('advanced-config.custom_text_home') != ''){{config('advanced-config.custom_text_home')}}@else Home @endif</a>@endif
5-
@if(config('advanced-config.display_link_terms') != 'false')<a class="footer-hover spacing" href="{{ url('') }}/pages/terms">Terms</a>@endif
6-
@if(config('advanced-config.display_link_privacy') != 'false')<a class="footer-hover spacing" href="{{ url('') }}/pages/privacy">Privacy</a>@endif
7-
@if(config('advanced-config.display_link_contact') != 'false')<a class="footer-hover spacing" href="{{ url('') }}/pages/contact">Contact</a>@endif
4+
@if(env('DISPLAY_FOOTER_HOME') === true)<a class="footer-hover spacing" href="@if(str_replace('"', "", EnvEditor::getKey('HOME_FOOTER_LINK')) === "" ){{ url('') }}@else{{ str_replace('"', "", EnvEditor::getKey('HOME_FOOTER_LINK')) }}@endif">{{str_replace('"', "", EnvEditor::getKey('TITLE_FOOTER_HOME'))}}</a>@endif
5+
@if(env('DISPLAY_FOOTER_TERMS') === true)<a class="footer-hover spacing" href="{{ url('') }}/pages/terms">{{env('TITLE_FOOTER_TERMS')}}</a>@endif
6+
@if(env('DISPLAY_FOOTER_PRIVACY') === true)<a class="footer-hover spacing" href="{{ url('') }}/pages/privacy">{{env('TITLE_FOOTER_PRIVACY')}}</a>@endif
7+
@if(env('DISPLAY_FOOTER_CONTACT') === true)<a class="footer-hover spacing" href="{{ url('') }}/pages/contact">{{env('TITLE_FOOTER_CONTACT')}}</a>@endif
88
@endif
99
</div>
1010

resources/views/layouts/sidebar.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,11 @@ function getUrlSatusCodesb($urlsb, $timeoutsb = 3)
232232
@if(env('DISPLAY_FOOTER') === true)
233233
<p>
234234
Copyright &copy; @php echo date('Y'); @endphp {{ config('app.name') }}<i class="icon-heart" aria-hidden="true"></i> </br>
235-
@php if(config('advanced-config.display_link_home') != 'false' and config('advanced-config.display_link_terms') != 'false' and config('advanced-config.display_link_privacy') != 'false' and config('advanced-config.display_link_contact') != 'false'){$dot=" . "; } else {$dot="&ensp;";} @endphp
236-
@if(config('advanced-config.display_link_home') != 'false')<a class="footer-hover spacing" @if(config('advanced-config.custom_link_home') != '')href="{{ config('advanced-config.custom_link_home') }}"@else href="{{ url('') }}/"@endif> @if(config('advanced-config.custom_text_home') != ''){{config('advanced-config.custom_text_home')}}@else Home @endif</a>{!!$dot!!}@endif
237-
@if(config('advanced-config.display_link_terms') != 'false')<a class="footer-hover spacing" href="{{ url('') }}/pages/terms">Terms</a>{!!$dot!!}@endif
238-
@if(config('advanced-config.display_link_privacy') != 'false')<a class="footer-hover spacing" href="{{ url('') }}/pages/privacy">Privacy</a>{!!$dot!!}@endif
239-
@if(config('advanced-config.display_link_contact') != 'false')<a class="footer-hover spacing" href="{{ url('') }}/pages/contact">Contact</a>@endif
235+
@php if(env('DISPLAY_FOOTER_HOME') != false and env('DISPLAY_FOOTER_TERMS') != false and env('DISPLAY_FOOTER_PRIVACY') != false and env('DISPLAY_FOOTER_CONTACT') != false){$dot=" . "; } else {$dot="&ensp;";} @endphp
236+
@if(env('DISPLAY_FOOTER_HOME') === true)<a class="footer-hover spacing" href="@if(str_replace('"', "", EnvEditor::getKey('HOME_FOOTER_LINK')) === "" ){{ url('') }}@else{{ str_replace('"', "", EnvEditor::getKey('HOME_FOOTER_LINK')) }}@endif">{{str_replace('"', "", EnvEditor::getKey('TITLE_FOOTER_HOME'))}}</a>{!!$dot!!}@endif
237+
@if(env('DISPLAY_FOOTER_TERMS') === true)<a class="footer-hover spacing" href="{{ url('') }}/pages/terms">{{str_replace('"', "", EnvEditor::getKey('TITLE_FOOTER_TERMS'))}}</a>{!!$dot!!}@endif
238+
@if(env('DISPLAY_FOOTER_PRIVACY') === true)<a class="footer-hover spacing" href="{{ url('') }}/pages/privacy">{{str_replace('"', "", EnvEditor::getKey('TITLE_FOOTER_PRIVACY'))}}</a>{!!$dot!!}@endif
239+
@if(env('DISPLAY_FOOTER_CONTACT') === true)<a class="footer-hover spacing" href="{{ url('') }}/pages/contact">{{str_replace('"', "", EnvEditor::getKey('TITLE_FOOTER_CONTACT'))}}</a>@endif
240240
</p>
241241
@endif
242242
@if(env('DISPLAY_CREDIT') === true)

resources/views/pages.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function update_color_scheme() {
8080
@endif
8181

8282
<div class="jumbotron" style="margin-top: 10%">
83-
<h1 class="display-4">{{ $name }}</h1>
83+
<h1 class="display-4">{{str_replace('"', "", EnvEditor::getKey('TITLE_FOOTER_'.strtoupper($name)))}}</h1>
8484
<hr class="my-4">
8585
<p>
8686
<?php echo $data['page']->$name; ?>

resources/views/panel/config-editor.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@
182182
<a href="#Security"><div class="legendl">Security</div></a>
183183
<a href="#Advanced"><div class="legendl">Advanced</div></a>
184184
<a href="#SMTP"><div class="legendl">SMTP</div></a>
185+
<a href="#Footer"><div class="legendl">Footer links</div></a>
185186
<a href="#Debug"><div class="legendl">Debug</div></a>
186187
<div>
187188
</div></div></div>
@@ -279,6 +280,7 @@
279280
$('html, body').animate({scrollTop:280}, '300');
280281
});
281282
</script>
283+
<script src="{{ asset('studio/external-dependencies/bootstrap.min.js') }}"></script>
282284
@endpush
283285

284286

resources/views/panel/pages.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
@csrf
1313
@foreach($pages as $page)
1414
<div class="form-group col-lg-8">
15-
<h3>Terms</h3>
15+
<h3>{{str_replace('"', "", EnvEditor::getKey('TITLE_FOOTER_TERMS'))}}</h3>
1616
<textarea class="form-control ckeditor" name="terms" rows="3">{{ $page->terms }}</textarea>
1717
</div><br>
1818
<div class="form-group col-lg-8">
19-
<h3>Privacy</h3>
19+
<h3>{{str_replace('"', "", EnvEditor::getKey('TITLE_FOOTER_PRIVACY'))}}</h3>
2020
<textarea class="form-control ckeditor" name="privacy" rows="3">{{ $page->privacy }}</textarea>
2121
</div><br>
2222
<div class="form-group col-lg-8">
23-
<h3>Contact</h3>
23+
<h3>{{str_replace('"', "", EnvEditor::getKey('TITLE_FOOTER_CONTACT'))}}</h3>
2424
<textarea class="form-control ckeditor" name="contact" rows="3">{{ $page->contact }}</textarea>
2525
</div><br>
2626
@endforeach

0 commit comments

Comments
 (0)