1 layout.admin.inc layout_break_lock_page($item, $type = 'layout')

Menu callback; Break a lock on a layout or menu item.

Parameters

$item: Either a Layout or LayoutMenuItem object, which is currently being edited.

string $type: The type of Layout item, either "layout" or "menu_item".

See also

layout_locked_message()

File

core/modules/layout/layout.admin.inc, line 2143
Administrative functions for Layout module.

Code

function layout_break_lock_page($item, $type = 'layout') {
  if (backdrop_get_token($type . '-' . $item->name) !== $_GET['token']) {
    return MENU_ACCESS_DENIED;
  }

  layout_clear_layout_tempstore($item->name, $type);
  backdrop_set_message(t('The lock has been cleared and all changes discarded. You may now make changes to this page.'));
  backdrop_goto();
}