1 layout.admin.inc layout_clone_form_submit($form, &$form_state)

Submit handler for layout_clone_form().

File

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

Code

function layout_clone_form_submit($form, &$form_state) {
  /* @var Layout $layout */
  $layout = $form_state['layout'];
  $layout->title = $form_state['values']['title'];
  $layout->name = $form_state['values']['name'];
  if (!empty($layout->menu_item)) {
    $layout->menu_item->menu['title'] = $form_state['values']['name'];
    $layout->menu_item->name = $form_state['values']['name'];
  }
  $layout->save();

  // Redirect to the full settings form.
  $form_state['redirect'] = array(
    'admin/structure/layouts/manage/' . $layout->name . '/configure',
    array('query' => array('destination' => 'admin/structure/layouts/manage/' . $layout->name)),
  );
  backdrop_set_message(t('Cloned layout @title created. You may now configure the cloned layout.', array('@title' => $layout->title)));
}