function PARSEENTRIES::returnArrays in Bibliography Module 6
Same name and namespace in other branches
- 5 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::returnArrays()
- 6.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::returnArrays()
- 7.3 plugins/biblio_style/bibtex/PARSEENTRIES.php \PARSEENTRIES::returnArrays()
- 7 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::returnArrays()
- 7.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::returnArrays()
File
- bibtexParse/PARSEENTRIES.php, line 492
Class
- PARSEENTRIES
Code
function returnArrays() {
global $transtab_latex_unicode;
foreach ($this->preamble as $value) {
preg_match("/.*?[{(](.*)/", $value, $matches);
$preamble = substr($matches[1], 0, -1);
$preambles['bibtexPreamble'] = trim($this
->removeDelimitersAndExpand(trim($preamble), TRUE));
}
if (isset($preambles)) {
$this->preamble = $preambles;
}
if ($this->fieldExtract) {
$strings = $this->strings;
$this->strings = isset($this->userStrings) ? $this->userStrings : array();
foreach ($strings as $value) {
$value = trim($value);
$matches = preg_split("/@\\s*string\\s*([{(])/i", $value, 2, PREG_SPLIT_DELIM_CAPTURE);
$delimit = $matches[1];
$matches = preg_split("/=/", $matches[2], 2, PREG_SPLIT_DELIM_CAPTURE);
$this->strings[strtolower(trim($matches[0]))] = $this
->extractStringValue($matches[1]);
}
}
if ($this->removeDelimit || $this->expandMacro && $this->fieldExtract) {
for ($i = 0; $i < count($this->entries); $i++) {
foreach ($this->entries[$i] as $key => $value) {
if ($key != 'bibtexCitation' && $key != 'bibtexEntryType') {
$this->entries[$i][$key] = trim($this
->removeDelimitersAndExpand($this->entries[$i][$key]));
}
}
}
}
return array(
$this->preamble,
$this->strings,
$this->entries,
$this->undefinedStrings,
);
}