You are here

function webform_component_include in Webform 7.4

Same name and namespace in other branches
  1. 6.3 webform.module \webform_component_include()
  2. 7.3 webform.module \webform_component_include()

Load a component file into memory.

Parameters

$component_type: The string machine name of a component.

11 calls to webform_component_include()
grid.inc in components/grid.inc
Webform module grid component.
time.inc in components/time.inc
Webform module time component.
WebformConditionals::executeConditionals in includes/webform.webformconditionals.inc
Executes the conditionals on a submission.
webform_client_form_process in ./webform.module
Process function for webform_client_form().
webform_component_delete in includes/webform.components.inc
Delete a Webform component.

... See full list

File

./webform.module, line 4929
This module provides a simple way to create forms and questionnaires.

Code

function webform_component_include($component_type) {
  static $included = array();

  // No need to load components that have already been added once.
  if (!isset($included[$component_type])) {
    $components = webform_components(TRUE);
    $included[$component_type] = TRUE;
    if (isset($components[$component_type]['file'])) {
      $info = $components[$component_type];
      $pathinfo = pathinfo($info['file']);
      $basename = basename($pathinfo['basename'], '.' . $pathinfo['extension']);
      $path = (!empty($pathinfo['dirname']) ? $pathinfo['dirname'] . '/' : '') . $basename;
      module_load_include($pathinfo['extension'], $info['module'], $path);
    }
  }
}