You are here

function DynamicBackgroundReaction::find_selected_image in Dynamic Background 6

Same name and namespace in other branches
  1. 7 modules/dynamic_background_context/plugins/dynamic_background_context_reaction.inc \DynamicBackgroundReaction::find_selected_image()
2 calls to DynamicBackgroundReaction::find_selected_image()
DynamicBackgroundReaction::execute in modules/dynamic_background_context/plugins/dynamic_background_context_reaction.inc
Find the selected image and return its id.
DynamicBackgroundReaction::options_form in modules/dynamic_background_context/plugins/dynamic_background_context_reaction.inc

File

modules/dynamic_background_context/plugins/dynamic_background_context_reaction.inc, line 41

Class

DynamicBackgroundReaction

Code

function find_selected_image($context) {

  // Find the currently selected image
  if (isset($context->reactions['dynamic_background'])) {
    foreach ($context->reactions['dynamic_background'] as $id => $value) {
      if (isset($value['selected']) && $value['selected']) {
        return $id;
      }
    }
  }
  return NULL;
}