You are here

function content_form in Content Construction Kit (CCK) 5

Same name and namespace in other branches
  1. 6.3 includes/content.node_form.inc \content_form()
  2. 6 includes/content.node_form.inc \content_form()
  3. 6.2 includes/content.node_form.inc \content_form()

Create fields' form for a content type.

Each field defines its own component of the content entry form, via its chosen widget.

1 call to content_form()
content_form_alter in ./content.module
Implementation of hook_form_alter().

File

./content.module, line 206
Allows administrators to associate custom fields to content types.

Code

function content_form(&$node) {
  $form = array();
  $type = content_types($node->type);

  // Set form parameters so we can accept file uploads.
  if (count($type['fields'])) {
    $form['#attributes'] = array(
      "enctype" => "multipart/form-data",
    );
  }
  _content_widget_invoke('prepare form values', $node);
  $form = array_merge($form, _content_widget_invoke('form', $node));
  return $form;
}