You are here

function availability_calendar_booking_formlet_get_customizable_text in Availability Calendars 7.5

Returns a customizable text.

Parameters

string $variable_name:

Return value

string

3 calls to availability_calendar_booking_formlet_get_customizable_text()
availability_calendar_booking_formlet_add_js in booking_formlet/availability_calendar_booking_formlet.inc
Adds the javascript for the booking formlet to the page.
availability_calendar_booking_formlet_form_inc in booking_formlet/availability_calendar_booking_formlet.inc
Callback for drupal_get_form() to create the booking formlet view.
availability_calendar_booking_formlet_get_customizable_title in booking_formlet/availability_calendar_booking_formlet.inc

File

booking_formlet/availability_calendar_booking_formlet.inc, line 16
General helper methods for Availability Calendar Booking formlet to make the .module file smaller:

Code

function availability_calendar_booking_formlet_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_booking_formlet', 'availability_calendar_booking_formlet.variable');
    $variable_info = availability_calendar_booking_formlet_variable_info();
    $text = $variable_info[$variable_name]['default'];
  }
  return $text;
}