You are here

function mathfield_mathfield_get_token in Math Field 7

Implements hook_mathfield_get_token().

Related topics

File

./mathfield.module, line 649
Adds a dynamic math expression field.

Code

function mathfield_mathfield_get_token($context) {
  $field_name = $context['field']['field_name'];
  $name = strtr('@field_name[@parts]', array(
    '@field_name' => $field_name,
    '@parts' => implode('][', array(
      $context['element']['#language'],
      $context['delta'],
      $context['column'],
    )),
  ));
  return array(
    'selector' => 'input[name="' . $name . '"]',
    'event' => 'blur',
  );
}