You are here

function webform_components in Webform 6.3

Same name and namespace in other branches
  1. 5.2 webform.module \webform_components()
  2. 7.4 webform.module \webform_components()
  3. 7.3 webform.module \webform_components()

Get a list of all available component definitions.

7 calls to webform_components()
webform_admin_settings in includes/webform.admin.inc
Menu callback for admin/settings/webform.
webform_client_form_includes in ./webform.module
Process function for webform_client_form().
webform_component_feature in includes/webform.components.inc
Check if a component has a particular feature.
webform_component_include in ./webform.module
Load a component file into memory.
webform_component_options in ./webform.module
Build a list of components suitable for use as select list options.

... See full list

File

./webform.module, line 3320

Code

function webform_components($include_disabled = FALSE, $reset = FALSE) {
  static $components, $disabled;
  if (!isset($components) || $reset) {
    $components = array();
    $disabled = array_flip(variable_get('webform_disabled_components', array()));
    foreach (module_implements('webform_component_info') as $module) {
      $module_components = module_invoke($module, 'webform_component_info');
      foreach ($module_components as $type => $info) {
        $module_components[$type]['module'] = $module;
        $module_components[$type]['enabled'] = !array_key_exists($type, $disabled);
      }
      $components += $module_components;
    }
    drupal_alter('webform_component_info', $components);
    ksort($components);
  }
  return $include_disabled ? $components : array_diff_key($components, $disabled);
}