You are here

function web_widgets_theme in Web Widgets 7

Same name and namespace in other branches
  1. 6 web_widgets.module \web_widgets_theme()

Implements hook_theme().

File

./web_widgets.module, line 20
web_widgets module main. Contains the views api hook and theming functions.

Code

function web_widgets_theme($existing, $type, $theme, $path) {
  $theme = array(
    'web_widgets_embed_code' => array(
      'variables' => array(
        'code' => NULL,
        'style' => NULL,
      ),
    ),
    'web_widgets_tracking_code' => array(
      'variables' => array(
        'id' => NULL,
      ),
    ),
  );
  $style_files = array_keys(web_widgets_get_styles());
  foreach ($style_files as $style) {
    require_once DRUPAL_ROOT . '/' . web_widgets_get_style_inc($style);
    $definition = call_user_func('web_widgets_style_' . $style);
    if (is_array($definition['theme'])) {
      $theme += $definition['theme'];
    }
  }
  return $theme;
}