function views_handler_argument::export_plugin

Same name and namespace in other branches
  1. 6.x-3.x handlers/views_handler_argument.inc \views_handler_argument::export_plugin()

Generic plugin export handler.

Since style and validation plugins have their own export handlers, this one is currently only used for default argument plugins.

Return value

string Export string.

1 call to views_handler_argument::export_plugin()
views_handler_argument_date::export_plugin in handlers/views_handler_argument_date.inc
Adapt the export mechanism.
1 method overrides views_handler_argument::export_plugin()
views_handler_argument_date::export_plugin in handlers/views_handler_argument_date.inc
Adapt the export mechanism.

File

handlers/views_handler_argument.inc, line 1237

Class

views_handler_argument
Base class for arguments.

Code

public function export_plugin($indent, $prefix, $storage, $option, $definition, $parents) {
  $output = '';
  if ($option == 'default_argument_type') {
    $type = 'argument default';
    $option_name = 'default_argument_options';
  }
  $plugin = $this->get_plugin($type);
  $name = $this->options[$option];
  if ($plugin) {
    // Write which plugin to use.
    $output .= $indent . $prefix . "['{$option}'] = '{$name}';\n";
    // Pass off to the plugin to export itself.
    $output .= $plugin->export_options($indent, $prefix . "['{$option_name}']");
  }
  return $output;
}