class ShortcutListController

Provides a listing of shortcut sets.

Hierarchy

Expanded class hierarchy of ShortcutListController

File

drupal/core/modules/shortcut/lib/Drupal/shortcut/ShortcutListController.php, line 15

Namespace

Drupal\shortcut
View source
class ShortcutListController extends ConfigEntityListController {

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

  /**
   * Overrides \Drupal\Core\Entity\EntityListController::getOperations().
   */
  public function getOperations(EntityInterface $entity) {
    $uri = $entity
      ->uri();
    $operations['list'] = array(
      'title' => t('List links'),
      'href' => $uri['path'],
    );
    $operations['edit'] = array(
      'title' => t('Edit set'),
      'href' => $uri['path'] . '/edit',
      'options' => $uri['options'],
      'weight' => 10,
    );
    if ($entity
      ->access('delete')) {
      $operations['delete'] = array(
        'title' => t('Delete set'),
        'href' => $uri['path'] . '/delete',
        'options' => $uri['options'],
        'weight' => 100,
      );
    }
    return $operations;
  }

  /**
   * Overrides \Drupal\Core\Entity\EntityListController::buildRow().
   */
  public function buildRow(EntityInterface $entity) {
    $row['name'] = check_plain($entity
      ->label());
    $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
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
ShortcutListController::buildHeader public function Overrides \Drupal\Core\Entity\EntityListController::buildHeader(). Overrides EntityListController::buildHeader
ShortcutListController::buildRow public function Overrides \Drupal\Core\Entity\EntityListController::buildRow(). Overrides EntityListController::buildRow
ShortcutListController::getOperations public function Overrides \Drupal\Core\Entity\EntityListController::getOperations(). Overrides ConfigEntityListController::getOperations