function views_handler_argument::get_plugin

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

Get the display or row plugin, if it exists.

8 calls to views_handler_argument::get_plugin()
views_handler_argument::default_argument_form in handlers/views_handler_argument.inc
Provide a form for selecting the default argument when the default action is set to provide default argument.
views_handler_argument::export_plugin in handlers/views_handler_argument.inc
Special handling for the style export.
views_handler_argument::get_default_argument in handlers/views_handler_argument.inc
Get a default argument, if available.
views_handler_argument::options_form in handlers/views_handler_argument.inc
views_handler_argument::options_submit in handlers/views_handler_argument.inc
Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.

... See full list

File

handlers/views_handler_argument.inc, line 889

Class

views_handler_argument
Base class for arguments.

Code

function get_plugin($type = 'argument default', $name = NULL) {
    $options = array();
    switch ($type) {
        case 'argument default':
            $plugin_name = 'default_argument_type';
            $options_name = 'default_argument_options';
            break;
        case 'argument validator':
            $plugin_name = 'validate_type';
            $options_name = 'validate_options';
    }
    if (!$name) {
        $name = $this->options[$plugin_name];
    }
    // we only fetch the options if we're fetching the plugin actually
    // in use.
    if ($name == $this->options[$plugin_name]) {
        $options = $this->options[$options_name];
    }
    $plugin = views_get_plugin($type, $name);
    if ($plugin) {
        $plugin->init($this->view, $this, $options);
        return $plugin;
    }
}