@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | $resultNames[] = $this->formatName($name, $rank); |
| 358 | 358 | } |
| 359 | 359 | break; |
| 360 | - /* “partial-first” - as “partial-each”, but substitution is limited to the first name of the name |
|
| 360 | + /* “partial-first” - as “partial-each”, but substitution is limited to the first name of the name |
|
| 361 | 361 | variable. */ |
| 362 | 362 | case SubsequentAuthorSubstituteRule::PARTIAL_FIRST: |
| 363 | 363 | if ($rank === 0) { |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | } |
| 372 | 372 | break; |
| 373 | 373 | |
| 374 | - /* “complete-each” - requires a complete match like “complete-all”, but now the value of |
|
| 374 | + /* “complete-each” - requires a complete match like “complete-all”, but now the value of |
|
| 375 | 375 | subsequent-author-substitute substitutes for each rendered name. */ |
| 376 | 376 | case SubsequentAuthorSubstituteRule::COMPLETE_EACH: |
| 377 | 377 | try { |
@@ -44,9 +44,9 @@ |
||
| 44 | 44 | 'chapter-number', // chapter number |
| 45 | 45 | 'collection-number', // number identifying the collection holding the item (e.g. the series number for a book) |
| 46 | 46 | 'edition', // (container) edition holding the item (e.g. “3” when citing a chapter in the third |
| 47 | - // edition of a book) |
|
| 47 | + // edition of a book) |
|
| 48 | 48 | 'issue', // (container) issue holding the item (e.g. “5” when citing a journal article from |
| 49 | - // journal volume 2, issue 5) |
|
| 49 | + // journal volume 2, issue 5) |
|
| 50 | 50 | 'number', // number identifying the item (e.g. a report number) |
| 51 | 51 | 'number-of-pages', // total number of pages of the cited item |
| 52 | 52 | 'number-of-volumes', // total number of volumes, usable for citing multi-volume books and such |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | unset($data->{$this->toRenderTypeValue}); |
| 114 | 114 | } |
| 115 | 115 | if (!CiteProcHelper::isUsingAffixesByMarkupExtentsion($data, $this->toRenderTypeValue)) { |
| 116 | - $renderedText = $this->applyAdditionalMarkupFunction($data, $renderedText); |
|
| 117 | - } |
|
| 116 | + $renderedText = $this->applyAdditionalMarkupFunction($data, $renderedText); |
|
| 117 | + } |
|
| 118 | 118 | break; |
| 119 | 119 | case 'macro': |
| 120 | 120 | $renderedText = $this->renderMacro($data); |
@@ -241,17 +241,17 @@ discard block |
||
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /** |
| 244 | - * @param $data |
|
| 245 | - * @param $renderedText |
|
| 244 | + * @param $data |
|
| 245 | + * @param $renderedText |
|
| 246 | 246 | * @return string |
| 247 | 247 | */ |
| 248 | 248 | private function formatRenderedText($data, $renderedText) |
| 249 | 249 | { |
| 250 | 250 | $text = $this->format($renderedText); |
| 251 | 251 | $res = $this->addAffixes($text); |
| 252 | - if (CiteProcHelper::isUsingAffixesByMarkupExtentsion($data, $this->toRenderTypeValue)) { |
|
| 253 | - $res = $this->applyAdditionalMarkupFunction($data, $res); |
|
| 254 | - } |
|
| 252 | + if (CiteProcHelper::isUsingAffixesByMarkupExtentsion($data, $this->toRenderTypeValue)) { |
|
| 253 | + $res = $this->applyAdditionalMarkupFunction($data, $res); |
|
| 254 | + } |
|
| 255 | 255 | if (!empty($res)) { |
| 256 | 256 | $res = $this->removeConsecutiveChars($res); |
| 257 | 257 | } |
@@ -267,9 +267,9 @@ discard block |
||
| 267 | 267 | private function renderCitationNumber($data, $citationNumber) |
| 268 | 268 | { |
| 269 | 269 | $renderedText = $citationNumber + 1; |
| 270 | - if (!CiteProcHelper::isUsingAffixesByMarkupExtentsion($data, $this->toRenderTypeValue)) { |
|
| 271 | - $renderedText = $this->applyAdditionalMarkupFunction($data, $renderedText); |
|
| 272 | - } |
|
| 270 | + if (!CiteProcHelper::isUsingAffixesByMarkupExtentsion($data, $this->toRenderTypeValue)) { |
|
| 271 | + $renderedText = $this->applyAdditionalMarkupFunction($data, $renderedText); |
|
| 272 | + } |
|
| 273 | 273 | return $renderedText; |
| 274 | 274 | } |
| 275 | 275 | |
@@ -27,21 +27,21 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $markupExtension = CiteProc::getContext()->getMarkupExtension(); |
| 29 | 29 | if (array_key_exists($valueToRender, $markupExtension)) { |
| 30 | - if (is_array($markupExtension[$valueToRender]) && array_key_exists('function', $markupExtension[$valueToRender])) { |
|
| 31 | - $function = $markupExtension[$valueToRender]['function']; |
|
| 32 | - } else { |
|
| 33 | - $function = $markupExtension[$valueToRender]; |
|
| 34 | - } |
|
| 30 | + if (is_array($markupExtension[$valueToRender]) && array_key_exists('function', $markupExtension[$valueToRender])) { |
|
| 31 | + $function = $markupExtension[$valueToRender]['function']; |
|
| 32 | + } else { |
|
| 33 | + $function = $markupExtension[$valueToRender]; |
|
| 34 | + } |
|
| 35 | 35 | if (is_callable($function)) { |
| 36 | 36 | $renderedText = $function($dataItem, $renderedText); |
| 37 | 37 | } |
| 38 | 38 | } elseif (array_key_exists($mode = CiteProc::getContext()->getMode(), $markupExtension)) { |
| 39 | 39 | if (array_key_exists($valueToRender, $markupExtension[$mode])) { |
| 40 | - if (is_array($markupExtension[$mode][$valueToRender]) && array_key_exists('function', $markupExtension[$mode][$valueToRender])) { |
|
| 41 | - $function = CiteProc::getContext()->getMarkupExtension()[$mode][$valueToRender]['function']; |
|
| 42 | - } else { |
|
| 43 | - $function = CiteProc::getContext()->getMarkupExtension()[$mode][$valueToRender]; |
|
| 44 | - } |
|
| 40 | + if (is_array($markupExtension[$mode][$valueToRender]) && array_key_exists('function', $markupExtension[$mode][$valueToRender])) { |
|
| 41 | + $function = CiteProc::getContext()->getMarkupExtension()[$mode][$valueToRender]['function']; |
|
| 42 | + } else { |
|
| 43 | + $function = CiteProc::getContext()->getMarkupExtension()[$mode][$valueToRender]; |
|
| 44 | + } |
|
| 45 | 45 | if (is_callable($function)) { |
| 46 | 46 | $renderedText = $function($dataItem, $renderedText); |
| 47 | 47 | } |
@@ -63,26 +63,26 @@ discard block |
||
| 63 | 63 | return $newArray; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * @param stdClass $dataItem the actual item |
|
| 68 | - * @param string $valueToRender value the has to apply on |
|
| 69 | - * @return bool |
|
| 70 | - */ |
|
| 66 | + /** |
|
| 67 | + * @param stdClass $dataItem the actual item |
|
| 68 | + * @param string $valueToRender value the has to apply on |
|
| 69 | + * @return bool |
|
| 70 | + */ |
|
| 71 | 71 | public static function isUsingAffixesByMarkupExtentsion($dataItem, $valueToRender) |
| 72 | - { |
|
| 73 | - $markupExtension = CiteProc::getContext()->getMarkupExtension(); |
|
| 74 | - if (array_key_exists($valueToRender, $markupExtension)) { |
|
| 75 | - if (is_array($markupExtension[$valueToRender]) && array_key_exists('affixes', $markupExtension[$valueToRender])) { |
|
| 76 | - return $markupExtension[$valueToRender]['affixes']; |
|
| 77 | - } |
|
| 78 | - } elseif (array_key_exists($mode = CiteProc::getContext()->getMode(), $markupExtension)) { |
|
| 79 | - if (array_key_exists($valueToRender, $markupExtension[$mode])) { |
|
| 80 | - if (is_array($markupExtension[$mode][$valueToRender]) && array_key_exists('affixes', $markupExtension[$mode][$valueToRender])) { |
|
| 81 | - return CiteProc::getContext()->getMarkupExtension()[$mode][$valueToRender]['affixes']; |
|
| 82 | - } |
|
| 83 | - } |
|
| 84 | - } |
|
| 72 | + { |
|
| 73 | + $markupExtension = CiteProc::getContext()->getMarkupExtension(); |
|
| 74 | + if (array_key_exists($valueToRender, $markupExtension)) { |
|
| 75 | + if (is_array($markupExtension[$valueToRender]) && array_key_exists('affixes', $markupExtension[$valueToRender])) { |
|
| 76 | + return $markupExtension[$valueToRender]['affixes']; |
|
| 77 | + } |
|
| 78 | + } elseif (array_key_exists($mode = CiteProc::getContext()->getMode(), $markupExtension)) { |
|
| 79 | + if (array_key_exists($valueToRender, $markupExtension[$mode])) { |
|
| 80 | + if (is_array($markupExtension[$mode][$valueToRender]) && array_key_exists('affixes', $markupExtension[$mode][$valueToRender])) { |
|
| 81 | + return CiteProc::getContext()->getMarkupExtension()[$mode][$valueToRender]['affixes']; |
|
| 82 | + } |
|
| 83 | + } |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - return FALSE; |
|
| 87 | - } |
|
| 86 | + return FALSE; |
|
| 87 | + } |
|
| 88 | 88 | } |