You are here

function theme_taxonomy_edge_overview_vocabularies in Taxonomy Edge 6

Same name and namespace in other branches
  1. 8 taxonomy_edge.theme.inc \theme_taxonomy_edge_overview_vocabularies()
  2. 7.2 taxonomy_edge.theme.inc \theme_taxonomy_edge_overview_vocabularies()
  3. 7 taxonomy_edge.theme.inc \theme_taxonomy_edge_overview_vocabularies()

Copy of theme_taxonomy_overview_vocabularies, but with the addition of a column, and an increase in colspan.

See also

taxonomy_overview_vocabularies()

File

./taxonomy_edge.theme.inc, line 13

Code

function theme_taxonomy_edge_overview_vocabularies($form) {
  $rows = array();
  foreach (element_children($form) as $key) {
    if (isset($form[$key]['name'])) {
      $vocabulary =& $form[$key];
      $row = array();
      $row[] = drupal_render($vocabulary['name']);
      $row[] = drupal_render($vocabulary['types']);
      if (isset($vocabulary['weight'])) {
        $vocabulary['weight']['#attributes']['class'] = 'vocabulary-weight';
        $row[] = drupal_render($vocabulary['weight']);
      }
      $row[] = drupal_render($vocabulary['edit']);
      $row[] = drupal_render($vocabulary['list']);
      $row[] = drupal_render($vocabulary['add']);
      $row[] = drupal_render($vocabulary['rebuild_edges']);
      $row[] = drupal_render($vocabulary['rebuild_order']);
      $row[] = drupal_render($vocabulary['rebuild_all']);
      $rows[] = array(
        'data' => $row,
        'class' => 'draggable',
      );
    }
  }
  if (empty($rows)) {
    $rows[] = array(
      array(
        'data' => t('No vocabularies available.'),
        'colspan' => '5',
      ),
    );
  }
  $header = array(
    t('Name'),
    t('Type'),
  );
  if (isset($form['submit'])) {
    $header[] = t('Weight');
    drupal_add_tabledrag('taxonomy', 'order', 'sibling', 'vocabulary-weight');
  }
  $header[] = array(
    'data' => t('Operations'),
    'colspan' => '3',
  );
  $header[] = array(
    'data' => t('Taxonomy Edge'),
    'colspan' => '3',
  );
  return theme('table', $header, $rows, array(
    'id' => 'taxonomy',
  )) . drupal_render($form);
}