You are here

function web_widgets_inside_widget in Web Widgets 7

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

Stores the fact that if we're inside web_widget processing.

1 call to web_widgets_inside_widget()
web_widgets_plugin_display_web_widgets::render in views/web_widgets_plugin_display_web_widgets.inc
Instead of going through the standard views_view.tpl.php, delegate this to the style handler.

File

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

Code

function web_widgets_inside_widget($in = NULL) {
  static $base_path;
  if ($in === TRUE) {
    $base_path = $GLOBALS['base_path'];
    $options = array(
      'language' => new stdClass(),
      'absolute' => TRUE,
      'purl' => array(
        'disabled' => TRUE,
      ),
    );

    // TODO The second parameter to this function call should be an array.
    $GLOBALS['base_path'] = url('', $options);
  }
  elseif ($in === FALSE) {
    $GLOBALS['base_path'] = $base_path;
  }
  static $inside = FALSE;
  if (is_null($in)) {
    return $inside;
  }
  else {
    $inside = $in;
  }
}