1.20.x 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

modules/layout/layout.admin.inc, line 2229
Admin page callbacks for the 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();
}