* (bug 1970) Don't show move tab for immobile pages
[lhc/web/wiklou.git] / includes / Revision.php
index 02d7c52..67eb4be 100644 (file)
@@ -170,7 +170,8 @@ class Revision {
                               'rev_user_text',
                               'rev_user',
                               'rev_minor_edit',
-                              'rev_timestamp' ),
+                              'rev_timestamp',
+                              'rev_deleted' ),
                        $conditions,
                        'Revision::fetchRow' );
                return $db->resultObject( $res );
@@ -190,6 +191,7 @@ class Revision {
                        $this->mUser      = IntVal( $row->rev_user );
                        $this->mMinorEdit = IntVal( $row->rev_minor_edit );
                        $this->mTimestamp =         $row->rev_timestamp;
+                       $this->mDeleted   = IntVal( $row->rev_deleted );
                
                        $this->mCurrent   = ( $row->rev_id == $row->page_latest );
                        $this->mTitle     = Title::makeTitle( $row->page_namespace,
@@ -212,6 +214,7 @@ class Revision {
                        $this->mUser      = isset( $row['user']       ) ? IntVal( $row['user']       ) : $wgUser->getId();
                        $this->mMinorEdit = isset( $row['minor_edit'] ) ? IntVal( $row['minor_edit'] ) : 0;
                        $this->mTimestamp = isset( $row['timestamp']  ) ? StrVal( $row['timestamp']  ) : wfTimestamp( TS_MW );
+                       $this->mDeleted   = isset( $row['deleted']    ) ? IntVal( $row['deleted']    ) : 0;
                        $this->mText      = isset( $row['text']       ) ? StrVal( $row['text']       ) : null;
                        
                        $this->mTitle     = null; # Load on demand if needed
@@ -296,6 +299,13 @@ class Revision {
                return (bool)$this->mMinorEdit;
        }
        
+       /**
+        * @return bool
+        */
+       function isDeleted() {
+               return (bool)$this->mDeleted;
+       }
+       
        /**
         * @return string
         */
@@ -368,6 +378,18 @@ class Revision {
                        return false;
                }
 
+               # Use external methods for external objects, text in table is URL-only then
+               if ( in_array( 'external', $flags ) ) {
+                       $url=$text;
+                       @list($proto,$path)=explode('://',$url,2);
+                       if ($path=="") {
+                               wfProfileOut( $fname );
+                               return false;
+                       }
+                       require_once('ExternalStore.php');
+                       $text=ExternalStore::fetchFromURL($url);
+               }
+
                if( in_array( 'gzip', $flags ) ) {
                        # Deal with optional compression of archived pages.
                        # This can be done periodically via maintenance/compressOld.php, and
@@ -469,6 +491,7 @@ class Revision {
                                'rev_user'       => $this->mUser,
                                'rev_user_text'  => $this->mUserText,
                                'rev_timestamp'  => $dbw->timestamp( $this->mTimestamp ),
+                               'rev_deleted'    => $this->mDeleted,
                        ), $fname
                );
                
@@ -544,4 +567,4 @@ class Revision {
        }
        
 }
-?>
\ No newline at end of file
+?>