function availability_calendar_get_customizable_text in Availability Calendars 7.5
Returns a customizable text.
Parameters
string $variable_name:
Return value
string
6 calls to availability_calendar_get_customizable_text()
- availability_calendar_get_customizable_formatted_text in ./
availability_calendar.inc - Returns a customizable title attribute.
- availability_calendar_get_customizable_title in ./
availability_calendar.inc - Returns a customizable title attribute.
- availability_calendar_handler_filter_availability::get_date_range_picker_options in views/
availability_calendar_handler_filter_availability.inc - Returns an array of options for the date (range) picker.
- availability_calendar_handler_filter_availability::value_form_date_field in views/
availability_calendar_handler_filter_availability.inc - Returns a date form field definition for the given operand
- availability_calendar_handler_filter_availability::value_form_duration_field in views/
availability_calendar_handler_filter_availability.inc - Returns a duration form field definition for the given operand
File
- ./
availability_calendar.inc, line 283
Code
function availability_calendar_get_customizable_text($variable_name) {
// 0 passes isset() and will differ from the empty string which is the actual
// default in a number of cases.
$text = 0;
if (variable_get('availability_calendar_configurable_texts_enabled', 0) !== 0 && function_exists('variable_get_value')) {
// Get from variable module, but do not get the default as that may have
// been translated into another language then the current one.
$text = variable_get_value($variable_name, array(
'default' => 0,
));
}
if ($text === 0) {
// Get the *translated* default. By calling the hook_variable_info
// function here, the defaults will be translated into the current language.
module_load_include('inc', 'availability_calendar', 'availability_calendar.variable');
$variable_info = availability_calendar_variable_info();
$text = isset($variable_info[$variable_name]) ? $variable_info[$variable_name]['default'] : $variable_name;
}
return $text;
}