You are here

function _dimension_get_modes in Dimension 7

Callback to determine which dimension components are supported by the $mode of a dimension field.

Parameters

int $mode: One of the values defined in DIMENSION_MODE_LENGTH, DIMENSION_MODE_AREA and DIMENSION_MODE_VOLUME.

Return value

array An array containing to boolean values where the first one determines if the length component is supported and the second one if width and height are supported.

7 calls to _dimension_get_modes()
dimension_field_dimension_property_callback in ./dimension.module
Additional callback to adapt the property info for dimension fields.
dimension_field_instance_settings_form in ./dimension.module
Implements hook_field_instance_settings_form().
dimension_field_schema in ./dimension.install
Implements hook_field_schema().
dimension_field_validate in ./dimension.module
Implements hook_field_validate().
dimension_field_widget_form in ./dimension.module
Implements hook_field_widget_form().

... See full list

File

./dimension.module, line 443

Code

function _dimension_get_modes($mode) {
  $has_length = in_array($mode, array(
    DIMENSION_MODE_LENGTH,
    DIMENSION_MODE_VOLUME,
  ));
  $has_more = in_array($mode, array(
    DIMENSION_MODE_AREA,
    DIMENSION_MODE_VOLUME,
  ));
  return array(
    $has_length,
    $has_more,
  );
}