diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu/lib/Drupal/menu/MenuFormController.php index ffab994..41e5696 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php +++ b/core/modules/menu/lib/Drupal/menu/MenuFormController.php @@ -82,11 +82,11 @@ public function save(array $form, array &$form_state) { $uri = $menu->uri(); if ($status == SAVED_UPDATED) { drupal_set_message(t('Menu %label has been updated.', array('%label' => $menu->label()))); - watchdog('contact', 'Menu %label has been updated.', array('%label' => $menu->label()), WATCHDOG_NOTICE, l(t('Edit'), $uri['path'] . '/edit')); + watchdog('menu', 'Menu %label has been updated.', array('%label' => $menu->label()), WATCHDOG_NOTICE, l(t('Edit'), $uri['path'] . '/edit')); } else { drupal_set_message(t('Menu %label has been added.', array('%label' => $menu->label()))); - watchdog('contact', 'Menu %label has been added.', array('%label' => $menu->label()), WATCHDOG_NOTICE, l(t('Edit'), $uri['path'] . '/edit')); + watchdog('menu', 'Menu %label has been added.', array('%label' => $menu->label()), WATCHDOG_NOTICE, l(t('Edit'), $uri['path'] . '/edit')); } $form_state['redirect'] = 'admin/structure/menu/manage/' . $menu->id(); diff --git a/core/modules/menu/lib/Drupal/menu/MenuListController.php b/core/modules/menu/lib/Drupal/menu/MenuListController.php index b867d06..a833dbc 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuListController.php +++ b/core/modules/menu/lib/Drupal/menu/MenuListController.php @@ -43,28 +43,31 @@ public function buildRow(EntityInterface $entity) { /** * Overrides \Drupal\Core\Entity\EntityListController::getOperations(); */ - public function getOperations(EntityInterface $menu) { - $uri = $menu->uri(); - $path = $uri['path']; + public function getOperations(EntityInterface $entity) { + $operations = parent::getOperations($entity); + $uri = $entity->uri(); $operations['list'] = array( 'title' => t('list links'), - 'href' => $path, + 'href' => $uri['path'], 'options' => $uri['options'], 'weight' => 0, ); - $operations['edit'] = array( - 'title' => t('edit menu'), - 'href' => $path . '/edit', - 'options' => $uri['options'], - 'weight' => 10, - ); + $operations['edit']['title'] = t('edit menu'); $operations['add'] = array( 'title' => t('add link'), - 'href' => $path . '/add', + 'href' => $uri['path'] . '/add', 'options' => $uri['options'], 'weight' => 20, ); + // System menus could not be deleted. + $system_menus = menu_list_system_menus(); + if (isset($system_menus[$entity->id()])) { + unset($operations['delete']); + } + else { + $operations['delete']['title'] = t('delete menu'); + } return $operations; }