You are here

public function views_plugin_argument_validate_taxonomy_term::init in Views (for Drupal 7) 7.3

Initialize this plugin with the view and the argument it is linked to.

Overrides views_plugin_argument_validate::init

File

modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc, line 16
Definition of views_plugin_argument_validate_taxonomy_term.

Class

views_plugin_argument_validate_taxonomy_term
Validate whether an argument is an acceptable node.

Code

public function init(&$view, &$argument, $options) {
  parent::init($view, $argument, $options);

  // Convert legacy vids option to machine name vocabularies.
  if (!empty($this->options['vids'])) {
    $vocabularies = taxonomy_get_vocabularies();
    foreach ($this->options['vids'] as $vid) {
      if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
        $this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
      }
    }
  }
}