You are here

function template_preprocess_web_widgets_inline in Web Widgets 7

Same name and namespace in other branches
  1. 6 inline/web_widgets_style_inline.inc \template_preprocess_web_widgets_inline()

Process variables for web_widgets_inline.tpl.php

File

inline/web_widgets_style_inline.inc, line 44
Inline-embedding specific functions, preprocessing

Code

function template_preprocess_web_widgets_inline(&$variables) {
  $path = parse_url($variables['path']);
  $path = substr($path['path'], 1);
  $variables['id_suffix'] = substr(md5($path), 0, 12);
  $variables['wid'] = 'web_widgets_inline_' . md5(microtime());

  // Create Javascript variables
  $widgetcontext = new stdClass();
  $widgetcontext->widgetid = $variables['wid'];
  $variables['js_variables'] = drupal_json_encode($widgetcontext);
  $variables['script_url'] = $variables['path'];
}