accesibilidad

Accesibilidad en las VIEWS de tipo TABLA

/**
 * Display the nodes of a view as a table.
 */
function phptemplate_views_view_table($view, $nodes, $type) {
  $fields = _views_get_fields();
 
  foreach ($nodes as $node) {
    $row = array();
    foreach ($view->field as $field) {
      if ($fields[$field['id']]['visible'] !== FALSE) {
        $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
        $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']);
        $row[] = $cell;
      }
    }
    $rows[] = $row;
  }
  return theme('table', $view->table_header, $rows,  array('summary' => 'Views tables'));
}

Accesibilidad en href.. "ul", "object" ...

  // Los enlaces en un tpl.php, template... deben ser de la siguiente forma para que no
  // de error de validación
  // en el siguiente ejemplo son con variables:
  //  Link :  /link/$link_ultima_parte
  //  titulo: titulo_$proyecto
  <?php print '<li><a href="/link/'. $link_ultima_parte .'"> titulo_'. $proyecto .'</a></li>';?>
 
//otra accesibilidad..crear href con target
 
 <a href="http://link../"  onclick="target='_blank';"><img src="/sites/foto.jpg" alt="foto"/></a>

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);
  }
}
 

Accesibilidad bloque de suscripción de SIMPLENEWS

 // En el phptemplate
 
 function phptemplate_radio($element) {
 
  // Create a random number to append to the ID
  //This is required as with e.g. poll mudule, the poll
  // node appears twice resulting in duplicate IDs
 
  $new_rand_no = (mt_rand(10,1000000));
 
  _form_set_class($element, array('form-radio'));
  $output = '<input type="radio" ';
  $output .= 'name="' . $element['#name'] .'" ';
  $output .= 'value="'. $element['#return_value'] .'" ';
  $output .= 'id="'. $element['#id'] . '_' . $element['#return_value'] . $new_rand_no .'" ';
  $output .= (check_plain($element['#value']) == $element['#return_value']) ? ' checked="checked" ' : ' ';
  $output .= drupal_attributes($element['#attributes']) .' />';
  if (!is_null($element['#title'])) {
    $output = '<label class="option" for="' . $element['#id'] . '_' . $element['#return_value'] . $new_rand_no .'">'. $output .' '. $element['#title'] .'</label>';
  }
 
  unset($element['#title']);
  return theme('form_element', $element, $output);
}
 
 
// En una función form_alter
if ($form_id == 'simplenews_block_form') {
    $form['mail']['#default_value'] = 'correo';
}

Accesibilidad formulario de CONTACTO

// En un módulo, dentro de una función form_alter
 
  if ($form_id == 'contact_mail_page') {
    $form['mail']['#id'] = 'edit-mail-comment';
    $form['submit']['#id'] = 'edit-submit-comment';
 
    $form['name']['#default_value'] = 'Nombre';
    $form['subject']['#default_value'] = 'Asunto';
    $form['message']['#default_value'] = 'Mensaje';
    $form['mail']['#default_value'] = 'E-mail';
    $form['cid']['#default_value'] = 0;
}

Accesibilidad tablas de los filtros del módulo VIEWS

//En el template.php
 
function phptemplate_views_filters($form) {
  $view = $form['view']['#value'];
 
  foreach ($view->exposed_filter as $count => $expose) {
    $row[] = drupal_render($form["op$count"]) . drupal_render($form["filter$count"]);
    $label[] = $expose['label'];
  }
  $row[] = drupal_render($form['submit']);
  $label[] = ''; // so the column count is the same.
 
  // make the 'q' come first
  return drupal_render($form['q']) . theme('table', $label, array($row), array('summary' => 'Views filters') ) . drupal_render($form);
}

Accesibilidad tablas del módulo EVENT

// en el template.php
 
function phptemplate_event_calendar_month($op, $header, $rows, $attributes = array(), $caption = NULL) {
  $attributes['summary'] = 'Calendar';  
  $output = theme("table", $header, $rows, $attributes, $caption);
  return '<div class="event-calendar"><div class="month-view">'. $output ."</div></div>\n";
}

Accesibilidad bloque search

function nombremodulo_form_alter($formid, &$form) {
 if ($form_id == 'search_block_form'){
  $form['search_block_form_keys']['#title'] = 'Buscar';
 }
}

Distribuir contenido
Diseño y desarrollo INVESTIC con DRUPAL