I am trying to integrate views with the OG Vocab module, and Im thinking the best way to do it is to add an extra option to the "Configure extra settings for filter Taxonomy: Term" form. So my code goes a bit like this...

  elseif($form_id == 'views_ui_config_item_extra_form')
  {
      $vocabularies = taxonomy_get_vocabularies();
      foreach ($vocabularies as $voc) {
        $options[$voc->vid] = check_plain($voc->name);
      }
    
      $options[]="Limit to vocabularies in current group"; 

      $form['vid']['#options']= $options;
  }

However nothing happens, even with increasing the weight of the og vocab module so it loads after views. I have no problem making a new form item appear:

  elseif($form_id == 'views_ui_config_item_extra_form')
  {
        
     $form['ogvocab'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use only terms in current group'),
      '#default_value' => FALSE,
    );
	
  }

However, i have no idea how to pass the value of this into the 'value_form' form, which I'm also going to have to do a form_alter on. Any mention of the $this variable which the handler class uses causes an ajax meltdown.

Also, how do you guarantee it only appears in the 'Taxonomy:Term' extra options form?

thanks in advance for all help :)

Comments

nirbhasa’s picture

I should say that both the above pieces of code are using hook_form_alter, if it wasnt obvious

petednz’s picture

Did you manage to do any more on this? or find an alternative? we will need to look in to this i suspect so keen to know what success/failures have already happened.

petednz’s picture

Actually just realised you are same dev who did the patch for D5 - so I guess there is no point us going back to look at that. We may have some hours to throw at this if we can help out with some coding/testing.

esmerel’s picture

Status: Active » Closed (fixed)

No activity for more than 6 months