You are here

function popup_preprocess_popup_element in Popup 6.x

Same name and namespace in other branches
  1. 7 popup.module \popup_preprocess_popup_element()
  2. 7.x popup.module \popup_preprocess_popup_element()

Popup element preprocessor

Adds CSS of the selected style

1 string reference to 'popup_preprocess_popup_element'
_popup_theme_array in includes/popup.util.inc
hook_theme helper function to generate a theme array for a specific style

File

./popup.module, line 254

Code

function popup_preprocess_popup_element($variables) {
  module_load_include('inc', 'popup', 'includes/popup.util');
  $style = $variables['style'] ? $variables['style'] : variable_get('popup-style', 'white');
  $styles = _popup_styles();
  $path = $styles[$style];
  drupal_add_css($path . '/popup-element.css', array(
    'media' => 'screen, projection',
    'preprocess' => variable_get('popup-preprocess', FALSE),
  ));
  if (file_exists($path . '/popup-element.js')) {
    drupal_add_js($path . '/popup-element.js', 'module', 'header', FALSE, TRUE, variable_get('popup-preprocess', FALSE));
  }
}