You are here

function _editablefields_get_edit_mode in Editable Fields 7

Gets the edit mode of an editable field in form.

Parameters

$form_state: A keyed array containing the current state of the form.

$parents: (optional) An array of parent form elements. Default to empty.

Return value

TRUE if the field is in edit mode, FALSE otherwise.

1 call to _editablefields_get_edit_mode()
editablefields_form in ./editablefields.module
Form builder callback.

File

./editablefields.module, line 577
Editable fields module.

Code

function _editablefields_get_edit_mode($form_state, $parents = array()) {
  if (!isset($form_state['edit_mode'])) {
    return FALSE;
  }
  if (!empty($parents) && is_array($form_state['edit_mode'])) {
    return drupal_array_get_nested_value($form_state['edit_mode'], $parents);
  }
  return (bool) $form_state['edit_mode'];
}