You are here

function _fasttoggle_get_label in Fasttoggle 6

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

Returns an array with labels for a given setting.

5 calls to _fasttoggle_get_label()
fasttoggle_comment_option in ./fasttoggle.toggle.inc
Menu callback. Toggle options for a comment if the action is confirmed via POST. Otherwise, display a confirmation form.
fasttoggle_fasttoggle_options in ./fasttoggle.module
Implementation of hook_fasttoggle_options().
fasttoggle_form_alter in ./fasttoggle.module
Implementation of hook_form_alter().
fasttoggle_node_option in ./fasttoggle.toggle.inc
Menu callback. Toggle options for a node if the action is confirmed via POST. Otherwise, display a confirmation form.
fasttoggle_user_option in ./fasttoggle.toggle.inc
Menu callback. Toggle the status of a user if the action is confirmed via POST. Otherwise, display a confirmation form.

File

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

Code

function _fasttoggle_get_label($label, $style = NULL) {
  static $labels = array();
  if (!isset($style)) {
    $style = variable_get('fasttoggle_label_style', FASTTOGGLE_LABEL_STATUS);
  }
  if (!isset($labels[$style])) {
    $labels[$style] = module_invoke_all('fasttoggle_labels', $style);

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