You are here

function biblio_admin_author_edit_form_link_submit in Bibliography Module 7

_state

Parameters

$form:

File

includes/biblio.admin.inc, line 2519
biblio.admin.inc

Code

function biblio_admin_author_edit_form_link_submit($form, &$form_state) {
  module_load_include('inc', 'biblio', 'includes/biblio.contributors');
  $linked_authors = array();
  $link_authors = '';
  if (isset($form_state['values']['linked_authors'])) {
    $linked_authors = $form_state['values']['linked_authors'];
  }
  if (isset($form_state['values']['link_authors'])) {
    $link_authors = $form_state['values']['link_authors'];
  }
  foreach ($linked_authors as $key => $value) {
    if ($value == 0) {
      db_update('biblio_contributor_data')
        ->fields(array(
        'aka' => $value,
      ))
        ->condition('cid', $key)
        ->execute();
    }
  }
  if (!empty($link_authors)) {
    if ($cid = biblio_get_cid_by_name($link_authors)) {
      db_update('biblio_contributor_data')
        ->fields(array(
        'aka' => $form_state['values']['cid'],
      ))
        ->condition('cid', $cid)
        ->execute();
    }
  }
}