You are here

function views_plugin_display::export_plugin in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 7.3 plugins/views_plugin_display.inc \views_plugin_display::export_plugin()

Special handling for plugin export

Plugins other than styles are stored in array with 'type' being the key to the plugin. For modern plugins, the options are stored in the 'options' array, but for legacy plugins (access and cache) options are stored as siblings to the type.

File

plugins/views_plugin_display.inc, line 2704
Contains the base display plugin.

Class

views_plugin_display
The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.

Code

function export_plugin($indent, $prefix, $storage, $option, $definition, $parents) {
  $output = '';
  $plugin_type = end($parents);
  $plugin = $this
    ->get_plugin($plugin_type);
  if ($plugin) {

    // Write which plugin to use.
    $value = $storage[$option];
    $new_prefix = $prefix . "['{$plugin_type}']";
    $output .= $indent . $new_prefix . "['{$option}'] = '{$value}';\n";
    if ($plugin_type != 'access' && $plugin_type != 'cache') {
      $new_prefix .= "['options']";
    }

    // Pass off to the plugin to export itself.
    $output .= $plugin
      ->export_options($indent, $new_prefix);
  }
  return $output;
}