You are here

function rooms_string in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

A string transformation function specific to Rooms to allow modules to use contextual information about bookings to change what is shown to the user.

Parameters

$string - The string to be altered.:

$context - Contextual information about the string.:

Return value

mixed

4 calls to rooms_string()
book_units_per_type_form in modules/rooms_booking_manager/rooms_booking_manager.module
Book units per type booking form callback.
book_unit_form_builder in modules/rooms_booking_manager/rooms_booking_manager.module
The form builder builds the form (where visible is simply the purchase button) for individual bookable units.
rooms_create_line_item in modules/rooms_booking_manager/rooms_booking_manager.commerce.inc
Creates a commerce line item related to a booking.
_rooms_booking_manager_load_price_info in modules/rooms_booking_manager/rooms_booking_manager.units_per_type_form.inc
Loads the price information for a given unit type/price level combination.

File

./rooms.module, line 1347
Provides basic underlying functionality and configuration options used by all Rooms modules

Code

function rooms_string($string, $context) {

  // The string_suggestions array will hold information about all the
  // suggestions coming from modules. The default behaviour now is to simply
  // return the suggestion made by the module with the highest weight.
  $string_suggestions = array();
  $string_suggestions[] = $string;
  drupal_alter('rooms_string', $string_suggestions, $context);

  // Return the highest option string.
  return max($string_suggestions);
}