View source
<?php
function biblio_style_cse_info() {
return array(
'cse' => 'Council of Science Editors (CSE)',
);
}
function biblio_style_cse_author_options() {
$author_options = array(
'BetweenAuthorsDelimStandard' => ', ',
'BetweenAuthorsDelimLastAuthor' => ', ',
'AuthorsInitialsDelimFirstAuthor' => ' ',
'AuthorsInitialsDelimStandard' => ' ',
'betweenInitialsDelim' => '',
'initialsBeforeAuthorFirstAuthor' => FALSE,
'initialsBeforeAuthorStandard' => FALSE,
'shortenGivenNames' => TRUE,
'numberOfAuthorsTriggeringEtAl' => 10,
'includeNumberOfAuthors' => 10,
'customStringAfterFirstAuthors' => ' et al.',
'encodeHTML' => TRUE,
);
return $author_options;
}
function biblio_style_cse($biblio) {
$wrapper = biblio_wrapper($biblio);
$title = $wrapper->biblio_title
->value();
$secondary_title = $wrapper->biblio_title_secondary
->value();
$year = $wrapper->biblio_year
->value();
$volume = $wrapper->biblio_volume
->value();
$issue = $wrapper->biblio_issue
->value();
$pages = $wrapper->biblio_pages
->value();
$citekey = $wrapper->biblio_citekey
->value();
module_load_include('inc', 'biblio', '/includes/biblio.contributors');
$output = $authors = '';
if (!empty($biblio->biblio_authors_primary)) {
$primary_authors = $biblio->biblio_authors_primary[$biblio->language];
$author_options = biblio_style_cse_author_options();
}
if (!empty($biblio->biblio_authors_secondary)) {
$editors = $biblio->biblio_authors_secondary[$biblio->language];
}
if (!empty($biblio->biblio_authors_corporate)) {
$corp_authors = $biblio->biblio_authors_corporate[$biblio->language];
}
if (!empty($primary_authors)) {
$authors = theme('biblio_format_authors', array(
'contributors' => $primary_authors,
'options' => $author_options,
));
}
if (empty($authors) && !empty($corp_authors)) {
foreach ($corp_authors as $rank => $author) {
$authors .= empty($authors) ? '' : ', ';
$authors .= variable_get('biblio_author_links', 1) ? theme('biblio_author_link', array(
'author' => $author,
)) : $author['name'];
}
}
if (empty($authors)) {
$authors = '[' . t('Anonymous') . ']';
}
if (!empty($citekey) && variable_get('biblio_display_citation_key', 0)) {
$output .= '[' . check_plain($citekey) . '] ';
}
$output .= '<span class="biblio-authors">' . $authors . "</span>. \n";
switch ($biblio->publication_type) {
default:
if (isset($year)) {
$output .= check_plain($year) . ". ";
}
$output .= '<span class="biblio-title">';
$url = biblio_get_title_url_info($biblio);
$output .= l($title, $url['link'], $url['options']);
$output .= strpos($title, '?') ? " </span>" : ". </span>";
$output .= !empty($secondary_title) ? check_plain($secondary_title) . '. ' : '';
$output .= !empty($volume) ? check_plain($volume) : '';
$output .= !empty($issue) ? '(' . check_plain($issue) . ')' : '';
$output .= !empty($pages) ? ':' . str_replace(" ", "", check_plain($pages)) . '.' : '';
break;
}
return filter_xss($output, biblio_get_allowed_tags());
}