You are here

function alinks_add_form_submit in Alinks 7

Same name and namespace in other branches
  1. 6 alinks.module \alinks_add_form_submit()

Submit the form used to add alinks and insert the data in the db

File

./alinks.module, line 353
this module allows users to associates defined text to links

Code

function alinks_add_form_submit($form, &$form_state) {
  db_insert('alinks')
    ->fields(array(
    'alink_start_boundary' => $form_state['values']['start_boundary'],
    'alink_text' => $form_state['values']['word'],
    'alink_end_boundary' => $form_state['values']['end_boundary'],
    'alink_case_insensitive' => $form_state['values']['case_insensitive'],
    'alink_url' => $form_state['values']['url'],
    'url_title' => $form_state['values']['url_title'],
    'alink_external' => $form_state['values']['external'],
    'alink_class' => $form_state['values']['class'],
    'alink_weight' => $form_state['values']['weight'],
  ))
    ->execute();
  drupal_set_message('Alink succesfuly added');
  $form_state['redirect'] = 'admin/structure/alinks/edit';
}