class CustomBlockTypeListController

Provides a listing of custom block types.

Hierarchy

Expanded class hierarchy of CustomBlockTypeListController

File

drupal/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php, line 16
Contains \Drupal\custom_block\CustomBlockTypeListController.

Namespace

Drupal\custom_block
View source
class CustomBlockTypeListController extends ConfigEntityListController {

  /**
   * Overrides \Drupal\Core\Entity\EntityListController::getOperations().
   */
  public function getOperations(EntityInterface $entity) {
    $operations = parent::getOperations($entity);
    if (module_exists('field_ui')) {
      $uri = $entity
        ->uri();
      $operations['manage-fields'] = array(
        'title' => t('Manage fields'),
        'href' => $uri['path'] . '/fields',
        'options' => $uri['options'],
        'weight' => 15,
      );
      $operations['manage-display'] = array(
        'title' => t('Manage display'),
        'href' => $uri['path'] . '/display',
        'options' => $uri['options'],
        'weight' => 20,
      );
    }
    return $operations;
  }

  /**
   * Overrides \Drupal\Core\Entity\EntityListController::buildHeader().
   */
  public function buildHeader() {
    $row['type'] = t('Block type');
    $row['description'] = t('Description');
    $row['operations'] = t('Operations');
    return $row;
  }

  /**
   * Overrides \Drupal\Core\Entity\EntityListController::buildRow().
   */
  public function buildRow(EntityInterface $entity) {
    parent::buildRow($entity);
    $uri = $entity
      ->uri();
    $row['type'] = l($entity
      ->label(), $uri['path'], $uri['options']);
    $row['description'] = filter_xss_admin($entity->description);
    $row['operations']['data'] = $this
      ->buildOperations($entity);
    return $row;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigEntityListController::load public function Overrides Drupal\Core\Entity\EntityListController::load(). Overrides EntityListController::load 3
CustomBlockTypeListController::buildHeader public function Overrides \Drupal\Core\Entity\EntityListController::buildHeader(). Overrides EntityListController::buildHeader
CustomBlockTypeListController::buildRow public function Overrides \Drupal\Core\Entity\EntityListController::buildRow(). Overrides EntityListController::buildRow
CustomBlockTypeListController::getOperations public function Overrides \Drupal\Core\Entity\EntityListController::getOperations(). Overrides ConfigEntityListController::getOperations
EntityListController::$entityInfo protected property The entity info array.
EntityListController::$entityType protected property The entity type name.
EntityListController::$moduleHandler protected property The module handler to invoke hooks on.
EntityListController::$storage protected property The entity storage controller class.
EntityListController::buildOperations public function Builds a renderable list of operation links for the entity. 1
EntityListController::createInstance public static function Instantiates a new instance of this entity controller. Overrides EntityControllerInterface::createInstance 1
EntityListController::getStorageController public function Implements \Drupal\Core\Entity\EntityListControllerInterface::getStorageController(). Overrides EntityListControllerInterface::getStorageController
EntityListController::render public function Implements \Drupal\Core\Entity\EntityListControllerInterface::render(). Overrides EntityListControllerInterface::render 6
EntityListController::__construct public function Constructs a new EntityListController object. 1