[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/vertical_tabs/core/ -> taxonomy.js (source)

   1  // $Id: taxonomy.js,v 1.1.2.1 2009/12/09 01:08:39 davereid Exp $
   2  
   3  Drupal.verticalTabs = Drupal.verticalTabs || {};
   4  
   5  Drupal.verticalTabs.taxonomy = function() {
   6    var terms = {};
   7    var termCount = 0;
   8    $('fieldset.vertical-tabs-taxonomy').find('select, input.form-text').each(function() {
   9      if (this.value) {
  10        var vocabulary = $(this).siblings('label').html();
  11        terms[vocabulary] = terms[vocabulary] || [];
  12        if ($(this).is('input.form-text')) {
  13          terms[vocabulary].push(this.value);
  14          termCount++;
  15        }
  16        else if ($(this).is('select')) {
  17          $(this).find('option[selected]').each(function() {
  18            terms[vocabulary].push($(this).text());
  19            termCount++;
  20          });
  21        }
  22      }
  23    });
  24  
  25    if (termCount) {
  26      var output = '';
  27      $.each(terms, function(vocab, vocab_terms) {
  28        if (output) {
  29          output += '<br />';
  30        }
  31        output += vocab;
  32        output += vocab_terms.join(', ');
  33      });
  34      return output;
  35    }
  36    else {
  37      return Drupal.t('No terms');
  38    }
  39  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7