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

Diff of /contributions/modules/computed_field/computed_field.module

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

revision 1.17.2.3, Mon Sep 29 04:08:21 2008 UTC revision 1.17.2.4, Fri Oct 17 21:21:05 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: computed_field.module,v 1.17.2.2 2008/09/12 17:43:58 moonshine Exp $  // $Id: computed_field.module,v 1.17.2.3 2008/09/29 04:08:21 moonshine Exp $
3    
4  /**  /**
5   * Implementation of cck hook_field_info()   * Implementation of cck hook_field_info()
# Line 185  function computed_field_widget_info() { Line 185  function computed_field_widget_info() {
185  /**  /**
186   * Implementation of cck hook_widget()   * Implementation of cck hook_widget()
187   */   */
188  function computed_field_widget($op, &$node, $field, &$node_field) {  function computed_field_widget(&$form, &$form_state, $field, $items, $delta = 0) {
189    switch ($op) {    $elements = array();
190      case 'form':    foreach($items as $delta => $item) {
191        $form = array();      $elements[$delta]['value'] = array (
192          '#type' => 'value',
193        $form[$field['field_name']] = array('#tree' => TRUE);        '#tree' => TRUE,
194          '#default_value' => isset($item['value']) ? $item['value'] : NULL,
195        $form[$field['field_name']][0]['value'] = array(      );
         '#type' => 'value',  
         '#title' => t($field['widget']['label']),  
         '#default_value' => isset($node_field[0]['value']) ? $node_field[0]['value'] : '',  
       );  
       return $form;  
196    }    }
197      return $elements;
198  }  }
199    
200  /**  /**

Legend:
Removed from v.1.17.2.3  
changed lines
  Added in v.1.17.2.4

  ViewVC Help
Powered by ViewVC 1.1.2