You are here

function _editablefields_entry_form in Editable Fields 5

Same name and namespace in other branches
  1. 5.3 editablefields.module \_editablefields_entry_form()
  2. 5.2 editablefields.module \_editablefields_entry_form()
2 calls to _editablefields_entry_form()
theme_views_editablefields_view_list in ./editablefields.module
Display the nodes of a view as a list.
theme_views_editablefields_view_table in ./editablefields.module
Display the nodes of a view as a table.

File

./editablefields.module, line 342

Code

function _editablefields_entry_form($view) {
  $type = _editablefields_node_type($view);
  if (!$type) {
    return '';
  }
  global $user;
  $types = node_get_types();
  $type = isset($type) ? str_replace('-', '_', $type) : NULL;

  // If a node type has been specified, validate its existence.
  if (isset($types[$type]) && node_access('create', $type)) {

    // Initialize settings:
    $node = array(
      'uid' => $user->uid,
      'name' => $user->name,
      'type' => $type,
      'language' => '',
    );
    $form = _editablefields_drupal_get_form(false, $type, $view);
    $output = drupal_render_form($type . '_node_form', $form);
  }
  return '<div class="view_footer_form">' . $output . '</div>';
}