src/wcmf/lib/presentation/link/LinkProcessor.php
protected static function convertInternalLink($url, LinkProcessorStrategy $strategy) {
    $urlConv = $url;
    if (InternalLink::isLink($url)) {
      $oid = InternalLink::getReferencedOID($url);
      if ($oid != null) {
        $persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
        $object = $persistenceFacade->load($oid);
        $urlConv = $strategy->getObjectUrl($object);
      }
      else {
        $urlConv = '#';
      }
      $anchorOID = InternalLink::getAnchorOID($url);
      if ($anchorOID != null) {
        if (strrpos($urlConv) !== 0) {
          $urlConv .= '#';
        }
        $urlConv .= $anchorOID;
      }
      else {
        $anchorName = InternalLink::getAnchorName($url);
        if ($anchorName != null) {
          if (strrpos($urlConv) !== 0) {
            $urlConv .= '#';
          }
          $urlConv .= $anchorName;
        }
      }
    }
    return $urlConv;
  }
protected static function convertInternalLink($url, LinkProcessorStrategy $strategy) {
    $urlConv = $url;
    if (InternalLink::isLink($url)) {
      $oid = InternalLink::getReferencedOID($url);
      if ($oid != null) {
        $persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
        $object = $persistenceFacade->load($oid);
        $urlConv = $strategy->getObjectUrl($object);
      }
      else {
        $urlConv = '#';
      }
      $anchorOID = InternalLink::getAnchorOID($url);
      if ($anchorOID != null) {
        if (strrpos($urlConv) !== 0) {
          $urlConv .= '#';
        }
        $urlConv .= $anchorOID;
      }
      else {
        $anchorName = InternalLink::getAnchorName($url);
        if ($anchorName != null) {
          if (strrpos($urlConv) !== 0) {
            $urlConv .= '#';
          }
          $urlConv .= $anchorName;
        }
      }
    }
    return $urlConv;
  }
protected static function convertInternalLink ( $ url , LinkProcessorStrategy $ strategy ) { $ urlConv = $ url ; if ( InternalLink :: isLink ( $ url ) ) { $ oid = InternalLink :: getReferencedOID ( $ url ) ; if ( $ oid != null ) { $ persistenceFacade = ObjectFactory :: getInstance ( 'persistenceFacade' ) ; $ object = $ persistenceFacade -> load ( $ oid ) ; $ urlConv = $ strategy -> getObjectUrl ( $ object ) ; } else { $ urlConv = '#' ; } $ anchorOID = InternalLink :: getAnchorOID ( $ url ) ; if ( $ anchorOID != null ) { if ( strrpos ( $ urlConv ) !== 0 ) { $ urlConv .= '#' ; } $ urlConv .= $ anchorOID ; } else { $ anchorName = InternalLink :: getAnchorName ( $ url ) ; if ( $ anchorName != null ) { if ( strrpos ( $ urlConv ) !== 0 ) { $ urlConv .= '#' ; } $ urlConv .= $ anchorName ; } } } return $ urlConv ; }
Convert an internal link.
@param $url The url to convert
@param $strategy The strategy used to check and create urls
@return The converted url
Convert an internal link .