Classes/ViewHelpers/ResultViewHelper.php
protected function authorInfo($result)
    {
        $outputElement = null;

        if ($result['md-title-responsibility'][0]['values']) {
            $outputText = implode('; ', $result['md-title-responsibility'][0]['values']);
            if (!$outputText && $result['md-author']) {
                $authors = [];
                foreach ($result['md-author'] as $index => $author) {
                    if ($index < self::MAX_AUTHORS) {
                        $authorName = $author['values'][0];
                        $authors[] = $authorName;
                    } else {
                        $authors[] = LocalizationUtility::translate('et al.', 'Pazpar2');
                        break;
                    }
                }

                $outputText = implode('; ', $authors);
            }
        }

        if (isset($outputText)) {
            $outputElement = $this->doc->createElement('span');
            $outputElement->setAttribute('class', 'pz2-item-responsibility');
            $outputElement->appendChild($this->doc->createTextNode($outputText));
        }

        return $outputElement;
    }
protected function authorInfo($result)
    {
        $outputElement = null;

        if ($result['md-title-responsibility'][0]['values']) {
            $outputText = implode('; ', $result['md-title-responsibility'][0]['values']);
            if (!$outputText && $result['md-author']) {
                $authors = [];
                foreach ($result['md-author'] as $index => $author) {
                    if ($index < self::MAX_AUTHORS) {
                        $authorName = $author['values'][0];
                        $authors[] = $authorName;
                    } else {
                        $authors[] = LocalizationUtility::translate('et al.', 'Pazpar2');
                        break;
                    }
                }

                $outputText = implode('; ', $authors);
            }
        }

        if (isset($outputText)) {
            $outputElement = $this->doc->createElement('span');
            $outputElement->setAttribute('class', 'pz2-item-responsibility');
            $outputElement->appendChild($this->doc->createTextNode($outputText));
        }

        return $outputElement;
    }
protected function authorInfo ( $ result ) { $ outputElement = null ; if ( $ result [ 'md-title-responsibility' ] [ 0 ] [ 'values' ] ) { $ outputText = implode ( '; ' , $ result [ 'md-title-responsibility' ] [ 0 ] [ 'values' ] ) ; if ( ! $ outputText && $ result [ 'md-author' ] ) { $ authors = [ ] ; foreach ( $ result [ 'md-author' ] as $ index => $ author ) { if ( $ index < self :: MAX_AUTHORS ) { $ authorName = $ author [ 'values' ] [ 0 ] ; $ authors [ ] = $ authorName ; } else { $ authors [ ] = LocalizationUtility :: translate ( 'et al.' , 'Pazpar2' ) ; break ; } } $ outputText = implode ( '; ' , $ authors ) ; } } if ( isset ( $ outputText ) ) { $ outputElement = $ this -> doc -> createElement ( 'span' ) ; $ outputElement -> setAttribute ( 'class' , 'pz2-item-responsibility' ) ; $ outputElement -> appendChild ( $ this -> doc -> createTextNode ( $ outputText ) ) ; } return $ outputElement ; }
Returns DOM SPAN element with markup for the current hit's author information.
The pre-formatted title-responsibility field is preferred and a list of author
names is used as a fallback.
@param array $result
@return \DOMElement
Returns DOM SPAN element with markup for the current hit s author information . The pre - formatted title - responsibility field is preferred and a list of author names is used as a fallback .