function __construct( $item ) { parent::__construct( $item->Url, $item->Title, ( !empty( $item->Date ) ? $item->Date : null ), $item->Url, ( !empty( $item->Author ) ? $item->Author : null ), new WlTextConstruct( 'html', $item->Description ) ); if ( !empty( $item->Comments ) ) { $this->addLinkRel( 'replies', array( 'href' => $item->Comments ) ); } }
/** * Generates and returns a single feed entry. * @param $row The wikilog comment database entry. * @return A new WlSyndicationEntry object. */ function formatFeedEntry( $row ) { global $wgMimeType; # Create comment object. $item = $this->mSingleItem ? $this->mSingleItem : WikilogItem::newFromRow( $row ); $comment = WikilogComment::newFromRow( $item, $row ); # Prepare some strings. if ( $comment->mUserID ) { $usertext = $comment->mUserText; } else { $usertext = wfMsgForContent( 'wikilog-comment-anonsig', $comment->mUserText, ''/*talk*/, $comment->mAnonName ); } if ( $this->mSingleItem ) { $title = wfMsgForContent( 'wikilog-comment-feed-title1', $comment->mID, $usertext ); } else { $title = wfMsgForContent( 'wikilog-comment-feed-title2', $comment->mID, $usertext, $comment->mItem->mName ); } # Create new syndication entry. $entry = new WlSyndicationEntry( self::makeEntryId( $comment ), $title, $comment->mUpdated, $comment->getCommentArticleTitle()->getFullUrl() ); # Comment text. if ( $comment->mCommentRev ) { list( $article, $parserOutput ) = WikilogUtils::parsedArticle( $comment->mCommentTitle, true ); $content = Sanitizer::removeHTMLcomments( $parserOutput->getText() ); if ( $content ) { $entry->setContent( new WlTextConstruct( 'html', $content ) ); } } # Author. $usertitle = Title::makeTitle( NS_USER, $comment->mUserText ); $useruri = $usertitle->exists() ? $usertitle->getFullUrl() : null; $entry->addAuthor( $usertext, $useruri ); # Timestamp $entry->setPublished( $comment->mTimestamp ); return $entry; }