You are here

function hosting_alias_add_alias_submit in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 alias/hosting_alias.module \hosting_alias_add_alias_submit()
  2. 7.3 alias/hosting_alias.module \hosting_alias_add_alias_submit()

Callback to handle "Add Alias" button

1 string reference to 'hosting_alias_add_alias_submit'
hosting_alias_form_data in alias/hosting_alias.module
Alter the node form for a site to add the aliases and redirection items.

File

alias/hosting_alias.module, line 193
Allow sites to have domain aliases that they can be accessed with.

Code

function hosting_alias_add_alias_submit($form, &$form_state) {

  // Set the form to rebuild and run submit handlers.
  node_form_submit_build_node($form, $form_state);

  // Make the changes we want to the form state.
  if ($form_state['values']['add_alias']) {
    $form_state['values']['aliases'] = array_filter($form_state['values']['aliases']);
    $form_state['alias_count'] = max(count($form_state['values']['aliases']), 1);
  }
}