You are here

function biblio_implode_keywords in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 includes/biblio.keywords.inc \biblio_implode_keywords()
  2. 7 includes/biblio.keywords.inc \biblio_implode_keywords()
  3. 7.2 includes/biblio.keywords.inc \biblio_implode_keywords()
2 calls to biblio_implode_keywords()
biblio_form in ./biblio.module
Implementation of hook_form().
biblio_insert_keywords in ./biblio.keywords.inc

File

./biblio.keywords.inc, line 283

Code

function biblio_implode_keywords($keywords, $sep = '') {
  if (empty($sep)) {
    $sep = check_plain(variable_get('biblio_keyword_sep', ','));
  }
  $string = '';
  foreach ($keywords as $kid => $keyword) {
    $string .= strlen($string) ? "{$sep} " : '';
    if (strpos($keyword, $sep) !== FALSE) {
      $string .= '"' . $keyword . '"';
    }
    else {
      $string .= $keyword;
    }
  }
  return $string;
}