You are here

function file_styles_variable_get in Styles 7.2

Wrapper for variable_get() using the File Styles variable registry.

Parameters

string $name: The variable name to retrieve. Note that it will be namespaced by pre-pending FILE_STYLES_NAMESPACE, as to avoid variable collisions with other modules.

unknown $default: An optional default variable to return if the variable hasn't been set yet. Note that within this module, all variables should already be set in the file_styles_variable_default() function.

Return value

unknown Returns the stored variable or its default.

See also

file_styles_variable_set()

file_styles_variable_del()

file_styles_variable_default()

1 call to file_styles_variable_get()
file_styles_preview_image in contrib/file_styles/file_styles.module
Return the path to the image for previews in Styles UI.

File

contrib/file_styles/includes/file_styles.variables.inc, line 35
file_styles/includes/file_styles.variables.inc Variable defaults for File Styles.

Code

function file_styles_variable_get($name, $default = NULL) {

  // Allow for an override of the default.
  // Useful when a variable is required (like $path), but namespacing is still
  // desired.
  if (!isset($default)) {
    $default = file_styles_variable_default($name);
  }

  // Namespace all variables.
  $variable_name = FILE_STYLES_NAMESPACE . $name;
  return variable_get($variable_name, $default);
}