* Returns true if the current user can view the item
*/
abstract public function canView();
+
+ /**
+ * Returns true if the current user can view the item text/file
+ */
+ abstract public function canViewContent();
/**
* Get the current deletion bitfield value
public function canView() {
return $this->revision->userCan( Revision::DELETED_RESTRICTED );
}
+
+ public function canViewContent() {
+ return $this->revision->userCan( Revision::DELETED_TEXT );
+ }
public function getBits() {
return $this->revision->mDeleted;
protected function getRevisionLink() {
global $wgLang;
$date = $wgLang->timeanddate( $this->revision->getTimestamp(), true );
- if ( $this->isDeleted() && !$this->canView() ) {
+ if ( $this->isDeleted() && !$this->canViewContent() ) {
return $date;
}
return $this->special->skin->link(
* Overridden by RevDel_ArchiveItem
*/
protected function getDiffLink() {
- if ( $this->isDeleted() && !$this->canView() ) {
+ if ( $this->isDeleted() && !$this->canViewContent() ) {
return wfMsgHtml('diff');
} else {
return
global $wgLang;
$undelete = SpecialPage::getTitleFor( 'Undelete' );
$date = $wgLang->timeanddate( $this->revision->getTimestamp(), true );
- if ( $this->isDeleted() && !$this->canView() ) {
+ if ( $this->isDeleted() && !$this->canViewContent() ) {
return $date;
}
return $this->special->skin->link( $undelete, $date, array(),
}
protected function getDiffLink() {
- if ( $this->isDeleted() && !$this->canView() ) {
+ if ( $this->isDeleted() && !$this->canViewContent() ) {
return wfMsgHtml( 'diff' );
}
$undelete = SpecialPage::getTitleFor( 'Undelete' );
public function canView() {
return $this->file->userCan( File::DELETED_RESTRICTED );
}
+
+ public function canViewContent() {
+ return $this->file->userCan( File::DELETED_FILE );
+ }
public function getBits() {
return $this->file->getVisibility();
$date = $wgLang->timeanddate( $this->file->getTimestamp(), true );
if ( $this->isDeleted() ) {
# Hidden files...
- if ( !$this->canView() ) {
+ if ( !$this->canViewContent() ) {
$link = $date;
} else {
$link = $this->special->skin->link(
$undelete = SpecialPage::getTitleFor( 'Undelete' );
$key = $this->file->getKey();
# Hidden files...
- if( !$this->canView() ) {
+ if( !$this->canViewContent() ) {
$link = $date;
} else {
$link = $this->special->skin->link( $undelete, $date, array(),
public function canView() {
return LogEventsList::userCan( $this->row, Revision::DELETED_RESTRICTED );
}
+
+ public function canViewContent() {
+ return true; // none
+ }
public function getBits() {
return $this->row->log_deleted;