Skip to content
Snippets Groups Projects
Commit 65e9122c authored by Viktor Holovachek's avatar Viktor Holovachek
Browse files

Issue #3288961 - Drupal 10

parent 92eb579c
No related branches found
No related tags found
1 merge request!1Issue #3288961 - Drupal 10
......@@ -2,10 +2,8 @@ name: Panels Breadcrumbs
description: 'Provides panels breadcrumbs functionality.'
type: module
package: Panels
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^9.4 || ^10
dependencies:
- ctools:ctools
- page_manager:page_manager_ui
- token:token
......@@ -5,16 +5,19 @@
* Module file for panels breadcrumbs module.
*/
use Drupal\panels_breadcrumbs\Form\PageVariantBreadcrumbsForm;
use Drupal\panels_breadcrumbs\Wizard\PanelsBreadcrumbsEditWizard;
/**
* Implements hook_page_manager_variant_operations_alter().
* Implements hook_entity_type_build().
*/
function panels_breadcrumbs_page_manager_variant_operations_alter(&$operations) {
$operations['breadcrumbs'] = [
'title' => t('Breadcrumbs'),
'form' => PageVariantBreadcrumbsForm::class,
];
function panels_breadcrumbs_entity_type_build(array &$entity_types) {
/** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
if (isset($entity_types['page'])) {
$classes = $entity_types['page']->getHandlerClasses();
$classes['wizard']['edit'] = PanelsBreadcrumbsEditWizard::class;
$entity_types['page']->setHandlerClass('wizard', $classes['wizard']);
}
}
/**
......
<?php
namespace Drupal\panels_breadcrumbs\Wizard;
use Drupal\page_manager\PageVariantInterface;
use Drupal\page_manager_ui\Wizard\PageEditWizard;
use Drupal\panels_breadcrumbs\Form\PageVariantBreadcrumbsForm;
class PanelsBreadcrumbsEditWizard extends PageEditWizard {
/**
* {@inheritdoc}
*/
protected function getVariantOperations(PageVariantInterface $page_variant, $cached_values) {
$operations = parent::getVariantOperations($page_variant, $cached_values);
$operations['breadcrumbs'] = [
'title' => $this->t('Breadcrumbs'),
'form' => PageVariantBreadcrumbsForm::class,
];
return $operations;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment