You are here

function rb_misc_ctools_render_alter in Rules Bonus Pack 7

Implements hook_ctools_render_alter().

This alter function is called when Page manager content is rendered. It checks if the called custom page variant has Rules event triggering enabled, and if so calls the event – sending along context objects as parameters.

File

./rb_misc.module, line 87
A necessary file for letting Drupal know this is a module. All functionality goes into rb_misc.rules.inc.

Code

function rb_misc_ctools_render_alter(&$info, &$page, &$context) {

  // To avoid unnecessary load, first check if the invoked variant is a Rules
  // triggering variant.
  if (isset($context['handler']->conf['rb_misc_trigger']) && $context['handler']->conf['rb_misc_trigger']) {

    // Invoke the event together with the fully loaded context entities from the
    // variant being used.
    rules_invoke_event_by_args('rb_misc_trigger_' . $context['handler']->name, rb_misc_load_variant_context_entities($context['handler'], $context['contexts']));
  }
}