function round_tracker_form(&$node) { $type = node_get_types('type', $node); $form['#attributes']['enctype'] = 'multipart/form-data'; //$form['#multistep'] = TRUE; //$form['#redirect'] = FALSE; // We need to define form elements for the node's title and body. $form['title'] = array( '#type' => 'textfield', '#title' => check_plain($type->title_label), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -10 ); $courses = getCourses(); $form['course'] = array( '#type' => 'select', '#title' => t('Course'), '#required' => TRUE, '#default_value' => $node->course, '#options' => $courses, '#weight' => -9 ); $form['date_played'] = array( '#type' => 'textfield', '#title' => t('Date Round Played'), '#required' => TRUE, '#default_value' => $node->date_played, '#maxlength' => 10, '#size' => 10, '#weight' => -8, '#attributes' => array('style'=> 'width:auto'), '#description' => t('Please enter the date the round was played in this format: 01/01/2007') ); $form['score'] = array( '#type' => 'textfield', '#title' => t('Score'), '#required' => TRUE, '#default_value' => $node->score, '#maxlength' => 3, '#size' => 5, '#weight' => -7, '#attributes' => array('style'=> 'width:auto'), '#description' => t('Please enter your score') ); $form['holes_played'] = array( '#type' => 'textfield', '#title' => t('# of Holes Played'), '#required' => TRUE, '#default_value' => $node->holes_played, '#maxlength' => 2, '#size' => 5, '#weight' => -6, '#attributes' => array('style'=> 'width:auto'), '#description' => t('Please enter the # of holes played') ); $form['shots_marked'] = array( '#type' => 'select', '#title' => t('Types of Shots Marked'), '#required' => TRUE, '#weight' => -5, '#default_value' => variable_get('shots_marked','All'), '#options' => array( 'All' => t('All'), 'All except Putts' => t('All except Putts'), 'Drives only' => t('Drives only'), 'Only specific clubs (i.e. 6-iron, 7-iron)' => t('Only specific clubs (i.e. 6-iron, 7-iron)'), ), '#description' => t('Please enter the types of shots Marked'), ); $form['round_commentary'] = array( '#type' => 'textarea', '#title' => t('Round Commentary'), '#required' => TRUE, '#default_value' => $node->round_commentary, '#cols' => 62, '#rows' => 10, '#weight' => -4, '#attributes' => array('style'=> 'width:auto'), '#description' => t('Please enter any notes or commentary about your round') ); $form['body_filter']['filter'] = filter_form($node->format); $form['upload'] = array('#type' => 'file','#title' => t('GPX file to Upload'), '#size' => 50, '#weight' => -1); return $form; }