You are here

function _fasttoggle_get_label in Fasttoggle 5

Same name and namespace in other branches
  1. 6 fasttoggle.module \_fasttoggle_get_label()

Returns an array with labels for a given setting.

1 call to _fasttoggle_get_label()
fasttoggle_fasttoggle_options in ./fasttoggle.module
Implementation of hook_fasttoggle_options().

File

./fasttoggle.module, line 595
Enables fast toggling of binary or not so binary settings

Code

function _fasttoggle_get_label($label) {
  static $labels;
  if ($labels == NULL) {
    $style = variable_get('fasttoggle_label_style', FASTTOGGLE_LABEL_STATUS);
    $labels = module_invoke_all('fasttoggle_labels', $style);

    // Allow custom labels in settings.php.
    if ($style == FASTTOGGLE_LABEL_CUSTOM) {
      $labels = array_merge($labels, variable_get('fasttoggle_labels', array()));
    }
  }
  return $labels[$label];
}