You are here

function ds_panels_layout_remove in Display Suite 7

Submit callback: remove a layout.

1 string reference to 'ds_panels_layout_remove'
ds_panels_layout in modules/ds_extras/ds_extras.panels.inc
Return the Panels layout settings form.

File

modules/ds_extras/ds_extras.panels.inc, line 743
Administrative functions for DS panels.

Code

function ds_panels_layout_remove($form, $form_state) {

  // Setup some variables.
  $entity_type = $form['#entity_type'];
  $bundle = $form['#bundle'];
  $view_mode = $form['#view_mode'];

  // Delete panels display.
  panels_delete_display($form['#did']);

  // Remove old record.
  db_delete('ds_layout_settings')
    ->condition('entity_type', $entity_type)
    ->condition('bundle', $bundle)
    ->condition('view_mode', $view_mode)
    ->execute();

  // Clear entity info cache.
  cache_clear_all('entity_info', 'cache', TRUE);

  // Show message.
  drupal_set_message(t('The layout has been removed.'));
}