function node_patterns_callbacks in Patterns 7.2
Same name and namespace in other branches
- 7 patterns_components/components/node.inc \node_patterns_callbacks()
File
- patterns_components/
components/ node.inc, line 307
Code
function node_patterns_callbacks($action, $tag, &$data) {
if ($tag == 'node') {
if ($action === PATTERNS_CREATE or $action === PATTERNS_MODIFY) {
$result = array(
$data['type'] . '_node_form',
);
}
else {
$result = array(
'node_delete_confirm',
);
}
}
elseif ($tag == 'content_type') {
if ($action === PATTERNS_CREATE or $action === PATTERNS_MODIFY) {
$result = array(
'node_type_form',
);
}
elseif ($action === PATTERNS_DELETE) {
$result = array(
'node_type_delete_confirm',
);
}
}
return patterns_results(PATTERNS_SUCCESS, t('Execution successful'), $result);
}