diff options
| author | Christian Fowler <spider@viovio.com> | 2012-04-18 17:01:20 -0400 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2012-04-18 17:01:20 -0400 |
| commit | 09631f4c559cc7446f456420211ec2d5aa28283a (patch) | |
| tree | 22324b592ae6a7020f959eb3518c6acddedb0fad | |
| parent | 4eea9666267b9d90f4a4b57572399fe877777c44 (diff) | |
| download | pigeonholes-09631f4c559cc7446f456420211ec2d5aa28283a.tar.gz pigeonholes-09631f4c559cc7446f456420211ec2d5aa28283a.tar.bz2 pigeonholes-09631f4c559cc7446f456420211ec2d5aa28283a.zip | |
major migration of getDisplayUrl to ->getDisplayUrl and ::getDisplayUrlFromHash
| -rw-r--r-- | Pigeonholes.php | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/Pigeonholes.php b/Pigeonholes.php index 263707a..c00e7bd 100644 --- a/Pigeonholes.php +++ b/Pigeonholes.php @@ -197,7 +197,7 @@ class Pigeonholes extends LibertyMime { $type['content_object'] = new $type['handler_class'](); } if( $type['content_object']->isViewable( $aux['content_id'] )) { - $aux['display_url'] = $type['content_object']->getDisplayUrl( NULL, $aux ); + $aux['display_url'] = $type['content_object']->getDisplayUrlFromHash( $aux ); $aux['display_link'] = $type['content_object']->getDisplayLink( $aux['title'], $aux ); $aux['title'] = $type['content_object']->getTitle( $aux ); $aux['thumbnail_url'] = liberty_fetch_thumbnails( array( @@ -425,7 +425,7 @@ class Pigeonholes extends LibertyMime { if( !empty( $pPath ) && is_array( $pPath ) ) { foreach( $pPath as $node ) { $title = htmlspecialchars( $node['title'] ); - $ret .= ( @BitBase::verifyId( $node['parent_id'] ) ? ' » ' : '' ).'<a title="'.$title.'" href="'.$this->getDisplayUrl( $node['content_id'] ).'">'.preg_replace('/ /',' ',$title).'</a>'; + $ret .= ( @BitBase::verifyId( $node['parent_id'] ) ? ' » ' : '' ).'<a title="'.$title.'" href="'.$this->getDisplayUrlFromHash( $node ).'">'.preg_replace('/ /',' ',$title).'</a>'; } } @@ -926,24 +926,19 @@ class Pigeonholes extends LibertyMime { * @param $pContentId is the pigeonhole id we want to see * @return the link to display the page. */ - function getDisplayUrl( $pContentId=NULL, $pMixed=NULL ) { + function getDisplayUrlFromHash( $pMixed=NULL ) { global $gBitSystem; $ret = NULL; - // try to get the correct content_id from anywhere possible - if( !@BitBase::verifyId( $pContentId ) && !empty( $this->mContentId ) ) { - $pContentId = $this->mContentId; - } elseif( !@BitBase::verifyId( $pContentId ) && !empty( $pMixed ) ) { - $pContentId = $pMixed['content_id']; - } - if( @BitBase::verifyId( $pContentId ) ) { + if( @BitBase::verifyId( $pMixed['content_id'] ) ) { $rewrite_tag = $gBitSystem->isFeatureActive( 'pretty_urls_extended' ) ? 'view/' : ''; if( $gBitSystem->isFeatureActive( 'pretty_urls' ) || $gBitSystem->isFeatureActive( 'pretty_urls_extended' ) ) { - $ret = PIGEONHOLES_PKG_URL.$rewrite_tag.$pContentId; + $ret = PIGEONHOLES_PKG_URL.$rewrite_tag.$pMixed['content_id']; }else{ - $ret = PIGEONHOLES_PKG_URL.'view.php?content_id='.$pContentId; + $ret = PIGEONHOLES_PKG_URL.'view.php?content_id='.$pMixed['content_id']; } } + return $ret; } @@ -966,7 +961,7 @@ class Pigeonholes extends LibertyMime { $ret = $pTitle; if( !empty( $pTitle ) && !empty( $pMixed ) ) { if( $gBitSystem->isPackageActive( 'pigeonholes' ) ) { - $ret = '<a title="'.htmlspecialchars( $pTitle ).'" href="'.Pigeonholes::getDisplayUrl( $pMixed['content_id'], $pMixed ).'">'.htmlspecialchars( $pTitle ).'</a>'; + $ret = '<a title="'.htmlspecialchars( $pTitle ).'" href="'.Pigeonholes::getDisplayUrlFromHash( $pMixed ).'">'.htmlspecialchars( $pTitle ).'</a>'; } } |
