mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/structural_pages.git
synced 2026-03-10 10:27:41 -03:00
Rename module site_structure → structural_pages and vocabulary site_section → site_sections
Renames the module from site_structure to structural_pages and pluralizes the taxonomy vocabulary machine name from site_section to site_sections, updating all config, PHP, translations, and documentation references while preserving field_site_section, clears_site_section, and $site_section_id. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\site_structure\Plugin\Block;
|
||||
namespace Drupal\structural_pages\Plugin\Block;
|
||||
|
||||
use Drupal\Core\Block\BlockBase;
|
||||
use Drupal\Core\Cache\Cache;
|
||||
@@ -12,22 +12,22 @@ use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\node\NodeInterface;
|
||||
use Drupal\site_structure\ParentEntityHandler\ParentEntityHandlerManagerInterface;
|
||||
use Drupal\structural_pages\ParentEntityHandler\ParentEntityHandlerManagerInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Provides a dynamic menu block based on site structure hierarchy.
|
||||
*
|
||||
* @Block(
|
||||
* id = "site_structure_menu",
|
||||
* admin_label = @Translation("Site Structure Menu"),
|
||||
* category = @Translation("Site Structure"),
|
||||
* id = "structural_pages_menu",
|
||||
* admin_label = @Translation("Structural Pages Menu"),
|
||||
* category = @Translation("Structural Pages"),
|
||||
* context_definitions = {
|
||||
* "node" = @ContextDefinition("entity:node", label = @Translation("Node"), required = FALSE),
|
||||
* }
|
||||
* )
|
||||
*/
|
||||
class SiteStructureMenuBlock extends BlockBase implements ContainerFactoryPluginInterface {
|
||||
class StructuralPagesMenuBlock extends BlockBase implements ContainerFactoryPluginInterface {
|
||||
|
||||
/**
|
||||
* Maximum depth to prevent infinite loops.
|
||||
@@ -51,7 +51,7 @@ class SiteStructureMenuBlock extends BlockBase implements ContainerFactoryPlugin
|
||||
/**
|
||||
* The parent entity handler manager.
|
||||
*
|
||||
* @var \Drupal\site_structure\ParentEntityHandler\ParentEntityHandlerManagerInterface
|
||||
* @var \Drupal\structural_pages\ParentEntityHandler\ParentEntityHandlerManagerInterface
|
||||
*/
|
||||
protected ParentEntityHandlerManagerInterface $handlerManager;
|
||||
|
||||
@@ -175,7 +175,7 @@ class SiteStructureMenuBlock extends BlockBase implements ContainerFactoryPlugin
|
||||
}
|
||||
|
||||
$build = [
|
||||
'#theme' => 'site_structure_menu',
|
||||
'#theme' => 'structural_pages_menu',
|
||||
'#ancestor' => $ancestor,
|
||||
'#tree' => $tree,
|
||||
'#active_trail' => $active_trail,
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\site_structure\Plugin\ParentEntityHandler;
|
||||
namespace Drupal\structural_pages\Plugin\ParentEntityHandler;
|
||||
|
||||
use Drupal\Core\Breadcrumb\Breadcrumb;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\Core\StringTranslation\TranslatableMarkup;
|
||||
use Drupal\node\NodeInterface;
|
||||
use Drupal\site_structure\Attribute\ParentEntityHandler;
|
||||
use Drupal\site_structure\ParentEntityHandler\ParentEntityHandlerBase;
|
||||
use Drupal\structural_pages\Attribute\ParentEntityHandler;
|
||||
use Drupal\structural_pages\ParentEntityHandler\ParentEntityHandlerBase;
|
||||
|
||||
/**
|
||||
* Handler for node entities.
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\site_structure\Plugin\ParentEntityHandler;
|
||||
namespace Drupal\structural_pages\Plugin\ParentEntityHandler;
|
||||
|
||||
use Drupal\Core\Breadcrumb\Breadcrumb;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\StringTranslation\TranslatableMarkup;
|
||||
use Drupal\site_structure\Attribute\ParentEntityHandler;
|
||||
use Drupal\site_structure\ParentEntityHandler\ParentEntityHandlerBase;
|
||||
use Drupal\structural_pages\Attribute\ParentEntityHandler;
|
||||
use Drupal\structural_pages\ParentEntityHandler\ParentEntityHandlerBase;
|
||||
use Drupal\taxonomy\TermInterface;
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ use Drupal\taxonomy\TermInterface;
|
||||
entity_type_id: 'taxonomy_term',
|
||||
clears_site_section: FALSE,
|
||||
sort_field: 'name',
|
||||
bundle_restrictions: ['site_section'],
|
||||
bundle_restrictions: ['site_sections'],
|
||||
weight: 0,
|
||||
)]
|
||||
class TaxonomyTermHandler extends ParentEntityHandlerBase {
|
||||
@@ -69,8 +69,8 @@ class TaxonomyTermHandler extends ParentEntityHandlerBase {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Only site_section terms can be site sections.
|
||||
if ($entity->bundle() !== 'site_section') {
|
||||
// Only site_sections terms can be site sections.
|
||||
if ($entity->bundle() !== 'site_sections') {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\site_structure\Plugin\ParentEntityHandler;
|
||||
namespace Drupal\structural_pages\Plugin\ParentEntityHandler;
|
||||
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\Core\StringTranslation\TranslatableMarkup;
|
||||
use Drupal\site_structure\Attribute\ParentEntityHandler;
|
||||
use Drupal\site_structure\ParentEntityHandler\ParentEntityHandlerBase;
|
||||
use Drupal\structural_pages\Attribute\ParentEntityHandler;
|
||||
use Drupal\structural_pages\ParentEntityHandler\ParentEntityHandlerBase;
|
||||
use Drupal\user\UserInterface;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user