- Añadir PageVisibility use case y repositorio - Implementar PageTypeDetector para detectar home/single/page/archive - Actualizar FieldMappers con soporte show_on_[page_type] - Extender FormBuilders con UI de visibilidad por página - Refactorizar Renderers para evaluar visibilidad dinámica - Limpiar schemas removiendo campos de visibilidad legacy - Añadir MigrationCommand para migrar configuraciones existentes - Implementar adsense-loader.js para carga lazy de ads - Actualizar front-page.php con nueva estructura - Extender DIContainer con nuevos servicios 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
84 lines
4.8 KiB
PHP
84 lines
4.8 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace ROITheme\Admin\RelatedPost\Infrastructure\FieldMapping;
|
|
|
|
use ROITheme\Admin\Shared\Domain\Contracts\FieldMapperInterface;
|
|
|
|
/**
|
|
* Field Mapper para Related Post
|
|
*
|
|
* RESPONSABILIDAD:
|
|
* - Mapear field IDs del formulario a atributos de BD
|
|
* - Solo conoce sus propios campos (modularidad)
|
|
*
|
|
* NOTA: Este componente NO tenia mapeos en AdminAjaxHandler
|
|
* (era el unico componente roto - 35 campos no se guardaban)
|
|
*/
|
|
final class RelatedPostFieldMapper implements FieldMapperInterface
|
|
{
|
|
public function getComponentName(): string
|
|
{
|
|
return 'related-post';
|
|
}
|
|
|
|
public function getFieldMapping(): array
|
|
{
|
|
return [
|
|
// Visibility
|
|
'relatedPostEnabled' => ['group' => 'visibility', 'attribute' => 'is_enabled'],
|
|
'relatedPostShowOnDesktop' => ['group' => 'visibility', 'attribute' => 'show_on_desktop'],
|
|
'relatedPostShowOnMobile' => ['group' => 'visibility', 'attribute' => 'show_on_mobile'],
|
|
|
|
// Page Visibility (grupo especial _page_visibility)
|
|
'relatedPostVisibilityHome' => ['group' => '_page_visibility', 'attribute' => 'show_on_home'],
|
|
'relatedPostVisibilityPosts' => ['group' => '_page_visibility', 'attribute' => 'show_on_posts'],
|
|
'relatedPostVisibilityPages' => ['group' => '_page_visibility', 'attribute' => 'show_on_pages'],
|
|
'relatedPostVisibilityArchives' => ['group' => '_page_visibility', 'attribute' => 'show_on_archives'],
|
|
'relatedPostVisibilitySearch' => ['group' => '_page_visibility', 'attribute' => 'show_on_search'],
|
|
|
|
// Content
|
|
'relatedPostSectionTitle' => ['group' => 'content', 'attribute' => 'section_title'],
|
|
'relatedPostPerPage' => ['group' => 'content', 'attribute' => 'posts_per_page'],
|
|
'relatedPostOrderby' => ['group' => 'content', 'attribute' => 'orderby'],
|
|
'relatedPostOrder' => ['group' => 'content', 'attribute' => 'order'],
|
|
'relatedPostShowPagination' => ['group' => 'content', 'attribute' => 'show_pagination'],
|
|
|
|
// Layout
|
|
'relatedPostColsDesktop' => ['group' => 'layout', 'attribute' => 'columns_desktop'],
|
|
'relatedPostColsTablet' => ['group' => 'layout', 'attribute' => 'columns_tablet'],
|
|
'relatedPostColsMobile' => ['group' => 'layout', 'attribute' => 'columns_mobile'],
|
|
|
|
// Typography
|
|
'relatedPostSectionTitleSize' => ['group' => 'typography', 'attribute' => 'section_title_size'],
|
|
'relatedPostSectionTitleWeight' => ['group' => 'typography', 'attribute' => 'section_title_weight'],
|
|
'relatedPostCardTitleSize' => ['group' => 'typography', 'attribute' => 'card_title_size'],
|
|
'relatedPostCardTitleWeight' => ['group' => 'typography', 'attribute' => 'card_title_weight'],
|
|
|
|
// Colors
|
|
'relatedPostSectionTitleColor' => ['group' => 'colors', 'attribute' => 'section_title_color'],
|
|
'relatedPostCardBgColor' => ['group' => 'colors', 'attribute' => 'card_bg_color'],
|
|
'relatedPostCardTitleColor' => ['group' => 'colors', 'attribute' => 'card_title_color'],
|
|
'relatedPostCardHoverBgColor' => ['group' => 'colors', 'attribute' => 'card_hover_bg_color'],
|
|
'relatedPostPaginationBgColor' => ['group' => 'colors', 'attribute' => 'pagination_bg_color'],
|
|
'relatedPostPaginationTextColor' => ['group' => 'colors', 'attribute' => 'pagination_text_color'],
|
|
'relatedPostPaginationActiveBg' => ['group' => 'colors', 'attribute' => 'pagination_active_bg'],
|
|
'relatedPostPaginationActiveText' => ['group' => 'colors', 'attribute' => 'pagination_active_text'],
|
|
|
|
// Spacing
|
|
'relatedPostSectionMarginTop' => ['group' => 'spacing', 'attribute' => 'section_margin_top'],
|
|
'relatedPostSectionMarginBottom' => ['group' => 'spacing', 'attribute' => 'section_margin_bottom'],
|
|
'relatedPostTitleMarginBottom' => ['group' => 'spacing', 'attribute' => 'title_margin_bottom'],
|
|
'relatedPostGridGap' => ['group' => 'spacing', 'attribute' => 'grid_gap'],
|
|
'relatedPostCardPadding' => ['group' => 'spacing', 'attribute' => 'card_padding'],
|
|
'relatedPostPaginationMarginTop' => ['group' => 'spacing', 'attribute' => 'pagination_margin_top'],
|
|
|
|
// Visual Effects
|
|
'relatedPostCardBorderRadius' => ['group' => 'visual_effects', 'attribute' => 'card_border_radius'],
|
|
'relatedPostCardShadow' => ['group' => 'visual_effects', 'attribute' => 'card_shadow'],
|
|
'relatedPostCardHoverShadow' => ['group' => 'visual_effects', 'attribute' => 'card_hover_shadow'],
|
|
'relatedPostCardTransition' => ['group' => 'visual_effects', 'attribute' => 'card_transition'],
|
|
];
|
|
}
|
|
}
|