You are here

function bulk_photo_nodes_add_form in Bulk File Nodes 7

Form constructor for final step of bpn_multistep_form().

3 calls to bulk_photo_nodes_add_form()
bpn_flickr_form_step_3 in modules/bpn_flickr/bpn_flickr.module
Form constructor for Step 3: Add bulk info.
bpn_flickr_private_form_step_3 in modules/bpn_flickr_private/bpn_flickr_private.module
Step 3 of the Flickr Private form.
bpn_upload_form_step_2 in modules/bpn_upload/bpn_upload.module
Form constructor for step two of bpn_upload_form().

File

./bulk_photo_nodes.module, line 286
hooks and helper functions for bulk photo node.

Code

function bulk_photo_nodes_add_form($form, &$form_state) {
  bulk_photo_nodes_chosen_form('bulk_photo_nodes_add_form');
  drupal_set_title(t('Add Description(s)'));
  $form = array();
  $form['#attached']['js'] = array(
    drupal_get_path('module', 'bulk_photo_nodes') . '/js/bulk_photo_nodes.js',
  );
  $form['#attributes'] = array(
    'class' => array(
      'bpn-enabled',
    ),
  );
  $form['nodes'] = array(
    '#tree' => TRUE,
    '#type' => 'fieldset',
    '#collapsed' => FALSE,
    '#prefix' => '<div id="bpn-nodes">' . '<p class="bpn-inline-help"><em>' . t('To apply the same descriptions to all photos, use Batch Settings on the right') . '<p></em>',
    '#suffix' => '</div>',
    '#attributes' => array(
      'class' => array(
        'bpn-left bpn-info clearfix',
      ),
    ),
  );

  // Attach files to form.
  bulk_photo_nodes_get_session_files($form_state);

  // Generate node subforms from files.
  bulk_photo_nodes_create_subform($form, $form_state);
  bulk_photo_nodes_create_overrides($form, $form_state);

  // Handle required/optional logic for fields in file subforms.
  bulk_photo_nodes_required_optional($form, $form_state);
  drupal_alter('bulk_photo_nodes_overrides', $form, $form_state);
  return $form;
}