| 1 |
<?php
|
| 2 |
// $Id: biblio.type.mapper.inc,v 1.1.2.2 2009/07/22 18:20:51 rjerome Exp $
|
| 3 |
function biblio_get_type_map($file_format, $default = FALSE) {
|
| 4 |
if ($default) {
|
| 5 |
switch ($file_format) {
|
| 6 |
case 'bibtex':
|
| 7 |
return $map = array(
|
| 8 |
'article' => 102,
|
| 9 |
'book' => 100,
|
| 10 |
'booklet' => 129,
|
| 11 |
'conference' => 103,
|
| 12 |
'inbook' => 101,
|
| 13 |
'incollection' => 101,
|
| 14 |
'inproceedings' => 103,
|
| 15 |
'manual' => 129,
|
| 16 |
'mastersthesis' => 108,
|
| 17 |
'misc' => 129,
|
| 18 |
'phdthesis' => 108,
|
| 19 |
'proceedings' => 104,
|
| 20 |
'techreport' => 129,
|
| 21 |
'unpublished' => 124,
|
| 22 |
);
|
| 23 |
case 'tagged':
|
| 24 |
return $map = array(
|
| 25 |
"Journal Article" => 102,
|
| 26 |
"Conference Paper" => 103,
|
| 27 |
"Conference Proceedings" => 104,
|
| 28 |
"Report" => 109,
|
| 29 |
"Book" => 100,
|
| 30 |
"Edited Book" => 100,
|
| 31 |
"Book Section" => 101,
|
| 32 |
"Thesis" => 108,
|
| 33 |
"Patent" => 119,
|
| 34 |
"Generic" => 129,
|
| 35 |
"Newspaper Article" => 105,
|
| 36 |
"Web Page" => 107,
|
| 37 |
"Film or Broadcast" => 110,
|
| 38 |
"Artwork" => 112,
|
| 39 |
"Audiovisual Material" => 114,
|
| 40 |
"Hearing" => 115,
|
| 41 |
"Case" => 116,
|
| 42 |
"Bill" => 117,
|
| 43 |
"Statute" => 118,
|
| 44 |
"Personal Communication" => 120,
|
| 45 |
"Manuscript" => 121,
|
| 46 |
"Map" => 122,
|
| 47 |
"Chart or Table" => 123,
|
| 48 |
"Unpublished Work" => 124,
|
| 49 |
"Online Database" => 125,
|
| 50 |
"Government Document" => 126,
|
| 51 |
"Classical Work" => 127,
|
| 52 |
"Legal Rule or Regulation" => 128,
|
| 53 |
);
|
| 54 |
case 'ris':
|
| 55 |
return $map = array(
|
| 56 |
'ABST' => 129,
|
| 57 |
'ADVS' => 114,
|
| 58 |
'ART' => 112,
|
| 59 |
'BILL' => 117,
|
| 60 |
'BOOK' => 100,
|
| 61 |
'CASE' => 116,
|
| 62 |
'CHAP' => 101,
|
| 63 |
'COMP' => 113,
|
| 64 |
'CONF' => 103,
|
| 65 |
'CTLG' => 129,
|
| 66 |
'DATA' => 125,
|
| 67 |
'ELEC' => 129,
|
| 68 |
'GEN' => 129,
|
| 69 |
'HEAR' => 115,
|
| 70 |
'ICOMM' => 107,
|
| 71 |
'INPR' => 129,
|
| 72 |
'JFULL' => 129,
|
| 73 |
'JOUR' => 102,
|
| 74 |
'MAP' => 122,
|
| 75 |
'MGZN' => 106,
|
| 76 |
'MPCT' => 110,
|
| 77 |
'MUSIC' => 129,
|
| 78 |
'NEWS' => 105,
|
| 79 |
'PAMP' => 129,
|
| 80 |
'PAT' => 119,
|
| 81 |
'PCOMM' => 120,
|
| 82 |
'RPRT' => 109,
|
| 83 |
'SER' => 100,
|
| 84 |
'SLIDE' => 129,
|
| 85 |
'SOUND' => 129,
|
| 86 |
'STAT' => 125,
|
| 87 |
'THES' => 108,
|
| 88 |
'UNBILl' => 129,
|
| 89 |
'UNPB' => 124,
|
| 90 |
'VIDEO' => 129,
|
| 91 |
);
|
| 92 |
case 'endnote7':
|
| 93 |
return $map = array(
|
| 94 |
0 => 102, // Journal Article
|
| 95 |
1 => 100, // Book
|
| 96 |
2 => 108, // Thesis
|
| 97 |
3 => 103, // Conference Proceedings
|
| 98 |
4 => 120, // Personal Communication
|
| 99 |
5 => 105, // NewsPaper Article
|
| 100 |
6 => 113, // Computer Program
|
| 101 |
7 => 101, // Book Section
|
| 102 |
8 => 106, // Magazine Article
|
| 103 |
9 => 100, // Edited Book
|
| 104 |
10 => 109, // Report
|
| 105 |
11 => 122, // Map
|
| 106 |
12 => 114, // Audiovisual Material
|
| 107 |
13 => 112, // Artwork
|
| 108 |
15 => 119, // Patent
|
| 109 |
16 => 107, // Electronic Source
|
| 110 |
17 => 117, // Bill
|
| 111 |
18 => 116, // Case
|
| 112 |
19 => 115, // Hearing
|
| 113 |
20 => 121, // Manuscript
|
| 114 |
21 => 110, // Film or Broadcast
|
| 115 |
22 => 118, // Statute
|
| 116 |
26 => 123, // Chart or Table
|
| 117 |
31 => 129 // Generic
|
| 118 |
);
|
| 119 |
case 'endnote8':
|
| 120 |
return $map = array(
|
| 121 |
2 => 112, // artwork
|
| 122 |
3 => 114, // Audio Visual
|
| 123 |
4 => 117, // bill
|
| 124 |
5 => 101, // Book Section
|
| 125 |
6 => 100, // Book
|
| 126 |
7 => 116, // case
|
| 127 |
9 => 113, // software
|
| 128 |
17 => 102, // Journal Article
|
| 129 |
10 => 104, // Conference Proceeding
|
| 130 |
12 => 107, // web page
|
| 131 |
13 => 129, // Generic
|
| 132 |
14 => 115, // hearing
|
| 133 |
19 => 106, // magazine_article
|
| 134 |
20 => 122, // map
|
| 135 |
21 => 110, // film
|
| 136 |
21 => 111, // broadcast
|
| 137 |
23 => 105, // newspaper_article
|
| 138 |
25 => 119, // patent
|
| 139 |
26 => 120, // personal communication
|
| 140 |
27 => 109, // Report
|
| 141 |
28 => 129, // Edited Book
|
| 142 |
31 => 118, // statute
|
| 143 |
32 => 108, // Thesis
|
| 144 |
34 => 124, // unpublished
|
| 145 |
36 => 121, // manuscript
|
| 146 |
37 => 129, // figure
|
| 147 |
38 => 123, // chart
|
| 148 |
39 => 129, // equation
|
| 149 |
43 => 129, // electronic article
|
| 150 |
44 => 129, // electronic book
|
| 151 |
45 => 125, // online database
|
| 152 |
46 => 126, // government_document
|
| 153 |
47 => 103, // conference_paper
|
| 154 |
48 => 129, // online multimedia
|
| 155 |
49 => 127, // Classical Work
|
| 156 |
50 => 128, // legal_ruling
|
| 157 |
52 => 129, // Dictionary
|
| 158 |
53 => 129, // Encyclopedia
|
| 159 |
54 => 129, // Grant
|
| 160 |
);
|
| 161 |
case 'unixref':
|
| 162 |
return $map = array(
|
| 163 |
'error' => 0,
|
| 164 |
'book' => 100, // Book
|
| 165 |
'journal' => 102, // Journal Article
|
| 166 |
'standard' => 129, // Generic
|
| 167 |
'conference' => 103, // conference_paper
|
| 168 |
'report-paper' => 109, // Report
|
| 169 |
'dissertation' => 108, // Thesis
|
| 170 |
'database' => 125, // online database
|
| 171 |
'sa_component' => 129
|
| 172 |
);
|
| 173 |
}
|
| 174 |
}
|
| 175 |
else {
|
| 176 |
$map = variable_get('biblio_'.$file_format.'_type_map', array());
|
| 177 |
if (empty($map)) $map = biblio_get_type_map($file_format, TRUE);
|
| 178 |
return $map;
|
| 179 |
|
| 180 |
}
|
| 181 |
}
|
| 182 |
function biblio_get_type_names($file_format, $default = FALSE) {
|
| 183 |
if ($default) {
|
| 184 |
switch ($file_format) {
|
| 185 |
case 'bibtex':
|
| 186 |
return $names = array(
|
| 187 |
'article' => 'An article from a journal',
|
| 188 |
'book' => 'A book with an explicit publisher',
|
| 189 |
'booklet' => 'A work that is printed and bound, but without a named publisher or sponsoring institution',
|
| 190 |
'conference' => 'An article in a conference proceedings',
|
| 191 |
'inbook' => 'A part of a book, usually untitled. May be a chapter (or section or whatever) and/or a range of pages',
|
| 192 |
'incollection' => 'A part of a book having its own title',
|
| 193 |
'inproceedings' => 'An article in a conference proceedings',
|
| 194 |
'manual' => 'Technical documentation',
|
| 195 |
'mastersthesis' => 'A Master\'s thesis',
|
| 196 |
'misc' => 'For use when nothing else fits',
|
| 197 |
'phdthesis' => 'A Ph.D. thesis',
|
| 198 |
'proceedings' => 'The proceedings of a conference',
|
| 199 |
'techreport' => 'A report published by a school or other institution, usually numbered within a series',
|
| 200 |
'unpublished' => 'A document having an author and title, but not formally published',
|
| 201 |
);
|
| 202 |
case 'tagged':
|
| 203 |
return $names = array(
|
| 204 |
"Journal Article" => "Journal Article",
|
| 205 |
"Conference Paper" => "Conference Paper",
|
| 206 |
"Conference Proceedings" => "Conference Proceedings",
|
| 207 |
"Report" => "Report",
|
| 208 |
"Book" => "Book",
|
| 209 |
"Edited Book" => "Edited Book",
|
| 210 |
"Book Section" => "Book Section",
|
| 211 |
"Thesis" => "Thesis",
|
| 212 |
"Patent" => "Patent",
|
| 213 |
"Generic" => "Generic",
|
| 214 |
"Newspaper Article" => "Newspaper Article",
|
| 215 |
"Web Page" => "Web Page",
|
| 216 |
"Film or Broadcast" => "Film or Broadcast",
|
| 217 |
"Artwork" => "Artwork",
|
| 218 |
"Audiovisual Material" => "Audiovisual Material",
|
| 219 |
"Hearing" => "Hearing",
|
| 220 |
"Case" => "Case",
|
| 221 |
"Bill" => "Bill",
|
| 222 |
"Statute" => "Statute",
|
| 223 |
"Personal Communication" => "Personal Communication",
|
| 224 |
"Manuscript" => "Manuscript",
|
| 225 |
"Map" => "Map",
|
| 226 |
"Chart or Table" => "Chart or Table",
|
| 227 |
"Unpublished Work" => "Unpublished Work",
|
| 228 |
"Online Database" => "Online Database",
|
| 229 |
"Government Document" => "Government Document",
|
| 230 |
"Classical Work" => "Classical Work",
|
| 231 |
"Legal Rule or Regulation" => "Legal Rule or Regulation",
|
| 232 |
);
|
| 233 |
case 'ris':
|
| 234 |
return $names = array(
|
| 235 |
'ABST' => 'Abstract',
|
| 236 |
'ADVS' => 'Audiovisual material',
|
| 237 |
'ART' => 'Art Work',
|
| 238 |
'BILL' => 'Bill/Resolution',
|
| 239 |
'BOOK' => 'Book, Whole',
|
| 240 |
'CASE' => 'Case',
|
| 241 |
'CHAP' => 'Book chapter',
|
| 242 |
'COMP' => 'Computer program',
|
| 243 |
'CONF' => 'Conference proceeding',
|
| 244 |
'CTLG' => 'Catalog',
|
| 245 |
'DATA' => 'Data file',
|
| 246 |
'ELEC' => 'Electronic Citation',
|
| 247 |
'GEN' => 'Generic',
|
| 248 |
'HEAR' => 'Hearing',
|
| 249 |
'ICOMM' => 'Internet Communication',
|
| 250 |
'INPR' => 'In Press',
|
| 251 |
'JFULL' => 'Journal (full)',
|
| 252 |
'JOUR' => 'Journal',
|
| 253 |
'MAP' => 'Map',
|
| 254 |
'MGZN' => 'Magazine article',
|
| 255 |
'MPCT' => 'Motion picture',
|
| 256 |
'MUSIC' => 'Music score',
|
| 257 |
'NEWS' => 'Newspaper',
|
| 258 |
'PAMP' => 'Pamphlet',
|
| 259 |
'PAT' => 'Patent',
|
| 260 |
'PCOMM' => 'Personal communication',
|
| 261 |
'RPRT' => 'Report',
|
| 262 |
'SER' => 'Serial (Book, Monograph)',
|
| 263 |
'SLIDE' => 'Slide',
|
| 264 |
'SOUND' => 'Sound recording',
|
| 265 |
'STAT' => 'Statute',
|
| 266 |
'THES' => 'Thesis/Dissertation',
|
| 267 |
'UNBILl' => 'Unenacted bill/resolution',
|
| 268 |
'UNPB' => 'Unpublished work',
|
| 269 |
'VIDEO' => 'Video recording',
|
| 270 |
);
|
| 271 |
case 'endnote7':
|
| 272 |
return $names = array(
|
| 273 |
0 => 'Journal Article',
|
| 274 |
1 => 'Book',
|
| 275 |
2 => 'Thesis',
|
| 276 |
3 => 'Conference Proceedings',
|
| 277 |
4 => 'Personal Communication',
|
| 278 |
5 => 'NewsPaper Article',
|
| 279 |
6 => 'Computer Program',
|
| 280 |
7 => 'Book Section',
|
| 281 |
8 => 'Magazine Article',
|
| 282 |
9 => 'Edited Book',
|
| 283 |
10 => 'Report',
|
| 284 |
11 => 'Map',
|
| 285 |
12 => 'Audiovisual Material',
|
| 286 |
13 => 'Artwork',
|
| 287 |
15 => 'Patent',
|
| 288 |
16 => 'Electronic Source',
|
| 289 |
17 => 'Bill',
|
| 290 |
18 => 'Case',
|
| 291 |
19 => 'Hearing',
|
| 292 |
20 => 'Manuscript',
|
| 293 |
21 => 'Film or Broadcast',
|
| 294 |
22 => 'Statute',
|
| 295 |
26 => 'Chart or Table',
|
| 296 |
31 => 'Generic',
|
| 297 |
);
|
| 298 |
|
| 299 |
case 'endnote8':
|
| 300 |
return $names = array(
|
| 301 |
2 => 'Artwork',
|
| 302 |
3 => 'Audio Visual',
|
| 303 |
4 => 'Bill',
|
| 304 |
5 => 'Book Section',
|
| 305 |
6 => 'Book',
|
| 306 |
7 => 'Case',
|
| 307 |
9 => 'Software',
|
| 308 |
17 => 'Journal Article',
|
| 309 |
10 => 'Conference Proceeding',
|
| 310 |
12 => 'Web page',
|
| 311 |
13 => 'Generic',
|
| 312 |
14 => 'Hearing',
|
| 313 |
19 => 'Magazine Article',
|
| 314 |
20 => 'Map',
|
| 315 |
21 => 'Film',
|
| 316 |
21 => 'Broadcast',
|
| 317 |
23 => 'Newspaper Article',
|
| 318 |
25 => 'Patent',
|
| 319 |
26 => 'Personal Communication',
|
| 320 |
27 => 'Report',
|
| 321 |
28 => 'Edited Book',
|
| 322 |
31 => 'Statute',
|
| 323 |
32 => 'Thesis',
|
| 324 |
34 => 'Unpublished',
|
| 325 |
36 => 'Manuscript',
|
| 326 |
37 => 'Figure',
|
| 327 |
38 => 'Chart',
|
| 328 |
39 => 'Equation',
|
| 329 |
43 => 'Electronic Article',
|
| 330 |
44 => 'Electronic Book',
|
| 331 |
45 => 'Online Database',
|
| 332 |
46 => 'Government Document',
|
| 333 |
47 => 'Conference Paper',
|
| 334 |
48 => 'Online Multimedia',
|
| 335 |
49 => 'Classical Work',
|
| 336 |
50 => 'Legal Ruling',
|
| 337 |
52 => 'Dictionary',
|
| 338 |
53 => 'Encyclopedia',
|
| 339 |
54 => 'Grant',
|
| 340 |
);
|
| 341 |
case 'unixref':
|
| 342 |
return $name = array(
|
| 343 |
'error' => 'Error',
|
| 344 |
'book' => 'Book',
|
| 345 |
'journal' => 'Journal Article',
|
| 346 |
'standard' => 'Generic',
|
| 347 |
'conference' => 'Conference Paper',
|
| 348 |
'report-paper' => 'Report',
|
| 349 |
'dissertation' => 'Thesis',
|
| 350 |
'database' => 'Online database',
|
| 351 |
'sa_component' => 'SA Component',
|
| 352 |
);
|
| 353 |
}
|
| 354 |
}
|
| 355 |
else {
|
| 356 |
$names = variable_get('biblio_'.$file_format.'_type_names', array());
|
| 357 |
if (empty($names)) $names = biblio_get_type_names($file_format, TRUE);
|
| 358 |
return $names;
|
| 359 |
}
|
| 360 |
}
|