Class ilBibTex.
More...
◆ convertBibSpecialChars()
ilBibTex::convertBibSpecialChars |
( |
| ) |
|
|
protected |
Definition at line 115 of file class.ilBibTex.php.
References ilBibliograficFileReaderBase\getFileContent(), and ilBibliograficFileReaderBase\setFileContent().
Referenced by parseContent().
116 $bibtex_special_chars[
'ä'] =
'{\"a}';
117 $bibtex_special_chars[
'ë'] =
'{\"e}';
118 $bibtex_special_chars[
'ï'] =
'{\"i}';
119 $bibtex_special_chars[
'ö'] =
'{\"o}';
120 $bibtex_special_chars[
'ü'] =
'{\"u}';
121 $bibtex_special_chars[
'Ä'] =
'{\"A}';
122 $bibtex_special_chars[
'Ë'] =
'{\"E}';
123 $bibtex_special_chars[
'Ï'] =
'{\"I}';
124 $bibtex_special_chars[
'Ö'] =
'{\"O}';
125 $bibtex_special_chars[
'Ü'] =
'{\"U}';
126 $bibtex_special_chars[
'â'] =
'{\^a}';
127 $bibtex_special_chars[
'ê'] =
'{\^e}';
128 $bibtex_special_chars[
'î'] =
'{\^i}';
129 $bibtex_special_chars[
'ô'] =
'{\^o}';
130 $bibtex_special_chars[
'û'] =
'{\^u}';
131 $bibtex_special_chars[
'Â'] =
'{\^A}';
132 $bibtex_special_chars[
'Ê'] =
'{\^E}';
133 $bibtex_special_chars[
'Î'] =
'{\^I}';
134 $bibtex_special_chars[
'Ô'] =
'{\^O}';
135 $bibtex_special_chars[
'Û'] =
'{\^U}';
136 $bibtex_special_chars[
'à'] =
'{\`a}';
137 $bibtex_special_chars[
'è'] =
'{\`e}';
138 $bibtex_special_chars[
'ì'] =
'{\`i}';
139 $bibtex_special_chars[
'ò'] =
'{\`o}';
140 $bibtex_special_chars[
'ù'] =
'{\`u}';
141 $bibtex_special_chars[
'À'] =
'{\`A}';
142 $bibtex_special_chars[
'È'] =
'{\`E}';
143 $bibtex_special_chars[
'Ì'] =
'{\`I}';
144 $bibtex_special_chars[
'Ò'] =
'{\`O}';
145 $bibtex_special_chars[
'Ù'] =
'{\`U}';
146 $bibtex_special_chars[
'á'] =
'{\\\'a}';
147 $bibtex_special_chars[
'é'] =
'{\\\'e}';
148 $bibtex_special_chars[
'í'] =
'{\\\'i}';
149 $bibtex_special_chars[
'ó'] =
'{\\\'o}';
150 $bibtex_special_chars[
'ú'] =
'{\\\'u}';
151 $bibtex_special_chars[
'Á'] =
'{\\\'A}';
152 $bibtex_special_chars[
'É'] =
'{\\\'E}';
153 $bibtex_special_chars[
'Í'] =
'{\\\'I}';
154 $bibtex_special_chars[
'Ó'] =
'{\\\'O}';
155 $bibtex_special_chars[
'Ú'] =
'{\\\'U}';
156 $bibtex_special_chars[
'à'] =
'{\`a}';
157 $bibtex_special_chars[
'è'] =
'{\`e}';
158 $bibtex_special_chars[
'ì'] =
'{\`i}';
159 $bibtex_special_chars[
'ò'] =
'{\`o}';
160 $bibtex_special_chars[
'ù'] =
'{\`u}';
161 $bibtex_special_chars[
'À'] =
'{\`A}';
162 $bibtex_special_chars[
'È'] =
'{\`E}';
163 $bibtex_special_chars[
'Ì'] =
'{\`I}';
164 $bibtex_special_chars[
'Ò'] =
'{\`O}';
165 $bibtex_special_chars[
'Ù'] =
'{\`U}';
166 $bibtex_special_chars[
'ç'] =
'{\c c}';
167 $bibtex_special_chars[
'ß'] =
'{\ss}';
168 $bibtex_special_chars[
'ñ'] =
'{\~n}';
169 $bibtex_special_chars[
'Ñ'] =
'{\~N}';
170 $bibtex_special_chars[
'ń'] =
"{\\'n}";
171 $bibtex_special_chars[
'l'] =
"{\\'n}";
172 $bibtex_special_chars[
'&'] =
"{\&}";
173 $bibtex_special_chars[
'@'] =
"{\@}";
setFileContent($file_content)
◆ isEntryType()
static ilBibTex::isEntryType |
( |
|
$entry_ype | ) |
|
|
static |
- Parameters
-
- Returns
- bool
Definition at line 246 of file class.ilBibTex.php.
247 return in_array($entry_ype, self::$entry_types);
◆ isStandardField()
static ilBibTex::isStandardField |
( |
|
$field_name | ) |
|
|
static |
◆ normalizeContent()
ilBibTex::normalizeContent |
( |
| ) |
|
|
protected |
◆ parseContent()
ilBibTex::parseContent |
( |
| ) |
|
should return
Array ( [0] => Array ( [isbn] => 978-0-12-411454-8 [year] => 2013 [title] => Mastering cloud computing [cite] => Masteringcloudcomputing:2013 [entryType] => book )
[...]
- Returns
- array
Implements ilBibliograficFileReader.
Definition at line 37 of file class.ilBibTex.php.
References array, convertBibSpecialChars(), ilBibliograficFileReaderBase\getFileContent(), and normalizeContent().
43 $objects = preg_split(
"/\\@([\\w]*)/uix", $this->
getFileContent(), null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
45 if (in_array($objects[0], self::$ignored_keywords)) {
46 $objects = array_splice($objects, 2);
49 if (strlen($objects[0]) <= 3) {
50 $objects = array_splice($objects, 1);
54 foreach ($objects as $key => $object) {
55 if ((
int)$key % 2 == 0 || (
int)$key == 0) {
57 $entry[
'entryType'] = strtolower($object);
60 preg_match(
"/^{(?<cite>.*),\\n/um", $object, $cite_matches);
61 if ($cite_matches[
'cite']) {
62 $entry[
'cite'] = $cite_matches[
'cite'];
66 $re =
"/(?<attr>[\\w]*)\\s*=\\s*[{\"]*(?<content>(.*?))\\s*[}\"]*?\\s*[,]*?\\s*\\n/";
68 preg_match_all($re, $object, $matches, PREG_SET_ORDER);
70 foreach ($matches as $match) {
71 $clean = $match[
'content'];
72 $clean = preg_replace(
"/[\", \\t\\s]*\\n/u",
"\n", $clean);
74 $entry[strtolower($match[
'attr'])] = $clean;
Create styles array
The data for the language used.
◆ removeBomUtf8()
ilBibTex::removeBomUtf8 |
( |
|
$s | ) |
|
|
protected |
- Parameters
-
- Returns
- bool|string
Definition at line 256 of file class.ilBibTex.php.
Referenced by normalizeContent().
257 if (substr($s, 0, 3) == chr(hexdec(
'EF')) . chr(hexdec(
'BB')) . chr(hexdec(
'BF'))) {
258 return substr($s, 3);
◆ $entry_types
Initial value: 'article',
'book',
'booklet',
'conference',
'inbook',
'incollection',
'inproceedings',
'manual',
'mastersthesis',
'misc',
'phdthesis',
'proceedings',
'techreport',
'unpublished',
)
Definition at line 213 of file class.ilBibTex.php.
◆ $ignored_keywords
ilBibTex::$ignored_keywords = array( 'Preamble' ) |
|
staticprotected |
◆ $standard_fields
ilBibTex::$standard_fields |
|
staticprotected |
Initial value: 'address',
'annote',
'author',
'booktitle',
'chapter',
'crossref',
'edition',
'editor',
'eprint',
'howpublished',
'institution',
'journal',
'key',
'month',
'note',
'number',
'organization',
'pages',
'publisher',
'school',
'series',
'title',
'type',
'url',
'volume',
'year',
)
Definition at line 182 of file class.ilBibTex.php.
The documentation for this class was generated from the following file: