You are here

function template_preprocess_web_widgets_iframe_wrapper in Web Widgets 7

Same name and namespace in other branches
  1. 6 iframe/web_widgets_style_iframe.inc \template_preprocess_web_widgets_iframe_wrapper()

Process variables for web_widgets_iframe_wrapper.tpl.php

File

iframe/web_widgets_style_iframe.inc, line 67
Iframe-specific functions, preprocessing

Code

function template_preprocess_web_widgets_iframe_wrapper(&$variables) {
  $variables['head'] = drupal_get_html_head();
  if (!empty($variables['scripts'])) {
    $scripts = array();
    foreach ($variables['scripts'] as $script) {
      $scripts[] = '<script type="text/javascript" src="' . $script . '"></script>';
    }
    $variables['scripts'] = implode(' ', $scripts);
  }
  if (!empty($variables['styles'])) {
    $styles = array();
    foreach ($variables['styles'] as $style) {
      $styles[] = '<style type="text/css" media="all">@import url(' . $style . ');</style>';
    }
    $variables['styles'] = implode(' ', $styles);
  }
}