@@ -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 = $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 = $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 | } |
@@ -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 | } |