You are here

function biblio_save_keyword in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 includes/biblio.keywords.inc \biblio_save_keyword()
  2. 6 biblio.keywords.inc \biblio_save_keyword()
  3. 7.2 includes/biblio.keywords.inc \biblio_save_keyword()

Parameters

$word:

2 calls to biblio_save_keyword()
BiblioKeywordWebTestCase::createKeyword in tests/BiblioKeywordWebTestCase.test
Returns a new keyword with random properties.
biblio_insert_keywords in includes/biblio.keywords.inc
Insert keywords into the database.

File

includes/biblio.keywords.inc, line 286
Contains all keyword related functions.

Code

function biblio_save_keyword(&$keyword) {
  if (!empty($keyword['kid']) && $keyword['word']) {
    drupal_write_record('biblio_keyword_data', $keyword, 'kid');
    $status = SAVED_UPDATED;
  }
  else {
    drupal_write_record('biblio_keyword_data', $keyword);
    $status = SAVED_NEW;
  }
  return $status;
}