Skip to content

Commit

Permalink
ROOMS-31 - Feature to enable entering the hotel address and entering …
Browse files Browse the repository at this point in the history
…hotel location on map
  • Loading branch information
Nicolò Caruso committed Jan 28, 2013
1 parent 61efcd9 commit caada7d
Show file tree
Hide file tree
Showing 5 changed files with 304 additions and 0 deletions.
5 changes: 5 additions & 0 deletions profiles/drupalrooms/drupalrooms.info
Expand Up @@ -30,6 +30,10 @@ dependencies[] = "panels"
dependencies[] = "views_slideshow"
dependencies[] = "flexslider"
dependencies[] = "flexslider_views_slideshow"
dependencies[] = "addressfield"
dependencies[] = "leaflet"
dependencies[] = "geophp"
dependencies[] = "geofield"

dependencies[] = "rooms"
dependencies[] = "rooms_ui"
Expand All @@ -42,3 +46,4 @@ dependencies[] = "rooms_booking_manager"

dependencies[] = "drupal_rooms_homepage"
dependencies[] = "drupal_rooms_slideshow"
dependencies[] = "drupal_rooms_location"
@@ -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;
}
@@ -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;
}
@@ -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
@@ -0,0 +1,7 @@
<?php
/**
* @file
* Code for the Drupal Rooms Location feature.
*/

include_once 'drupal_rooms_location.features.inc';

0 comments on commit caada7d

Please sign in to comment.