If local language's magicwords list is incomplete, try fetching it from the English one
[lhc/web/wiklou.git] / includes / Article.php
index 2c3123b..e26a8a4 100644 (file)
@@ -569,7 +569,7 @@ class Article {
                ) {
                        $wgOut->addWikiText( wfMsg('usercssjs'));
                        $wgOut->addHTML( '<pre>'.htmlspecialchars($this->mContent)."\n</pre>" );
-               } else if( $wgEnableParserCache && intval($wgUser->getOption( "stubthreshold" )) == 0 ){
+               } else if( $wgEnableParserCache && intval($wgUser->getOption( "stubthreshold" )) == 0 && empty( $oldid ) ){
                        $wgOut->addWikiText( $text, true, $this );
                } else {
                        $wgOut->addWikiText( $text );
@@ -719,7 +719,7 @@ class Article {
                return $text;
        }
 
-       function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false )
+       function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = "" )
        {
                global $wgOut, $wgUser, $wgLinkCache;
                global $wgDBtransactions, $wgMwRedir;
@@ -824,14 +824,14 @@ class Article {
                        $u->doUpdate();
                }
 
-               $this->showArticle( $text, wfMsg( "updated" ) );
+               $this->showArticle( $text, wfMsg( "updated" ), $sectionanchor );
                return true;
        }
 
        # After we've either updated or inserted the article, update
        # the link tables and redirect to the new page.
 
-       function showArticle( $text, $subtitle )
+       function showArticle( $text, $subtitle , $sectionanchor = '' )
        {
                global $wgOut, $wgUser, $wgLinkCache;
                global $wgMwRedir;
@@ -850,7 +850,7 @@ class Article {
                        $r = "redirect=no";
                else
                        $r = "";
-               $wgOut->redirect( $this->mTitle->getFullURL( $r ) );
+               $wgOut->redirect( $this->mTitle->getFullURL( $r ).$sectionanchor );
        }
 
        # Add this page to my watchlist
@@ -1282,6 +1282,9 @@ class Article {
                $sql = "DELETE FROM brokenlinks WHERE bl_from={$id}";
                wfQuery( $sql, DB_WRITE, $fname );
                
+               $sql = "DELETE FROM categorylinks WHERE cl_from={$id}";
+               wfQuery( $sql, DB_WRITE, $fname );
+               
                $log = new LogPage( wfMsg( "dellogpage" ), wfMsg( "dellogpagetext" ) );
                $art = $this->mTitle->getPrefixedText();
                $log->addEntry( wfMsg( "deletedarticle", $art ), $reason );
@@ -1509,6 +1512,10 @@ class Article {
                        return false;
                }
        }
+
+       function getTouched() {
+               return $this->mTouched;
+       }
        
        /* static */ function incViewCount( $id )
        {
@@ -1564,7 +1571,7 @@ class Article {
 
        # This is called on page move and undelete, as well as edit     
        /* static */ function onArticleCreate($title_obj){
-               global $wgEnablePersistentLC, $wgEnableParserCache, $wgUseSquid, $wgDeferredUpdateList;
+               global $wgEnablePersistentLC, $wgUseSquid, $wgDeferredUpdateList;
 
                $titles = $title_obj->getBrokenLinksTo();
                
@@ -1582,31 +1589,20 @@ class Article {
                if ( $wgEnablePersistentLC ) {
                        LinkCache::linksccClearBrokenLinksTo( $title_obj->getPrefixedDBkey() );
                }
-
-               # Clear parser cache (not really used)
-               if ( $wgEnableParserCache ) {
-                       OutputPage::parsercacheClearBrokenLinksTo( $title_obj->getPrefixedDBkey() );
-               }
        }
 
        /* static */ function onArticleDelete($title_obj){
-               global $wgEnablePersistentLC, $wgEnableParserCache;
+               global $wgEnablePersistentLC;
                if ( $wgEnablePersistentLC ) {
                        LinkCache::linksccClearLinksTo( $title_obj->getArticleID() );
                }
-               if ( $wgEnableParserCache ) {
-                       OutputPage::parsercacheClearLinksTo( $title_obj->getArticleID() );
-               }
        }
 
        /* static */ function onArticleEdit($title_obj){
-               global $wgEnablePersistentLC, $wgEnableParserCache;
+               global $wgEnablePersistentLC;
                if ( $wgEnablePersistentLC ) {
                        LinkCache::linksccClearPage( $title_obj->getArticleID() );
                }
-               if ( $wgEnableParserCache ) {
-                       OutputPage::parsercacheClearPage( $title_obj->getArticleID(), $title_obj->getNamespace() );
-               }
        }
 }