18.10.2016 Views

Drupal 7 Module Development

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Installation Profiles<br />

The form function will look a little different than a normal form function:<br />

function store_configure_contact_form($form, &$form_state, &$install_<br />

state) {<br />

drupal_set_title(t('Default site contact information'));<br />

$form['recipients'] = array(<br />

'#type' => 'textarea',<br />

'#title' => t('Recipients'),<br />

'#default_value' => '',<br />

'#description' => t("Example: 'webmaster@example.com' or 'sales@<br />

example.com,support@example.com' . To specify multiple recipients,<br />

separate each e-mail address with a comma."),<br />

'#required' => TRUE,<br />

);<br />

$form['reply'] = array(<br />

'#type' => 'textarea',<br />

'#title' => t('Auto-reply'),<br />

'#default_value' => '',<br />

'#description' => t('Optional auto-reply. Leave empty if you do<br />

not want to send the user an auto-reply message.'),<br />

);<br />

$form['submit'] = array(<br />

'#type' => 'submit',<br />

'#value' => t('Save'),<br />

);<br />

return $form;<br />

}<br />

[ 352 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!