Beispiel #1
0
function typeLink(ThemeResource $resource, ReturnTag $returnTag, $origin = null)
{
    $types = $returnTag->getTypes();
    $ret = array();
    foreach ($types as $typeName) {
        if (isInternalType($typeName)) {
            $infos = getInternalTypeInfos($typeName);
        } else {
            $className = $resource->getResolver()->resolveClassName($typeName);
            if ($resource->getResolver()->isIndexed($className)) {
                $infos = array('name' => $className, 'link' => $resource->url($className, 'class', $origin) . '.html');
            } else {
                $infos = array('name' => $typeName, 'link' => null);
            }
        }
        if ($infos['link'] != null && !empty($infos['link'])) {
            array_push($ret, sprintf('<a href="%s">%s</a>', $infos['link'], $infos['name']));
        } else {
            array_push($ret, $infos['name']);
        }
    }
    return implode('|', $ret);
}