function views_handler_argument_date::export_plugin

3.x views_handler_argument_date.inc views_handler_argument_date::export_plugin($indent, $prefix, $storage, $option, $definition, $parents)

The date handler provides some default argument types, which aren't argument default plugins, so addapt the export mechanism.

Overrides views_handler_argument::export_plugin

File

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

Class

views_handler_argument_date
Abstract argument handler for dates.

Code

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);
}