function basicevent_form in Event 5
Implementation of hook_form().
File
- contrib/
basicevent.module, line 63 - An extremly simple module to implement the event API.
Code
function basicevent_form(&$node) {
// warn them if this isn't set to appear in the calendar
if (variable_get('event_nodeapi_event', 'never') == 'never') {
$link = l(t('event content-type settings page'), 'admin/content/types/event');
drupal_set_message(t('The event node is currently set to never appear in the calendar. You will not be able to set the start and end dates until an administrator changes the content-type settings. This is done using the !link.', array(
'!link' => $link,
)));
}
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#default_value' => $node->title,
'#size' => 60,
'#maxlength' => 128,
'#required' => TRUE,
);
$form['body_filter']['body'] = array(
'#type' => 'textarea',
'#title' => t('Body'),
'#default_value' => $node->body,
'#rows' => 20,
'#required' => TRUE,
);
$form['body_filter']['format'] = filter_form($node->format);
return $form;
}