/[drupal]/contributions/modules/taxonomy_other/taxonomy_other.module
ViewVC logotype

Diff of /contributions/modules/taxonomy_other/taxonomy_other.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.5, Wed Aug 6 23:07:13 2008 UTC revision 1.1.2.6, Wed Apr 29 19:40:02 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: taxonomy_other.module,v 1.1.2.4 2008/07/28 20:23:49 rellis Exp $  // $Id: taxonomy_other.module,v 1.1.2.5 2008/08/06 23:07:13 rellis Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 143  function taxonomy_other_form_alter(&$for Line 143  function taxonomy_other_form_alter(&$for
143            // Add a specific weight for the select list, so we can make the text field follow immediately after.            // Add a specific weight for the select list, so we can make the text field follow immediately after.
144            $form['taxonomy'][$vid]['#weight'] = $form['taxonomy'][$vid]['#weight'] += 0.1 * $vid;            $form['taxonomy'][$vid]['#weight'] = $form['taxonomy'][$vid]['#weight'] += 0.1 * $vid;
145    
146              // Handle preview.
147              if (!empty($form_state['clicked_button']['#post']['taxonomy']['taxonomy_other_' . $vid])) {
148                $taxonomy_other = $form_state['clicked_button']['#post']['taxonomy']['taxonomy_other_' . $vid];
149                $form['taxonomy'][$vid]['#default_value'] = 'taxonomy_other';
150              }
151    
152            // Add the text field.            // Add the text field.
153            $form['taxonomy']['taxonomy_other_' . $vid] = array(            $form['taxonomy']['taxonomy_other_' . $vid] = array(
154              '#type' => 'textfield',              '#type' => 'textfield',
155              '#size' => 128,              '#size' => 128,
156              '#title' => t('Other %title', array('%title' => $form['taxonomy'][$vid]['#title'])),              '#title' => t('Other %title', array('%title' => $form['taxonomy'][$vid]['#title'])),
157              '#id' => 'taxonomy-other-' . $vid,              '#id' => 'taxonomy-other-' . $vid,
158                '#default_value' => empty($taxonomy_other) ? '' : $taxonomy_other,
159              '#description' => t('Add your own category.'),              '#description' => t('Add your own category.'),
160              '#weight' => $form['taxonomy'][$vid]['#weight'] + 0.01,              '#weight' => $form['taxonomy'][$vid]['#weight'] + 0.01,
161            );            );

Legend:
Removed from v.1.1.2.5  
changed lines
  Added in v.1.1.2.6

  ViewVC Help
Powered by ViewVC 1.1.2