{{-- Array input: Side list + detail (no tabs), tree view, meta editing --}} @php $safePath = preg_replace('/[^A-Za-z0-9_-]+/', '_', $path); $isFooterSections = $inputName === 'footer_sections'; $isSectionLinks = $inputName === 'section_links'; $addLabel = $isFooterSections ? __('Bölüm Ekle') : ($isSectionLinks ? __('Link Ekle') : __('common.add_item')); $removeLabel = $isFooterSections ? __('Bölüm Sil') : ($isSectionLinks ? __('Link Sil') : __('common.remove_item')); $emptyLabelText = '(Başlık girilmemiş)'; // Sağ panelde gösterilecek detay path'i (bu seviye veya alt seviye) $detailPath = method_exists($this, 'getDetail') ? $this->getDetail($path) : $path; // Sol listedeki bu seviye için mevcut veri ve şema $rawData = data_get($data, $path, []); if (!is_array($rawData)) { $rawData = []; } // Meta (string key) değerleri (örn. 'title') liste sayımına dahil edilmemeli. $actualData = array_values(array_filter($rawData, function ($v, $k) { return is_int($k); }, ARRAY_FILTER_USE_BOTH)); $schemaItems = (isset($inputType['items']) && is_array($inputType['items'])) ? $inputType['items'] : []; $count = max(count($schemaItems), count($actualData)); // Aktif index $activeIndex = method_exists($this, 'getActive') ? $this->getActive($path) : (isset($active[$path]) ? (int)$active[$path] : 0); if ($activeIndex < 0) { $activeIndex=0; } if ($activeIndex>= $count && $count > 0) { $activeIndex = $count - 1; } @endphp