function location_node_node_locations_enabled in Location 7.3
Determine whether or not node locations are enabled for a given node type.
This is needed to stop location_node from deleting/inserting/updating location_cck locations. This is not used for loading and viewing locations because it is expected that cck locations will be loaded into $node->locations.
Parameters
string $type: The node type.
Return value
bool Boolean depending on whether or not node locations are enabled.
4 calls to location_node_node_locations_enabled()
- location_node_node_delete in ./
location_node.module - Implements hook_node_delete().
- location_node_node_insert in ./
location_node.module - Implements hook_node_insert().
- location_node_node_revision_delete in ./
location_node.module - Implements hook_node_revision_delete().
- location_node_node_update in ./
location_node.module - Implements hook_node_update().
File
- ./
location_node.module, line 315 - Associate locations with nodes.
Code
function location_node_node_locations_enabled($type) {
$settings = variable_get('location_settings_node_' . $type, array());
// If max number of locations is zero it is disabled.
if (!empty($settings) && isset($settings['multiple']['max']) && !empty($settings['multiple']['max'])) {
return TRUE;
}
return FALSE;
}