Index: modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/taxonomy/Attic/views_plugin_argument_default_taxonomy_tid.inc,v retrieving revision 1.1.6.3 diff -u -p -r1.1.6.3 views_plugin_argument_default_taxonomy_tid.inc --- modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc 13 Aug 2010 19:52:16 -0000 1.1.6.3 +++ modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc 1 Dec 2010 10:17:51 -0000 @@ -12,31 +12,46 @@ class views_plugin_argument_default_taxo $options['term_page'] = array('default' => TRUE); $options['node'] = array('default' => FALSE); $options['limit'] = array('default' => FALSE); - $options['vids'] = array('default' => NULL); + $options['vids'] = array('default' => array()); return $options; } - function options_form(&$form, &$form_state) { + function argument_form(&$form, &$form_state) { $form['term_page'] = array( '#type' => 'checkbox', '#title' => t('Load default argument from term page'), - '#default_value' => $this->options['term_page'], + '#default_value' => $this->argument->options['term_page'], + '#process' => array('views_process_dependency'), + '#dependency' => array( + 'radio:options[default_action]' => array('default'), + 'radio:options[default_argument_type]' => array($this->id) + ), + '#dependency_count' => 2, ); $form['node'] = array( '#type' => 'checkbox', '#title' => t('Load default argument from node page. Good for related taxonomy blocks.'), - '#default_value' => $this->options['node'], + '#default_value' => $this->argument->options['node'], + '#process' => array('views_process_dependency'), + '#dependency' => array( + 'radio:options[default_action]' => array('default'), + 'radio:options[default_argument_type]' => array($this->id) + ), + '#dependency_count' => 2, ); $form['limit'] = array( '#type' => 'checkbox', '#title' => t('Limit terms by vocabulary'), - '#default_value'=> $this->options['limit'], - '#process' => array('expand_checkboxes', 'views_process_dependency'), + '#default_value'=> $this->argument->options['limit'], + '#process' => array('views_process_dependency'), '#dependency' => array( - 'edit-options-argument-default-taxonomy-tid-node' => array(1), + 'radio:options[default_action]' => array('default'), + 'radio:options[default_argument_type]' => array($this->id), + 'edit-options-node' => array(1) ), + '#dependency_count' => 3, ); $options = array(); @@ -50,13 +65,17 @@ class views_plugin_argument_default_taxo '#suffix' => '', '#type' => 'checkboxes', '#title' => t('Vocabularies'), + '#description' => t('If you wish to limit terms for specific vocabularies, check them; if none are checked, all terms will be included.'), '#options' => $options, - '#default_value' => $this->options['vids'], + '#default_value' => isset($this->argument->options['vids']) ? $this->argument->options['vids'] : array(), '#process' => array('expand_checkboxes', 'views_process_dependency'), '#dependency' => array( - //'edit-options-argument-default-taxonomy-tid-limit' => array(1), - 'edit-options-argument-default-taxonomy-tid-node' => array(1), + 'radio:options[default_action]' => array('default'), + 'radio:options[default_argument_type]' => array($this->id), + 'edit-options-node' => array(1), + 'edit-options-limit' => array(1) ), + '#dependency_count' => 4, ); } @@ -67,13 +86,13 @@ class views_plugin_argument_default_taxo function get_argument() { // Load default argument from taxonomy page. - if (!empty($this->options['term_page'])) { + if (!empty($this->argument->options['term_page'])) { if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) { return arg(2); } } // Load default argument from node. - if (!empty($this->options['node'])) { + if (!empty($this->argument->options['node'])) { foreach (range(1, 3) as $i) { $node = menu_get_object('node', $i); if (!empty($node)) { @@ -82,11 +101,11 @@ class views_plugin_argument_default_taxo } // Just check, if a node could be detected. if ($node) { - if (!empty($this->options['limit'])) { + if (!empty($this->argument->options['limit'])) { $tids = array(); - // filter by vid + // Filter by vid. foreach ($node->taxonomy as $tid => $term) { - if (!empty($this->options['vids'][$term->vid])) { + if (!empty($this->argument->options['vids'][$term->vid])) { $tids[] = $tid; } }