function template_preprocess_web_widgets_iframe in Web Widgets 6
Same name and namespace in other branches
- 7 iframe/web_widgets_style_iframe.inc \template_preprocess_web_widgets_iframe()
Process variables for web_widgets_iframe.tpl.php
File
- iframe/
web_widgets_style_iframe.inc, line 34 - Iframe-specific functions, preprocessing
Code
function template_preprocess_web_widgets_iframe(&$variables) {
$variables['wid'] = 'web_widget_iframe_' . md5(microtime());
// Create Javascript variables
$widgetcontext = new stdClass();
$widgetcontext->url = $variables['path'];
if (empty($variables['width'])) {
$variables['width'] = 200;
}
if (empty($variables['height'])) {
$variables['height'] = 200;
}
$widgetcontext->width = $variables['width'];
$widgetcontext->height = $variables['height'];
$widgetcontext->widgetid = $variables['wid'];
$variables['js_variables'] = drupal_to_js($widgetcontext);
$variables['script_url'] = $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'web_widgets') . '/iframe/web_widgets_iframe.js';
}