function media_variable_get in D7 Media 7
Wrapper for variable_get() that uses the Media variable registry.
Parameters
string $name: The variable name to retrieve. Note that it will be namespaced by pre-pending MEDIA_VARIABLE_NAMESPACE, as to avoid variable collisions with other modules. @param 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_variable_default() function. @return unknown Returns the stored variable or its default.
@see media_variable_set() @see media_variable_del() @see media_variable_default()
19 calls to media_variable_get()
- MediaInternetFileHandler::claim in modules/
media_internet/ includes/ MediaInternetFileHandler.inc - Determines if this handler should claim the item.
- MediaInternetFileHandler::preSave in modules/
media_internet/ includes/ MediaInternetFileHandler.inc - Before the file has been saved, implementors may do additional operations.
- media_add_upload in includes/
media.pages.inc - Form callback for adding media via an upload form. @todo: should use the AJAX uploader
- media_admin_config_browser in includes/
media.admin.inc - Admin configruation form for media browser settings.
- media_admin_paths in ./
media.module - Implements hook_admin_paths().
File
- includes/
media.variables.inc, line 42 - Contains the variables used by media and their defaults.
Code
function media_variable_get($name, $default = NULL) {
// Allow for an override of the default.
// Useful when a variable is required (like $path), but namespacing still desired.
if (!isset($default)) {
$default = media_variable_default($name);
}
// Namespace all variables
$variable_name = MEDIA_VARIABLE_NAMESPACE . $name;
return variable_get($variable_name, $default);
}