function views_handler_argument::export_validation
3.x views_handler_argument.inc | views_handler_argument::export_validation($indent, $prefix, $storage, $option, $definition, $parents) |
Export handler for validation export.
Arguments use validation plugins. This special export handler makes sure this works properly.
File
- handlers/
views_handler_argument.inc, line 1116 - @todo.
Class
- views_handler_argument
- Base class for arguments.
Code
function export_validation($indent, $prefix, $storage, $option, $definition, $parents) {
$output = '';
$name = $this->options['validate'][$option];
$options = $this->options['validate_options'];
$plugin = views_get_plugin('argument validator', $name);
if ($plugin) {
$plugin->init($this->view, $this->display, $options);
// Write which plugin to use.
$output .= $indent . $prefix . "['validate']['$option'] = '$name';\n";
// Pass off to the plugin to export itself.
$output .= $plugin->export_options($indent, $prefix . "['validate_options']");
}
return $output;
}