You are here

function dynamic_background_context_dynamic_background_css in Dynamic Background 7.2

Same name and namespace in other branches
  1. 6 modules/dynamic_background_context/dynamic_background_context.module \dynamic_background_context_dynamic_background_css()
  2. 7 modules/dynamic_background_context/dynamic_background_context.module \dynamic_background_context_dynamic_background_css()

Implements hook_dynamic_background_css().

File

modules/dynamic_background_context/dynamic_background_context.module, line 56

Code

function dynamic_background_context_dynamic_background_css($vars) {

  // Find the selected image id.
  $image = FALSE;
  $plugin = context_get_plugin('reaction', 'dynamic_background');
  if ($plugin) {
    $image = $plugin
      ->execute();
  }

  // If image is defined for the current context, return configuration options.
  if ($image) {

    // Load image style settings.
    $image_style = variable_get('dynamic_background_context_image_style', FALSE);
    return array(
      'image' => $image,
      'configuration' => variable_get('dynamic_background_context_css', array()),
      'image_style' => $image_style ? $image_style['style'] : FALSE,
      'weight' => 225,
    );
  }
}