Overrides Drupal\Core\Entity\EntityListController::render();
Overrides EntityListController::render
public function render() {
$entities = $this
->load();
$list['#type'] = 'container';
$list['#attached']['css'] = ViewFormControllerBase::getAdminCSS();
$list['#attached']['library'][] = array(
'system',
'drupal.ajax',
);
$list['#attributes']['id'] = 'views-entity-list';
$list['enabled']['heading']['#markup'] = '<h2>' . t('Enabled') . '</h2>';
$list['disabled']['heading']['#markup'] = '<h2>' . t('Disabled') . '</h2>';
foreach (array(
'enabled',
'disabled',
) as $status) {
$list[$status]['#type'] = 'container';
$list[$status]['#attributes'] = array(
'class' => array(
'views-list-section',
$status,
),
);
$list[$status]['table'] = array(
'#theme' => 'table',
'#header' => $this
->buildHeader(),
'#rows' => array(),
);
foreach ($entities[$status] as $entity) {
$list[$status]['table']['#rows'][$entity
->id()] = $this
->buildRow($entity);
}
}
// @todo Use a placeholder for the entity label if this is abstracted to
// other entity types.
$list['enabled']['table']['#empty'] = t('There are no enabled views.');
$list['disabled']['table']['#empty'] = t('There are no disabled views.');
return $list;
}