You are here

function location_node_content_extra_fields in Location 7.3

Same name and namespace in other branches
  1. 6.3 location_node.module \location_node_content_extra_fields()
  2. 7.4 location_node.module \location_node_content_extra_fields()

Implements hook_content_extra_fields().

For being able to edit location weight in node forms and node view.

File

./location_node.module, line 273
Associate locations with nodes.

Code

function location_node_content_extra_fields($type_name) {
  $settings = variable_get('location_settings_node_' . $type_name, array());
  if (isset($settings['multiple']) && $settings['multiple']['max'] > 0) {
    $weight = isset($settings['form']['weight']) ? $settings['form']['weight'] : 0;
    $extra['locations'] = array(
      'label' => t('Locations', array(), array(
        'context' => 'geolocation',
      )),
      'description' => t('Node Locations module form.'),
      'weight' => $weight,
    );
    return $extra;
  }
}