You are here

function webform_admin_type_list in Webform 7.4

Same name and namespace in other branches
  1. 6.3 includes/webform.admin.inc \webform_admin_type_list()
  2. 7.3 includes/webform.admin.inc \webform_admin_type_list()

Create a comma-separate list of content types that are webform enabled.

2 calls to webform_admin_type_list()
theme_webform_admin_content in includes/webform.admin.inc
Generate a list of all webforms available on this site.
webform_help in ./webform.module
Implements hook_help().

File

includes/webform.admin.inc, line 346
Administration pages provided by Webform module.

Code

function webform_admin_type_list() {
  $webform_types = webform_node_types();
  $webform_type_list = '';
  $webform_type_count = count($webform_types);
  foreach ($webform_types as $n => $type) {
    $webform_type_list .= l(node_type_get_name($type), 'node/add/' . str_replace('_', '-', $type));
    if ($n + 1 < $webform_type_count) {
      $webform_type_list .= $webform_type_count == 2 ? ' ' : ', ';
    }
    if ($n + 2 == $webform_type_count) {
      $webform_type_list .= t('or') . ' ';
    }
  }
  return $webform_type_list;
}