Enhance EditSetting Page: Added a method to mutate form data before filling, allowing dynamic retrieval of virtual field values based on the selected type. Updated footer template to utilize localization for contact information and section titles, improving multilingual support and user experience.

This commit is contained in:
Ümit Tunç
2025-12-31 22:16:42 +03:00
parent b345c6f71c
commit 2a1cdafbea
2 changed files with 33 additions and 14 deletions
@@ -18,6 +18,25 @@ class EditSetting extends EditRecord
return __('settings.edit');
}
protected function mutateFormDataBeforeFill(array $data): array
{
$record = $this->getRecord();
if (isset($data['type'])) {
$type = $data['type'];
$virtualField = 'value_' . $type;
try {
// Model accessor'ını kullanarak değeri al
$data[$virtualField] = $record->{$virtualField};
} catch (\Exception $e) {
// Accessor bulunamazsa devam et
}
}
return $data;
}
protected function getHeaderActions(): array
{
return [
+14 -14
View File
@@ -4,7 +4,7 @@
<div class="md:w-4/12 xl:w-3/12 lg:w-3/12 w-full flex-[0_0_auto] !px-[15px] max-w-full xl:!mt-0 lg:!mt-0 !mt-[30px]">
<div class="widget !text-[#cacaca]">
<img class="!mb-4" src="../../assets/img/truncgil-yatay-dark.svg" alt="image">
<p class="!mb-4">© 2025 Trunçgil. <br class="hidden xl:block lg:block !text-[#cacaca]">All rights reserved.</p>
<p class="!mb-4">© {{ date('Y') }} {{ t('Trunçgil Teknoloji') }}. <br class="hidden xl:block lg:block !text-[#cacaca]">{{ t('Tüm hakları saklıdır.') }}</p>
<nav class="nav social social-white">
<a class="!text-[#cacaca] text-[1rem] transition-all duration-[0.2s] ease-in-out translate-y-0 motion-reduce:transition-none hover:translate-y-[-0.15rem] m-[0_.7rem_0_0]" href="#"><i class="uil uil-twitter before:content-['\ed59'] !text-white text-[1rem]"></i></a>
<a class="!text-[#cacaca] text-[1rem] transition-all duration-[0.2s] ease-in-out translate-y-0 motion-reduce:transition-none hover:translate-y-[-0.15rem] m-[0_.7rem_0_0]" href="#"><i class="uil uil-facebook-f before:content-['\eae2'] !text-white text-[1rem]"></i></a>
@@ -19,22 +19,22 @@
<!-- /column -->
<div class="md:w-4/12 xl:w-3/12 lg:w-3/12 w-full flex-[0_0_auto] !px-[15px] max-w-full xl:!mt-0 lg:!mt-0 !mt-[30px]">
<div class="widget !text-[#cacaca]">
<h4 class="widget-title !text-white !mb-3">Get in Touch</h4>
<address class="xl:!pr-20 xxl:!pr-28 not-italic !leading-[inherit] block !mb-4">ÇAMTEPE MAH. MAHMUT TEVFİK ATAY BUL. GAZİANTEP TEKNOPARK NO: 4A İÇ KAPI NO: 1 ŞAHİNBEY / GAZİANTEP</address>
<a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="mailto:first.last@email.com">info@truncgil.com</a><br> 00 (123) 456 78 90
<h4 class="widget-title !text-white !mb-3">{{ t('İletişim') }}</h4>
<address class="xl:!pr-20 xxl:!pr-28 not-italic !leading-[inherit] block !mb-4">{{ setting('contact_address') }}</address>
<a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="mailto:{{ setting('contact_email') }}">{{ setting('contact_email') }}</a><br> {{ setting('contact_phone') }}
</div>
<!-- /.widget -->
</div>
<!-- /column -->
<div class="md:w-4/12 xl:w-3/12 lg:w-3/12 w-full flex-[0_0_auto] !px-[15px] max-w-full xl:!mt-0 lg:!mt-0 !mt-[30px]">
<div class="widget !text-[#cacaca]">
<h4 class="widget-title !text-white !mb-3">Learn More</h4>
<h4 class="widget-title !text-white !mb-3">{{ t('Daha Fazla Bilgi') }}</h4>
<ul class="pl-0 list-none !mb-0">
<li><a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="#">About Us</a></li>
<li class="!mt-[0.35rem]"><a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="#">Our Story</a></li>
<li class="!mt-[0.35rem]"><a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="#">Projects</a></li>
<li class="!mt-[0.35rem]"><a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="#">Terms of Use</a></li>
<li class="!mt-[0.35rem]"><a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="#">Privacy Policy</a></li>
<li><a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="#">{{ t('Hakkımızda') }}</a></li>
<li class="!mt-[0.35rem]"><a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="#">{{ t('Hikayemiz') }}</a></li>
<li class="!mt-[0.35rem]"><a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="#">{{ t('Projelerimiz') }}</a></li>
<li class="!mt-[0.35rem]"><a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="#">{{ t('Kullanım Koşulları') }}</a></li>
<li class="!mt-[0.35rem]"><a class="!text-[#cacaca] hover:!text-[#3f78e0]" href="#">{{ t('Gizlilik Politikası') }}</a></li>
</ul>
</div>
<!-- /.widget -->
@@ -42,8 +42,8 @@
<!-- /column -->
<div class="md:w-full xl:w-3/12 lg:w-3/12 w-full flex-[0_0_auto] !px-[15px] max-w-full xl:!mt-0 lg:!mt-0 !mt-[30px]">
<div class="widget !text-[#cacaca]">
<h4 class="widget-title !text-white !mb-3">Our Newsletter</h4>
<p class="!mb-5">Subscribe to our newsletter to get our news &amp; deals delivered to you.</p>
<h4 class="widget-title !text-white !mb-3">{{ t('Bizimle İletişime Geçin') }}</h4>
<p class="!mb-5">{{ t('Yeniliklerden haberdar olmak için bize e-posta adresinizi bırakın.') }}</p>
<div class="newsletter-wrapper">
<!-- Begin Mailchimp Signup Form -->
<div id="mc_embed_signup">
@@ -51,8 +51,8 @@
<div id="mc_embed_signup_scroll">
<div class="!text-left input-group form-floating !relative flex flex-wrap items-stretch w-full">
<input type="email" value="" name="EMAIL" class="required email form-control block w-full text-[12px] font-medium !leading-[1.7] appearance-none bg-clip-padding shadow-[0_0_1.25rem_rgba(30,34,40,0.04)] px-4 py-[0.6rem] rounded-[0.4rem] motion-reduce:transition-none focus:shadow-[0_0_1.25rem_rgba(30,34,40,0.04),unset] disabled:bg-[#aab0bc] disabled:opacity-100 file:!mt-[-0.6rem] file:mr-[-1rem] file:!mb-[-0.6rem] file:ml-[-1rem] file:!text-[#60697b] file:bg-[#fefefe] file:pointer-events-none file:transition-all file:duration-[0.2s] file:ease-in-out file:px-4 file:py-[0.6rem] file:rounded-none motion-reduce:file:transition-none placeholder:!text-[#959ca9] placeholder:opacity-100 border border-solid !border-[rgba(255,255,255,0.1)] !text-[#cacaca] bg-[rgba(255,255,255,.03)] focus-visible:!border-[rgba(63,120,224,0.5)] " placeholder="" id="mce-EMAIL">
<label class="!ml-[0.05rem] !text-[#959ca9] text-[.75rem] absolute z-[2] h-full overflow-hidden text-start text-ellipsis whitespace-nowrap pointer-events-none origin-[0_0] px-4 py-[0.6rem] left-0 top-0" for="mce-EMAIL">Email Address</label>
<input type="submit" value="Join" name="subscribe" id="mc-embedded-subscribe" class="btn btn-primary !text-white !bg-[#3f78e0] border-[#3f78e0] hover:text-white hover:bg-[#3f78e0] hover:!border-[#3f78e0] active:text-white active:bg-[#3f78e0] active:border-[#3f78e0] disabled:text-white disabled:bg-[#3f78e0] disabled:border-[#3f78e0] !relative z-[2] focus:z-[5] hover:!transform-none border-0">
<label class="!ml-[0.05rem] !text-[#959ca9] text-[.75rem] absolute z-[2] h-full overflow-hidden text-start text-ellipsis whitespace-nowrap pointer-events-none origin-[0_0] px-4 py-[0.6rem] left-0 top-0" for="mce-EMAIL">{{ t('E-posta Adresiniz') }}</label>
<input type="submit" value="{{ t('Abone Ol') }}" name="subscribe" id="mc-embedded-subscribe" class="btn btn-primary !text-white !bg-[#3f78e0] border-[#3f78e0] hover:text-white hover:bg-[#3f78e0] hover:!border-[#3f78e0] active:text-white active:bg-[#3f78e0] active:border-[#3f78e0] disabled:text-white disabled:bg-[#3f78e0] disabled:border-[#3f78e0] !relative z-[2] focus:z-[5] hover:!transform-none border-0">
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>