You are here

function hosting_site_data_form_alter in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 example/site_data/hosting_site_data.module \hosting_site_data_form_alter()
  2. 7.3 example/site_data/hosting_site_data.module \hosting_site_data_form_alter()

Implementation of hook_form_alter()

File

example/site_data/hosting_site_data.module, line 7

Code

function hosting_site_data_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'site_node_form') {
    $form['site_data'] = array(
      '#type' => 'fieldset',
      '#title' => t('Site data example'),
      '#description' => t('Example implementation of saving data into the site context.'),
    );
    $form['site_data']['site_data'] = array(
      '#type' => 'textfield',
      '#title' => t('Site data'),
      '#default_value' => $form['#node']->site_data ? $form['#node']->site_data : '',
      '#weight' => 0,
    );
    return $form;
  }
}