function date_copy_type_misc_form in Date 6
Same name and namespace in other branches
- 5.2 date_copy/date_copy.module \date_copy_type_misc_form()
- 5 date_copy.module \date_copy_type_misc_form()
A form to select miscellaneous other options for a content type.
1 call to date_copy_type_misc_form()
- date_copy_import_ical_form in date_copy/
date_copy.module - iCal import form.
File
- date_copy/
date_copy.module, line 177
Code
function date_copy_type_misc_form($type) {
$form = array();
$vocabs = taxonomy_get_vocabularies($type);
if ($vocabs && count($vocabs) > 0) {
$taxonomy = isset($taxonomy) ? $taxonomy : array();
$node = (object) array(
'type' => $type,
'taxonomy' => date_import_taxonomy_form2node($taxonomy),
);
$subform = array(
'type' => array(
'#value' => $type,
),
'#node' => $node,
);
taxonomy_form_alter($subform, array(), $type . '_node_form');
$form['taxonomy'] = array(
'#type' => 'fieldset',
'#title' => t('Categories'),
'#description' => t('Select the categories that should be used for the imported nodes.'),
);
$form['taxonomy'] += $subform['taxonomy'];
}
if (module_exists('og')) {
og_form_add_og_audience($form_id, $form);
}
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Authored by'),
'#maxlength' => 60,
'#autocomplete_path' => 'user/autocomplete',
'#default_value' => $node->name ? $node->name : '',
'#description' => t('Leave blank for %anonymous.', array(
'%anonymous' => variable_get('anonymous', t('Anonymous')),
)),
);
$form['status'] = array(
'#type' => 'checkbox',
'#title' => t('Published'),
'#default_value' => $node->status,
);
$form['promote'] = array(
'#type' => 'checkbox',
'#title' => t('Promoted to front page'),
'#default_value' => $node->promote,
);
$form['sticky'] = array(
'#type' => 'checkbox',
'#title' => t('Sticky at top of lists'),
'#default_value' => $node->sticky,
);
$form['revision'] = array(
'#type' => 'checkbox',
'#title' => t('Create new revision'),
'#default_value' => $node->revision,
);
return $form;
}