function vote_storylink_form in Vote Up/Down 5
Implementation of hook_form().
File
- ./
vote_storylink.module, line 129
Code
function vote_storylink_form(&$node, &$param) {
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#required' => TRUE,
'#default_value' => $node->title,
'#maxlength' => 96,
'#description' => t("Title of the story the link goes to, max 96 characters."),
'#weight' => -18,
);
$form['vote_storylink_url'] = array(
'#type' => 'textfield',
'#title' => t('URL'),
'#default_value' => $node->vote_storylink[0]['url'],
'#maxlength' => 256,
'#required' => TRUE,
'#description' => t('The URL/address of the story.'),
'#validate' => array(
'_vote_storylink_valid_url' => array(
'vote_storylink_url',
),
),
'#weight' => -17,
);
$form['body_filter']['body'] = array(
'#type' => 'textarea',
'#title' => t('Description'),
'#default_value' => $node->body,
'#required' => FALSE,
'#rows' => 5,
'#maxlength' => 600,
'#resizable' => TRUE,
'#description' => t('A short description of the story. It should be around 2 to 4 sentences.'),
'#weight' => -16,
);
$form['body_filter']['filter'] = filter_form($node->format);
return $form;
}