@php use App\Library\AdminLibrary as AdminLibrary; $selectLangList=[]; foreach($form["languages"] as $slanguage){ $selectLangList[$slanguage["id"]]=$slanguage["title"]; } $contentType=$themeComponentRelational["content_type"]; $categoryList=$themeComponentRelational["category_list"]; $categoryListJsonDecode=json_decode($categoryList,true); @endphp {{ html()->form()->method('POST')->action(route('admin.themes.components.categories-content.update', ['theme_id' => $themeComponentRelational["theme_id"],"theme_component_rel_id"=>$themeComponentRelational["id"]]))->class("form modulForm")->id("categoryContentForm")->autocomplete("off")->attribute('enctype','multipart/form-data')->open() }}

{{trans("admin/themes.components.component_detail.categories-content.title")}}

@foreach($form["languages"] as $lang) @php $langID=$lang["id"]; $langCode=$lang["code"]; $contentCategoriesListSelect=[]; if($contentType==="content"){ $contentCategoriesList=AdminLibrary::contentCategoriesList($langCode); foreach ($contentCategoriesList as $contentCategories){ $contentCategoriesListSelect[]=["id"=>$contentCategories["id"],"title"=>$contentCategories["title"]]; } }elseif($contentType==="product"){ $productCategoriesList=AdminLibrary::productCategoriesList($langCode); foreach ($productCategoriesList as $productCategories){ $contentCategoriesListSelect[]=["id"=>$productCategories["id"],"title"=>$productCategories["title"]]; } } $categoryListJsonDecodeList=[]; $componentTitle=null; if(is_array($categoryListJsonDecode)){ $categoryListJsonDecodeList=array_key_exists($langCode,$categoryListJsonDecode) ? array_key_exists('category',$categoryListJsonDecode[$langCode])? $categoryListJsonDecode[$langCode]["category"] : []: []; $componentTitle=array_key_exists($langCode,$categoryListJsonDecode) ? array_key_exists('title',$categoryListJsonDecode[$langCode])? $categoryListJsonDecode[$langCode]["title"] : null: null; } @endphp
{{html()->label()->for("lang")->html(trans("admin/themes.components.component_detail.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.categories-content.form.title")) }} {{html()->input()->name("language[".$langCode."][title]")->value($componentTitle)->id("title-".$langCode)->class("form-control")}}
{{html()->label()->for("category-".$langCode)->text(trans("admin/themes.components.component_detail.categories-content.form.category")) }}
{{ html()->button()->type("submit")->class("btn btn-info btn-sm")->id("btnAction")->html(trans("admin/themes.components.component_detail.categories-content.form.btn_action")) }}
@endforeach
{{ html()->form()->close() }}