/[drupal]/contributions/modules/biblio/biblio_style_cse.inc
ViewVC logotype

Contents of /contributions/modules/biblio/biblio_style_cse.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.25 - (show annotations) (download) (as text)
Thu Oct 1 01:45:42 2009 UTC (8 weeks, 2 days ago) by rjerome
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-7--1
Changes since 1.24: +5 -6 lines
File MIME type: text/x-php
merged changes from 6--1 to HEAD
1 <?php
2
3 // $Id: biblio_style_cse.inc,v 1.24 2009/06/25 18:23:09 rjerome Exp $
4 /**
5 * Get the style information
6 *
7 * @return
8 * The name of the style
9 */
10 function biblio_style_cse_info() {
11 return array (
12 'cse' => 'Council of Science Editors (CSE)'
13 );
14 }
15 /**
16 * Apply a bibliographic style to the node
17 *
18 *
19 * @param $node
20 * An object containing the node data to render
21 * @param $base
22 * The base URL of the biblio module (defaults to /biblio)
23 * @param $inline
24 * A logical value indicating if this is being rendered within the
25 * Drupal framwork (false) or we are just passing back the html (true)
26 * @return
27 * The styled biblio entry
28 */
29 function biblio_style_cse_author_options() {
30 $author_options = array(
31 'BetweenAuthorsDelimStandard' =>', ', //4
32 'BetweenAuthorsDelimLastAuthor' => ', ', //5
33 'AuthorsInitialsDelimFirstAuthor' => ', ', //7
34 'AuthorsInitialsDelimStandard' => ' ', //8
35 'betweenInitialsDelim' => '', //9
36 'initialsBeforeAuthorFirstAuthor' => false, //10
37 'initialsBeforeAuthorStandard' => FALSE, //11
38 'shortenGivenNames' => TRUE, //12
39 'numberOfAuthorsTriggeringEtAl' => 10, //13
40 'includeNumberOfAuthors' => 10, //14
41 'customStringAfterFirstAuthors' => ' et al.',//15
42 'encodeHTML' => true
43 );
44 return $author_options;
45 }
46
47 function biblio_style_cse($node, $base = 'biblio', $inline = false) {
48 $author_options = biblio_style_cse_author_options();
49 $authors = theme('biblio_format_authors', $node->biblio_contributors[1], $author_options, $inline);
50 if (empty($authors) && count($node->biblio_contributors[5])) {// if no authors substitute corp author if available
51 foreach ($node->biblio_contributors[5] as $rank => $author) {
52 $authors .= (empty($authors)) ? '' : ', ';
53 $authors .= (variable_get('biblio_author_links', 1)) ? theme('biblio_author_link',$author['name'], $author['cid'], variable_get('biblio_base', 'biblio'), $inline) : $author['name'];
54 }
55 }
56 if (empty($authors)) $authors = '[' . t('Anonymous') . ']'; // use anonymous if we still have nothing.
57 if (!empty ($node->biblio_citekey)&&(variable_get('biblio_display_citation_key',0))) {
58 $output .= '[' . check_plain($node->biblio_citekey) . '] ';
59 }
60 $output .= '<span class="biblio-authors">' . $authors . "</span>.&nbsp; \n";
61 switch ($node->biblio_type) {
62
63 default :
64 if (isset ($node->biblio_year)) {
65 $output .= check_plain($node->biblio_year) . ".&nbsp;&nbsp;";
66 }
67 $output .= '<span class="biblio-title">';
68 $url = biblio_get_title_url_info($node);
69 $output .= l($node->title, $url['link'], $url['options']);
70 $output .= (strpos($node->title, '?'))? " </span>" : ". </span>"; // if the title ends in a question mark, don't put a period after it.
71 $output .= (!empty ($node->biblio_secondary_title)) ? check_plain($node->biblio_secondary_title) . '. ' : '';
72 $output .= (!empty ($node->biblio_volume)) ? check_plain($node->biblio_volume) : '';
73 $output .= (!empty ($node->biblio_issue)) ? '(' . check_plain($node->biblio_issue) . ')' : '';
74 $output .= (!empty ($node->biblio_pages)) ? ':' . str_replace(" ", "", check_plain($node->biblio_pages)) . '.' : '';
75 break; // generic
76 }
77 /* if ($node->biblio_date) $output .= ', '. check_plain($node->biblio_date);
78 if ($node->biblio_number) $output .= ', Number '. check_plain($node->biblio_number);
79
80 if ($node->biblio_place_published) $output .= ', '. check_plain($node->biblio_place_published);
81 */
82 return filter_xss($output, biblio_get_allowed_tags());
83
84 }

  ViewVC Help
Powered by ViewVC 1.1.2