You are here

function npop_page_build in Node pop-up 7

Implements hook_page_build().

File

./npop.module, line 215
Create popup nodes with ajax and Drupal core functionality.

Code

function npop_page_build(&$page) {

  // Add core ajax script and npop.js script on each page.
  // @todo set conditions for adding script.
  $animations = variable_get('npop_animations');
  if ($animations !== 'no_animate') {
    $page['content']['#attached']['css'][] = drupal_get_path('module', 'npop') . '/css/animations.css';
  }
  $close_by_overlay_click = (bool) variable_get('npop_overlay_close', 1);
  $page['content']['#attached']['js'][] = array(
    'type' => 'setting',
    'data' => array(
      'npop_overlay_close' => $close_by_overlay_click,
    ),
  );
  $page['content']['#attached']['js'][] = drupal_get_path('module', 'npop') . '/js/npop.js';
  $page['content']['#attached']['js'][] = drupal_get_path('module', 'npop') . '/js/npop-ajax.js';
  $page['content']['#attached']['library'][] = array(
    'system',
    'drupal.ajax',
  );
}