1 layout.flexible.inc _layout_flexible_template_region_name_exists($machine_name, $element, $form_state)

Callback: Check if machine_name is unique.

Even though callback is required for the Form API machine_name field type, the region classes are not required to be unique. It will accept any machine_name.

Parameters

$machine_name: The machine name for a region.

Return value

Whether or not the region name is taken.:

See also

layout_flexible_template_edit_row_form()

form_validate_machine_name()

File

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

Code

function _layout_flexible_template_region_name_exists($machine_name, $element, $form_state) {
  $flexible_template = layout_flexible_tempstore_load($form_state['flexible_template_name']);
  foreach ($flexible_template->rows as $row) {
    foreach ($row['region_names'] as $region_name) {
      if ($region_name['name'] == $machine_name) {
        return TRUE;
      }
    }
  }

  return FALSE;
}