Hi all. I have my module (zbtips) and my zbtips_form() function:
/**
* Implementation of hook_form().
*/
function zbtips_form(&$node) {
print_r($node);
/* if ($node->uid == 0) {
$form['name'] = array('#type' => 'textfield', '#title' => t('Il tuo nome'), '#required' => TRUE, '#default_value' => $node->name, '#weight' => -10);
$form['mail'] = array('#type' => 'textfield', '#title' => t('La tua email'), '#required' => FALSE, '#default_value' => $node->mail, '#weight' => -9)
;
}
*/
$form['title'] = array('#type' => 'textfield', '#title' => t('Titolo tips&tricks'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -8
);
$form['body_filter']['body'] = array('#type' => 'textarea', '#title' => t('Descrizione del tips&tricks'), '#default_value' => $node->body, '#rows' => 20,
'#required' => TRUE, '#weight' => -7);
$form['body_filter']['format'] = filter_form($node->format);
$form['format'] = array('#default_value' => 4);
//print_r($form);
for ($i=0;$i < count($form['body_filter']['format']); $i++)
{
if ($form['body_filter']['format'][$i]['#title'] != 'Filtered HTML')
unset($form['body_filter']['format'][$i]);
else {
$form['body_filter']['format'][$i]['#default_value'] = $i;
$form['body_filter']['format']['#default_value']= $i;