function forum_overview in Drupal 5
Same name and namespace in other branches
- 4 modules/forum.module \forum_overview()
- 6 modules/forum/forum.admin.inc \forum_overview()
- 7 modules/forum/forum.admin.inc \forum_overview()
Returns an overview list of existing forums and containers
1 string reference to 'forum_overview'
- forum_menu in modules/
forum/ forum.module - Implementation of hook_menu().
File
- modules/
forum/ forum.module, line 581 - Enable threaded discussions about general topics.
Code
function forum_overview() {
$header = array(
t('Name'),
t('Operations'),
);
$tree = taxonomy_get_tree(_forum_get_vid());
if ($tree) {
foreach ($tree as $term) {
if (in_array($term->tid, variable_get('forum_containers', array()))) {
$rows[] = array(
str_repeat(' -- ', $term->depth) . ' ' . l($term->name, 'forum/' . $term->tid),
l(t('edit container'), 'admin/content/forum/edit/container/' . $term->tid),
);
}
else {
$rows[] = array(
str_repeat(' -- ', $term->depth) . ' ' . l($term->name, 'forum/' . $term->tid),
l(t('edit forum'), 'admin/content/forum/edit/forum/' . $term->tid),
);
}
}
}
else {
$rows[] = array(
array(
'data' => '<em>' . t('There are no existing containers or forums. You may add some on the <a href="@container">add container</a> or <a href="@forum">add forum</a> pages.', array(
'@container' => url('admin/content/forum/add/container'),
'@forum' => url('admin/content/forum/add/forum'),
)) . '</em>',
'colspan' => 2,
),
);
}
return theme('table', $header, $rows);
}