forms

Formulario select del nombre de las vistas

 $form['views_existing'] = array(
    '#type' => 'fieldset',
    '#title' => t('Existing views'),
     '#collapsible' => 1,
 );
 
  $result = db_query("SELECT name FROM {view_view} ORDER BY name");
  while ($view = db_fetch_array($result)) {
    $form['views_existing']['views_'.$view['name']] = array(
      '#type' => 'checkbox',
      '#title' => t('@s', array('@s' => $view['name'])),
      '#default_value' => variable_get('views_'. $view['name'], FALSE),
    );
  }
  $form['views_default'] = array(
    '#type' => 'fieldset',
    '#title' => t('Default views'),
     '#collapsible' => 1,
  );
 
  views_load_cache();
  $default_views = _views_get_default_views();
  foreach ($default_views as $view) {
    $form['views_default']['views_default_'.$view->name] = array(
      '#type' => 'checkbox',
      '#title' => t('@s', array('@s' => $view->name)),
      '#default_value' => variable_get('views_default_'. $view->name, FALSE),
    );
  }

Formulario select de tipos de contenidos, cck

 $form['tipos'] = array(
    '#type' => 'fieldset',
    '#title' => t('Título'),
  );
  $types = node_get_types('names');
 
  foreach ($types as $type => $name) {
    $form['tipos'][$type] = array(
      '#type' => 'checkbox',
      '#title' => t('@s', array('@s' => $name)),
      '#default_value' => variable_get('export_reset_'. $type, FALSE),
    );
  }
  return system_settings_form($form);

Formulario select de tipos de archivos adjuntos

  $filemime = variable_get('deskarga_filemime', array());
  $consult = db_query("SELECT DISTINCT(filemime) FROM {files}");
  while ($mim = db_fetch_object($consult)) {
    $mime[$mim->filemime]= $mim->filemime;
  }
  $form['deskarga_filemime'] = array(
     '#type' => 'fieldset',
     '#collapsible' => TRUE,
     '#collapsed' => false,
     '#title' => t('Archivos descargables '),
  );
  $form['deskarga_filemime']['filemime'] = array(
     '#type'   => 'checkboxes',
     '#title'  => $adjunto,
     '#options' => $mime,
     '#multiple' => 1,
     '#default_value' => $filemime['filemime'],
  );

Formulario select de vocabularios

$vocabularios = taxonomy_get_vocabularies(NULL);
$options_voc[0] = 'none';
foreach ($vocabularios as $voc) {
  $options_voc[$voc->vid] = $voc->name;
}
$voc_value = variable_get('voc',"0");
$form['opciones'] = array('#type' => 'fieldset', '#title' => t('Opciones'));
$form['opciones']['voc']= array(
  '#type' => 'select',
  '#title' => 'Vocabualario??',
  '#description' => t(''),
  '#options' => $options_voc,
  '#prefix' => '<div class="field_voc">',
  '#suffix' => '</div>',
  '#default_value' => $voc_value,
  '#description' => t("Descripcion"),
 );

Distribuir contenido
Diseño y desarrollo INVESTIC con DRUPAL