vid . '_'; // Common form fields. $name = drupal_render($form[$id . 'name']); $list_style = drupal_render($form[$id . 'view']); $node_count = drupal_render($form[$id . 'node_count']); array_unshift($rows, array($name, NULL, $list_style, $node_count)); // The path/enable form field. if ($type == VOCABINDEX_VI_PAGE) { $rows[0][1] = drupal_render($form[$id . 'path']); } else { $rows[0][1] = drupal_render($form[$id . 'enabled']); } } // Set the table header. $header = array(t('Vocabulary'), NULL, t('View'), t('Node counts')); if ($type == VOCABINDEX_VI_PAGE) { $header[1] = t('Path'); } else { $header[1] = t('Enabled'); } return theme('table', $header, $rows) . drupal_render($form); } /** * Render a term link. * * @param $term * Type: object; Regular term object with the following extra properties: * - $path The path to the term's page. Note: this is no alias! * - $node_count The amount of nodes in the term. 0 if node counts are disabled. * @param $vi * Type: object; The VI object for the vocabulary currently being viewed. * * @return string */ function theme_vocabindex_link($term, $vi) { $term->name .= $vi->node_count ? ' (' . $term->node_count . ')' : NULL; // Tree views show term descriptions as link titles (tooltips), while other // views show them directly under the term names. if ($vi->view != VOCABINDEX_VIEW_TREE && $term->description) { $term->name .= '' . $term->description . ''; } else { $title = $term->description; } return l($term->name, $term->path, array('title' => $title), NULL, NULL, FALSE, TRUE); } /** * Render an index page. * * @param $parent * Type: object; Either the VI object or a $term object. * @param $list * Type: string; The list of terms. * $pager * Type: string; A regular pager if necessary. * @param $pager_alpha * Type: string; A pager to filter by first letter. Used for alphabetical lists. */ function theme_vocabindex_page($parent, $terms, $pager, $pager_alpha) { if ($parent->description) { $description = '

' . $parent->description . '

'; } return $description . $pager_alpha . $terms . $pager_alpha . $pager; } /** * Render the separator for alphabetical pagers. */ function theme_vocabindex_pager_separator() { return '|'; } /** * Render a pager which is used for alphabetical lists. * * @param $letters * Type: string; The pager items. */ function theme_vocabindex_pager($letters) { return '
' . $letters . '
'; }