function panels_context_node_settings_form_validate in Panels 5.2
Same name and namespace in other branches
- 6.2 contexts/node.inc \panels_context_node_settings_form_validate()
Validate a node.
1 string reference to 'panels_context_node_settings_form_validate'
- panels_node_panels_contexts in contexts/
node.inc - @file contexts/node.inc
File
- contexts/
node.inc, line 112 - contexts/node.inc
Code
function panels_context_node_settings_form_validate($form, $form_values) {
// Validate the autocomplete
if (empty($form_values['external']) && empty($form_values['nid']) && empty($form_values['node'])) {
form_error($form['node'], t('You must select a node.'));
return;
}
if (empty($form_values['node'])) {
return;
}
if ($nid = panels_nid_autocomplete($form_values['node'])) {
form_set_value($form['nid'], $nid);
}
else {
form_error($form['node'], t('Invalid node selected.'));
}
}