1 layout.flexible.inc | layout_flexible_template_settings_form_submit($form, &$form_state) |
Submit handler that saves a flexible template.
See also
layout_flexible_template_settings_edit_form()
File
- core/
modules/ layout/ layout.flexible.inc, line 90 - Provides configurable (flexible) layout templates.
Code
function layout_flexible_template_settings_form_submit($form, &$form_state) {
/* @var LayoutFlexibleTemplate $flexible_template */
$flexible_template = $form_state['flexible_template'];
$flexible_template->name = $form_state['values']['machine_name'];
$flexible_template->title = $form_state['values']['name'];
$flexible_template->description = $form_state['values']['description'];
unset($flexible_template->is_new);
$flexible_template->save();
layout_flexible_tempstore_set($flexible_template);
backdrop_set_message(t('Layout template "@title" saved.', array('@title' => $flexible_template->title)));
$form_state['redirect'] = 'admin/structure/layouts/settings/flexible-template/' . $form_state['values']['machine_name'] . '/configure';
}