You are here

public function views_content_plugin_display_ctools_context::render in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 views_content/plugins/views/views_content_plugin_display_ctools_context.inc \views_content_plugin_display_ctools_context::render()

Render this display.

Overrides views_plugin_display::render

File

views_content/plugins/views/views_content_plugin_display_ctools_context.inc, line 70
Contains the block display plugin.

Class

views_content_plugin_display_ctools_context
The plugin that handles a block.

Code

public function render() {
  if (!empty($this->previewing)) {
    return theme($this
      ->theme_functions(), array(
      'view' => $this->view,
    ));
  }
  else {

    // We want to process the view like we're theming it, but not actually
    // use the template part. Therefore we run through all the preprocess
    // functions which will populate the variables array.
    $hooks = theme_get_registry();
    $info = $hooks[$this->definition['theme']];
    if (!empty($info['file'])) {
      @(include_once './' . $info['path'] . '/' . $info['file']);
    }
    $this->variables = array(
      'view' => &$this->view,
    );
    if (isset($info['preprocess functions']) && is_array($info['preprocess functions'])) {
      foreach ($info['preprocess functions'] as $preprocess_function) {
        if (function_exists($preprocess_function)) {
          $preprocess_function($this->variables, $this->definition['theme']);
        }
      }
    }
  }
  return $this->variables;
}