diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2006-01-10 21:16:02 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2006-01-10 21:16:02 +0000 |
| commit | 9a238f69969e9c3c33f72dd35335dffc8f52f774 (patch) | |
| tree | 1f1024f53ef02d6ae11951baefca2d0e5edd52b4 /Pigeonholes.php | |
| parent | 617f856fc5d6253736da749937b9a620b35e1ff9 (diff) | |
| download | pigeonholes-9a238f69969e9c3c33f72dd35335dffc8f52f774.tar.gz pigeonholes-9a238f69969e9c3c33f72dd35335dffc8f52f774.tar.bz2 pigeonholes-9a238f69969e9c3c33f72dd35335dffc8f52f774.zip | |
merge recent changes into HEAD
Diffstat (limited to 'Pigeonholes.php')
| -rw-r--r-- | Pigeonholes.php | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/Pigeonholes.php b/Pigeonholes.php index ff797a1..7e2ac2f 100644 --- a/Pigeonholes.php +++ b/Pigeonholes.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.13 2005/12/26 12:28:01 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.14 2006/01/10 21:16:02 squareing Exp $ * * +----------------------------------------------------------------------+ * | Copyright ( c ) 2004, bitweaver.org @@ -17,7 +17,7 @@ * Pigeonholes class * * @author xing <xing@synapse.plus.com> - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ * @package pigeonholes */ @@ -848,39 +848,46 @@ class Pigeonholes extends LibertyAttachable { */ function getDisplayUrl( $pContentId=NULL, $pMixed=NULL ) { global $gBitSystem; - if( !@BitBase::verifyId( $pContentId ) ) { + $ret = NULL; + // try to get the correct content_id from anywhere possible + if( !@BitBase::verifyId( $pContentId ) && !empty( $this ) ) { $pContentId = $this->mContentId; + } elseif( !@BitBase::verifyId( $pContentId ) && !empty( $pMixed ) ) { + $pContentId = $pMixed['content_id']; } - $rewrite_tag = $gBitSystem->isFeatureActive( 'feature_pretty_urls_extended' ) ? 'view/' : ''; - if( $gBitSystem->isFeatureActive( 'pretty_urls' ) || $gBitSystem->isFeatureActive( 'feature_pretty_urls_extended' ) ) { - $baseUrl = PIGEONHOLES_PKG_URL.$rewrite_tag.$pContentId; - } else { - $baseUrl = PIGEONHOLES_PKG_URL.'view.php?content_id='.$pContentId; + if( @BitBase::verifyId( $pContentId ) ) { + $rewrite_tag = $gBitSystem->isFeatureActive( 'feature_pretty_urls_extended' ) ? 'view/' : ''; + if( $gBitSystem->isFeatureActive( 'pretty_urls' ) || $gBitSystem->isFeatureActive( 'feature_pretty_urls_extended' ) ) { + $ret = PIGEONHOLES_PKG_URL.$rewrite_tag.$pContentId; + } else { + $ret = PIGEONHOLES_PKG_URL.'view.php?content_id='.$pContentId; + } } - - return $baseUrl; + return $ret; } /** * Returns HTML link to display a pigeonhole - * @param $pPigeonholeTitle is the pigeonhole we want to see + * @param $pTitle is the pigeonhole we want to see * @param $pContentId content id of the pigeonhole in question * @return the link to display the page. */ - function getDisplayLink( $pPigeonholeTitle=NULL, $pMixed=NULL ) { + function getDisplayLink( $pTitle=NULL, $pMixed=NULL ) { global $gBitSystem; - if( empty( $pPigeonholeTitle ) && !empty( $this ) ) { - $pPigeonholeTitle = $this->mInfo['title']; + if( empty( $pTitle ) && !empty( $this ) ) { + $pTitle = $this->getTitle(); } if( empty( $pMixed ) && !empty( $this ) ) { $pMixed = $this->mInfo; } - $ret = $pPigeonholeTitle; - if( $gBitSystem->isPackageActive( 'pigeonholes' ) ) { - $ret = '<a title="'.$pPigeonholeTitle.'" href="'.Pigeonholes::getDisplayUrl( $pMixed['content_id'] ).'">'.$pPigeonholeTitle.'</a>'; + $ret = $pTitle; + if( !empty( $pTitle ) && !empty( $pMixed ) ) { + if( $gBitSystem->isPackageActive( 'pigeonholes' ) ) { + $ret = '<a title="'.$pTitle.'" href="'.Pigeonholes::getDisplayUrl( $pMixed['content_id'] ).'">'.$pTitle.'</a>'; + } } return $ret; |
