Browse Source

Mise à jour de la librairie CiteProc.php

svn/root/tags/v3.6.0
joseph@larmarange.net 9 years ago
parent
commit
42c9ceba68
1 changed files with 28 additions and 9 deletions
  1. +28
    -9
      lib/citeproc-php/CiteProc.php

+ 28
- 9
lib/citeproc-php/CiteProc.php View File

@ -602,8 +602,10 @@ class csl_name extends csl_format {
if (isset($this->{'et-al-min'}) && $count >= $this->{'et-al-min'}) break;
}
if (isset($this->{'et-al-min'}) &&
$count >= $this->{'et-al-min'} &&
isset($this->{'et-al-use-first'})) {
$count >= $this->{'et-al-min'} &&
isset($this->{'et-al-use-first'}) &&
$count >= $this->{'et-al-use-first'} &&
count($names) > $this->{'et-al-use-first'}) {
if ($this->{'et-al-use-first'} < $this->{'et-al-min'}) {
for ($i = $this->{'et-al-use-first'}; $i < $count; $i++) {
unset($authors[$i]);
@ -767,7 +769,7 @@ class csl_names extends csl_format {
}
}
function render($data, $mode) {
function render($data, $mode = NULL) {
$matches = 0;
$variable_parts = array();
if (!isset($this->delimiter)) {
@ -893,7 +895,7 @@ class csl_date extends csl_format {
}
function render($data, $mode) {
function render($data, $mode = NULL) {
$date_parts = array();
$date = '';
$text = '';
@ -914,7 +916,7 @@ class csl_date extends csl_format {
class csl_date_part extends csl_format {
function render($date, $mode) {
function render($date, $mode = NULL) {
$text = '';
switch ($this->name) {
@ -962,7 +964,7 @@ class csl_date_part extends csl_format {
class csl_number extends csl_format {
function render($data, $mode) {
function render($data, $mode = NULL) {
$var = $this->variable;
if (!$var || empty($data->$var)) return;
@ -1159,12 +1161,13 @@ class csl_macros extends csl_collection{
class csl_group extends csl_format{
function render($data, $mode) {
function render($data, $mode = NULL) {
$text = '';
$text_parts = array();
$terms = $variables = $have_variables = 0;
$terms = $variables = $have_variables = $element_count = 0;
foreach ($this->elements as $element) {
$element_count++;
if (($element instanceof csl_text) &&
($element->source == 'term' ||
$element->source == 'value' )) {
@ -1180,7 +1183,18 @@ class csl_group extends csl_format{
$text = $element->render($data, $mode);
$delimiter = $this->delimiter;
if (!empty($text)) {
if ($delimiter && ($element_count < count($this->elements))) {
//check to see if the delimiter is already the last character of the text string
//if so, remove it so we don't have two of them when we paste together the group
$stext = strip_tags(trim($text));
if((strrpos($stext, $delimiter[0])+1) == strlen($stext) && strlen($stext) > 1) {
$text = str_replace($stext, '----REPLACE----', $text);
$stext = substr($stext, 0, -1);
$text = str_replace('----REPLACE----', $stext, $text);
}
}
$text_parts[] = $text;
if ($element->source == 'variable' || isset($element->variable)) $have_variables++;
if ($element->source == 'macro') $have_variables++;
@ -1206,7 +1220,7 @@ class csl_layout extends csl_format {
parent::init_formatting();
}
function render($data, $mode) {
function render($data, $mode = NULL) {
$text = '';
$parts = array();
// $delimiter = $this->delimiter;
@ -1435,19 +1449,24 @@ class csl_locale {
"da" => "da-DK",
"de" => "de-DE",
"el" => "el-GR",
"en" => "en-GB",
"en" => "en-US",
"es" => "es-ES",
"et" => "et-EE",
"fa" => "fa-IR",
"fi" => "fi-FI",
"fr" => "fr-FR",
"he" => "he-IL",
"hu" => "hu-HU",
"is" => "is-IS",
"it" => "it-IT",
"ja" => "ja-JP",
"km" => "km-KH",
"ko" => "ko-KR",
"mn" => "mn-MN",
"nb" => "nb-NO",
"nl" => "nl-NL",
"nn" => "nn-NO",
"pl" => "pl-PL",
"pt" => "pt-PT",
"ro" => "ro-RO",


Loading…
Cancel
Save