public static function getResultLinkConfiguration($resultRow, $targetDefault = '', $targetFiles = '')
    {
        $linkconf = array();

        list($type) = explode(':', $resultRow['type']);

        switch ($type) {
            case 'file':
                // render a link for files
                // if we use FAL, we can use the API
                if ($resultRow['orig_uid'] && ($fileObject = SearchHelper::getFile($resultRow['orig_uid']))) {
                    $linkconf['parameter'] = $fileObject->getPublicUrl();
                } else {
                    $linkconf['parameter'] = $resultRow['directory'] . rawurlencode($resultRow['title']);
                }
                $linkconf['fileTarget'] = $targetFiles;
                break;

            case 'external':
                // render a link for external results (provided by eg. ke_search_premium)
                $linkconf['parameter'] = $resultRow['params'];
                $linkconf['useCacheHash'] = false;
                $linkconf['additionalParams'] = '';
                $extConfPremium = SearchHelper::getExtConfPremium();
                $linkconf['extTarget'] = $extConfPremium['apiExternalResultTarget'] ?
                    $extConfPremium['apiExternalResultTarget'] : '_blank';
                break;

            default:
                // render a link for page targets
                // if params are filled, add them to the link generation process
                if (!empty($resultRow['params'])) {
                    $linkconf['additionalParams'] = $resultRow['params'];
                }
                $linkconf['parameter'] = $resultRow['targetpid'];
                $linkconf['useCacheHash'] = true;
                $linkconf['target'] = $targetDefault;
                break;
        }

        return $linkconf;
    }
public static function getResultLinkConfiguration($resultRow, $targetDefault = '', $targetFiles = '')
    {
        $linkconf = array();

        list($type) = explode(':', $resultRow['type']);

        switch ($type) {
            case 'file':
                // render a link for files
                // if we use FAL, we can use the API
                if ($resultRow['orig_uid'] && ($fileObject = SearchHelper::getFile($resultRow['orig_uid']))) {
                    $linkconf['parameter'] = $fileObject->getPublicUrl();
                } else {
                    $linkconf['parameter'] = $resultRow['directory'] . rawurlencode($resultRow['title']);
                }
                $linkconf['fileTarget'] = $targetFiles;
                break;

            case 'external':
                // render a link for external results (provided by eg. ke_search_premium)
                $linkconf['parameter'] = $resultRow['params'];
                $linkconf['useCacheHash'] = false;
                $linkconf['additionalParams'] = '';
                $extConfPremium = SearchHelper::getExtConfPremium();
                $linkconf['extTarget'] = $extConfPremium['apiExternalResultTarget'] ?
                    $extConfPremium['apiExternalResultTarget'] : '_blank';
                break;

            default:
                // render a link for page targets
                // if params are filled, add them to the link generation process
                if (!empty($resultRow['params'])) {
                    $linkconf['additionalParams'] = $resultRow['params'];
                }
                $linkconf['parameter'] = $resultRow['targetpid'];
                $linkconf['useCacheHash'] = true;
                $linkconf['target'] = $targetDefault;
                break;
        }

        return $linkconf;
    }
public static function getResultLinkConfiguration ( $ resultRow , $ targetDefault = '' , $ targetFiles = '' ) { $ linkconf = array ( ) ; list ( $ type ) = explode ( ':' , $ resultRow [ 'type' ] ) ; switch ( $ type ) { case 'file' : // render a link for files // if we use FAL, we can use the API if ( $ resultRow [ 'orig_uid' ] && ( $ fileObject = SearchHelper :: getFile ( $ resultRow [ 'orig_uid' ] ) ) ) { $ linkconf [ 'parameter' ] = $ fileObject -> getPublicUrl ( ) ; } else { $ linkconf [ 'parameter' ] = $ resultRow [ 'directory' ] . rawurlencode ( $ resultRow [ 'title' ] ) ; } $ linkconf [ 'fileTarget' ] = $ targetFiles ; break ; case 'external' : // render a link for external results (provided by eg. ke_search_premium) $ linkconf [ 'parameter' ] = $ resultRow [ 'params' ] ; $ linkconf [ 'useCacheHash' ] = false ; $ linkconf [ 'additionalParams' ] = '' ; $ extConfPremium = SearchHelper :: getExtConfPremium ( ) ; $ linkconf [ 'extTarget' ] = $ extConfPremium [ 'apiExternalResultTarget' ] ? $ extConfPremium [ 'apiExternalResultTarget' ] : '_blank' ; break ; default : // render a link for page targets // if params are filled, add them to the link generation process if ( ! empty ( $ resultRow [ 'params' ] ) ) { $ linkconf [ 'additionalParams' ] = $ resultRow [ 'params' ] ; } $ linkconf [ 'parameter' ] = $ resultRow [ 'targetpid' ] ; $ linkconf [ 'useCacheHash' ] = true ; $ linkconf [ 'target' ] = $ targetDefault ; break ; } return $ linkconf ; }
renders a link to a search result

@param array $resultRow
@param string $targetDefault
@param string $targetFiles
@author Christian Bülter <buelter@kennziffer.com>
@since 31.10.14
@return array
renders a link to a search result