You are here

function ResponsiveMenusContextReactionGeneral::execute in Responsive Menus 8

Execute & make those menus responsive.

File

plugins/context/responsive_menus_context_reaction_general.inc, line 35

Class

ResponsiveMenusContextReactionGeneral
Exposes Responsive Menus as a reaction in Context.

Code

function execute() {

  // $contexts = context_active_contexts();
  $contextManager = \Drupal::service('context.manager');
  $contexts = $contextManager
    ->getActiveContexts();
  foreach ($contexts as $value) {
    if (!empty($value->reactions[$this->plugin])) {
      $style = $value->reactions[$this->plugin]['responsive_menus_style'];
      $js_defaults = $value->reactions[$this->plugin]['responsive_menus_style_settings'];

      // Execute the responsiveness!
      responsive_menus_execute($style, $js_defaults);
    }
  }
}