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

Diff of /contributions/modules/i_ching/i_ching.module

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

revision 1.1, Wed Jun 4 05:39:51 2008 UTC revision 1.1.4.1, Fri Jun 6 22:23:26 2008 UTC
# Line 155  function i_ching_block($op = 'list', $de Line 155  function i_ching_block($op = 'list', $de
155    
156  function i_ching_form(&$node) {  function i_ching_form(&$node) {
157    // The site admin can decide if this node type has a title and body, and how    // The site admin can decide if this node type has a title and body, and how
158    // the fields should be labeled. We need to load these settings so we can    // ·the fields should be labeled. We need to load these settings so we can
159    // build the node form correctly.    // build the node form correctly.
160    $type = node_get_types('type', $node);    $type = node_get_types('type', $node);
161    
# Line 165  function i_ching_form(&$node) { Line 165  function i_ching_form(&$node) {
165        '#title' => check_plain($type->title_label),        '#title' => check_plain($type->title_label),
166        '#required' => TRUE,        '#required' => TRUE,
167        '#default_value' => $node->title,        '#default_value' => $node->title,
168        '#weight' => -5        '#weight' => -8
169      );      );
170    }    }
171    
# Line 191  function i_ching_form(&$node) { Line 191  function i_ching_form(&$node) {
191        '2' => t('- - (2 heads)'),        '2' => t('- - (2 heads)'),
192      ),      ),
193      '#required' => TRUE,      '#required' => TRUE,
194      '#weight' => -1      '#weight' => -6
195  );  );
196    
197    $form['line_5'] = array(    $form['line_5'] = array(
# Line 206  function i_ching_form(&$node) { Line 206  function i_ching_form(&$node) {
206        '2' => t('- - (2 heads)'),        '2' => t('- - (2 heads)'),
207      ),      ),
208      '#required' => TRUE,      '#required' => TRUE,
209      '#weight' => -1      '#weight' => -5
210  );  );
211    
212    $form['line_4'] = array(    $form['line_4'] = array(
# Line 221  function i_ching_form(&$node) { Line 221  function i_ching_form(&$node) {
221        '2' => t('- - (2 heads)'),        '2' => t('- - (2 heads)'),
222      ),      ),
223      '#required' => TRUE,      '#required' => TRUE,
224      '#weight' => -1      '#weight' => -4
225  );  );
226    
227    $form['line_3'] = array(    $form['line_3'] = array(
# Line 236  function i_ching_form(&$node) { Line 236  function i_ching_form(&$node) {
236        '2' => t('- - (2 heads)'),        '2' => t('- - (2 heads)'),
237      ),      ),
238      '#required' => TRUE,      '#required' => TRUE,
239      '#weight' => -1      '#weight' => -3
240  );  );
241    
242    $form['line_2'] = array(    $form['line_2'] = array(
# Line 251  function i_ching_form(&$node) { Line 251  function i_ching_form(&$node) {
251        '2' => t('- - (2 heads)'),        '2' => t('- - (2 heads)'),
252      ),      ),
253      '#required' => TRUE,      '#required' => TRUE,
254      '#weight' => -1      '#weight' => -2
255  );  );
256    
257    $form['line_1'] = array(    $form['line_1'] = array(
# Line 268  function i_ching_form(&$node) { Line 268  function i_ching_form(&$node) {
268      '#required' => TRUE,      '#required' => TRUE,
269      '#weight' => -1      '#weight' => -1
270  );  );
271    
272    return $form;    return $form;
273  }  }
274    
275    
276    
277    function i_ching_form_alter(&$form, &$form_state, $form_id) {
278      if ($form_id == 'i_ching_node_form') {
279        // Form modification code goes here; $form_state cannot be modified,
280        // but decisions can be made based on its contents.
281        $form['taxonomy']['#weight']=-7;
282        $form['menu']['#weight']=1;
283      }
284    }
285    
286    
287    
288  /**  /**
289   * Implementation of hook_validate().   * Implementation of hook_validate().
290   * Errors should be signaled with form_set_error().   * Errors should be signaled with form_set_error().
# Line 286  function i_ching_validate(&$node) { Line 299  function i_ching_validate(&$node) {
299      // Let an empty field mean "zero."      // Let an empty field mean "zero."
300      $node->quantity = 0;      $node->quantity = 0;
301    }    }
302      drupal_set_message('<pre>'. print_r(get_defined_vars(), 1) .'</pre>');
303    
304  }  }
305    
306  /**  /**

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.4.1

  ViewVC Help
Powered by ViewVC 1.1.2