Ragazzi ho questo codice:
<?php
function factory_admin_settings()
{
$type_nodes = variable_get("factory_content_type", '');
$form['nodes'] = array('#type' => 'checkboxes',
'#title' => t('Types'),
'#options' => array_map('check_plain', node_get_types('names')),
'#description' => t('A list of node types you want to associate with this vocabulary.'),
'#required' => TRUE,
'#default_value' => ??
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
return $form;
}
?>
quello che ho in factory_content_type è "a:1:{s:4:"page";i:1;}"!
come faccio per farmi restituire le checkbox giuste cioè quelle segnate ad uno clikkate?? grazie mille! cioè cosa metto in '#default_value' => ???
dipende da dove le salvi, per esempio con:
dovrebbe andare.
Ciao
Marco
--
My blog
Working at @agavee
grazie mavimo ma ho risolto cosi!
function f_admin_settings()
{
$type_nodes = array();
$data = array();
$type_nodes = variable_get("f_content_type", '');
foreach($type_nodes as $key=>$value)
{
if ( $value )
$data[$key] = $key;
}
$form['nodes'] = array('#type' => 'checkboxes',
'#title' => t('Types'),
'#options' => array_map('check_plain', node_get_types('names')),
'#description' => t('A list of node types you want to associate with this vocabulary.'),
'#required' => TRUE,
'#default_value' => $data
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
return $form;
}
cia cia
100 brani in 10 minuti
https://www.youtube.com/watch?v=z9-zE7lsEv0
se operi in quel modo devi andare a fare il savataggio del checkbox nella variabile interessata tramite callback del submit (lo dico giusto nel caso in qcui qualcuno si chiede come mai non funzioni così com'è :D )
Ciao
Marco
--
My blog
Working at @agavee
ma a me funzia! :-) nn capisco
100 brani in 10 minuti
https://www.youtube.com/watch?v=z9-zE7lsEv0
Si, funziona se hai qualceh cosa ceh va a scrivere la variabile f_content_type nella tabella del DB, altrimenti non può funzionare :D
Ciao
Marco
--
My blog
Working at @agavee
ah zi zi ho qualcosa... abbraccix
100 brani in 10 minuti
https://www.youtube.com/watch?v=z9-zE7lsEv0