You are here

function editablefields_inline in Editable Fields 6.3

Menu callback.

Parameters

$method : 'ajax' or 'nojs'

$responder: The ajax responder being used for this page request.

$node: The node to be edited.

$field_name: The field to be edited.

Return value

void

1 string reference to 'editablefields_inline'
inline.inc in plugins/responders/inline.inc
Editablefields CTools modal plugin.

File

plugins/responders/inline.inc, line 56
Editablefields CTools modal plugin.

Code

function editablefields_inline($method, $responder = 'inline', $node, $field_name = NULL) {
  drupal_add_js(drupal_get_path('module', 'editablefields') . '/editablefields.js');
  ctools_include('ajax');
  ctools_include('plugins');
  $target_id = editablefields_inline_wrapper_id(array(
    '#type_name' => $node->type,
    '#field_name' => $field_name,
    '#node' => $node,
  ));
  $form_state = array(
    'ajax' => TRUE,
    'node' => $node,
    '_params' => array(
      'field_name' => $field_name,
      'node_type' => $node->type,
      'active_elem_index' => (int) $_REQUEST['active_elem_index'],
    ),
  );
  $output = editablefields_inline_form_wrapper('editablefields_inline_form', $form_state);
  if (!$output) {
    $output = array();
    if ($replacements = $form_state['replacements']) {
      foreach ($replacements as $nid => $text) {
        $link_text = '<div id="' . $target_id . '">' . $text . '</div>';
        $html = editablefields_inline_text_button($link_text, 'editablefields/nojs/inline/' . $element['#node']->nid . '/' . $element['#field_name'], filter_xss($text, array()), $css_id);
        $output[] = ctools_ajax_command_replace('#editable-fields-inline-form', $html);
      }
    }

    // dpm($output);
    // $output[] = ctools_modal_command_dismiss();
  }
  ctools_ajax_render($output);
}