[RISOLTO] Drupal 6 Form orizzontale

1 contenuto / 0 new
[RISOLTO] Drupal 6 Form orizzontale

Soluzione:

avevo mancato l'implementazione all'hook_theme()

/**
* Implementation of hook_theme().
*/
function NOMEMODULO_theme() {
  return array(
    'testform_form' => array(
      'arguments' => array('form' => NULL),
    ),
  );
}

--------------------------------------------------------------------------------------------

all'epoca consultai la guida dei form orizzontali per drupal 5 e tutto funziona alla perfezione, adesso sto riscrivendo il moduo per drupal 6 ma ho difficolta' a realizzare il form orizontale.

ho cercato e consultato moduli gia' fatti ma per quanto mi stia sforzando non riesco a farlo funzionare.
dove sbaglio?

riporto un cosice di esempio:

function testform_form($form_state) {
  $form['campo1'] = array(
       '#title' => t('Campo1'),
       '#type' => 'select',
       '#options' => $lista_campi1,
  );
  $form['campo2'] = array(
       '#title' => t('campo2'),
       '#type' => 'select',
       '#options' => $lista_campo2,
  );
  $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Submit'),
  );
  return $form;
}
function theme_testform_form($form) {
   drupal_set_title(t('Test Form'));
  $output = '';
  $rows = array();
  $rows[] = array(drupal_render($form['campo1']),
                  drupal_render($form['campo2'])
                 );
  $rows[] = array(array('data' => drupal_render($form['submit']), 'colspan' => 2));
  $output .= theme('table', array(), $rows);
  $output .= drupal_render($form);
  return $output;
}

ovviamente ho tolto tutto il codice relativo alll'interrogazione del db che mi generava la $lista_campo1, $lista_campo2

ora il form mi viene viusalizzato e funzionante ma non allineato orrizontalmente

Grazie a tutti