t('Disabled'), 'bucket' => t('Bucket'), 'resource' => t('Resource'), ); $arg = $this->get_argument(); if (empty($arg)) { $arg = array(); } $form[$this->option_name] = array( '#type' => 'checkboxes', '#prefix' => '
', '#suffix' => '
', '#title' => t('Types'), '#options' => $options, '#default_value' => $arg, '#description' => t('If you wish to validate for specific node types, check them; if none are checked, all nodes will pass.'), '#process' => array('expand_checkboxes', 'views_process_dependency'), '#dependency' => array('edit-options-validate-type' => array($this->id)), ); $form['validate_argument_merci_sub_type'] = array( '#type' => 'checkboxes', '#title' => t('Argument type'), '#prefix' => '
', '#suffix' => '
', '#options' => array( 1 => "MERCI Item", 2 => "MERCI Reservaton Item", ), '#default_value' => isset($this->argument->options['validate_argument_merci_sub_type']) ? $this->argument->options['validate_argument_merci_sub_type'] : array(), '#description' => t('If you wish to validate for specific node types, check them; if none are checked, all nodes will pass.'), '#process' => array('expand_checkboxes', 'views_process_dependency'), '#dependency' => array('edit-options-validate-type' => array($this->id)), ); } function validate_argument($argument) { $node = node_load($argument); $types = array_filter($this->argument->options[$this->option_name]); $sub_types = array_filter($this->argument->options['validate_argument_merci_sub_type']); if (!isset($types[$node->merci_type_setting])) { return FALSE; } if (!isset($sub_types[$node->merci_sub_type])) { return FALSE; } return TRUE; } }