You are here

function freelinking_set_conf in Freelinking 6.3

Same name and namespace in other branches
  1. 7.3 freelinking.utilities.inc \freelinking_set_conf()

Calculate a configuration value based on a precedence of existing variables. Format-specific before Freelinking before Drupal-wide.

Parameters

$name: Set the named setting. Examples:

  • 'cache': boolean. True indicates the filter cache should be turned on.
  • 'default_match': String. Mode of default syntax for freelinking.

$format: Calculate the setting for the specified format. If the format is not specified, will return the value from memory without calculating.

Return value

String of the computed value.

1 call to freelinking_set_conf()
freelinking_get_conf in ./freelinking.utilities.inc
Get a configuration value for the current text being processed. Configuration values may vary by format, or fall back to a general default.

File

./freelinking.utilities.inc, line 187
Freelinking 3 Utilities

Code

function freelinking_set_conf($name, $format = NULL, $reset = FALSE) {
  static $conf;
  if ($conf[$name] && !$format) {
    return $conf[$name];
  }

  // Specific format -> Freelinking Global -> Format Settings
  if ($name == 'cache') {
    $conf[$name] = variable_get('freelinking_' . $name . '_format_' . $format, variable_get('freelinking_' . $name, filter_format_allowcache($format)));
  }
  else {
    $conf[$name] = variable_get('freelinking_' . $name . '_format_' . $format, variable_get('freelinking_' . $name, FALSE));
  }
  return $conf[$name];
}