1 system.theme.inc theme_tree_table($variables)

Theme a tree table.

Related topics

File

core/modules/system/system.theme.inc, line 615
Theme functions for the System module.

Code

function theme_tree_table($variables) {
  foreach ($variables['rows'] as &$row) {
    $row += array('class' => array());
    if (!empty($row['id'])) {
      $row['data-tt-id'] = $row['id'];
      $row['no_striping'] = TRUE;
      unset($row['id']);
    }
    if (!empty($row['parent'])) {
      $row['data-tt-parent-id'] = $row['parent'];
      unset($row['parent']);
    }
  }

  if (!empty($variables['rows'])) {
    backdrop_add_library('system', 'jquery.treetable');
  }

  return theme('table', $variables);
}