ContentMenuListController.php in Content Menu 8
File
lib/Drupal/content_menu/ContentMenuListController.php
View source
<?php
namespace Drupal\content_menu;
use Drupal\menu\MenuListController;
use Drupal\Core\Entity\EntityInterface;
class ContentMenuListController extends MenuListController {
public function buildHeader() {
$row = parent::buildHeader();
unset($row['description']);
return $row;
}
public function buildRow(EntityInterface $entity) {
$row['title'] = '<div class="menu-label">' . check_plain($entity
->label()) . '</div>' . filter_xss_admin($entity->description);
$row['operations']['data'] = $this
->buildOperations($entity);
return $row;
}
public function getOperations(EntityInterface $entity) {
$operations = parent::getOperations($entity);
unset($operations['add']);
unset($operations['delete']);
return $operations;
}
public function render() {
$build = array(
'#theme' => 'table',
'#header' => $this
->buildHeader(),
'#rows' => array(),
'#empty' => t('There is no @label yet.', array(
'@label' => $this->entityInfo['label'],
)),
);
foreach ($this
->load() as $entity) {
if (content_menu_is_menu_considered($entity
->id()) || user_access('administer system menus')) {
$build['#rows'][$entity
->id()] = $this
->buildRow($entity);
}
}
return $build;
}
}