/**
* List for revision table items for a single page
*/
-abstract class RevisionListBase {
+abstract class RevisionListBase extends ContextSource {
/**
* @var Title
*/
var $title;
- /**
- * @var IContextSource
- */
- var $context;
var $ids, $res, $current;
* @param $title Title
*/
function __construct( IContextSource $context, Title $title ) {
- $this->context = $context;
+ $this->setContext( $context );
$this->title = $title;
}
* @param $row stdclass
*/
abstract public function newItem( $row );
-
- /**
- * Get the language of the user doing the action
- *
- * @return Language object
- */
- public function getLang() {
- return $this->context->getLang();
- }
-
- /**
- * Get the user doing the action
- *
- * @return User object
- */
- public function getUser() {
- return $this->context->getUser();
- }
}
/**
* Get the date, formatted in user's languae
*/
public function formatDate() {
- return $this->list->context->getLang()->userDate( $this->getTimestamp(),
- $this->list->context->getUser() );
+ return $this->list->getLanguage()->userDate( $this->getTimestamp(),
+ $this->list->getUser() );
}
/**
* Get the time, formatted in user's languae
*/
public function formatTime() {
- return $this->list->context->getLang()->userTime( $this->getTimestamp(),
- $this->list->context->getUser() );
+ return $this->list->getLanguage()->userTime( $this->getTimestamp(),
+ $this->list->getUser() );
}
/**
$conds,
__METHOD__,
array( 'ORDER BY' => 'rev_id DESC' ),
- array( 'page' => array( 'INNER JOIN', 'rev_page = page_id' ),
- 'user' => array( 'LEFT JOIN', 'user_id = rev_user' ) )
+ array(
+ 'page' => Revision::pageJoinCond(),
+ 'user' => Revision::userJoinCond() )
);
}
* Overridden by RevDel_ArchiveItem.
*/
protected function getRevisionLink() {
- $date = $this->list->getLang()->timeanddate( $this->revision->getTimestamp(), true );
+ $date = $this->list->getLanguage()->timeanddate( $this->revision->getTimestamp(), true );
if ( $this->isDeleted() && !$this->canViewContent() ) {
return $date;
}