You are here

function hook_form_builder_property_groups in Form Builder 7

Same name and namespace in other branches
  1. 6 form_builder.api.php \hook_form_builder_property_groups()
  2. 7.2 form_builder.api.php \hook_form_builder_property_groups()

Designate groups of properties. Displayed as tabs when editing a field.

Most properties will fall into one of the predefined categories created by Form Builder, but it may be desired that some properties be split into entirely different groups to separate them from other property options.

Form Builder provides the following groups by default:

  • default: The "Properties" tab, used if no group is specified.
  • hidden: Not displayed at all unless JavaScript is disabled.
  • display: The "Display" tab. Use for properties that are purely cosmetic.
  • options: The "Options" tab. Typically used for select list, radio, or checkbox options.
  • validation: The "Validation" tab. Use for properties or configuration that enables validation functions on the element.

Parameters

$form_type: The form type for which this group will be available. You may optionally check this value if you'd like to limit this group to only certain form types.

Return value

An array of property groups, keyed by the value used in the #form_builder['property_group'] property.

See also

hook_form_builder_load()

2 functions implement hook_form_builder_property_groups()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

form_builder_form_builder_property_groups in ./form_builder.module
Implementation of hook_form_builder_property_groups().
form_builder_webform_form_builder_property_groups in modules/webform/form_builder_webform.module
Implements hook_form_builder_property_groups().
1 invocation of hook_form_builder_property_groups()
form_builder_field_configure in includes/form_builder.admin.inc
Form for editing a field.

File

./form_builder.api.php, line 221
These are the hooks that are invoked by Form Builder.

Code

function hook_form_builder_property_groups($form_type) {
  return array(
    'my_group' => array(
      // Low weight values will appear as first tabs.
      'weight' => 0,
      // The title will be used as the tab title.
      'title' => t('My group'),
    ),
    'my_hidden_group' => array(
      'weight' => 100,
      'title' => t('Advanced'),
      // When JavaScript is enabled, collapsed groups will not be rendered.
      // This group will only be displayed when JavaScript is disabled.
      'collapsible' => TRUE,
      'collapsed' => TRUE,
    ),
  );
}