You are here

function media_vimeo_variable_get in Media: Vimeo 7

Same name and namespace in other branches
  1. 6 includes/media_vimeo.variables.inc \media_vimeo_variable_get()

Wrapper for variable_get() using the Media: Vimeo variable registry.

Parameters

string $name: The variable name to retrieve. Note that it will be namespaced by pre-pending MEDIA_VIMEO_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 media_vimeo_variable_default() function.

Return value

unknown Returns the stored variable or its default.

See also

media_vimeo_variable_set()

media_vimeo_variable_del()

media_vimeo_variable_default()

4 calls to media_vimeo_variable_get()
media_vimeo_file_default_displays in includes/media_vimeo.formatters.inc
Implements hook_file_default_displays().
media_vimeo_file_formatter_info in includes/media_vimeo.formatters.inc
Implements hook_file_formatter_info().
theme_media_vimeo_embed in includes/themes/media_vimeo.theme.inc
@todo: get this working
theme_media_vimeo_preview_style in includes/themes/media_vimeo.theme.inc
Preview for Styles UI.

File

includes/media_vimeo.variables.inc, line 35
media_vimeo/includes/media_vimeo.variables.inc Variable defaults for Media: Vimeo.

Code

function media_vimeo_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 = media_vimeo_variable_default($name);
  }

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