Merge "Include original exception when throw TimestampException"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 8 Jul 2013 17:43:31 +0000 (17:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 8 Jul 2013 17:43:31 +0000 (17:43 +0000)
includes/SkinTemplate.php
includes/WikiPage.php
includes/api/ApiPurge.php
includes/filerepo/file/File.php
languages/messages/MessagesEn.php

index 8e41b5a..94978d4 100644 (file)
@@ -165,39 +165,14 @@ class SkinTemplate extends Skin {
                return $language_urls;
        }
 
-       /**
-        * initialize various variables and generate the template
-        *
-        * @param $out OutputPage
-        */
-       function outputPage( OutputPage $out = null ) {
-               global $wgContLang;
-               global $wgScript, $wgStylePath;
-               global $wgMimeType, $wgJsMimeType;
-               global $wgXhtmlNamespaces, $wgHtml5Version;
-               global $wgDisableCounters, $wgSitename, $wgLogo;
-               global $wgMaxCredits, $wgShowCreditsIfMax;
-               global $wgPageShowWatchingUsers;
-               global $wgArticlePath, $wgScriptPath, $wgServer;
-
+       protected function setupTemplateForOutput() {
                wfProfileIn( __METHOD__ );
-               Profiler::instance()->setTemplated( true );
 
-               $oldContext = null;
-               if ( $out !== null ) {
-                       // @todo Add wfDeprecated in 1.20
-                       $oldContext = $this->getContext();
-                       $this->setContext( $out->getContext() );
-               }
-
-               $out = $this->getOutput();
                $request = $this->getRequest();
                $user = $this->getUser();
                $title = $this->getTitle();
 
                wfProfileIn( __METHOD__ . '-init' );
-               $this->initPage( $out );
-
                $tpl = $this->setupTemplate( $this->template, 'skins' );
                wfProfileOut( __METHOD__ . '-init' );
 
@@ -226,6 +201,47 @@ class SkinTemplate extends Skin {
 
                wfProfileOut( __METHOD__ . '-stuff' );
 
+               wfProfileOut( __METHOD__ );
+
+               return $tpl;
+       }
+
+       /**
+        * initialize various variables and generate the template
+        *
+        * @param $out OutputPage
+        */
+       function outputPage( OutputPage $out = null ) {
+               global $wgContLang;
+               global $wgScript, $wgStylePath;
+               global $wgMimeType, $wgJsMimeType;
+               global $wgXhtmlNamespaces, $wgHtml5Version;
+               global $wgDisableCounters, $wgSitename, $wgLogo;
+               global $wgMaxCredits, $wgShowCreditsIfMax;
+               global $wgPageShowWatchingUsers;
+               global $wgArticlePath, $wgScriptPath, $wgServer;
+
+               wfProfileIn( __METHOD__ );
+               Profiler::instance()->setTemplated( true );
+
+               $oldContext = null;
+               if ( $out !== null ) {
+                       // @todo Add wfDeprecated in 1.20
+                       $oldContext = $this->getContext();
+                       $this->setContext( $out->getContext() );
+               }
+
+               $out = $this->getOutput();
+               $request = $this->getRequest();
+               $user = $this->getUser();
+               $title = $this->getTitle();
+
+               wfProfileIn( __METHOD__ . '-init' );
+               $this->initPage( $out );
+               wfProfileOut( __METHOD__ . '-init' );
+
+               $tpl = $this->setupTemplateForOutput();
+
                wfProfileIn( __METHOD__ . '-stuff-head' );
                if ( !$this->useHeadElement ) {
                        $tpl->set( 'pagecss', false );
@@ -515,6 +531,20 @@ class SkinTemplate extends Skin {
                wfProfileOut( __METHOD__ );
        }
 
+       /**
+        * Get the HTML for the p-personal list
+        * @return string
+        */
+       public function getPersonalToolsList() {
+               $tpl = $this->setupTemplateForOutput();
+               $tpl->set( 'personal_urls', $this->buildPersonalUrls() );
+               $html = '';
+               foreach ( $tpl->getPersonalTools() as $key => $item ) {
+                       $html .= $tpl->makeListItem( $key, $item );
+               }
+               return $html;
+       }
+
        /**
         * Format language name for use in sidebar interlanguage links list.
         * By default it is capitalized.
index 4aab674..1a46b3e 100644 (file)
@@ -2071,7 +2071,9 @@ class WikiPage implements Page, IDBAccessObject {
 
                // Update the links tables and other secondary data
                if ( $content ) {
-                       $updates = $content->getSecondaryDataUpdates( $this->getTitle(), null, true, $editInfo->output );
+                       $recursive = $options['changed']; // bug 50785
+                       $updates = $content->getSecondaryDataUpdates(
+                               $this->getTitle(), null, $recursive, $editInfo->output );
                        DataUpdate::runUpdates( $updates );
                }
 
index b68dc5c..e2eae61 100644 (file)
@@ -64,6 +64,7 @@ class ApiPurge extends ApiBase {
                $params = $this->extractRequestParams();
 
                $forceLinkUpdate = $params['forcelinkupdate'];
+               $forceRecursiveLinkUpdate = $params['forcerecursivelinkupdate'];
                $pageSet = $this->getPageSet();
                $pageSet->execute();
 
@@ -82,7 +83,7 @@ class ApiPurge extends ApiBase {
                        $page->doPurge(); // Directly purge and skip the UI part of purge().
                        $r['purged'] = '';
 
-                       if ( $forceLinkUpdate ) {
+                       if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
                                if ( !$this->getUser()->pingLimiter() ) {
                                        global $wgEnableParserCache;
 
@@ -93,7 +94,8 @@ class ApiPurge extends ApiBase {
                                        $p_result = $content->getParserOutput( $title, $page->getLatest(), $popts, $wgEnableParserCache );
 
                                        # Update the links tables
-                                       $updates = $content->getSecondaryDataUpdates( $title, null, true, $p_result );
+                                       $updates = $content->getSecondaryDataUpdates(
+                                               $title, null, $forceRecursiveLinkUpdate, $p_result );
                                        DataUpdate::runUpdates( $updates );
 
                                        $r['linkupdate'] = '';
@@ -150,7 +152,10 @@ class ApiPurge extends ApiBase {
        }
 
        public function getAllowedParams( $flags = 0 ) {
-               $result = array( 'forcelinkupdate' => false );
+               $result = array(
+                       'forcelinkupdate' => false,
+                       'forcerecursivelinkupdate' => false
+               );
                if ( $flags ) {
                        $result += $this->getPageSet()->getFinalParams( $flags );
                }
@@ -159,7 +164,11 @@ class ApiPurge extends ApiBase {
 
        public function getParamDescription() {
                return $this->getPageSet()->getFinalParamDescription()
-                       + array( 'forcelinkupdate' => 'Update the links tables' );
+                       + array(
+                               'forcelinkupdate' => 'Update the links tables',
+                               'forcerecursivelinkupdate' => 'Update the links table, and update ' .
+                                       'the links tables for any page that uses this page as a template',
+                       );
        }
 
        public function getResultProperties() {
index 0da4036..9060731 100644 (file)
@@ -48,6 +48,7 @@
  * @ingroup FileAbstraction
  */
 abstract class File {
+       // Bitfield values akin to the Revision deletion constants
        const DELETED_FILE = 1;
        const DELETED_COMMENT = 2;
        const DELETED_USER = 4;
@@ -1499,7 +1500,7 @@ abstract class File {
         * Is this file a "deleted" file in a private archive?
         * STUB
         *
-        * @param $field
+        * @param integer $field one of DELETED_* bitfield constants
         *
         * @return bool
         */
index dcd6b1f..973c946 100644 (file)
@@ -1622,8 +1622,8 @@ Legend: '''({{int:cur}})''' = difference with latest revision, '''({{int:last}})
 'history-fieldset-title' => 'Browse history',
 'history-show-deleted'   => 'Deleted only',
 'history_copyright'      => '-', # do not translate or duplicate this message to other languages
-'histfirst'              => 'Earliest',
-'histlast'               => 'Latest',
+'histfirst'              => 'oldest',
+'histlast'               => 'newest',
 'historysize'            => '({{PLURAL:$1|1 byte|$1 bytes}})',
 'historyempty'           => '(empty)',