diff --git a/core/modules/layout/layout.module b/core/modules/layout/layout.module index 5f034bd..7d82798 100644 --- a/core/modules/layout/layout.module +++ b/core/modules/layout/layout.module @@ -31,36 +31,3 @@ function layout_theme($existing, $type, $theme, $path) { } return $items; } - -/** - * Implements hook_entity_info(). - * - * Provides the core Display object, which contains all the info necessary for - * block-driven pages. - */ -function layout_entity_info() { - return array( - 'display' => array( - 'label' => t('Display'), - 'entity class' => 'Drupal\layout\Config\Display', - 'controller class' => 'Drupal\Core\Config\Entity\ConfigStorageController', - 'config prefix' => 'display', - 'fieldable' => FALSE, - 'entity keys' => array( - 'id' => 'id', - 'uuid' => 'uuid', - ), - ), - 'unbound_display' => array( - 'label' => t('Unbound Display'), - 'entity class' => 'Drupal\layout\Config\UnboundDisplay', - 'controller class' => 'Drupal\Core\Config\Entity\ConfigStorageController', - 'config prefix' => 'display.unbound', - 'fieldable' => FALSE, - 'entity keys' => array( - 'id' => 'id', - 'uuid' => 'uuid', - ), - ) - ); -} \ No newline at end of file diff --git a/core/modules/layout/lib/Drupal/layout/Config/UnboundDisplayInterface.php b/core/modules/layout/lib/Drupal/layout/Config/UnboundDisplayInterface.php index 9549788..d709db1 100644 --- a/core/modules/layout/lib/Drupal/layout/Config/UnboundDisplayInterface.php +++ b/core/modules/layout/lib/Drupal/layout/Config/UnboundDisplayInterface.php @@ -28,7 +28,7 @@ * The type of entity to create. Must resolve to a class implementing * BoundDisplayInterface. * - * @return \Drupal\layout\Config\Display + * @return \Drupal\layout\Plugin\Core\Entity\Display * A Display object that has had the data from this config object mapped to * the provided layout plugin. */ diff --git a/core/modules/layout/lib/Drupal/layout/Config/Display.php b/core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/Display.php similarity index 91% rename from core/modules/layout/lib/Drupal/layout/Config/Display.php rename to core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/Display.php index 26e948f..814ed73 100644 --- a/core/modules/layout/lib/Drupal/layout/Config/Display.php +++ b/core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/Display.php @@ -2,16 +2,30 @@ /** * @file - * Definition of Drupal\layout\Config\Entity\Display. + * Definition of Drupal\layout\Plugin\Core\Entity\Display. */ -namespace Drupal\layout\Config; +namespace Drupal\layout\Plugin\Core\Entity; use Drupal\layout\Plugin\LayoutInterface; +use Drupal\Core\Annotation\Plugin; +use Drupal\Core\Annotation\Translation; /** * Configuration encapsulator that provides all the data needed by block-driven * controllers to render a page. + * + * @Plugin( + * id = "display", + * label = @Translation("Display"), + * module = "layout", + * controller_class = "Drupal\Core\Config\Entity\ConfigStorageController", + * config_prefix = "display", + * entity_keys = { + * "id" = "id", + * "uuid" = "uuid" + * } + * ) */ class Display extends DisplayBase implements BoundDisplayInterface { /** diff --git a/core/modules/layout/lib/Drupal/layout/Config/UnboundDisplay.php b/core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/UnboundDisplay.php similarity index 68% rename from core/modules/layout/lib/Drupal/layout/Config/UnboundDisplay.php rename to core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/UnboundDisplay.php index 7a066af..9a6e375 100644 --- a/core/modules/layout/lib/Drupal/layout/Config/UnboundDisplay.php +++ b/core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/UnboundDisplay.php @@ -2,12 +2,14 @@ /** * @file - * Definition of Drupal\layout\Config\Entity\Display. + * Definition of Drupal\layout\Plugin\Core\Entity\Display. */ -namespace Drupal\layout\Config; +namespace Drupal\layout\Plugin\Core\Entity; use Drupal\layout\Plugin\LayoutInterface; +use Drupal\Core\Annotation\Plugin; +use Drupal\Core\Annotation\Translation; /** * Configuration encapsulator that provides all the data needed by block-driven @@ -15,6 +17,18 @@ * * Unbound displays contain blocks that are not 'bound' to a specific layout, * and their contained blocks are mapped only to region types, not real regions. + * + * @Plugin( + * id = "unbound_display", + * label = @Translation("Unbound Display"), + * module = "layout", + * controller_class = "Drupal\Core\Config\Entity\ConfigStorageController", + * config_prefix = "display.unbound", + * entity_keys = { + * "id" = "id", + * "uuid" = "uuid" + * } + * ) */ class UnboundDisplay extends DisplayBase implements UnboundDisplayInterface { diff --git a/core/modules/layout/lib/Drupal/layout/Tests/DisplayInternalLogicTest.php b/core/modules/layout/lib/Drupal/layout/Tests/DisplayInternalLogicTest.php index d1b2f6b..9417a32 100644 --- a/core/modules/layout/lib/Drupal/layout/Tests/DisplayInternalLogicTest.php +++ b/core/modules/layout/lib/Drupal/layout/Tests/DisplayInternalLogicTest.php @@ -8,8 +8,8 @@ namespace Drupal\layout\Tests; use Drupal\simpletest\WebTestBase; -use Drupal\layout\Config\Display; -use Drupal\layout\Config\UnboundDisplay; +use Drupal\layout\Plugin\Core\Entity\Display; +use Drupal\layout\Plugin\Core\Entity\UnboundDisplay; /** * Tests the API and internal logic offered by Displays. @@ -28,21 +28,21 @@ class DisplayInternalLogicTest extends WebTestBase { /** * The twocol test display. * - * @var \Drupal\layout\Config\Display + * @var \Drupal\layout\Plugin\Core\Entity\Display */ public $twocol; /** * The onecol test display. * - * @var \Drupal\layout\Config\Display + * @var \Drupal\layout\Plugin\Core\Entity\Display */ public $onecol; /** * The unbound test display. * - * @var \Drupal\layout\Config\UnboundDisplay + * @var \Drupal\layout\Plugin\Core\Entity\UnboundDisplay */ public $unbound;