You are here

function nodewords_custom_pages_edit_submit in Nodewords: D6 Meta Tags 6

Same name and namespace in other branches
  1. 6.2 nodewords_custom_pages/nodewords_custom_pages.admin.inc \nodewords_custom_pages_edit_submit()

Submission function for the meta tags edit page.

File

./nodewords.admin.inc, line 224
Administration interface for nodewords.module.

Code

function nodewords_custom_pages_edit_submit($form, &$form_state) {
  $form_state['values']['path'] = trim($form_state['values']['path']);
  $row = new stdClass();
  if (isset($form_state['values']['pid'])) {
    $row->pid = $form_state['values']['pid'];
  }
  $row->name = $form_state['values']['name'];
  $row->path = $form_state['values']['path'];
  $row->weight = $form_state['values']['weight'];
  $row->enabled = $form_state['values']['enabled'];
  drupal_write_record('nodewords_custom', $row, isset($row->pid) ? 'pid' : array());
  nodewords_save_tags(NODEWORDS_TYPE_PAGE, $row->pid, $form_state['values']['nodewords'], TRUE);
  drupal_set_message(t('The configuration options have been saved.'));
  $form_state['values']['pid'] = $row->pid;
  $form_state['redirect'] = 'admin/content/nodewords/meta-tags/custom';
}