You are here

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

Converts Rooms option human name to its machine name.

Parameters

string $option_name: The human option name.

string $pattern: The pattern used to convert. By default "/[^a-z0-9_]+/".

string $replacement: The replacement string. By default "_".

Return value

string The option machine name.

9 calls to rooms_options_machine_name()
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.
book_unit_form_submit in modules/rooms_booking_manager/rooms_booking_manager.module
Submit callback for book_unit_form form.
rooms_booking_edit_form in modules/rooms_booking/rooms_booking.admin.inc
Form callback: create or edit a booking.
rooms_booking_edit_form_submit in modules/rooms_booking/rooms_booking.admin.inc
Form API submit callback for the Booking form.

... See full list

File

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

Code

function rooms_options_machine_name($option_name, $pattern = '/[^a-z0-9_]+/', $replacement = '_') {
  return preg_replace($pattern, $replacement, drupal_strtolower($option_name));
}