1.20.x layout.admin.inc layout_clone_form($form, &$form_state, $layout)

Form callback; Copy an existing layout into a new layout.

Related topics

File

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

Code

function layout_clone_form($form, &$form_state, $layout) {
  $layout_clone = $layout->getClone();

  $settings_form = layout_settings_form($form, $form_state, $layout_clone);
  $form['title'] = $settings_form['title'];
  $form['name'] = $settings_form['name'];

  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Clone layout'),
  );

  return $form;
}