adjuntos

Accesibilidad. Tabla de ATTACHMENTS sin atributo summary

//En el template.php
 
function phptemplate_upload_attachments($files) {
   $attributes['summary'] = 'Attachment_table';
   $attributes['id'] = 'attachments';
 
  $header = array(t('Attachment'), t('Size'));
  $rows = array();
  foreach ($files as $file) {
    $file = (object)$file;
    if ($file->list && !$file->remove) {
      // Generate valid URL for both existing attachments and preview of new attachments (these have 'upload' in fid)
      $href = file_create_url((strpos($file->fid, 'upload') === FALSE ? $file->filepath : file_create_filename($file->filename, file_create_path())));
      $text = $file->description ? $file->description : $file->filename;
      $rows[] = array(l($text, $href), format_size($file->filesize));
    }
  }
  if (count($rows)) {
    return theme('table', $header, $rows, $attributes);
  }
}
 

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'],
  );

Distribuir contenido
Diseño y desarrollo INVESTIC con DRUPAL