function webform_component_include in Webform 7.3
Same name and namespace in other branches
- 6.3 webform.module \webform_component_include()
- 7.4 webform.module \webform_component_include()
Load a component file into memory.
Parameters
$component_type: The string machine name of a component.
9 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.
- webform_client_form_includes in ./
webform.module - Process function for webform_client_form().
- webform_component_delete in includes/
webform.components.inc - webform_component_implements in ./
webform.module - Check if a component implements a particular hook.
File
- ./
webform.module, line 3585 - 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 (($info = $components[$component_type]) && isset($info['file'])) {
$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);
}
}
}