You are here

function popup_onload_add_popup in Popup On Load 7

Add a popup to the current page.

2 calls to popup_onload_add_popup()
popup_onload_action_display_popup in ./popup_onload.rules.inc
Action to display a popup.
popup_onload_init in ./popup_onload.module
Implements hook_init().

File

./popup_onload.module, line 305
Contains main popup_onload hooks and functions.

Code

function popup_onload_add_popup($popup_settings) {

  // Add and initialise the Colorbox plugin.
  libraries_load('colorbox', 'minified');
  $module_path = drupal_get_path('module', 'popup_onload');

  // Add popup_onload javascripts.
  drupal_add_js([
    'popup_onload' => $popup_settings,
  ], 'setting');
  drupal_add_js($module_path . '/popup_onload.js');

  // Add some basic colorbox styling.
  drupal_add_css($module_path . '/popup_onload-colorbox.css');

  // Tell others that the popup is finally added.
  drupal_static(POPUP_ONLOAD_IS_POPUP_ADDED, TRUE);
}