function content_form_alter in Content Construction Kit (CCK) 6
Same name and namespace in other branches
- 5 content.module \content_form_alter()
- 6.3 content.module \content_form_alter()
- 6.2 content.module \content_form_alter()
Implementation of hook_form_alter().
File
- ./
content.module, line 434 - Allows administrators to associate custom fields to content types.
Code
function content_form_alter(&$form, $form_state, $form_id) {
if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) {
module_load_include('inc', 'content', 'includes/content.node_form');
// Merge field widgets.
$form = array_merge($form, content_form($form, $form_state));
// Adjust weights for non-CCK fields.
$type = content_types($form['type']['#value']);
foreach ($type['extra'] as $key => $value) {
if (isset($form[$key])) {
$form[$key]['#weight'] = $value['weight'];
// Special case for the 'menu path' fieldset : we keep it
// just below the title.
if ($key == 'title' && isset($form['menu'])) {
$form['menu']['#weight'] = $value['weight'] + 0.1;
}
}
}
}
}