1 taxonomy.theme.inc theme_taxonomy_overview_vocabularies($variables)

Returns HTML for the vocabulary overview form as a sortable list of vocabularies.

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.

See also

taxonomy_overview_vocabularies()

Related topics

File

core/modules/taxonomy/taxonomy.theme.inc, line 17
Theme functions for the Taxonomy module.

Code

function theme_taxonomy_overview_vocabularies($variables) {
  $form = $variables['form'];

  $rows = array();

  foreach (element_children($form) as $key) {
    if (isset($form[$key]['name'])) {
      $vocabulary = &$form[$key];

      $row = array();
      $row[] = backdrop_render($vocabulary['name']);
      if (isset($vocabulary['weight'])) {
        $vocabulary['weight']['#attributes']['class'] = array('vocabulary-weight');
        $row[] = backdrop_render($vocabulary['weight']);
      }
      $row[] = backdrop_render($vocabulary['operations']);
      $rows[] = array('data' => $row, 'class' => array('draggable'));
    }
  }

  $header = array(t('Vocabulary name'));
  if (isset($form['actions'])) {
    $header[] = t('Weight');
    backdrop_add_tabledrag('taxonomy', 'order', 'sibling', 'vocabulary-weight');
  }
  $header[] = t('Operations');
  return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No vocabularies available. <a href="@link">Add vocabulary</a>.', array('@link' => url('admin/structure/taxonomy/add'))), 'attributes' => array('id' => 'taxonomy'))) . backdrop_render_children($form);
}