Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ROOMS-31 - Feature to enable entering the hotel address and entering …
…hotel location on map
- Loading branch information
Nicolò Caruso
committed
Jan 28, 2013
1 parent
61efcd9
commit caada7d
Showing
5 changed files
with
304 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
254 changes: 254 additions & 0 deletions
254
...upalrooms/modules/features/drupal_rooms_location/drupal_rooms_location.features.field.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,254 @@ | ||
<?php | ||
/** | ||
* @file | ||
* drupal_rooms_location.features.field.inc | ||
*/ | ||
|
||
/** | ||
* Implements hook_field_default_fields(). | ||
*/ | ||
function drupal_rooms_location_field_default_fields() { | ||
$fields = array(); | ||
|
||
// Exported field: 'node-location-field_location_address'. | ||
$fields['node-location-field_location_address'] = array( | ||
'field_config' => array( | ||
'active' => '1', | ||
'cardinality' => '1', | ||
'deleted' => '0', | ||
'entity_types' => array(), | ||
'field_name' => 'field_location_address', | ||
'foreign keys' => array(), | ||
'indexes' => array(), | ||
'locked' => '0', | ||
'module' => 'addressfield', | ||
'settings' => array(), | ||
'translatable' => '0', | ||
'type' => 'addressfield', | ||
), | ||
'field_instance' => array( | ||
'bundle' => 'location', | ||
'default_value' => array( | ||
0 => array( | ||
'element_key' => 'node|location|field_location_address|und|0', | ||
'thoroughfare' => '', | ||
'premise' => '', | ||
'locality' => '', | ||
'country' => 'AF', | ||
), | ||
), | ||
'deleted' => '0', | ||
'description' => '', | ||
'display' => array( | ||
'default' => array( | ||
'label' => 'above', | ||
'module' => 'addressfield', | ||
'settings' => array( | ||
'format_handlers' => array( | ||
0 => 'address', | ||
), | ||
'use_widget_handlers' => 1, | ||
), | ||
'type' => 'addressfield_default', | ||
'weight' => '0', | ||
), | ||
'teaser' => array( | ||
'label' => 'above', | ||
'settings' => array(), | ||
'type' => 'hidden', | ||
'weight' => 0, | ||
), | ||
), | ||
'entity_type' => 'node', | ||
'field_name' => 'field_location_address', | ||
'label' => 'Address', | ||
'required' => 0, | ||
'settings' => array( | ||
'user_register_form' => FALSE, | ||
), | ||
'widget' => array( | ||
'active' => 1, | ||
'module' => 'addressfield', | ||
'settings' => array( | ||
'available_countries' => array(), | ||
'format_handlers' => array( | ||
'address' => 'address', | ||
'address-hide-country' => 0, | ||
'organisation' => 0, | ||
'name-full' => 0, | ||
'name-oneline' => 0, | ||
), | ||
), | ||
'type' => 'addressfield_standard', | ||
'weight' => '-4', | ||
), | ||
), | ||
); | ||
|
||
// Exported field: 'node-location-field_location_directions'. | ||
$fields['node-location-field_location_directions'] = array( | ||
'field_config' => array( | ||
'active' => '1', | ||
'cardinality' => '1', | ||
'deleted' => '0', | ||
'entity_types' => array(), | ||
'field_name' => 'field_location_directions', | ||
'foreign keys' => array( | ||
'format' => array( | ||
'columns' => array( | ||
'format' => 'format', | ||
), | ||
'table' => 'filter_format', | ||
), | ||
), | ||
'indexes' => array( | ||
'format' => array( | ||
0 => 'format', | ||
), | ||
), | ||
'locked' => '0', | ||
'module' => 'text', | ||
'settings' => array(), | ||
'translatable' => '0', | ||
'type' => 'text_long', | ||
), | ||
'field_instance' => array( | ||
'bundle' => 'location', | ||
'default_value' => NULL, | ||
'deleted' => '0', | ||
'description' => '', | ||
'display' => array( | ||
'default' => array( | ||
'label' => 'above', | ||
'module' => 'text', | ||
'settings' => array(), | ||
'type' => 'text_default', | ||
'weight' => '3', | ||
), | ||
'teaser' => array( | ||
'label' => 'above', | ||
'settings' => array(), | ||
'type' => 'hidden', | ||
'weight' => 0, | ||
), | ||
), | ||
'entity_type' => 'node', | ||
'field_name' => 'field_location_directions', | ||
'label' => 'Directions', | ||
'required' => 0, | ||
'settings' => array( | ||
'text_processing' => '0', | ||
'user_register_form' => FALSE, | ||
), | ||
'widget' => array( | ||
'active' => 1, | ||
'module' => 'text', | ||
'settings' => array( | ||
'rows' => '5', | ||
), | ||
'type' => 'text_textarea', | ||
'weight' => '-1', | ||
), | ||
), | ||
); | ||
|
||
// Exported field: 'node-location-field_location_map'. | ||
$fields['node-location-field_location_map'] = array( | ||
'field_config' => array( | ||
'active' => '1', | ||
'cardinality' => '1', | ||
'deleted' => '0', | ||
'entity_types' => array(), | ||
'field_name' => 'field_location_map', | ||
'foreign keys' => array(), | ||
'indexes' => array(), | ||
'locked' => '0', | ||
'module' => 'geofield', | ||
'settings' => array(), | ||
'translatable' => '0', | ||
'type' => 'geofield', | ||
), | ||
'field_instance' => array( | ||
'bundle' => 'location', | ||
'default_value' => NULL, | ||
'deleted' => '0', | ||
'description' => '', | ||
'display' => array( | ||
'default' => array( | ||
'label' => 'above', | ||
'module' => 'leaflet', | ||
'settings' => array( | ||
'icon' => array( | ||
'iconAnchor' => array( | ||
'x' => '', | ||
'y' => '', | ||
), | ||
'iconSize' => array( | ||
'x' => '32', | ||
'y' => '37', | ||
), | ||
'iconUrl' => '/sites/default/files/marker.png', | ||
'popupAnchor' => array( | ||
'x' => '', | ||
'y' => '', | ||
), | ||
'shadowUrl' => '', | ||
), | ||
'leaflet_map' => 'OSM Mapnik', | ||
), | ||
'type' => 'geofield_leaflet', | ||
'weight' => '2', | ||
), | ||
'teaser' => array( | ||
'label' => 'above', | ||
'settings' => array(), | ||
'type' => 'hidden', | ||
'weight' => 0, | ||
), | ||
), | ||
'entity_type' => 'node', | ||
'field_name' => 'field_location_map', | ||
'label' => 'Map', | ||
'required' => 0, | ||
'settings' => array( | ||
'local_solr' => array( | ||
'enabled' => FALSE, | ||
'lat_field' => 'lat', | ||
'lng_field' => 'lng', | ||
), | ||
'user_register_form' => FALSE, | ||
), | ||
'widget' => array( | ||
'active' => 1, | ||
'module' => 'geofield', | ||
'settings' => array( | ||
'delta_handling' => 'default', | ||
'geocoder_field' => 'field_location_address', | ||
'geocoder_handler' => 'google', | ||
'handler_settings' => array( | ||
'google' => array( | ||
'all_results' => 0, | ||
'geometry_type' => 'point', | ||
'reject_results' => array( | ||
'APPROXIMATE' => 0, | ||
'GEOMETRIC_CENTER' => 0, | ||
'RANGE_INTERPOLATED' => 0, | ||
'ROOFTOP' => 0, | ||
), | ||
), | ||
), | ||
), | ||
'type' => 'geofield_latlon', | ||
'weight' => '-2', | ||
), | ||
), | ||
); | ||
|
||
// Translatables | ||
// Included for use with string extractors like potx. | ||
t('Address'); | ||
t('Directions'); | ||
t('Map'); | ||
|
||
return $fields; | ||
} |
22 changes: 22 additions & 0 deletions
22
...les/drupalrooms/modules/features/drupal_rooms_location/drupal_rooms_location.features.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* @file | ||
* drupal_rooms_location.features.inc | ||
*/ | ||
|
||
/** | ||
* Implements hook_node_info(). | ||
*/ | ||
function drupal_rooms_location_node_info() { | ||
$items = array( | ||
'location' => array( | ||
'name' => t('Location'), | ||
'base' => 'node_content', | ||
'description' => '', | ||
'has_title' => '1', | ||
'title_label' => t('Title'), | ||
'help' => '', | ||
), | ||
); | ||
return $items; | ||
} |
16 changes: 16 additions & 0 deletions
16
profiles/drupalrooms/modules/features/drupal_rooms_location/drupal_rooms_location.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name = Drupal Rooms Location | ||
description = Drupal Rooms Location | ||
core = 7.x | ||
package = Features | ||
dependencies[] = addressfield | ||
dependencies[] = features | ||
dependencies[] = field_sql_storage | ||
dependencies[] = geofield | ||
dependencies[] = leaflet | ||
dependencies[] = node | ||
dependencies[] = text | ||
features[features_api][] = api:1 | ||
features[field][] = node-location-field_location_address | ||
features[field][] = node-location-field_location_directions | ||
features[field][] = node-location-field_location_map | ||
features[node][] = location |
7 changes: 7 additions & 0 deletions
7
profiles/drupalrooms/modules/features/drupal_rooms_location/drupal_rooms_location.module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
/** | ||
* @file | ||
* Code for the Drupal Rooms Location feature. | ||
*/ | ||
|
||
include_once 'drupal_rooms_location.features.inc'; |