MediaWiki  REL1_24
RevDelLogList.php
Go to the documentation of this file.
00001 <?php
00025 class RevDelLogList extends RevDelList {
00026     public function getType() {
00027         return 'logging';
00028     }
00029 
00030     public static function getRelationType() {
00031         return 'log_id';
00032     }
00033 
00034     public static function getRestriction() {
00035         return 'deletelogentry';
00036     }
00037 
00038     public static function getRevdelConstant() {
00039         return LogPage::DELETED_ACTION;
00040     }
00041 
00042     public static function suggestTarget( $target, array $ids ) {
00043         $result = wfGetDB( DB_SLAVE )->select( 'logging',
00044             'log_type',
00045             array( 'log_id' => $ids ),
00046             __METHOD__,
00047             array( 'DISTINCT' )
00048         );
00049         if ( $result->numRows() == 1 ) {
00050             // If there's only one type, the target can be set to include it.
00051             return SpecialPage::getTitleFor( 'Log', $result->current()->log_type );
00052         }
00053 
00054         return SpecialPage::getTitleFor( 'Log' );
00055     }
00056 
00061     public function doQuery( $db ) {
00062         $ids = array_map( 'intval', $this->ids );
00063 
00064         return $db->select( 'logging', array(
00065                 'log_id',
00066                 'log_type',
00067                 'log_action',
00068                 'log_timestamp',
00069                 'log_user',
00070                 'log_user_text',
00071                 'log_namespace',
00072                 'log_title',
00073                 'log_page',
00074                 'log_comment',
00075                 'log_params',
00076                 'log_deleted'
00077             ),
00078             array( 'log_id' => $ids ),
00079             __METHOD__,
00080             array( 'ORDER BY' => 'log_id DESC' )
00081         );
00082     }
00083 
00084     public function newItem( $row ) {
00085         return new RevDelLogItem( $this, $row );
00086     }
00087 
00088     public function getSuppressBit() {
00089         return Revision::DELETED_RESTRICTED;
00090     }
00091 
00092     public function getLogAction() {
00093         return 'event';
00094     }
00095 
00096     public function getLogParams( $params ) {
00097         return array(
00098             implode( ',', $params['ids'] ),
00099             "ofield={$params['oldBits']}",
00100             "nfield={$params['newBits']}"
00101         );
00102     }
00103 }