You are here

function mvf_element_info in Measured Value Field 7

Implements hook_element_info().

File

./mvf.module, line 242
Define a field type of measured value.

Code

function mvf_element_info() {
  $type = array();

  // This one is a MVF widget - an element for entering value and unit
  // measurement that corresponds to that value.
  $type['mvf_widget'] = array(
    '#input' => TRUE,
    '#delta' => 0,
    '#field' => array(),
    '#instance' => array(),
    '#language' => LANGUAGE_NONE,
    '#field_parents' => array(),
    '#items' => array(),
    '#process' => array(
      '_mvf_widget_process',
    ),
    '#attached' => array(
      'css' => array(
        drupal_get_path('module', 'mvf') . '/mvf.css',
      ),
    ),
    '#theme_wrappers' => array(
      'form_element',
    ),
  );

  // Form element of unit suggester settings.
  $type['mvf_unit_suggester'] = array(
    '#input' => TRUE,
    '#field' => array(),
    '#instance' => array(),
    '#view_mode' => NULL,
    '#theme' => 'mvf_unit_suggesters_settings',
    '#process' => array(
      '_mvf_unit_suggester_process',
    ),
    '#theme_wrappers' => array(
      'container',
    ),
  );
  return $type;
}