You are here

function _editablefields_set_edit_mode in Editable Fields 7

Sets the edit mode of an editable field in form.

Parameters

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

$value: Edit mode value, either TRUE or FALSE.

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

2 calls to _editablefields_set_edit_mode()
editablefields_form_submit in ./editablefields.module
Form submit callback: save the field modifications.
editablefields_form_submit_edit_mode in ./editablefields.module
Form submit callback: switch to edit mode.

File

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

Code

function _editablefields_set_edit_mode(&$form_state, $value, $parents = array()) {
  if (!empty($parents)) {
    if (!isset($form_state['edit_mode']) || !is_array($form_state['edit_mode'])) {
      $form_state['edit_mode'] = array();
    }
    drupal_array_set_nested_value($form_state['edit_mode'], $parents, $value);
  }
  else {
    $form_state['edit_mode'] = $value;
  }
}