diff options
| author | Lester Caine ext:(%22) <lester@lsces.co.uk> | 2012-04-16 08:16:12 +0100 |
|---|---|---|
| committer | Lester Caine ext:(%22) <lester@lsces.co.uk> | 2012-04-16 08:16:12 +0100 |
| commit | 6e30c337f7702ba2b0d3ce8392607c3d1a539164 (patch) | |
| tree | e3bec4423589f1d02cbbf0641957e9545c1762aa | |
| parent | 9dbee19cc5a1b71d982918b1452ce4184ed3ecf2 (diff) | |
| download | articles-6e30c337f7702ba2b0d3ce8392607c3d1a539164.tar.gz articles-6e30c337f7702ba2b0d3ce8392607c3d1a539164.tar.bz2 articles-6e30c337f7702ba2b0d3ce8392607c3d1a539164.zip | |
Tidy up to remove 'STRICT' warnings
Split static and dynamic use of getDisplayUrl
Create getContentUrl as the instantiated version
parameters need to be identical across all classes
| -rw-r--r-- | BitArticle.php | 15 | ||||
| -rw-r--r-- | articles_rss.php | 2 | ||||
| -rw-r--r-- | test/TestTikiArticle.php | 2 |
3 files changed, 13 insertions, 6 deletions
diff --git a/BitArticle.php b/BitArticle.php index b75bc58..dd46f86 100644 --- a/BitArticle.php +++ b/BitArticle.php @@ -77,7 +77,7 @@ class BitArticle extends LibertyMime { * Load the data from the database * @access public **/ - function load() { + function load( $pContentId = NULL, $pPluginParams = NULL ) { if( @$this->verifyId( $this->mArticleId ) || @$this->verifyId( $this->mContentId ) ) { // LibertyContent::load()assumes you have joined already, and will not execute any sql! // This is a significant performance optimization @@ -117,7 +117,7 @@ class BitArticle extends LibertyMime { $this->mInfo['thumbnail_url'] = BitArticle::getImageThumbnails( $this->mInfo ); $this->mInfo['creator'] = ( !empty( $this->mInfo['creator_real_name'] ) ? $this->mInfo['creator_real_name'] : $this->mInfo['creator_user'] ); $this->mInfo['editor'] = ( !empty( $this->mInfo['modifier_real_name'] ) ? $this->mInfo['modifier_real_name'] : $this->mInfo['modifier_user'] ); - $this->mInfo['display_url'] = $this->getDisplayUrl(); + $this->mInfo['display_url'] = $this->getContentUrl(); // we need the raw data to display in the textarea $this->mInfo['raw'] = $this->mInfo['data']; // here we have the displayed data without the ...split... stuff @@ -561,7 +561,7 @@ class BitArticle extends LibertyMime { $res['thumbnail_url'] = BitArticle::getImageThumbnails( $res ); $res['num_comments'] = $comment->getNumComments( $res['content_id'] ); - $res['display_url'] = $this->getDisplayUrl( $res['article_id'] ); + $res['display_url'] = $this->getContentUrl( $res['article_id'] ); $res['display_link'] = $this->getDisplayLink( $res['title'], $res ); // fetch the primary attachment that we can display the file on the front page if needed @@ -613,7 +613,7 @@ class BitArticle extends LibertyMime { * Generates the URL to the article * @return the link to the full article */ - function getDisplayUrl( $pArticleId = NULL, $pParamHash = NULL ) { + public static function getDisplayUrl( $pArticleId = NULL, $pParamHash = NULL ) { global $gBitSystem; $ret = NULL; @@ -637,6 +637,13 @@ class BitArticle extends LibertyMime { return $ret; } + function getContentUrl( $pArticleId = NULL ) { + if( !@BitBase::verifyId( $pArticleId ) && $this->isValid() ) { + $pArticleId = $this->mArticleId; + } + + return self::getDisplayUrl($pArticleId); + } /** * get a list of all available statuses * @return an array of available statuses diff --git a/articles_rss.php b/articles_rss.php index a9d4a00..3ce1f33 100644 --- a/articles_rss.php +++ b/articles_rss.php @@ -45,7 +45,7 @@ if( !$gBitUser->hasPermission( 'p_articles_read' ) ) { foreach( $feeds as $feed ) { $item = new FeedItem(); $item->title = $feed['title']; - $item->link = $articles->getDisplayUrl( $feed['article_id'] ); + $item->link = $articles->getContentUrl( $feed['article_id'] ); // show the full article in the feed $parseHash['content_id'] = $feed['content_id']; diff --git a/test/TestTikiArticle.php b/test/TestTikiArticle.php index 7efd5b0..b7b1ad4 100644 --- a/test/TestTikiArticle.php +++ b/test/TestTikiArticle.php @@ -67,7 +67,7 @@ class TestBitArticle extends Test { function testUrlItem() { - Assert::equalsTrue($this->test->getDisplayUrl() != ""); + Assert::equalsTrue($this->test->getContentUrl() != ""); } function testExpungeItem() |
