You are here

function biblio_implode_keywords in Bibliography Module 6.2

Same name and namespace in other branches
  1. 6 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()

Parameters

$keywords:

$sep: (optional)

Return value

string

2 calls to biblio_implode_keywords()
biblio_form in ./biblio.module
Implements hook_form().
biblio_insert_keywords in includes/biblio.keywords.inc

File

includes/biblio.keywords.inc, line 349
Keywords related functions for Drupal biblio module.

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;
}