$group) { if (!isset($group['pages'][$key])) { continue; } $template = $group['pages'][$key]; $sections = []; $quicklinks = []; foreach ($template['sections'] as [$anchor, $title, $style, $body, $feed]) { $sections[] = ['key' => $anchor, 'title' => $title, 'style' => $style, 'body' => Html::sanitize($body, $anchor), 'lead' => '', 'feed' => $feed, 'alignments' => '{}', 'version' => 0]; $quicklinks[] = ['#' . $anchor, $title]; } return array_replace($template, [ 'slug' => $key, 'theme' => $theme, 'title' => $template['name'], 'accent' => '', 'lead' => $template['description'], 'quicklinks' => $quicklinks, 'status' => 'draft', 'alignments' => [], 'image_scale' => 0, 'sections' => $sections, ]); } return null; } }