1 layout.admin.inc layout_toggle_enabled(Layout $layout, $status)

Menu callback; Enable or disable a layout configuration.

File

core/modules/layout/layout.admin.inc, line 2003
Administrative functions for 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');
}