@php use App\Library\AdminLibrary as AdminLibrary; use \App\Models\Theme\ThemeComponentConstant as ThemeComponentConstant; $selectLangList=[]; foreach($form["languages"] as $slanguage){ $selectLangList[$slanguage["id"]]=$slanguage["title"]; } $themeComponentConstants=AdminLibrary::themeComponentConstant($themeComponentRelational["theme_id"],$themeComponentRelational["id"]); $imagePositions=ThemeComponentConstant::$imagePositions; $positions=ThemeComponentConstant::$positions; @endphp

{{trans("admin/themes.components.component_detail.constant.title")}}

{{ html()->form()->method('POST')->action(route('admin.themes.components.constant.action', ['theme_id' => $themeComponentRelational["theme_id"],"theme_component_rel_id"=>$themeComponentRelational["id"]]))->class("form modulForm")->id("constantModulForm")->autocomplete("off")->attribute('enctype','multipart/form-data')->open() }}
@foreach($form["languages"] as $lang) @php $langID=$lang["id"]; $langCode=$lang["code"]; $title=null; $description=null; $image=null; $link=null; $position=null; $imagePosition="left"; $linkTitle=null; if(array_key_exists($langCode,$themeComponentConstants)){ $title=$themeComponentConstants[$langCode]["title"]; $description=$themeComponentConstants[$langCode]["description"]; $image=$themeComponentConstants[$langCode]["image_url"]; $link=$themeComponentConstants[$langCode]["link"]; $imagePosition=$themeComponentConstants[$langCode]["image_position"]; $position=$themeComponentConstants[$langCode]["position"]; $linkTitle=$themeComponentConstants[$langCode]["link_title"]; } @endphp
{{html()->label()->for("lang")->html(trans("admin/contents.form.lang")) }} {{html()->span()->id("lang-".$langID)->html($lang["title"])->style(['font-size'=>'12px','margin'=>' 5px 0','font-weight'=>'bold']) }}
{{html()->label()->for("title-".$langCode)->text(trans("admin/themes.components.component_detail.constant.form.title")) }} {{html()->input()->name("language[".$langCode."][title]")->value($title)->id("title-".$langCode)->class("form-control title")}}
{{html()->label()->for("description")->text(trans("admin/themes.components.component_detail.constant.form.description")) }} {{html()->textarea()->name("language[".$langCode."][description]")->value($description)->id("description")->class("form-control editor")}}
{{html()->label()->for("image-".$langCode)->text(trans("admin/themes.components.component_detail.constant.form.image")) }} {{html()->file()->name("language[".$langCode."][image]")->id("image-".$langCode)->class("form-control image")}} @if(!empty($image)) {{$title}} @endif
{{html()->label()->for("link-".$langCode)->text(trans("admin/themes.components.component_detail.constant.form.link")) }} {{html()->input()->name("language[".$langCode."][link]")->value($link)->id("link-".$langCode)->class("form-control link")}}
{{html()->label()->for("link_title-".$langCode)->text(trans("admin/themes.components.component_detail.constant.form.link_title")) }} {{html()->input()->name("language[".$langCode."][link_title]")->value($linkTitle)->id("link-".$langCode)->class("form-control link_title")}}
{{html()->label()->for("image_position-".$langCode)->text(trans("admin/themes.components.component_detail.constant.form.image_position")) }} {{html()->select()->options($imagePositions)->name("language[".$langCode."][image_position]")->value($imagePosition)->id("image_position-".$langCode)->class("form-control image_position")}}
{{html()->label()->for("position-".$langCode)->text(trans("admin/themes.components.component_detail.constant.form.position")) }} {{html()->select()->options($positions)->name("language[".$langCode."][position]")->value($position)->id("position-".$langCode)->class("form-control image_position")}}
{{ html()->button()->type("submit")->class("btn btn-info btn-sm")->id("btnAction")->html(trans("admin/themes.components.component_detail.constant.form.btn_action")) }}
@endforeach
{{ html()->form()->close() }}