function availability_calendar_booking_formlet_format_key in Availability Calendars 7.5
Same name and namespace in other branches
- 7.3 booking_formlet/availability_calendar_booking_formlet.module \availability_calendar_booking_formlet_format_key()
- 7.4 booking_formlet/availability_calendar_booking_formlet.module \availability_calendar_booking_formlet_format_key()
Helper function for the formatter summary to display what preset value will be used.
Parameters
string $key: The key, something like 'key1' or key1[subkey1][subkey2].
Return value
string The key but with the first part also enclosed in angle brackets, thus something like [key1] or [key1][subkey1][subkey2].
1 call to availability_calendar_booking_formlet_format_key()
File
- booking_formlet/
availability_calendar_booking_formlet.inc, line 359 - General helper methods for Availability Calendar Booking formlet to make the .module file smaller:
Code
function availability_calendar_booking_formlet_format_key($key) {
$key = check_plain($key);
// Put angle brackets around (first part of) the key.
$pos = strpos($key, '[');
if ($pos === FALSE) {
$key = "[{$key}]";
}
else {
$key = '[' . substr($key, 0, $pos) . ']' . substr($key, $pos);
}
return $key;
}