You are here

function content_menu_mark_link_updated in Content Menu 8

Same name and namespace in other branches
  1. 7 content_menu.module \content_menu_mark_link_updated()

Remember newly created menu items to highlight them on the next menu admin page view/request.

Parameters

\Drupal\menu_link\Plugin\Core\Entity\MenuLink $menu_link: A menu link entity.

2 calls to content_menu_mark_link_updated()
content_menu_menu_link_insert in ./content_menu.module
Implements hook_menu_link_insert().
content_menu_menu_link_update in ./content_menu.module
Implements hook_menu_link_update().

File

./content_menu.module, line 167

Code

function content_menu_mark_link_updated($menu_link) {

  // Save menu links created on or right before menu admin pages to session var.
  if (isset($_GET['destination']) && strpos($_GET['destination'], 'admin/structure/menu/manage/') === 0 || strpos(current_path(), 'admin/structure/menu/manage/') === 0) {
    $menu_link->created = time();
    $_SESSION['content_menu_inserted_links'][$menu_link
      ->id()] = $menu_link;
  }
}