1 layout.flexible.inc layout_flexible_template_edit_row_validate($form, &$form_state)

Validation handler for layout_flexible_template_edit_row_form().

File

core/modules/layout/layout.flexible.inc, line 717
Provides configurable (flexible) layout templates.

Code

function layout_flexible_template_edit_row_validate($form, &$form_state) {
  $last_region_number = layout_flexible_template_get_last_region_number($form_state['flexible_template'], $form_state);

  foreach ($form_state['values']['region_names'] as $key => $region) {
    if (empty($region)) {
      $number = str_replace('region_', '', $key);
      $form_state['values']['region_names'][$key]['label'] = t('Region') . ' ' . ($last_region_number + $number + 1);
      $last_region_number++;
    }
  }
}