You are here

function views_content_exposed_form_pane_render in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 views_content/views_content.module \views_content_exposed_form_pane_render()

Render function for 'special' view blocks.

We took over the render for the special view blocks so that we could add options to it.

1 string reference to 'views_content_exposed_form_pane_render'
views_ctools_block_info in views_content/views_content.module
Don't show Views' blocks; we expose them already.

File

views_content/views_content.module, line 99
Provides views as panels content, configurable by the administrator. Each view provided as panel content must be configured in advance, but once configured, building panels with views is a little bit simpler.

Code

function views_content_exposed_form_pane_render($subtype, $conf, $panel_args, $contexts) {
  $delta = str_replace('views-', '', $subtype);
  if (strlen($delta) == 32) {
    $hashes = variable_get('views_block_hashes', array());
    if (!empty($hashes[$delta])) {
      $delta = $hashes[$delta];
    }
  }
  list($nothing, $type, $name, $display_id) = explode('-', $delta);

  // Put the - back on. For views special blocks, the first character is always - but
  // the explode killed it. Note that this code is mostly copied from views_block().
  $type = '-' . $type;
  if ($view = views_get_view($name)) {
    if ($view
      ->access($display_id)) {
      if (!empty($conf['inherit_path'])) {
        $view->override_path = $_GET['q'];
      }
      $view
        ->set_display($display_id);
      if (isset($view->display_handler)) {
        $block = (object) $view->display_handler
          ->view_special_blocks($type);
        return $block;
      }
    }
    $view
      ->destroy();
  }
}