You are here

function views_plugin_display::export_option 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_option()

Override of export_option()

Because displays do not want to export options that are NOT overridden from the default display, we need some special handling during the export process.

Overrides views_object::export_option

File

plugins/views_plugin_display.inc, line 2596
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_option($indent, $prefix, $storage, $option, $definition, $parents) {

  // The $prefix is wrong because we store our actual options a little differently:
  $prefix = '$handler->display->display_options';
  $output = '';
  if (!$parents && !$this
    ->is_default_display()) {

    // Do not export items that are not overridden.
    if ($this
      ->is_defaulted($option)) {
      return;
    }

    // If this is not defaulted and is overrideable, flip the switch to say this
    // is overridden.
    if ($this
      ->defaultable_sections($option)) {
      $output .= $indent . $prefix . "['defaults']['{$option}'] = FALSE;\n";
    }
  }
  $output .= parent::export_option($indent, $prefix, $storage, $option, $definition, $parents);
  return $output;
}