You are here

function key_provider_variable_set_key in Key 7

Callback function to set a key from a variable.

1 string reference to 'key_provider_variable_set_key'
variable.inc in plugins/key_provider/variable.inc
Plugin definition for the Variable key provider.

File

plugins/key_provider/variable.inc, line 37
Plugin definition for the Variable key provider.

Code

function key_provider_variable_set_key($settings, $key) {
  if (empty($settings['variable_name'])) {
    return NULL;
  }
  $variable_name = KEY_PROVIDER_VARIABLE_PREFIX . $settings['variable_name'];
  if (empty($key)) {
    variable_del($variable_name);
  }
  else {
    variable_set($variable_name, $key);
  }
}