You are here

function advanced_forum_allowed_node_types in Advanced Forum 7.2

Same name and namespace in other branches
  1. 6.2 advanced_forum.module \advanced_forum_allowed_node_types()

Return an array of node types allowed in a given vocabulary or term ID.

1 call to advanced_forum_allowed_node_types()
advanced_forum_node_type_create_list in ./advanced_forum.module
Generate a list of node creation links for a forum.

File

./advanced_forum.module, line 1122
Enables the look and feel of other popular forum software.

Code

function advanced_forum_allowed_node_types($tid = 0) {
  if (module_exists('forum_access')) {

    // Check with forum access to see if this forum allows node creation.
    // If it doesn't, send back an empty list.
    if (!forum_access_access('create', $tid)) {
      return array();
    }
  }
  $field = field_info_field('taxonomy_forums');
  if (!empty($field['bundles']['node'])) {
    return $field['bundles']['node'];
  }
  else {
    return array();
  }
}