You are here

public function views_handler_argument_date::export_plugin in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 handlers/views_handler_argument_date.inc \views_handler_argument_date::export_plugin()

Adapt the export mechanism.

The date handler provides some default argument types, which aren't argument default plugins.

Overrides views_handler_argument::export_plugin

File

handlers/views_handler_argument_date.inc, line 92
Definition of views_handler_argument_date.

Class

views_handler_argument_date
Abstract argument handler for dates.

Code

public function export_plugin($indent, $prefix, $storage, $option, $definition, $parents) {

  // Only use a special behaviour for the special argument types, else just
  // use the default behaviour.
  if ($option == 'default_argument_type') {
    $type = 'argument default';
    $option_name = 'default_argument_options';
    $plugin = $this
      ->get_plugin($type);
    $name = $this->options[$option];
    if (in_array($name, array(
      'date',
      'node_created',
      'node_changed',
    ))) {

      // Write which plugin to use.
      $output = $indent . $prefix . "['{$option}'] = '{$name}';\n";
      return $output;
    }
  }
  return parent::export_plugin($indent, $prefix, $storage, $option, $definition, $parents);
}