function views_handler_argument_date::export_plugin

Same name in other branches
  1. 7.x-3.x handlers/views_handler_argument_date.inc \views_handler_argument_date::export_plugin()

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 71

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