You are here

function location_addanother_form in Location 5.3

Same name and namespace in other branches
  1. 6.3 contrib/location_addanother/location_addanother.module \location_addanother_form()
  2. 7.5 contrib/location_addanother/location_addanother.module \location_addanother_form()
  3. 7.3 contrib/location_addanother/location_addanother.module \location_addanother_form()
  4. 7.4 contrib/location_addanother/location_addanother.module \location_addanother_form()

Form to display directly on a node view for "quick location add" functionality.

1 string reference to 'location_addanother_form'
location_addanother_nodeapi in contrib/location_addanother/location_addanother.module
Implementation of hook_nodeapi().

File

contrib/location_addanother/location_addanother.module, line 44
"Add location from node view" functionality. Split from main location.module in version 3.

Code

function location_addanother_form(&$node) {
  $settings = variable_get('location_fields_' . $node->type, array());
  $form['location'] = array(
    '#type' => 'location_element',
    '#title' => t('Add another location'),
    '#default_value' => NULL,
    '#location_settings' => $settings,
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['location']['nid'] = array(
    '#type' => 'hidden',
    // @@@ See if we can get away with value-ing this.
    '#value' => $node->nid,
  );
  $form['location']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add location'),
    '#weight' => 50,
  );
  return $form;
}