Plan 99.11 - Correcciones críticas: - FooterRenderer: Añadir PageVisibilityHelper::shouldShow() - HeroSectionRenderer: Añadir PageVisibilityHelper::shouldShow() - AdsensePlacementRenderer: Añadir PageVisibilityHelper::shouldShow() Mejoras adicionales: - UrlPatternExclusion: Soporte wildcards (*sct* → regex) - ExclusionFormPartial: UI mejorada con placeholders - ComponentConfiguration: Grupo _exclusions validado - 12 FormBuilders: Integración UI de exclusiones - 12 FieldMappers: Mapeo campos de exclusión Verificado: Footer oculto en post con categoría excluida SCT 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
65 lines
3.3 KiB
PHP
65 lines
3.3 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace ROITheme\Admin\TopNotificationBar\Infrastructure\FieldMapping;
|
|
|
|
use ROITheme\Admin\Shared\Domain\Contracts\FieldMapperInterface;
|
|
|
|
/**
|
|
* Field Mapper para Top Notification Bar
|
|
*
|
|
* RESPONSABILIDAD:
|
|
* - Mapear field IDs del formulario a atributos de BD
|
|
* - Solo conoce sus propios campos (modularidad)
|
|
*/
|
|
final class TopNotificationBarFieldMapper implements FieldMapperInterface
|
|
{
|
|
public function getComponentName(): string
|
|
{
|
|
return 'top-notification-bar';
|
|
}
|
|
|
|
public function getFieldMapping(): array
|
|
{
|
|
return [
|
|
// Visibility
|
|
'topBarEnabled' => ['group' => 'visibility', 'attribute' => 'is_enabled'],
|
|
'topBarShowOnMobile' => ['group' => 'visibility', 'attribute' => 'show_on_mobile'],
|
|
'topBarShowOnDesktop' => ['group' => 'visibility', 'attribute' => 'show_on_desktop'],
|
|
'topBarIsCritical' => ['group' => 'visibility', 'attribute' => 'is_critical'],
|
|
|
|
// Page Visibility (grupo especial _page_visibility)
|
|
'topBarVisibilityHome' => ['group' => '_page_visibility', 'attribute' => 'show_on_home'],
|
|
'topBarVisibilityPosts' => ['group' => '_page_visibility', 'attribute' => 'show_on_posts'],
|
|
'topBarVisibilityPages' => ['group' => '_page_visibility', 'attribute' => 'show_on_pages'],
|
|
'topBarVisibilityArchives' => ['group' => '_page_visibility', 'attribute' => 'show_on_archives'],
|
|
'topBarVisibilitySearch' => ['group' => '_page_visibility', 'attribute' => 'show_on_search'],
|
|
|
|
// Exclusions (grupo especial _exclusions - Plan 99.11)
|
|
'topBarExclusionsEnabled' => ['group' => '_exclusions', 'attribute' => 'exclusions_enabled'],
|
|
'topBarExcludeCategories' => ['group' => '_exclusions', 'attribute' => 'exclude_categories', 'type' => 'json_array'],
|
|
'topBarExcludePostIds' => ['group' => '_exclusions', 'attribute' => 'exclude_post_ids', 'type' => 'json_array_int'],
|
|
'topBarExcludeUrlPatterns' => ['group' => '_exclusions', 'attribute' => 'exclude_url_patterns', 'type' => 'json_array_lines'],
|
|
|
|
// Content
|
|
'topBarIconClass' => ['group' => 'content', 'attribute' => 'icon_class'],
|
|
'topBarLabelText' => ['group' => 'content', 'attribute' => 'label_text'],
|
|
'topBarMessageText' => ['group' => 'content', 'attribute' => 'message_text'],
|
|
'topBarLinkText' => ['group' => 'content', 'attribute' => 'link_text'],
|
|
'topBarLinkUrl' => ['group' => 'content', 'attribute' => 'link_url'],
|
|
|
|
// Colors
|
|
'topBarBackgroundColor' => ['group' => 'colors', 'attribute' => 'background_color'],
|
|
'topBarTextColor' => ['group' => 'colors', 'attribute' => 'text_color'],
|
|
'topBarLabelColor' => ['group' => 'colors', 'attribute' => 'label_color'],
|
|
'topBarIconColor' => ['group' => 'colors', 'attribute' => 'icon_color'],
|
|
'topBarLinkColor' => ['group' => 'colors', 'attribute' => 'link_color'],
|
|
'topBarLinkHoverColor' => ['group' => 'colors', 'attribute' => 'link_hover_color'],
|
|
|
|
// Spacing
|
|
'topBarFontSize' => ['group' => 'spacing', 'attribute' => 'font_size'],
|
|
'topBarPadding' => ['group' => 'spacing', 'attribute' => 'padding'],
|
|
];
|
|
}
|
|
}
|