function webform_menu_component_load in Webform 6.2
Same name and namespace in other branches
- 6.3 webform.module \webform_menu_component_load()
- 7.4 webform.module \webform_menu_component_load()
- 7.3 webform.module \webform_menu_component_load()
Menu loader callback. Load a webform component if the given cid is a valid.
File
- ./
webform.module, line 281
Code
function webform_menu_component_load($cid, $nid, $type) {
module_load_include('inc', 'webform', 'webform_components');
if ($cid == 'new') {
$components = webform_load_components();
$component = in_array($type, array_keys($components)) ? array(
'type' => $type,
'name' => $_GET['name'],
'mandatory' => $_GET['mandatory'],
'email' => $_GET['email'],
'pid' => $_GET['pid'],
'weight' => $_GET['weight'],
) : FALSE;
}
else {
$node = node_load($nid);
$component = isset($node->webform['components'][$cid]) ? $node->webform['components'][$cid] : FALSE;
}
webform_component_defaults($component);
return $component;
}