aboutsummaryrefslogtreecommitdiff
path: root/bibtex.php
diff options
context:
space:
mode:
Diffstat (limited to 'bibtex.php')
-rw-r--r--bibtex.php64
1 files changed, 61 insertions, 3 deletions
diff --git a/bibtex.php b/bibtex.php
index 9fd391f..0484915 100644
--- a/bibtex.php
+++ b/bibtex.php
@@ -124,7 +124,7 @@ class BibtexParser
foreach ($search as $key => $value)
{
$key = strtolower($key);
- if (!empty($entry[$key]) && !preg_match($value, $entry[$key]))
+ if (!empty($entry[$key]) && !preg_match('/' . $value . '/u', $entry[$key]))
{
$select = false;
break;
@@ -189,6 +189,7 @@ class BibtexParserTeam extends BibtexParser
'no.' => array('russian' => '№'),
'et al.' => array('russian' => 'и др.'),
'Ed. by' => array('russian' => 'Под ред.'),
+ 'leader' => array('russian' => 'рук.'),
);
protected function _($str)
@@ -261,6 +262,30 @@ class BibtexParserTeam extends BibtexParser
);
}
+ protected function format_organization() // for @GRANT
+ {
+ $this->format_field_default('organization');
+ $this->entry['organization'] = '<strong>' . $this->entry['organization'] . '</strong>';
+ }
+
+ protected function format_doer() // for @GRANT
+ {
+ $res = '';
+ $authors_array = preg_split('/\s+and\s+/',
+ $this->expand_string($this->entry['doer']));
+
+ foreach ($authors_array as &$a)
+ {
+ $a = $this->format_author1($a);
+ }
+
+ if(isset($authors_array[1]))
+ $authors_array[0] .= '&nbsp;(' . $this->_('leader') . ')';
+ $res = implode(', ', $authors_array);
+
+ $this->entry['doer'] = $res;
+ }
+
protected function format_pages()
{
$this->format_field_default('pages');
@@ -364,7 +389,7 @@ class BibtexParserTeam extends BibtexParser
}
else
{
- $res = 'Not implemented for ' . $this->entry['entry'];
+ $res = 'Not implemented for "' . $this->entry['entry'] . '"';
}
$res .= '.';
@@ -460,7 +485,7 @@ class BibtexParserTeam extends BibtexParser
$parts[] = $this->entry['year'];
}
- if (!empty($this->entry['manth']))
+ if (!empty($this->entry['month']))
{
$parts[] = $this->entry['month'];
}
@@ -484,6 +509,39 @@ class BibtexParserTeam extends BibtexParser
return implode('.&nbsp;&mdash; ', $parts);
}
+ protected function format_grant()
+ {
+ $parts = array(); // All parts are connected with '.&nbsp;&mdash; '
+
+
+ if (!empty($this->entry['organization']))
+ {
+ $parts[] = $this->entry['organization'];
+ }
+
+ if (!empty($this->entry['number']))
+ {
+ $parts[] = $this->entry['number'];
+ }
+
+ if (!empty($this->entry['title']))
+ {
+ $parts[] = $this->entry['title'];
+ }
+
+ if (!empty($this->entry['year']))
+ {
+ $parts[] = $this->entry['year'];
+ }
+
+ if (!empty($this->entry['doer']))
+ {
+ $parts[] = '<em>' . $this->entry['doer'] . '</em>';
+ }
+
+ return implode('.&nbsp;&mdash; ', $parts);
+ }
+
protected function format_inproceedings()
{