You are here

function editablefields_html in Editable Fields 6.3

Same name and namespace in other branches
  1. 6 editablefields.module \editablefields_html()
  2. 6.2 editablefields.module \editablefields_html()

Menu callback: ajax form.

2 string references to 'editablefields_html'
editablefields_menu in ./editablefields.module
Implementation of hook_menu().
theme_editablefields_formatter_editable in ./editablefields.module
Theme the editable field.

File

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

Code

function editablefields_html() {
  $nid = arg(1);
  $field_name = arg(2);
  $delta = arg(3);
  $node = node_load($nid);
  if (node_access('update', $node)) {

    //  $html = _editablefields_create_form($node, $field_name);
    $html = drupal_get_form('editablefields_form', $node, $field_name, $delta);
    $object = new stdClass();
    $object->content = $html;

    // Register the JavaScript callback for this module.
    $object->__callbacks = array();

    // Allow other modules to extend the data returned.
    drupal_alter('ajax_data', $object, 'editablefields', $html);
    drupal_json($object);
  }
  else {
    drupal_not_found();
  }
  exit;
}