1.20.x layout.admin.inc layout_toggle_enabled(Layout $layout, $status)

Menu callback; Enable or disable a layout configuration.

File

modules/layout/layout.admin.inc, line 2089
Admin page callbacks for the Layout module.

Code

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

  if ($status) {
    $layout->enable();
    backdrop_set_message(t('Layout "@title" enabled.', array('@title' => $layout->title)));
  }
  else {
    $layout->disable();
    backdrop_set_message(t('Layout "@title" disabled.', array('@title' => $layout->title)));
  }
  backdrop_goto('admin/structure/layouts');
}